API - Documentation

Here we offer an API (Application Programming Interface) to assist users in integrating CSM-Potential into their research pipelines.

In summary, all jobs submitted to our server are labelled with a unique ID which is used to query the status (in queue, processing, processed).

CSM-Potential allows for two distinct types of submissions, Identification of PPI sites and Biological ligand classification. Here we summarise the inputs and outputs for using the API for Identification of PPI sites. For Biological ligand classification we recommend users to run predictions via the web interface since for this prediction an extra step for selecting the pocket is necessary.

Identification of PPI sites - https://biosig.lab.uq.edu.au/csm_potential/api/predict
POST - Job Submission

Arguments

  • pdb_file (required) - file in PDB format
  • chain (optional) - Used to select specific monomers within the pdb_file (if empty all chains will be considered).
  • email (optional) - Email for contact when the job is finished

Return

  • job_id - ID used for uniquely identify each job

Examples

  • curl

    $ curl https://biosig.lab.uq.edu.au/csm_potential/api/predict -X POST -i -F pdb_file=@/home/ubuntu/1u46.pdb
    
    {
    	"job_id": "160706007808"
    }
    												
  • python

    
    import argparse
    import requests
    import sys
    
    URL = "https://biosig.lab.uq.edu.au/csm_potential/api/predict"
    
    def main(args):
        pdb_file = args.pdb_file
    
        files_to_submit = {"pdb_file": pdb_file}
    
        req = requests.post(URL, files=pdb_to_submit)
        print(req.json())
        return True
    
    if __name__ == "__main__":
        parser = argparse.ArgumentParser(description='Job submission for PPI sites \
    identification - CSM-Potential')
        parser.add_argument('--pdb_file', dest='pdb_file', type=file, help='PDB file', \
    required=False, default=None)
    
        args = parser.parse_args()
        if args.pdb_file == None:
            print('usage: main.py [-h] [--pdb_file PDB_FILE]')
            print('main.py: error: missing arguments: Please provide --pdb_file')
            sys.exit(1)
        main(args)
    												
GET - Retrieve Job Results

Arguments

  • job_id - ID used for uniquely identify each job. Generated upon submission

Return

For jobs still being processed or waiting on queue, the message below will be returned from querying this endpoint:
  • message - RUNNING
For jobs successfully processed by CSM-Potential, the following data will be returned:
  • curl

    $ curl https://biosig.lab.uq.edu.au/csm_potential/api/predict -X GET -F job_id=160706007808
    
    {
        "Chain A": [
            {
                "aa": "L", 
                "prediction": 0.5, 
                "resnumber": 117
            }, 
            {
                "aa": "T", 
                "prediction": 0.71, 
                "resnumber": 118
            }, 
    
    ... (truncated for visualisation purposes)
    
            {
                "aa": "E", 
                "prediction": 0.2, 
                "resnumber": 387
            }, 
            {
                "aa": "A", 
                "prediction": 0.45, 
                "resnumber": 388
            }, 
            {
                "aa": "Q", 
                "prediction": 0.42, 
                "resnumber": 389
            }
        ]
    }
    												
  • python

    
    import argparse
    import requests
    import sys
    
    URL = "https://biosig.lab.uq.edu.au/csm_potential/api/predict"
    
    def main(args):
        job_id = args.job_id
    
        params = {
            "job_id": job_id,
        }
    
        req = requests.get(URL, data=params)
        print(req.json())
        return True
    
    if __name__ == "__main__":
        parser = argparse.ArgumentParser(description='Retrieve job results for PPI sites \
    identification - CSM-Potential')
        parser.add_argument('--job_id', dest='job_id', type=str, help='Job identifier code \
    generated upon submission', required=False, default=None)
    
        args = parser.parse_args()
        main(args)