There will be a brief site outage this evening (April 20, 2014) around 10pm EST. The hosting company will be upgrading our servers.
Question: [Python] Uniprot Id To Gene Name
5
gravatar for Yo_O
2.9 years ago by
Yo_O80
Yo_O80 wrote:

Hi, I've got a huge list of Uniprot IDs and I want to get the matching gene names. Do you know how to do that in python ? (I'm currently searching with Biopython...) Thanks !

Yo.

ADD COMMENTlink written 2.9 years ago by Yo_O80
1

See related post here: http://biostar.stackexchange.com/questions/22/gene-id-conversion-tool/8107#8107

ADD REPLYlink written 2.9 years ago by Casey Bergman14k
3
gravatar for Jerven
2.9 years ago by
Jerven530
Jerven530 wrote:

You can do this using the retrieve function at www.uniprot.org (4th tab element in the top bar)

Upload your list of ID's.

Look for the small blue UniProtKB (number of retrieved) entries link. Click this. Then use the customize display to select only gene names. Then click download as tab.

Ok, not very pythonic, but a few http calls from python would work.

ADD COMMENTlink written 2.9 years ago by Jerven530
1
gravatar for Chris
2.9 years ago by
Chris1.5k
Munich
Chris1.5k wrote:

Perhaps sth like this:

for record in SwissProt.parse(open('uniprot_sprot.dat')):
  accessions = record.accessions
  gene_name = record.gene_name

Chris

ADD COMMENTlink written 2.9 years ago by Chris1.5k
1

Well, my code snippet was rather meant as an inspiration of how to access the uniprot_id and corresponding gene_name from swissprot. Once you have that mapping (e.g. as a dictionary) it should be easy to do the mapping from that to your problem setting.

ADD REPLYlink written 2.9 years ago by Chris1.5k
1

Yep. I got what I wanted with this :

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

query=uniprot_id params = {'from':'ACC','to':'ENSEMBL_ID','format':'tab','query':query} data = urllib.urlencode(params) request = urllib2.Request(url, data) response = urllib2.urlopen(request) page = response.read(200000)

Then I've got an homemade dictionary id_Ensembl <-> geneName

Thanks a lot for your answers guys !

Yo.

ADD REPLYlink written 2.9 years ago by Yo_O80

It's a good beginning I think. But my input file is like this : "Uniprot_ID--->position", one per line. So I just want to translate Uniprot_ID to Gene_name in output. Does anything exist yet ? Thx a lot !

ADD REPLYlink written 2.9 years ago by Yo_O80

Oups, I don't know how to paste code here...if an admin can edit it..thanks

ADD REPLYlink written 2.9 years ago by Yo_O80
Please log in to add an answer.

Help
Access
  • RSS
  • Stats
  • API

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.0.0
Traffic: 247 posts viewed in the last hour