Question: reterive data from UniProt
gravatar for Learner
10 weeks ago by
Learner 150
Learner 150 wrote:

I want to get few information for bunch of genes

I looked at UniProt and they give a similar python code to the following

import urllib,urllib2
    url = ''
    params = {
    'query': 'gene_exact:mapk1 AND organism:homo_sapiens AND reviewed:yes', 
    'format': 'tab', 
    'columns': 'id,ec,entry_name,genes'}

    data = urllib.urlencode(params)
    request = urllib2.Request(url, data)
    contact = "" 
    request.add_header('User-Agent', 'Python %s' % contact)
    response = urllib2.urlopen(request)
    header = response.readline()

I also used the above question C: UniProtKB - mapping gene name to ID (*_HUMAN ) using python2 and answer but it does not work for me , I get no output, is there any opinion or comment ?

gene • 150 views
ADD COMMENTlink modified 10 weeks ago • written 10 weeks ago by Learner 150

If you manage to get the code shown above to run, there won't be any output printed to screen. The data retrieved from UniProt will be saved in the variable entries. If you are on the python interpreter, try this:

>>> entries
'P28482\tMK01_HUMAN\tMAPK1 ERK2 PRKM1 PRKM2\n'
ADD REPLYlink written 10 weeks ago by vkkodali990
Please log in to add an answer.


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