This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Esearch results not matching up with online results

I am using the code below to perform an esearch, but the id's that I get from IdList are not matching up with the ID's on the online search.

 handle = Entrez.esearch(db = "nucleotide", term = "chordata[orgn] AND chromosome", retmax = 200, idtype = "acc")
 genome_ids = Entrez.read(handle)['IdList']

Does anyone know why? And does anyone know how I can download the chromosomal and mitochondrial genome of all the organisms from the chordata phylum? I want to do it using BioPython through the E-utilities.

biopython entrez esearch

If your code doesn't retrieve the same thing as the online tool, it means it's doing something different. The most common source of discrepancies is the use of different parameters, in particular default parameters can be different between the web site and the code.

For downloading large data sets from NCBI, I would recommend using their FTP site. E-utilities are slow and if you hammer the NCBI web site with queries, you'll get banned.

1 answer

You cannot call IdList directly like that. Try the following:

handle = Entrez.esearch(db = "nucleotide", term = "chordata[orgn] AND chromosome", retmax = 200, idtype = "acc")
genome_ids = Entrez.read(handle)
genome_ids = genome_ids['IdList']

Log in to answer this question.