Debian Codegraph @

modules/sequence/apollo-bridge/apollo.inserts

raw
1 --creates several items that Apollo expects to be in the database:
2 -- a property type cv and terms
3 -- a pub type cv and terms
4 -- a pubrelationship type cv and terms
5 -- a pubprop type cv and terms
6
7 --Rice EST_match
8 --Rice cDNA_match
9 --Maize EST_match
10 --Maize cross_genome_match
11 --Rice protein_match
12 --FgenesH:Monocot
13
14 insert into analysis (name,program,programversion,sourcename)
15 values ('Rice_EST_match','blat','1','Rice_EST');
16 insert into analysis (name,program,programversion,sourcename)
17 values ('Rice_cDNA_match','blat','1','Rice_cDNA');
18 insert into analysis (name,program,programversion,sourcename)
19 values ('Maize_EST_match','blat','1','Maize_EST');
20 insert into analysis (name,program,programversion,sourcename)
21 values ('Rice_protein_match','blat','1','Rice_protein');
22 insert into analysis (name,program,programversion,sourcename)
23 values ('Maize_cross_genome_match','blat','1','Maize_genome');
24 insert into analysis (name,program,programversion,sourcename)
25 values ('FgenesH_Monocot','FgenesH','1','na');
26 insert into analysis (name,program,programversion,sourcename)
27 values ('Sorghum_EST_match','blat','1','Sourghum_EST');
28 insert into analysis (name,program,programversion,sourcename)
29 values ('Barley_EST_match','blat','1','Barley_EST');
30 insert into analysis (name,program,programversion,sourcename)
31 values ('Wheat_EST_match','blat','1','Wheat_EST');
32 insert into analysis (name,program,programversion,sourcename)
33 values ('Rice_cross_genome_match','blat','1','Rice_genome');
34 insert into analysis (name,program,programversion,sourcename)
35 values ('Millet_EST_match','blat','1','Millet_EST');
36 insert into analysis (name,program,programversion,sourcename)
37 values ('Rice_Japonica_BACend_nucleotide_match','blat','1','Rice_Japonica_BACend');
38 insert into analysis (name,program,programversion,sourcename)
39 values ('riceSativa_bacends_omap_nucleotide_match','blat','1','riceSativa_bacends_omap');
40 insert into analysis (name,program,programversion,sourcename)
41 values ('Rice_Australiensis_BACend_nucleotide_match','blat','1','Rice_Australiensis_BACend');
42 insert into analysis (name,program,programversion,sourcename)
43 values ('riceAustraliensis_bacends_omap_nucleotide_match','blat','1','riceAustraliensis_bacends_omap');
44 insert into analysis (name,program,programversion,sourcename)
45 values ('Rice_Punctata_BACend_nucleotide_match','blat','1','Rice_Punctata_BACend');
46 insert into analysis (name,program,programversion,sourcename)
47 values ('ricePunctata_bacends_omap_nucleotide_match','blat','1','ricePunctata_bacends_omap');
48 insert into analysis (name,program,programversion,sourcename)
49 values ('Maize_MAGI_ISU_cross_genome_match','blat','1','Maize_MAGI_ISU');
50 insert into analysis (name,program,programversion,sourcename)
51 values ('Maize_hi_cot_Bennetzen_cross_genome_match','blat','1','Maize_hi_cot_Bennetzen');
52 insert into analysis (name,program,programversion,sourcename)
53 values ('Maize_meth_filt_hi_cot_cluster_cross_genome_match','blat','1','Maize_meth_filt_hi_cot_cluster');
54 insert into analysis (name,program,programversion,sourcename)
55 values ('Maize_hi_cot_TIGR_cross_genome_match','blat','1','Maize_hi_cot_TIGR');
56 insert into analysis (name,program,programversion,sourcename)
57 values ('Maize_BACend_cross_genome_match','blat','1','Maize_BACend');
58 insert into analysis (name,program,programversion,sourcename)
59 values ('Rice_Nivara_BACend_nucleotide_match','blat','1','Rice_Nivara_BACend');
60 insert into analysis (name,program,programversion,sourcename)
61 values ('riceNivara_bacends_omap_nucleotide_match','blat','1','riceNivara_bacends_omap');
62 insert into analysis (name,program,programversion,sourcename)
63 values ('Rice_Rufipogon_BACend_nucleotide_match','blat','1','Rice_Rufipogon_BACend');
64 insert into analysis (name,program,programversion,sourcename)
65 values ('riceRufipogon_bacends_omap_nucleotide_match','blat','1','riceRufipogon_bacends_omap');
66 insert into analysis (name,program,programversion,sourcename)
67 values ('Sorghum_orion_cross_genome_match','blat','1','Sorghum_orion');
68 insert into analysis (name,program,programversion,sourcename)
69 values ('Maize_meth_filt_CSHL_Mccombie_cross_genome_match','blat','1','Maize_meth_filt_CSHL_Mccombie');
70 insert into analysis (name,program,programversion,sourcename)
71 values ('Maize_meth_filt_TIGR_cross_genome_match','blat','1','Maize_meth_filt_TIGR');
72 insert into analysis (name,program,programversion,sourcename)
73 values ('Ryegrass_Sequence_cross_genome_match','blat','1','Ryegrass_Sequence');
74 insert into analysis (name,program,programversion,sourcename)
75 values ('Ryegrass_Assembly_cross_genome_match','blat','1','Ryegrass_Assembly');
76 insert into analysis (name,program,programversion,sourcename)
77 values ('Rice_Glaberrima_BACend_nucleotide_match','blat','1','Rice_Glaberrima_BACend');
78 insert into analysis (name,program,programversion,sourcename)
79 values ('riceGlaberrima_bacends_omap_nucleotide_match','blat','1','riceGlaberrima_bacends_omap');
80 insert into analysis (name,program,programversion,sourcename)
81 values ('Rice_unmapped_BAC_back_nucleotide_match','blat','1','Rice_unmapped_BAC_back');
82 insert into analysis (name,program,programversion,sourcename)
83 values ('Rice_ArrayTarget_Affy57K_cDNA_match','blat','1','Rice_ArrayTarget_Affy57K');
84 insert into analysis (name,program,programversion,sourcename)
85 values ('Rice_GI_EST_match','blat','1','Rice_GI');
86 insert into analysis (name,program,programversion,sourcename)
87 values ('Rice_jap_cDNA_KOME_cDNA_match','blat','1','Rice_jap_cDNA_KOME');
88 insert into analysis (name,program,programversion,sourcename)
89 values ('Rice_Brachyantha_BACend_nucleotide_match','blat','1','Rice_Brachyantha_BACend');
90 insert into analysis (name,program,programversion,sourcename)
91 values ('riceBrachyantha_bacends_omap_nucleotide_match','blat','1','riceBrachyantha_bacends_omap');
92 insert into analysis (name,program,programversion,sourcename)
93 values ('Osativa_TUG_PlantGDB_EST_match','blat','1','Osativa_TUG_PlantGDB');
94 insert into analysis (name,program,programversion,sourcename)
95 values ('Rice_tug_EST_match','blat','1','Rice_tug');
96 insert into analysis (name,program,programversion,sourcename)
97 values ('Rice_Alta_BACend_nucleotide_match','blat','1','Rice_Alta_BACend');
98 insert into analysis (name,program,programversion,sourcename)
99 values ('riceAlta_bacends_omap_nucleotide_match','blat','1','riceAlta_bacends_omap');
100 insert into analysis (name,program,programversion,sourcename)
101 values ('Sorghum_cluster_Pratt_EST_match','blat','1','Sorghum_cluster_Pratt');
102 insert into analysis (name,program,programversion,sourcename)
103 values ('Maize_est_EST_match','blat','1','Maize_est');
104 insert into analysis (name,program,programversion,sourcename)
105 values ('Maize_GI_EST_match','blat','1','Maize_GI');
106 insert into analysis (name,program,programversion,sourcename)
107 values ('Maize_ArrayTarget_NSF58K_cDNA_match','blat','1','Maize_ArrayTarget_NSF58K');
108 insert into analysis (name,program,programversion,sourcename)
109 values ('Zmays_TUG_PlantGDB_EST_match','blat','1','Zmays_TUG_PlantGDB');
110 insert into analysis (name,program,programversion,sourcename)
111 values ('Wheat_est_EST_match','blat','1','Wheat_est');
112 insert into analysis (name,program,programversion,sourcename)
113 values ('Wheat_GI_EST_match','blat','1','Wheat_GI');
114 insert into analysis (name,program,programversion,sourcename)
115 values ('Wheat_tug_EST_match','blat','1','Wheat_tug');
116 insert into analysis (name,program,programversion,sourcename)
117 values ('Taestivum_TUG_PlantGDB_EST_match','blat','1','Taestivum_TUG_PlantGDB');
118 insert into analysis (name,program,programversion,sourcename)
119 values ('Wheat_ArrayTarget_Affy61K_cDNA_match','blat','1','Wheat_ArrayTarget_Affy61K');
120 insert into analysis (name,program,programversion,sourcename)
121 values ('Barley_est_EST_match','blat','1','Barley_est');
122 insert into analysis (name,program,programversion,sourcename)
123 values ('Barley_GI_EST_match','blat','1','Barley_GI');
124 insert into analysis (name,program,programversion,sourcename)
125 values ('Barley_ArrayTarget_Affy22K_cDNA_match','blat','1','Barley_ArrayTarget_Affy22K');
126 insert into analysis (name,program,programversion,sourcename)
127 values ('Hvulgare_TUG_PlantGDB_EST_match','blat','1','Hvulgare_TUG_PlantGDB');
128 insert into analysis (name,program,programversion,sourcename)
129 values ('Sugarcane_est_EST_match','blat','1','Sugarcane_est');
130 insert into analysis (name,program,programversion,sourcename)
131 values ('Barley_tug_EST_match','blat','1','Barley_tug');
132 insert into analysis (name,program,programversion,sourcename)
133 values ('Maize_markers_cross_genome_match','blat','1','Maize_markers');
134 insert into analysis (name,program,programversion,sourcename)
135 values ('Rice_ind_est_EST_match','blat','1','Rice_ind_est');
136 insert into analysis (name,program,programversion,sourcename)
137 values ('Rice_ind_cluster_EST_match','blat','1','Rice_ind_cluster');
138 insert into analysis (name,program,programversion,sourcename)
139 values ('Sorghum_GI_EST_match','blat','1','Sorghum_GI');
140 insert into analysis (name,program,programversion,sourcename)
141 values ('Rice_est_EST_match','blat','1','Rice_est');
142 insert into analysis (name,program,programversion,sourcename)
143 values ('Sorghum_CDNA_cDNA_match','blat','1','Sorghum_CDNA');
144 insert into analysis (name,program,programversion,sourcename)
145 values ('Sorghum_est_EST_match','blat','1','Sorghum_est');
146 insert into analysis (name,program,programversion,sourcename)
147 values ('Sbicolor_TUG_PlantGDB_EST_match','blat','1','Sbicolor_TUG_PlantGDB');
148 insert into analysis (name,program,programversion,sourcename)
149 values ('Maize_tug_EST_match','blat','1','Maize_tug');
150 insert into analysis (name,program,programversion,sourcename)
151 values ('Maize_ArrayTarget_Affy18K_cDNA_match','blat','1','Maize_ArrayTarget_Affy18K');
152 insert into analysis (name,program,programversion,sourcename)
153 values ('Sorghum_tug_EST_match','blat','1','Sorghum_tug');
154 insert into analysis (name,program,programversion,sourcename)
155 values ('Maize_cornsensus_cDNA_match','blat','1','Maize_cornsensus');
156 insert into analysis (name,program,programversion,sourcename)
157 values ('Millet_est_EST_match','blat','1','Millet_est');
158 insert into analysis (name,program,programversion,sourcename)
159 values ('Maize_CDs_cDNA_match','blat','1','Maize_CDs');
160 insert into analysis (name,program,programversion,sourcename)
161 values ('Maize_Unigene_Panzea_EST_match','blat','1','Maize_Unigene_Panzea');
162 insert into analysis (name,program,programversion,sourcename)
163 values ('Wheat_markers_cross_genome_match','blat','1','Wheat_markers');
164 insert into analysis (name,program,programversion,sourcename)
165 values ('Rice_BAC_nucleotide_match','blat','1','Rice_BAC');
166 insert into analysis (name,program,programversion,sourcename)
167 values ('Rice_unmapped_BAC_front_nucleotide_match','blat','1','Rice_unmapped_BAC_front');
168 insert into analysis (name,program,programversion,sourcename)
169 values ('Sorghum_Markers_cross_genome_match','blat','1','Sorghum_Markers');
170 insert into analysis (name,program,programversion,sourcename)
171 values ('Rice_CDS_cDNA_match','blat','1','Rice_CDS');
172 insert into analysis (name,program,programversion,sourcename)
173 values ('Sorghum_gss-read_Klein_cross_genome_match','blat','1','Sorghum_gss-read_Klein');
174 insert into analysis (name,program,programversion,sourcename)
175 values ('RiceAlta_BACend_OMAP_nucleotide_match','blat','1','RiceAlta_BACend_OMAP');
176 insert into analysis (name,program,programversion,sourcename)
177 values ('RiceBrachyantha_BACend_OMAP_nucleotide_match','blat','1','RiceBrachyantha_BACend_OMAP');
178 insert into analysis (name,program,programversion,sourcename)
179 values ('RiceJaponica_BACend_OMAP_nucleotide_match','blat','1','RiceJaponica_BACend_OMAP');
180 insert into analysis (name,program,programversion,sourcename)
181 values ('RiceAustraliensis_BACend_OMAP_nucleotide_match','blat','1','RiceAustraliensis_BACend_OMAP');
182 insert into analysis (name,program,programversion,sourcename)
183 values ('RiceCoarctata_BACend_OMAP_nucleotide_match','blat','1','RiceCoarctata_BACend_OMAP');
184 insert into analysis (name,program,programversion,sourcename)
185 values ('RicePunctata_BACend_OMAP_nucleotide_match','blat','1','RicePunctata_BACend_OMAP');
186 insert into analysis (name,program,programversion,sourcename)
187 values ('RiceGlaberrima_BACend_OMAP_nucleotide_match','blat','1','RiceGlaberrima_BACend_OMAP');
188 insert into analysis (name,program,programversion,sourcename)
189 values ('RiceNivara_BACend_OMAP_nucleotide_match','blat','1','RiceNivara_BACend_OMAP');
190 insert into analysis (name,program,programversion,sourcename)
191 values ('Rice_ESTCluster_PlantGDB_EST_match','blat','1','Rice_ESTCluster_PlantGDB');
192 insert into analysis (name,program,programversion,sourcename)
193 values ('Barley_ESTCluster_PlantGDB_EST_match','blat','1','Barley_ESTCluster_PlantGDB');
194 insert into analysis (name,program,programversion,sourcename)
195 values ('Wheat_ESTCluster_PlantGDB_EST_match','blat','1','Wheat_ESTCluster_PlantGDB');
196 insert into analysis (name,program,programversion,sourcename)
197 values ('Sorghum_ESTCluster3P_LGBPratt_EST_match','blat','1','Sorghum_ESTCluster3P_LGBPratt');
198 insert into analysis (name,program,programversion,sourcename)
199 values ('Sorghum_ESTCluster_PlantGDB_EST_match','blat','1','Sorghum_ESTCluster_PlantGDB');
200 insert into analysis (name,program,programversion,sourcename)
201 values ('Maize_ESTCluster_PlantGDB_EST_match','blat','1','Maize_ESTCluster_PlantGDB');
202 insert into analysis (name,program,programversion,sourcename)
203 values ('RiceRufipogon_BACend_OMAP_nucleotide_match','blat','1','RiceRufipogon_BACend_OMAP');
204 insert into analysis (name,program,programversion,sourcename)
205 values ('Maize_Seq_Panzea_EST_match','blat','1','Maize_Seq_Panzea');
206 insert into analysis (name,program,programversion,sourcename)
207 values ('RiceMinuta_BACend_OMAP_nucleotide_match','blat','1','RiceMinuta_BACend_OMAP');
208 insert into analysis (name,program,programversion,sourcename)
209 values ('RiceGranulata_BACend_OMAP_nucleotide_match','blat','1','RiceGranulata_BACend_OMAP');
210 insert into analysis (name,program,programversion,sourcename)
211 values ('RiceRidleyi_BACend_OMAP_nucleotide_match','blat','1','RiceRidleyi_BACend_OMAP');
212 insert into analysis (name,program,programversion,sourcename)
213 values ('RiceOfficinalis_BACend_OMAP_nucleotide_match','blat','1','RiceOfficinalis_BACend_OMAP');
214
215
216 insert into db (name) values ('DB:TIGR_EGAD');
217 insert into db (name) values ('DB:Maize_Seq_Panzea');
218 insert into db (name) values ('DB:RiceRufipogon_BACend_OMAP');
219 insert into db (name) values ('DB:Maize_ESTCluster_PlantGDB');
220 insert into db (name) values ('DB:Sorghum_ESTCluster_PlantGDB');
221 insert into db (name) values ('DB:Sorghum_ESTCluster3P_LGBPratt');
222 insert into db (name) values ('DB:Wheat_ESTCluster_PlantGDB');
223 insert into db (name) values ('DB:Barley_ESTCluster_PlantGDB');
224 insert into db (name) values ('DB:Rice_ESTCluster_PlantGDB');
225 insert into db (name) values ('DB:RiceNivara_BACend_OMAP');
226 insert into db (name) values ('DB:RiceGlaberrima_BACend_OMAP');
227 insert into db (name) values ('DB:RicePunctata_BACend_OMAP');
228 insert into db (name) values ('DB:RiceCoarctata_BACend_OMAP');
229 insert into db (name) values ('DB:RiceJaponica_BACend_OMAP');
230 insert into db (name) values ('DB:RiceBrachyantha_BACend_OMAP');
231 insert into db (name) values ('DB:RiceAlta_BACend_OMAP');
232 insert into db (name) values ('DB:Sorghum_gss-read_Klein');
233 insert into db (name) values ('DB:Rice_CDS');
234 insert into db (name) values ('DB:Sorghum_Markers');
235 insert into db (name) values ('DB:Rice_BAC');
236 insert into db (name) values ('DB:Wheat_Markers');
237 insert into db (name) values ('DB:Maize_cornsensus');
238 insert into db (name) values ('DB:Sorghum_tug');
239 insert into db (name) values ('DB:Maize_tug');
240 insert into db (name) values ('DB:Sorghum_CDNA');
241 insert into db (name) values ('DB:Sorghum_GI');
242 insert into db (name) values ('DB:Rice_ind_cluster');
243 insert into db (name) values ('DB:Rice_ind_est');
244 insert into db (name) values ('DB:Maize_markers');
245 insert into db (name) values ('DB:Barley_tug');
246 insert into db (name) values ('DB:Sugarcane_est');
247 insert into db (name) values ('DB:Barley_GI');
248 insert into db (name) values ('DB:Wheat_tug');
249 insert into db (name) values ('DB:Wheat_GI');
250 insert into db (name) values ('DB:Wheat_est');
251 insert into db (name) values ('DB:Maize_GI');
252 insert into db (name) values ('DB:Sorghum_cluster_Pratt');
253 insert into db (name) values ('DB:EST_match');
254 insert into db (name) values ('DB:Rice_tug');
255 insert into db (name) values ('DB:cDNA_match');
256 insert into db (name) values ('DB:Rice_GI');
257 insert into db (name) values ('DB:TIGR_Maize');
258 insert into db (name) values ('DB:TIGR_Osa');
259 insert into db (name) values ('DB:nucleotide_match');
260 insert into db (name) values ('DB:Sorghum_Orion');
261 insert into db (name) values ('DB:cross_genome_match');
262 insert into db (name) values ('DB:Maize_hi_cot_TIGR');
263 insert into db (name) values ('DB:Maize_meth_filt_TIGR');
264
265 insert into pub (uniquename, title, type_id) values ('none', 'none', (select cvterm_id from cvterm where name = 'null pub' and cv_id in (select cv_id from cv where name='pub type') ) );
266
267 --for the new triggers
268
269 create sequence uniquename_id_generator;
270
271 insert into cvtermprop (cvterm_id,type_id,value) values ((select cvterm_id from cvterm where name='prefix' and cv_id in (select cv_id from cv where name='apollo')),(select cvterm_id from cvterm where name='is_a' and cv_id in (select cv_id from cv where name='relationship')),'RICE');
272 insert into cvtermprop (cvterm_id,type_id,value) values ((select cvterm_id from cvterm where name='suffix' and cv_id in (select cv_id from cv where name='apollo')),(select cvterm_id from cvterm where name='is_a' and cv_id in (select cv_id from cv where name='relationship')),'');
273
274 insert into dbxref (db_id, accession) values ((select db_id from db where name='null'),'Relationship Ontology:producedby');
275 insert into cvterm (name, cv_id, dbxref_id, is_relationshiptype) values ('producedby',(select cv_id from cv where name='Relationship Ontology'),(select dbxref_id from dbxref where accession = 'Relationship Ontology:producedby'),1);
276
277 CREATE TABLE feature_namegenerator (
278 feature_namegenerator_id serial not null,
279 primary key (feature_namegenerator_id),
280 name varchar(255),
281 type_id bigint,
282 foreign key (type_id) references cvterm (cvterm_id) on delete cascade INITIALLY DEFERRED,
283 count int
284 -- constraint feature_namegenerator_c1 unique (name,type_id)
285 );
286
287 INSERT INTO feature_namegenerator (name,type_id,count)
288 SELECT substr(name, 0 , (position('-' in name))),
289 (select cvterm_id from cvterm where cv_id=7 and name='transcript'),
290 to_number(max(substring(name from 21)), '99999')
291 FROM feature WHERE name like 'RICE%-transcript%' group by name;
292
293 INSERT INTO feature_namegenerator (name,type_id,count)
294 SELECT substr(name, 0 , (position('-' in name))),
295 (select cvterm_id from cvterm where cv_id=14 and name='protein'),
296 to_number(max(substring(name from 19)), '99999')
297 FROM feature WHERE name like 'RICE%-protein%' group by name;
298
299 delete from feature_namegenerator where feature_namegenerator_id not in
300 (select feature_namegenerator_id from feature_namegenerator where count = max(count) group by name,type_id);
301
302 alter table feature_namegenerator add constraint feature_namegenerator_c1 unique (name,type_id);