Retrieve Pubmed Ids
2
0
Entering edit mode
11.3 years ago
Nitin ▴ 170

Hi all,

I have set of genes ( ASCL1, AEBP1, MLF1) i want to search PUBMED for literature in glioma. Means i want to get Pubmed Ids for these genes in glioma. To acheive this i tried biopython script as follows

from Bio Import Entrez
Entrez.email = "my email"
data = Entrez.esearch(db="pubmed",term = "ASCL1 and glioma", "AEBP1 and glioma")
res=Entrez.read(data)
PMID = res["IdList"]
print PMID

It doesnt work it gives following error SyntaxError: non-keyword arg after keyword arg

As I am new to biopython i am not able to solve this problem..

Can any body please let me know how to parse multiple terms and get pubmed Ids

Thanks Ni

biopython • 4.1k views
ADD COMMENT
1
Entering edit mode
11.3 years ago
Björn ▴ 670

Hi Nitin,

try that code:

from Bio import Entrez
Entrez.email = "mail@mail.com"
for single_term in ["ASCL1", "glioma"]:
    data = Entrez.esearch(db="pubmed",term = single_term)
    res = Entrez.read(data)
    pmids = res["IdList"]
    print 'PMIDs for %s: %s' % (single_term, pmids)
ADD COMMENT
0
Entering edit mode
11.3 years ago

try Entrez.esearch(db="pubmed",term = "ASCL1 and glioma")

ADD COMMENT
0
Entering edit mode

Thanks for reply that i tried it works perfectly..but i have mulitple genes ..so i want to get all Pubmed IDs for this genes in glioma..can you please tell me how to do that same Entrez.esearch?

ADD REPLY
0
Entering edit mode

how about using a simple loop ?

ADD REPLY
0
Entering edit mode

I tried this too it didnt work ..first I stored terms in text file as follows ASCL1 and glioma AEBP1 and glioma

infile = "file.txt"

for line in infile.readlines():

single_id = line

#Retreiving information

data = Entrez.esearch(db="pubmed",term = single_id)

res=Entrez.read(data)

PMID = res["IdList"]

print "%s" %(PMID)

out_put.write("%s\n" %(PMID))

out_put.close()

Can you tell where i am going wrong in this code? Thanks

ADD REPLY

Login before adding your answer.

Traffic: 1648 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