The jpredapi API Reference¶
jpredapi Python library¶
The JPred API allows users to submit jobs from the command-line.
Usage example for command-line:
python3 -m jpredapi --help python3 -m jpredapi --version python3 -m jpredapi submit --mode=single --format=raw --seq=MQVWPIEGIKKFETLSYLPP python3 -m jpredapi status --jobid=jp_K46D05A python3 -m jpredapi get_results --jobid=jp_K46D05A --results=jpred_sspred/results python3 -m jpredapi quota --email=name@domain.com python3 -m jpredapi check_rest_version
Usage example for interactive Python shell:
>>> import jpredapi
>>>
>>> jpredapi.submit(mode="single", user_format="raw", seq="MQVWPIEGIKKFETLSYLPP")
>>>
>>> jpredapi.status(jobid="jp_K46D05A")
>>>
>>> jpredapi.get_results(jobid="jp_K46D05A", results_dir_path="jpred_sspred/results")
>>>
>>> jpredapi.quota(email="name@domain.com")
>>>
>>> jpredapi.check_rest_version()
>>>
-
jpredapi.api.
check_rest_version
(host='http://www.compbio.dundee.ac.uk/jpred4/cgi-bin/rest', suffix='version', silent=False)[source]¶ Check version of JPred REST interface.
Parameters: Returns: Version of JPred REST API.
Return type:
-
jpredapi.api.
quota
(email, host='http://www.compbio.dundee.ac.uk/jpred4/cgi-bin/rest', suffix='quota', silent=False)[source]¶ Check how many jobs you have already submitted on a given day (out of 1000 maximum allowed jobs per user per day).
Parameters: Returns: Response.
Return type:
-
jpredapi.api.
submit
(mode, user_format, file=None, seq=None, skipPDB=True, email=None, name=None, silent=False, host='http://www.compbio.dundee.ac.uk/jpred4/cgi-bin/rest')[source]¶ Submit job to JPred REST API.
Parameters: - mode (str) – Submission mode, possible values: single, batch, msa.
- user_format (str) – Submission format, possible values: raw, fasta, msf, blc.
- file (str) – File path to a file with the job input (sequence or msa).
- seq (str) – Alternatively, amino acid sequence passed as string of single-letter code without spaces, e.g. –seq=ATWFGTHY
- skipPDB (
True
orFalse
) – Should the PDB query be skipped? - email (str) – For a batch job submission, where to send the results?
- name (str) – A name for the job.
- silent (
True
orFalse
) – Should the work be done silently?
Returns: Response.
Return type:
-
jpredapi.api.
status
(*args, **kw)[source]¶ Check status of the submitted job.
Parameters: - jobid (str) – Job id.
- results_dir_path (str) – Directory path where to save results if job is finished.
- extract (
True
orFalse
) – Extract (True) or not (False) results into directory. - silent (
True
orFalse
) – Should the work be done silently? - host (str) – JPred host address.
- jpred4 (str) – JPred address for results retrieval.
Returns: Response.
Return type:
-
jpredapi.api.
get_results
(jobid, results_dir_path=None, extract=False, silent=False, host='http://www.compbio.dundee.ac.uk/jpred4/cgi-bin/rest', jpred4='http://www.compbio.dundee.ac.uk/jpred4')[source]¶ Download results from JPred server.
Parameters: - jobid (str) – Job id.
- results_dir_path (str) – Directory path where to save results if job is finished.
- extract (
True
orFalse
) – Extract (True) or not (False) results into directory. - silent (
True
orFalse
) – Should the work be done silently? - host (str) – JPred host address.
- jpred4 (str) – JPred address for results retrieval.
Returns: Response.
Return type: