Python Online Server

AVAILABILITY

  • MoRFchibi SYSTEM main page, please click here.
  • HTML server, please click here.
  • RESTful web server, this page.
  • Downloadable software, please click here.

RESTful web server (down for maintenance)

MoRFchibi SYSTEM services can be accessed through programming languages. We provided a Python package, PY, (to download, please click here Updated in Sep. 17, 2020) which includes four template programs and a functional API:

Four template programs:

  1. process_one.py: To run: ./process_one.py [input.fasta]. This program utilizes the MoRFchibi API load_one_to_morfchibi(fasta_file) and fetch_one_from_morfchibi(location, into_file) functions to upload the sequence in input.fasta and then polls every 10 seconds until results are ready, fetch results into input.fasta.chibi.
  2. mc_upload.py: To run: ./mc_upload.py [dir]. This program calls the MoRFchibi API upload_dir_to_morfchibi(_path) function to uploads all files with ‘.fasta’ extension (each with one protein sequence) in the target directory dir into the MoRFchibi SYSTEM RESTful server. If dir was not provided, data is used as a default target directory.
  3. mc_fetch.py: To run: ./mc_fetsh.py [dir]. This program calls the MoRFchibi API fetch_dir_from_morfchibi(_path) function to retrieve results from the MoRFchibi SYSTEM RESTful server. If dir was not provided, data is used as a default target directory.
  4. mc_offload.py: To run: ./mc_offload.py [dir]. This program calls the MoRFchibi API del_dir_from_morfchibi(_path) function to cancel all jobs in directory _path from the MoRFchibi SYSTEM RESTful server. If dir was not provided, data is used as a default target directory.

Python functional API: MoRFchibi.py

A Python functional API for accessing the MoRFchibi SYSTEM RESTful web services. This API includes six functions:

  1. load_one_to_morfchibi(fasta_file): This function uploads one protein query sequence in fasta format, fasta_file, into the MoRFchibi SYSTEM server for processing. It returns a Location variable, a Status variable, and a Success variable.
  • Location: a string url variable which identifies the results location.
  • Status: a string variable describes the processing statues. It can have one of following five values:
  • <Processing> The sequence is currently been processed.
  • <Position: x> The job is in the server queue at position x.
  • <Pending> The job is in the private user queue.
  • <Completed in Xs> The job has completed in X seconds.
  • <Failed> Error Message.
  • Success: is a boolean variable which is set to True when the query sequence is successfully uploaded into the server. Otherwise, if the fasta_file includes errors (e.g. more than one sequence, bad FASTA format, or small case letters), Success will be set to False and a file with the name fasta_file.error that include an error report is generated.
  1. upload_dir_to_morfchibi(_path): This function uploads all files with ‘.fasta’ extension (each with one protein sequence) in the ‘_path’ directory into the MoRFchibi SYSTEM RESTful server. it also generate a text file pList.txt. pList.txt contain one line for each successfully uploaded protein sequence. This line includes the file name, url location, and statue. Example pList.txt:
data/p53.fasta	http://morfw.chibi.ubc.ca:8080/morf/rest/job/57eme7kcm62vpfh9gjmhpim2rm	Position: 1
data/P09883.fasta	http://morfw.chibi.ubc.ca:8080/morf/rest/job/3s31oanrjltsj7unchgrjci896	Position: 2
data/P26645.fasta	http://morfw.chibi.ubc.ca:8080/morf/rest/job/7fc70shjsqsi9puvi65efraqck	Pending
data/Example.fasta	http://morfw.chibi.ubc.ca:8080/morf/rest/job/jct52po8a3b5pj18f33ikpmuue	Pending

It also generate a second copy of pList.txt (pList.txt.bak).

  1. fetch_one_from_morfchibi(location, into_file): This function retrieves results from the URL location and saves it, if completed, into the into_file. It returns two variables, a string Status and a boolean Completed.
  2. fetch_dir_from_morfchibi(_path): This function attempts to retrieves every result with (1) a URL location in the _path/pList.txt file and (2) a status other than Completed. It check for that result, if completed, it saves it into the file_name.chibi file. For each line in pList.txt, it update its status in Plist.txt and prints the file name and status. When a file is retrieved, its printed file_name is presided by ‘>’.
  3. delete_one(location): This function cancel the job at URL location.
  4. del_dir_from_morfchibi(_path): This function cancel all jobs in directory _path from the MoRFchibi SYSTEM RESTful server..