Разбор файла обоо с помощью R - PullRequest
0 голосов
/ 10 сентября 2018

Мне нужно извлечь информацию из файла OBO, и он может работать, создавая код на языке R.

Мне нужно получить информацию из строки xref для каждого термина id. Информация внутри файла выглядит следующим образом для 13 000 терминов aprox:

[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

И результат должен быть примерно таким в формате txt или xlsx:

id          UMLS                        SNOMEDCT_US        MSH      EPCC     ICD-10 ICD-9   ICD-O   Fyler   MEDDRA
HP:0011540  C0232301;C0344616           56743000;83799000  C535426  01.01.03 Q20.5              
HP:0011555  C0344622                    253283000                   01.04.04 Q20.4              
HP:0011589  C3532020;C4020746;C4021141  460890003   

Заголовки (UMLS, SNOMEDCT_US, MSH, MEDDRA, ... все возможные внешние ссылки).

Большое спасибо !!

...