Last active
August 29, 2015 14:06
-
-
Save cfriedline/1ffb358fe3f03a85ef1b to your computer and use it in GitHub Desktop.
ncbi epost out of order
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ids = ["148908191", "297793721", "48525513", "507118461"] | |
search_results = Entrez.read(Entrez.epost("protein", id=','.join(ids))) | |
webenv = search_results["WebEnv"] | |
query_key = search_results["QueryKey"] | |
print Entrez.read(Entrez.elink(webenv=webenv, | |
query_key=query_key, | |
dbfrom="protein", | |
db="taxonomy")) | |
print "-------" | |
for i in ids: | |
search_results = Entrez.read(Entrez.epost("protein", id=i)) | |
webenv = search_results["WebEnv"] | |
query_key = search_results["QueryKey"] | |
print Entrez.read(Entrez.elink(webenv=webenv, | |
query_key=query_key, | |
dbfrom="protein", | |
db="taxonomy")) | |
#[{u'LinkSetDb': [{u'DbTo': 'taxonomy', u'Link': [{u'Id': '211604'}, {u'Id': '81972'}, {u'Id': '32630'}, {u'Id': '3332'}], u'LinkName': 'protein_taxonomy'}], u'DbFrom': 'protein', u'IdList': ['148908191', '297793721', '48525513', '507118461'], u'LinkSetDbHistory': [], u'ERROR': []}] | |
#------- | |
#[{u'LinkSetDb': [{u'DbTo': 'taxonomy', u'Link': [{u'Id': '3332'}], u'LinkName': 'protein_taxonomy'}], u'DbFrom': 'protein', u'IdList': ['148908191'], u'LinkSetDbHistory': [], u'ERROR': []}] | |
#[{u'LinkSetDb': [{u'DbTo': 'taxonomy', u'Link': [{u'Id': '81972'}], u'LinkName': 'protein_taxonomy'}], u'DbFrom': 'protein', u'IdList': ['297793721'], u'LinkSetDbHistory': [], u'ERROR': []}] | |
#[{u'LinkSetDb': [{u'DbTo': 'taxonomy', u'Link': [{u'Id': '211604'}], u'LinkName': 'protein_taxonomy'}], u'DbFrom': 'protein', u'IdList': ['48525513'], u'LinkSetDbHistory': [], u'ERROR': []}] | |
#[{u'LinkSetDb': [{u'DbTo': 'taxonomy', u'Link': [{u'Id': '32630'}], u'LinkName': 'protein_taxonomy'}], u'DbFrom': 'protein', u'IdList': ['507118461'], u'LinkSetDbHistory': [], u'ERROR': []}] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See also https://www.biostars.org/p/112225/ and https://stackoverflow.com/questions/25775309/entrez-epost-elink-returns-results-out-of-order-with-biopython