使用Rentrez解析pubmed中的作者和从属关系 [英] Using rentrez to parse out author and affiliation from pubmed
问题描述
我的总体目标是建立共同作者网络图。我有一份PubMed ID列表,这是我对共同作者网络图表感兴趣的唯一出版物。我无法弄清楚如何使用rentrez在查询中同时获得作者姓名和所属单位。我可以同时获得这两种信息,但是我的隶属关系列表比我的作者列表少300左右,因此显然有些人没有提供隶属关系,但我不知道是谁。有什么方法可以搜索作者和从属关系? [当我在entrez_fetch中同时执行这两项操作时,它只是分别列出了作者和单位的列表,因此我仍然无法弄清哪个单位属于哪个作者。]
My overall goal is to build a co-author network graph. I have a list of PubMed ID's and these are the only publications I am interested in for the graphing of the co-author network. I can't figure out how to get both the Author names and respective affiliations together in my query using rentrez. I can get both information but my list of affiliations is about 300 less than my author list so obviously some did not provide affiliations but I can't figure out who. Any way to search for Author and affiliation combined? [When I did both in my entrez_fetch, it just gave me a list of authors and affiliations separately so I still can't figure out which affiliations belong with which authors.]
library(tidyverse)
library(rentrez)
library(XML)
trial<-entrez_fetch(db="pubmed", id=pub.list$PMID, rettype="xml", parsed=TRUE)
affiliations<-xpathSApply(trial, "//Affiliation", xmlValue)
first.names<-xpathSApply(trial, "//Author/ForeName", xmlValue)
一切正常,但我不知道哪个作者的隶属关系因其长度不同而有所不同。
This all works fine but I can't figure out which authors are with which affiliations since their lengths are different.
任何帮助将不胜感激。谢谢!
Any help would be greatly appreciated. Thanks!
推荐答案
您可以尝试以下方法:
xpathSApply(trial, "//Author", function(x) {
author_name <- xmlValue(x[["LastName"]])
author_affiliation <- xmlValue(x[["AffiliationInfo"]][["Affiliation"]])
c(author_name,author_affiliation)
})
通过在第一行中返回每个 // Author $ c $的值,在第一行中返回作者的姓氏,在第二行中返回作者的隶属关系c>节点。
It returns in the first row the last name of the authors and in the second row their affiliation by getting these values for each //Author
node.
这篇关于使用Rentrez解析pubmed中的作者和从属关系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!