我想从 NCBI 条目的 features 部分中提取一些信息,我正在使用此代码。下载数据
fetch2 <- entrez_fetch(db = "nucleotide", id = 1028916732,
rettype = "gbc", retmode="xml", parsed = TRUE)
分析数据
xmltop = xmlRoot(fetch2) #gives content of root
class(xmltop)#"XMLInternalElementNode" "XMLInternalNode" "XMLAbstractNode"
xmlName(xmltop)
xmlSize(xmltop)
xmlName(xmltop[[1]])
features <- xmltop[[1]][[20]][[1]][[4]]
我只对功能感兴趣
<INSDFeature_quals>
<INSDQualifier>
<INSDQualifier_name>organism</INSDQualifier_name>
<INSDQualifier_value>Alanphillipsia aloeigena</INSDQualifier_value>
</INSDQualifier>
<INSDQualifier>
<INSDQualifier_name>mol_type</INSDQualifier_name>
<INSDQualifier_value>genomic DNA</INSDQualifier_value>
</INSDQualifier>
<INSDQualifier>
<INSDQualifier_name>strain</INSDQualifier_name>
<INSDQualifier_value>CPC 21286</INSDQualifier_value>
</INSDQualifier>
<INSDQualifier>
<INSDQualifier_name>isolation_source</INSDQualifier_name>
<INSDQualifier_value>leaves</INSDQualifier_value>
</INSDQualifier>
<INSDQualifier>
<INSDQualifier_name>host</INSDQualifier_name>
<INSDQualifier_value>Aloe melanacantha</INSDQualifier_value>
</INSDQualifier>
<INSDQualifier>
<INSDQualifier_name>culture_collection</INSDQualifier_name>
<INSDQualifier_value>CBS:136408</INSDQualifier_value>
</INSDQualifier>
<INSDQualifier>
<INSDQualifier_name>culture_collection</INSDQualifier_name>
<INSDQualifier_value>CPC:21286</INSDQualifier_value>
</INSDQualifier>
<INSDQualifier>
<INSDQualifier_name>type_material</INSDQualifier_name>
<INSDQualifier_value>culture from holotype of Alanphillipsia aloeigena</INSDQualifier_value>
</INSDQualifier>
<INSDQualifier>
<INSDQualifier_name>db_xref</INSDQualifier_name>
<INSDQualifier_value>taxon:1414674</INSDQualifier_value>
</INSDQualifier>
<INSDQualifier>
<INSDQualifier_name>country</INSDQualifier_name>
<INSDQualifier_value>South Africa: Namakwaland, Koegap Nature Reserve</INSDQualifier_value>
</INSDQualifier>
<INSDQualifier>
<INSDQualifier_name>collected_by</INSDQualifier_name>
<INSDQualifier_value>M.J. Wingfield</INSDQualifier_value>
</INSDQualifier>
<INSDQualifier>
<INSDQualifier_name>note</INSDQualifier_name>
<INSDQualifier_value>ex-holotype culture of Alanphillipsia aloeigena</INSDQualifier_value>
</INSDQualifier>
</INSDFeature_quals>
我想创建一个像
Organism | culture_collection | host
Alanphillipsia aloeigena | CBS:136408 | Aloe melanacantha
但是我不明白如何检索数据
<INSDQualifier_name>
<INSDQualifier_value>
我看过 Pubmed 的一些教程,效果很好,但输出的结构不同。最后,我想创建一个循环以从 ID 列表中提取数据,并且由于并非所有条目都具有相同的结构,因此我想使用标签host
organism
来检索该信息。