reterive data from UniProt
0
0
Entering edit mode
3.7 years ago
Learner ▴ 250

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 • 1.0k views
ADD COMMENT
0
Entering edit mode

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 REPLY

Login before adding your answer.

Traffic: 1354 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6