The HoTIDP web server has some RESTful endpoints for programmatic access.
You can:

  • Retrieve precalculated MSAs of Homology Transferred Regions from DisProt
  • Send a job to make good MSAs and transfer regions by homology using the pipeline
  • Check job status
  • Download the results of the executed jobs
Examples for testing are available below using the RESTful endpoints programmatic access and the input/output files.
  1. Retrieve a csrfmiddlewaretoken
    GET
  2. Retrieve a list of MSAs and their parameters in JSON format
    POST
  3. Retrieve a MSA
    GET

Example code in Python

        import requests  
        client = requests.session()
        #retrive csrf token
        y = client.get(http://hotidp.leloir.org.ar/api/querymsa)
        y = y.json()

        data_send = {
            "csrfmiddlewaretoken": y['csrfmiddlewaretoken'],
            "uniprot_accession": "P46527", 
            	"aln_method": "both", 
            	"aln_type": "both", 
            	"dp_identity": "both", 
            	"fullseq_identity": "both", 
            	"regionseq_identity": "both", 
            	"nd_full_cutoff": 0.6,            	
            	"nd_region_cutoff": 0.6
        }
        
        consult_r = client.post(http://hotidp.leloir.org.ar/api/querymsa, data=data_send)
        print(consult_r.status_code)
        #list of found MSAs
        msas_data = consult_r.json()
        
        if (consult_r.status_code == 200):
        #Retrieve the MSAs
            for x in msas_data["alignments"]:     
                msaname = x["file_name"]  
                consult_r = requests.get(http://hotidp.leloir.org.ar/api/querymsa/download/ + msaname)
                if consult_r.status_code == 200:
                    #save as tar.gz     
                    with open(msaname, 'wb') as f:
                       f.write(consult_r.content)    
    
       
  1. Retrieve a csrfmiddlewaretoken
    GET
  2. Send the job, a JSON file with the job ID is returned
    POST

Example code in Python

        import requests  
        client = requests.session()
        #retrive csrf token
        y = client.get(http://hotidp.leloir.org.ar/api/pipeline)
        y = y.json()

        data_send = {
            "csrfmiddlewaretoken": y['csrfmiddlewaretoken'],
            "aln_methods": ["clustalO"],
            "identity_full": ["60"],
            "identity_region": ["60"],
            "aa_percent_full": 30,
            "aa_max_full": 500,
            "aa_percent_region": 30,
            "aa_max_region": 100,
            "transfer_identity_full": 60,
            "transfer_identity_region": 60,
            "transfer_normd_full" : 0.6,
            "transfer_normd_region" : 0.6
        }
        text_type = {
            "txt": 'text/plain',
            "csv": 'application/vnd.ms-excel',
            "tsv": 'application/octet-stream'
            }
        file_send = {
            "uniprot_accessions": ('uniprot_list_P10636.txt', open('uniprot_list_P10636.txt', 'rb'), text_type['txt']),
            	"regions": ('regions_P10636_TAU.txt', open('regions_P10636_TAU.txt', 'rb'), text_type['txt'])
        }
        consult_r = client.post(http://hotidp.leloir.org.ar/api/pipeline, data=data_send, files=file_send)
        print(consult_r.status_code)
        print(consult_r.json())
       
Job Status is returned in JSON format
GET

Example code in Python

        import requests  
        jobid='your_job_id'
        consult_r = requests.get(http://hotidp.leloir.org.ar/api/pipeline/ + jobid)
        print(consult_r.status_code)
        print(consult_r.json())
       
Download a compressed file as tar.gz with the outputs
GET

Example code in Python

        import requests 
        jobid='your_job_id' 
        consult_r = requests.get(http://hotidp.leloir.org.ar/api/pipeline/download/ + jobid)
    
        if consult_r.status_code == 200:
            #save as tar.gz     
            with open(jobid + ".tar.gz", 'wb') as f:
               f.write(consult_r.content)    
        else:
            #some error found
            print(consult_r.json())