从多个PMID提取关联信息以在R中生成数据帧

问题描述

关于从PubMed提取关联信息到R中,我有多个问题和很大的帮助。最初,我是从XML链接中提取的,该XML链接生成了所需的数据框,提取了关联信息,然后使用PMID(作者姓名)创建了一个数据框。 ,国家/地区等。

现在我有多个PMID,而不是XML链接,而且我真的对如何处理它感到困惑。我已经在线阅读了多篇论文和网站,但仍然不太正确。

以下是从XML成功使用的代码:

#read the xml-data
#Insert the HTML of the pubmed ID
doc <- xml2::read_xml( "https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=pubmed&id=20301425&retmode=xml" )

#Locating the pubmed ID,the authors and then the affiliate information
#xml2 :: xml_text is converting the xml a character vector
pmid    <- xml2::xml_find_first( doc,".//PMID") %>% xml2::xml_text()
authors <- paste( 
  xml2::xml_find_all( doc,".//AuthorList[@Type = 'authors']/Author/LastName") %>% xml2::xml_text(),xml2::xml_find_all( doc,".//AuthorList[@Type = 'authors']/Author/ForeName") %>% xml2::xml_text(),sep = "," )
affiliate <- xml2::xml_find_all( doc,".//AuthorList[@Type = 'authors']/Author/AffiliationInfo/Affiliation") %>% xml2::xml_text()


#Producing a dataframe of the pmid,authors & affiliate 
df.USA <- data.frame( pmid = pmid,authors = authors,affiliate = affiliate )

任何帮助您做类似事情但用多个PMID(大约10,000个!)替换XML的方法将不胜感激。 预先感谢!

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)