It's easy to perform searches from code. All you have to do is send a request to our webserver with the form in post data. Results are returned in json format. A fully worked Python 2.6 example is as follows:
import urllib2
import urllib
import time
import json
params = {
'seed_sequence': 'MATADVKSTVPHMDMDRGGAFDFSNCIRNQAMCKMGGKAPKLTSTGTTIVAVAFKGGLVMGADSRATAGN',
'seed_organism': 'Homo sapiens',
'target_organism': 'Mus musculus',
'database': 'nr',
'program': 'blastp',
'e_value': '10**-15',
'return_type':'json'
}
post_data = urllib.urlencode(params)
json_handle = urllib2.urlopen('http://ortholog.us/', post_data)
results = json.load(json_handle)
search_id = results['id']
searching = bool(results['searching'])
# Wait 10 seconds and check if the search has completed
while searching:
time.sleep(10)
json_handle = urllib2.urlopen('http://ortholog.us/json/' + search_id + '/')
results = json.load(json_handle)
searching = results['searching'] == 'True'
print results
A comprehensive API specification with language bindings will provided in the coming months. The above code is a temporary solution for researchers needing to make immediate use of ortholog.us.