Question: Accessing UNIPROT using REST API
0
gravatar for Natasha
15 months ago by
Natasha30
Natasha30 wrote:

Hello Everyone, I would like to programmatically access the entries(uniprot id,entry name,protein name,gene name,kinetics) for a given EC Number and organism of interest, using python.

import urllib,urllib2

url = 'http://www.uniprot.org/uploadlists/'

params = {
'from':'ACC',
'to':'P_REFSEQ_AC',
'format':'tab',
'query':'P13368 P20806 Q9UM73 P97793 Q17192'
}

data = urllib.urlencode(params)
request = urllib2.Request(url, data)
contact = "" # Please set your email address here to help us debug in case of problems.
request.add_header('User-Agent', 'Python %s' % contact)
response = urllib2.urlopen(request)
page = response.read(200000)

I had a look at the above python code given here.However,I couldn't really understand how the code should be modified to download the search result(here) in xml format .

In the above code my query is ------'query':'3.1.3.9 2.7.1.2' and format is -----"format": 'xml' How do we add the organism filter("Organism":'Homo sapiens') in the code and download the xml file of the serach result?

Many thanks,

Deepa

ADD COMMENTlink modified 15 months ago by Elisabeth Gasteiger1.6k • written 15 months ago by Natasha30
2
gravatar for Elisabeth Gasteiger
15 months ago by
Geneva
Elisabeth Gasteiger1.6k wrote:

The UniProt IDmapping doesn't actually support EC numbers. For performance reasons, databases where the mapping relationship to UniProtKB identifiers is one-to-many, e.g. GO, InterPro or PubMed, are not supported. There is a note about this in the help page http://www.uniprot.org/help/uploadlists.

You can however build RESTful queries of the form

http://www.uniprot.org/uniprot/?query=(ec%3A+3.1.3.9+or+ec%3A2.7.1.2)+organism%3A9606&format=xml

You could also use the tab-delimited format:

http://www.uniprot.org/uniprot/?query=(ec%3A+3.1.3.9+or+ec%3A2.7.1.2)+organism%3A9606&format=tab&columns=id,entry_name,protein_names,genes,comment(KINETICS)

ADD COMMENTlink written 15 months ago by Elisabeth Gasteiger1.6k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 819 users visited in the last hour