PZLAST API
REST API for the PZLAST sequence search service.
You can use the API to submit jobs and retrieve results from the command line without going through a web browser.
Example using the curl command:
- Submit job
curl -X POST -F "fasta_file=@./my_sequence.fasta" https://pzlast.nig.ac.jp/pzlast/meta/job/submit\?max_out\=1000
{
"response": {
"Status": "Success",
"Message": "Success. Record inserted.",
"job_id": "sY9pQ0C3IxMaNoShmEpTCb5Lyq2TrweEvcRb9WktyAo"
}
}
- Get results
curl https://pzlast.nig.ac.jp/pzlast/meta/result/get_csv?job_id=sY9pQ0C3IxMaNoShmEpTCb5Lyq2TrweEvcRb9WktyAo
CSV-formatted result table file:
Query ID,Reference ID,BioSample ID,Query Start,Query End,Ref Start,Ref End,Score,Bit score,E-value,#Match
example_protein_sequence_1,ERR056993,SAMEA1317686,4,138,1,135,664.0,260.3807506891666,3.269707461829011e-64,134
example_protein_sequence_1,ERR225962,SAMEA2048024,4,138,1,135,664.0,260.3807506891666,3.269707461829011e-64,134
...
Resource Group ¶
Submit Job API ¶
Submit Job APIPOST/job/submit{?max_out}
-
API for Job Submission
- POST a text file (Single- or Multi-FASTA protein sequence file) in form-data with the name “fasta_file”.
- Specify “max_out” parameter that controls how many hits will be output per input sequence. Default is 1.
- In any of the following cases, JSON containing the error message will be returned.
- No fasta_file.
- The attached text file is not in FASTA format.
- Input file size limit. All sequences must be >= 10 AA (amino acids) and <= 2,000 AA. The number of input sequences must be <= 10,000. The number of total amino acids must be <= 100,000. The number of possible output must be <= 1,000,000.
- Database registration failed for some unknown reason. Please try again after a while.
-
If the job registration is successful, JSON will be returned. “job_id” is the unique ID for the registered job. Please remember it as you will need it to access the results later.
Example URI
POST https://pzlast.nig.ac.jp/pzlast/meta/job/submit?max_out=1
URI Parameters
- max_out
number
(optional) Example: 1Parameter specifying how many hits will be output per input sequence.
Response
200
Headers
Content-Type: application/json
Body
{
"response": {
"Status": "Success",
"Message": "Success. Record inserted.",
"job_id": "sY9pQ0C3IxMaNoShmEpTCb5Lyq2TrweEvcRb9Wktyow"
}
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"response": {
"type": "object",
"properties": {
"Status": {
"type": "string"
},
"Message": {
"type": "string"
},
"job_id": {
"type": "string"
}
},
"required": [
"Status",
"Message",
"job_id"
]
}
}
}
Get Result Table API ¶
Get Result Table APIGET/result/get_csv{?job_id}
- API to obtain search results in CSV format.
- Get a csv-formatted table file of search results.
- Specify your “job_id” as parameter.
- In any of the following cases, JSON containing the error message will be returned.
- No job_id specified.
- Specified job_id is not registered in database.
- Your job is not yet completed. Please wait and try later.
- Search failed for some unknown reason. Please start over from your job submission.
Example URI
GET https://pzlast.nig.ac.jp/pzlast/meta/result/get_csv?job_id=sY9pQ0C3IxMaNoShmEpTCb5Lyq2TrweEvcRb9Wktyow
URI Parameters
- job_id
string
(required) Example: sY9pQ0C3IxMaNoShmEpTCb5Lyq2TrweEvcRb9WktyowParameter specifying your job ID.
Response
200
Headers
Content-Type: text/csv;charset=UTF-8