我试图通过biopython使用以下代码从pubmed检索搜索结果
from Bio import Entrez
from Bio import Medline
Entrez.email = "A.N.iztb@bobxx.com"
LIM = 3
def search(Term):
handle = Entrez.esearch(db='pmc', term=Term, retmax=100000000)
record = Entrez.read(handle)
idlist = record["IdList"]
handle = Entrez.efetch(db='pmc', id=idlist, rettype="medline", retmode="text")
records = Medline.parse(handle)
return list(records)
mydic=search('(pathological conditions, signs and symptoms[MeSH Terms]) AND (pmc cc license[filter]) ')
print(len(mydic))
不管我试了多少次,我的输出都是10000次。尝试了不同的查询,但我还是得到了10000个。当我通过浏览器手动检查有多少结果时,我会得到随机数。在
到底出了什么问题,如何确保我得到最大的结果?在
您似乎只更改了
esearch
的限制,但不使用efetch
(NCBI似乎默认为10000个限制)。您需要使用retstart
和retmax
参数。在请参阅Biopython教程中的“使用history搜索和下载摘要”示例,http://biopython.org/DIST/docs/tutorial/Tutorial.html或http://biopython.org/DIST/docs/tutorial/Tutorial.pdf
相关问题 更多 >
编程相关推荐