This repository was archived by the owner on Sep 24, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathannoheaders.py
More file actions
executable file
·134 lines (114 loc) · 5.84 KB
/
annoheaders.py
File metadata and controls
executable file
·134 lines (114 loc) · 5.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
from string import Template
# templates for annotation blocks
author = Template("""[Author]
NameString=OpenBEL
CopyrightString=Copyright (c) ${year}, OpenBEL Project. This work is licensed under a Creative Commons Attribution 3.0 Unported License.
ContactInfoString=info@openbel.org\n
""")
processing = """[Processing]
CaseSensitiveFlag=yes
DelimiterString=|
CacheableFlag=yes\n\n"""
def annotation_definition(name, version, crdate):
""" Generate [AnnotationDefinition] block, given annotation name,
.belanno version, and creation date. """
annodef_template = Template("""[AnnotationDefinition]
Keyword=${kw}
TypeString=list
DescriptionString=${ad}
UsageString=${us}
VersionString=${version}
CreatedDateTime=$date\n
""")
hd = header_dict[name]
annodef = annodef_template.substitute(
kw=hd['kw'],
ad=hd['ad'],
us=hd['us'],
version=version,
date=crdate,)
return annodef
def citation_info(id, source_version, source_date=None):
""" Generate information for [Citation] block, given
source id, version, and date (optional). """
data = source_data[id]
citation = Template("""NameString=${cname}
DescriptionString=${sd}
PublishedVersionString=${sv}\n""").substitute(
cname=data['cname'],
sd=data['sd'],
sv=source_version)
if source_date:
citation += Template("""PublishedDate=${sdate}\n""").substitute(
sdate=source_date)
citation += Template("""ReferenceURL=${su}\n""").substitute(
su=data['su'])
return citation
# header_dict contains information for the [AnnotationDefinition] block
header_dict = {}
header_dict['anatomy'] = {
'kw': 'Anatomy',
'ad': 'Anatomy terms from Uberon',
'us': 'Use to annotate a statement demonstrated in a specific anatomical entity.'
}
header_dict['disease'] = {
'kw': 'Disease',
'ad': 'Disease names from the Disease Ontology (DO)',
'us': 'Use to annotate a statement demonstrated in a biological system where the disease state was present or where the facts represented in the statement were shown to be relevant to the disease.'
}
header_dict['cell'] = {
'kw': 'Cell',
'ad': 'Cell types from the Cell Ontology (CL)',
'us': 'Use this annotation to indicate the cell type context of a statement. Use to annotate a statement that was demonstrated in a given cell type or where the facts represented in the statement were shown to be relevant to the cell type.'
}
header_dict['cell-line'] = {
'kw': 'CellLine',
'ad': 'Cell Line Ontology (CLO) and Experimental Factor Ontology (EFO) Cell Lines',
'us': 'Use this annotation to indicate the cell line context of a statement. Use to annotate a statement that was demonstrated in a given cell line.'
}
header_dict['cell-structure'] = {
'kw': 'CellStructure',
'ad': 'The Cell Structures [A11.284] sub-branch of the Medical Subject Headings (MeSH) Anatomy [A] branch.',
'us': 'Use to annotate a statement demonstrated in the context of a specific cellular location.'}
header_dict['mesh-diseases'] = {
'kw': 'MeSHDisease',
'ad': 'Disease terms from the [C] and [F03] branches of Medical Subject Headings (MeSH).',
'us': 'Use to annotate a statement demonstrated in the context of a specific disease.',
}
header_dict['mesh-anatomy'] = {
'kw': 'MeSHAnatomy',
'ad': 'Anatomy terms from Medical Subject Headings (MeSH), limited to headings from the following subbranches:[A01], [A02], [A03], [A04], [A05], [A06], [A07], [A08], [A09], [A10], [A12], [A14], [A15], [A16], and [A17].',
'us': 'Use to annotate a statement demonstrated in a specific anatomical entity.',
'cname': '',
'sd': '',
'su': ''
}
# source_data contains information for the [Citation] block
source_data = {}
source_data['UBERON'] = {
'cname': 'Uberon',
'sd': 'Uberon is an integrated cross-species anatomy ontology representing a variety of entities classified according to traditional anatomical criteria such as structure, function and developmental lineage.',
'su': 'http://uberon.org/'
}
source_data['DOID'] = {
'cname': 'Disease Ontology (DO)',
'sd': 'The Disease Ontology has been developed as a standardized ontology for human disease with the purpose of providing the biomedical community with consistent, reusable and sustainable descriptions of human disease terms, phenotype characteristics and related medical vocabulary disease concepts through collaborative efforts of researchers at Northwestern University, Center for Genetic Medicine and the University of Maryland School of Medicine, Institute for Genome Sciences. The Disease Ontology semantically integrates disease and medical vocabularies through extensive cross mapping of DO terms to MeSH, ICD, NCI\'s thesaurus, SNOMED and OMIM.',
'su': 'http://disease-ontology.org/'
}
source_data['CL'] = {
'cname': 'Cell Ontology (CL)',
'sd': 'The Cell Ontology (CL) is a candidate OBO Foundry ontology for the representation of cell types. First described in 2005, the CL integrates cell types from the prokaryotic, fungal, and eukaryotic organisms.',
'su': 'http://cellontology.org/'
}
source_data['CLO'] = {
'cname': 'Cell Line Ontology (CLO)',
'sd': 'The Cell Line Ontology (CLO) is a community-driven ontology that is developed to standardize and integrate cell line information and support computer-assisted reasoning.',
'su': 'http://www.clo-ontology.org/'}
source_data['EFO'] = {
'cname': 'Experimental Factor Ontology (EFO)',
'sd': 'The Experimental Factor Ontology (EFO) provides a systematic description of many experimental variables available in EBI databases.',
'su': 'http://www.ebi.ac.uk/efo/'}
source_data['MESH'] = {
'cname': 'MeSH',
'sd': 'MeSH (Medical Subject Headings) is a controlled vocabulary thesaurus created, maintained, and provided by the U.S. National Library of Medicine.',
'su': 'http://www.nlm.nih.gov/mesh/meshhome.html'}