This is a test version of Biostars. For the public version, visit https://www.biostars.org.
NCBI search with ENTREZ biopython last refseq version tag

Hi! I'm trying to deal with ncbi research and reproduce it in ENTREZ through biopython.

This is my NCBI query : "Microbacterium"[Organism] AND "latest refseq"[filter] AND (all[filter] NOT partial[filter])

i then tried to reproduce it in biopython with :

query = "Microbacterium[Organism] AND latest refseq[Filter] NOT partial[filter]) " 
handle = Entrez.esearch(term=query, db="Assembly", retmax=900) 
ids = Entrez.read(handle)["IdList"] 
ids  
[]

if i'm trying with :

query = "Microbacterium[Organism] AND latest[Filter]"
handle = Entrez.esearch(term=query, db="Assembly", retmax=900)
ids = Entrez.read(handle)["IdList"]
len(ids) 
693

which is better but i still need the refseq version.. i don't understand what is the problem here. how can i add the tag of the refseq or genbank choice? thanks for your help!

ncbi biopython

1 answer

Try latest_refseq instead of latest refseq. Or, use quotes for it, like this: 'Microbacterium[Organism] AND "latest refseq"[Filter] NOT partial[filter])'. Apparently it matters which quotes are used where: use single quotes for the query and double quotes for Entrez terms that have spaces.

ohh thanks, it was so simple.. i tried with double quote but it wasn't working.. thanks a lot you saved my day!

Log in to answer this question.