I’m new to Biopython. Using this code:
handle = Entrez.esearch(db="nuccore", term="complete", field="title", FILT="refseq", porgn="viruses", rettype='xml')
print Entrez.read(handle)[u'QueryTranslation']
I get:
complete[Title]
but I’m expecting sth like this:
complete[Title] AND "viruses"[porgn]
(QueryTranslation from search results on http://www.ncbi.nlm.nih.gov/nuccore)
The refseq filter also seems not to work. What am I doing wrong?
Thanks in advance!
According to the current NCBI documentation, there are no options FILT or progrn – the NCBI is probably silently ignoring them (personally I’d prefer an explicit error message from them).
Based on the http://www.ncbi.nlm.nih.gov/books/NBK25499/#chapter4.ESearch you can now do
as an alternative to:
That field option is (I’m petty sure) a new feature from the NCBI, but doesn’t actually add any new functionality. It would seem to only make sense for trivial searches.
In order to do the complex search you appear to want, do this:
There are examples like this in the Biopython Tutorial. See also http://news.open-bio.org/news/2009/06/ncbi-einfo-biopython/ (also now in the Biopython Tutorial).