python-3.x - 是否可以获得一篇文章被引用的次数?
问题描述
我正在使用 Entrez 搜索 Pubmed 上的文章。是否可以使用 Entrez 来确定使用我的搜索参数找到的每篇文章的引用次数?如果没有,我可以使用其他方法吗?到目前为止,我的谷歌搜索并没有出现太多。
注意:引用次数(在我的上下文中)相关特定文章在其他文章中被引用的次数。
我发现的一件事:https ://gist.github.com/mcfrank/c1ec74df1427278cbe53 这可能表明我可以获得同样在 Pubmed DB 中的文章的引用编号,但我不清楚(对我来说)我是如何可以使用它来确定每篇文章的引用次数。
以下是我目前正在使用的代码(我想包括引用次数的“打印”行):
#search pubmed
from Bio import Entrez
from Bio import Medline
search_string = r'("Blah Blah")'
Entrez.email = "hello_world@example.com"
handle = Entrez.egquery(term=search_string)
record = Entrez.read(handle)
count = 0
for row in record["eGQueryResult"]:
if row["DbName"]=="pubmed":
print("Number of articles found with requested search parameters:", row["Count"])
count = row["Count"]
handle = Entrez.esearch(db="pubmed", term=search_string, retmax=count)
record = Entrez.read(handle)
handle.close()
idlist = record["IdList"]
handle = Entrez.efetch(db="pubmed", id=idlist, rettype="medline", retmode="text")
records = Medline.parse(handle)
records = list(records)
x=1
for record in records:
print("(" + str(x) + ")")
print("Title:", record.get("TI", "?"))
print("Authors: ", ", ".join(record.get("AU", "?")))
print("Pub Date:", record.get("DP", "?"))
print("Journal:", record.get("JT", "?"))
print("DOI:", record.get("LID", "?")[:-6])
#print("number of citations:", get.number_of_citations) #<--what I am requesting help about
print("\n")
x += 1
解决方案
不幸的是,您只能获取 pubmed Central 中的文章列表,其中引用了相关文章。
idlist = ['2344532', '2445435'] # this is your PMID list
citations = []
for pmid in idlist:
q = Entrez.read(Entrez.elink(dbfrom="pubmed", db="pmc", LinkName="pubmed_pubmed_citedin", from_uid=pmid))
for i in range(0, len(q)):
if len(q[i]["LinkSetDb"]) > 0:
pmids_list = [link["Id"] for link in q[i]["LinkSetDb"][0]["Link"]]
pmids = ";".join(pmids_list)
citations.append([q[i]["IdList"][0], pmids])
else:
citations.append([q[i]["IdList"][0]])
推荐阅读
- django-rest-framework - 在服务器 Django Rest Framework 之间设置身份验证功能
- c# - 前导零预定义方式中没有逗号
- javascript - 我可以更改绑定到 VueJS 中另一个变量的组件道具变量吗
- c - 如何定义 int[2] 的动态数组?
- authentication - SAS 传递语句中的无密码身份验证?
- c# - 为什么字体在 ASP.NET 代码中不可用?
- hashicorp-vault - 在 Vault 中创建新实体,实体别名并获取令牌进行身份验证
- java - 为什么 Java 类型推断不适用于参数化类型的返回值?
- python - 获取 Python 中最高的字符串版本号
- javascript - 我收到一条不存在的行的错误消息