用R解析obo文件

时间:2018-09-10 08:59:46

标签: r parsing xlsx

我需要从OBO文件中提取信息,并且可以通过创建R语言代码来工作。

我需要从每个术语xref的{​​{1}}行获取信息。该文件内的信息如下所示,表示约13.000个术语:

id

结果必须是txt或xlsx格式的类似内容

[Term]
id: HP:0011540
name: Congenitally corrected transposition of the great arteries
def: "The essence of the lesion is the combination of discordant atrioventricular and ventriculo-arterial connections. Thus, the morphologically right atrium is connected to a morphologically left ventricle across the mitral valve, with the left ventricle then connected to the pulmonary trunk. The morphologically left atrium is connected to the morphologically right ventricle across the tricuspid valve, with the morphologically right ventricle connected to the aorta." [DDD:dbrown, pmid:21569592]
synonym: "L-transposition" RELATED []
synonym: "Ventricular inversion" RELATED []
xref: EPCC:01.01.03
xref: ICD-10:Q20.5
xref: MSH:C535426
xref: SNOMEDCT_US:56743000
xref: SNOMEDCT_US:83799000
xref: UMLS:C0232301
xref: UMLS:C0344616
is_a: HP:0011534 ! Abnormal spatial orientation of the cardiac segments
is_a: HP:0011603 ! Congenital malformation of the great arteries
created_by: peter
creation_date: 2012-04-07T10:48:56Z

[Term]
id: HP:0011555
name: Double inlet left ventricle
def: "The condition in which both atria are joined to the left ventricle each by its own atrioventricular valve. Usually there is a hypoplastic right ventricle, which may be on the opposite side of the heart as usual." [DDD:dbrown, HPO:probinson]
xref: EPCC:01.04.04
xref: ICD-10:Q20.4
xref: SNOMEDCT_US:253283000
xref: UMLS:C0344622
is_a: HP:0001750 ! Single ventricle
is_a: HP:0011554 ! Double inlet atrioventricular connection
created_by: peter
creation_date: 2012-04-07T11:53:33Z

[Term]
id: HP:0011589
name: Common origin of the right brachiocephalic artery and left common carotid artery
def: "The left common carotid artery has a common origin with the innominate artery." [DDD:dbrown, HPO:probinson, pmid:17138027]
comment: Commonly the three great vessels (innominate artery, left common carotid artery, and the left subclavian artery) originate from the arch of the aorta. The second most common variant of aortic arch branching occurs when the left common carotid artery has a common origin with the innominate artery.
synonym: "Bovine arch" RELATED []
synonym: "Common brachiocephalic trunk" EXACT []
synonym: "Ovine arch" RELATED []
xref: SNOMEDCT_US:460890003
xref: UMLS:C3532020
xref: UMLS:C4020746
xref: UMLS:C4021141
is_a: HP:0011587 ! Abnormal branching pattern of the aortic arch
created_by: peter
creation_date: 2012-04-08T01:38:36Z

标头(UMLS,SNOMEDCT_US,MSH,MERDDRA等都是可能的外部参照)。

非常感谢您!

0 个答案:

没有答案