-
Notifications
You must be signed in to change notification settings - Fork 0
/
tripal_qtl.install
192 lines (172 loc) · 4.5 KB
/
tripal_qtl.install
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
<?php
/**
* @file
* Prepares the site for tripal_genentic module.
*/
/**
* Implements hook_enable().
*/
function tripal_qtl_enable() {
// Add cvterms needed for the feature map loader.
// map_type.
tripal_insert_cvterm(array(
'id' => 'MAIN:map_type',
'name' => 'map_type',
'cv_name' => 'MAIN',
'definition' => 'The type of feature map (e.g. genetic, cytogenetic, physical, sequence).',
));
// published_map_name.
tripal_insert_cvterm(array(
'id' => 'MAIN:published_map_name',
'name' => 'published_map_name',
'cv_name' => 'MAIN',
'definition' => 'The name of the map in the linked publication.',
));
// population_type.
tripal_insert_cvterm(array(
'id' => 'MAIN:population_type',
'name' => 'population_type',
'cv_name' => 'MAIN',
'definition' => 'The type of population used to generate a map (e.g. F2, BC1, RIL, ABC)',
));
// population_size.
tripal_insert_cvterm(array(
'id' => 'MAIN:population_size',
'name' => 'population_size',
'cv_name' => 'MAIN',
'definition' => 'The number of individuals in the population used to generate the map.',
));
// locus.
tripal_insert_cvterm(array(
'id' => 'MAIN:marker_locus',
'name' => 'marker_locus',
'cv_name' => 'MAIN',
'definition' => 'The position of a gene or a chromosomal marker on a chromosome; also, a stretch of DNA at a particular place on a particular chromosome. The use of locus is sometimes restricted to mean regions of DNA that are expressed..',
));
// start: used for marker positions.
tripal_insert_cvterm(array(
'id' => 'MAIN:start',
'name' => 'start',
'cv_name' => 'MAIN',
'definition' => 'The start position.',
));
// end: used for marker positions.
tripal_insert_cvterm(array(
'id' => 'MAIN:end',
'name' => 'end',
'cv_name' => 'MAIN',
'definition' => 'The end position.',
));
// instance_of.
tripal_insert_cvterm(array(
'id' => 'OBO_REL:instance_of',
'name' => 'instance_of',
'cv_name' => 'relationship',
'definition' => '',
));
// marker_type.
tripal_insert_cvterm(array(
'id' => 'MAIN:marker_type',
'name' => 'marker_type',
'cv_name' => 'MAIN',
'definition' => '',
));
// CVterms needed for QTL.
// published_symbol.
tripal_insert_cvterm(array(
'id' => 'MAIN:published_symbol',
'name' => 'published_symbol',
'cv_name' => 'MAIN',
'definition' => '',
));
// site_name.
tripal_insert_cvterm(array(
'id' => 'MAIN:site_name',
'name' => 'site_name',
'cv_name' => 'MAIN',
'definition' => '',
));
// lod.
tripal_insert_cvterm(array(
'id' => 'MAIN:lod',
'name' => 'lod',
'cv_name' => 'MAIN',
'definition' => '',
));
// r2.
tripal_insert_cvterm(array(
'id' => 'MAIN:r2',
'name' => 'r2',
'cv_name' => 'MAIN',
'definition' => '',
));
// additive_effect.
tripal_insert_cvterm(array(
'id' => 'MAIN:additive_effect',
'name' => 'additive_effect',
'cv_name' => 'MAIN',
'definition' => '',
));
// direction.
tripal_insert_cvterm(array(
'id' => 'MAIN:direction',
'name' => 'direction',
'cv_name' => 'MAIN',
'definition' => '',
));
// qtl_peak.
tripal_insert_cvterm(array(
'id' => 'MAIN:qtl_peak',
'name' => 'qtl_peak',
'cv_name' => 'MAIN',
'definition' => '',
));
// @todo File an issue with github/GMOD/chado to add this table to 1.4.
$table = 'featuremap_analysis';
$schema = [
'table' => 'featuremap_analysis',
'description' => 'Maps analysis to the featuremaps they generated.',
'fields' => [
'featuremap_analysis_id' => [
'type' => 'serial',
'not null' => TRUE,
],
'featuremap_id' => [
'size' => 'big',
'type' => 'int',
'not null' => TRUE,
],
'analysis_id' => [
'size' => 'big',
'type' => 'int',
'not null' => TRUE,
],
],
'primary key' => [
'featuremap_analysis_id',
],
'indexes' => [
'featuremap_analysis_idx1' => [
0 => 'featuremap_id',
],
'featuremap_analysis_idx2' => [
0 => 'analysis_id',
],
],
'foreign keys' => [
'featuremap' => [
'table' => 'featuremap',
'columns' => [
'featuremap_id' => 'featuremap_id',
],
],
'analysis' => [
'table' => 'analysis',
'columns' => [
'analysis_id' => 'analysis_id',
],
],
],
];
chado_create_custom_table($table, $schema, TRUE, NULL, FALSE);
}