Entering edit mode
6.8 years ago
Learner
▴
280
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 ?
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: