生物赛顿研究中心()查询翻译与我的查询不对应

2024-09-21 05:22:48 发布

您现在位置:Python中文网/ 问答频道 /正文

我对生物圈还不熟悉。使用此代码:

handle = Entrez.esearch(db="nuccore", term="complete", field="title", FILT="refseq", porgn="viruses", rettype='xml')
print Entrez.read(handle)[u'QueryTranslation']

我得到:

^{pr2}$

但我期待这样的事情:

complete[Title] AND "viruses"[porgn]

(查询来自http://www.ncbi.nlm.nih.gov/nuccore的搜索结果)

refseq过滤器似乎也不起作用。我做错什么了? 提前谢谢!在


Tags: 代码fielddbtitleentrezcompletehandlefilt
3条回答

要添加RefSeq要求,您可以

>>> from Bio import Entrez
>>> handle = Entrez.esearch(db="nuccore", term="complete[title] AND refeq[filter] AND viruses[porgn]", rettype='xml')

我认为您需要编辑您的term关键字参数。您需要包括AND viruses[porgn]

>>> handle = Entrez.esearch(db="nuccore", term="complete AND viruses[porgn]", field="title", FILT="refseq", rettype='xml')
>>> print Entrez.read(handle)[u'QueryTranslation']
complete[Title] AND viruses[porgn]

根据当前的NCBI文档,没有FILT或progrn选项-NCBI可能会默默地忽略它们(个人而言,我更希望它们发出明确的错误消息)。在

基于http://www.ncbi.nlm.nih.gov/books/NBK25499/#chapter4.ESearch你现在可以

>>> from Bio import Entrez
>>> handle = Entrez.esearch(db="nuccore", term="complete", field="title", rettype='xml')
>>> print Entrez.read(handle)[u'QueryTranslation']
complete[Title]

作为替代:

^{pr2}$

这个字段选项(我确信)是NCBI的一个新特性,但实际上并没有添加任何新功能。它似乎只对琐碎的搜索有意义。在

要执行您似乎想要的复杂搜索,请执行以下操作:

^{3}$

在Biopython教程中有这样的例子。另请参见http://news.open-bio.org/news/2009/06/ncbi-einfo-biopython/(现在也在Biopython教程中)。在

相关问题 更多 >

    热门问题