This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Query Returns A Different Number Of Results When Fetching With Biopython From Dbsnp

Hey all, I have issues on the output of rsid from dbSNP, if i use the website base output for specific terms of the protein I got an list of rsid no# around 13000, http://www.ncbi.nlm.nih.gov/snp/details?querykey=3

(pathogenic[Clinical_Significance] OR probable pathogenic[Clinical_Significance]) AND (nonsense[Function_Class] OR missense[Function_Class] OR frameshift[Function_Class]) AND "Homo sapiens"[Organism]

but if i use the Biopython Entrez ...i get different number for the output rsid list

fh= Entrez.esearch(db='snp', retmax= '15000', term="pathogenic OR probable pathogenic AND nonsens OR missense OR frameshift AND Homo sapiens")
rec=Entrez.read(fh)
rsid_list=rec['IdList']

the len(rsid_list) is 15000?? did I make sth wrong?

Thanks!

biopython entrez dbsnp

you do have a typo in what you show at nonsens instead of nonsense

1 answer

You are not using the same search term - your web version included the [field] restrictions and different AND/OR combinations, while the version you used in Biopython did not. Try:

from Bio import Entrez
fh= Entrez.esearch(db='snp', retmax= '15000', term='(pathogenic[Clinical_Significance] OR probable pathogenic[Clinical_Significance]) AND (nonsense[Function_Class] OR missense[Function_Class] OR frameshift[Function_Class]) AND "Homo sapiens"[Organism]')
rec=Entrez.read(fh)
fh.close()
rsid_list=rec['IdList']
print len(rsid_list)

Right now that gives 13035 results.

Thanks a lot :-) .!

Log in to answer this question.