gpt4 book ai didi

python - biopython - Entrez.esearch() 查询翻译与我的查询不符

转载 作者:太空宇宙 更新时间:2023-11-03 19:13:25 25 4
gpt4 key购买 nike

我是 Biopython 新手。使用此代码:

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

我得到:

complete[Title]

但我期待这样的事情:

complete[Title] AND "viruses"[porgn]

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

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

最佳答案

根据当前的 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]

作为替代:

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

该字段选项(我敢肯定)是 NCBI 的一项新功能,但实际上并未添加任何新功能。这似乎只对琐碎的搜索有意义。

为了进行您想要的复杂搜索,请执行以下操作:

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

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

关于python - biopython - Entrez.esearch() 查询翻译与我的查询不符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12180035/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com