Question: reterive data from UniProt
0
gravatar for Learner
9 months ago by
Learner 180
Learner 180 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 = 'https://www.uniprot.org/uploadlists/'
    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 = "xxxx@outlook.com" 
    request.add_header('User-Agent', 'Python %s' % contact)
    response = urllib2.urlopen(request)
    header = response.readline()
    entries=response.read(200000)

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 • 326 views
ADD COMMENTlink modified 9 months ago • written 9 months ago by Learner 180

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 9 months ago by vkkodali1.2k
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: 982 users visited in the last hour