Statistics
| Branch: | Revision:

root / AGPv2 / makeDb.sql @ 84c81131

History | View | Annotate | Download (9.2 kB)

1 8c368a17 Daofeng Li
-- ------------------------
2 8c368a17 Daofeng Li
--                       --
3 8c368a17 Daofeng Li
--      AGPv2heatmap     --
4 8c368a17 Daofeng Li
--                       --
5 8c368a17 Daofeng Li
-- ------------------------
6 8c368a17 Daofeng Li
drop table if exists config;
7 8c368a17 Daofeng Li
create table config (
8 8c368a17 Daofeng Li
  bbiPath text not null,
9 8c368a17 Daofeng Li
  seqPath text null,
10 8c368a17 Daofeng Li
  defaultTracks text not null,
11 8c368a17 Daofeng Li
  defaultMdcategory varchar(255) not null,
12 8c368a17 Daofeng Li
  defaultGenelist text not null,
13 8c368a17 Daofeng Li
  defaultCustomtracks text not null,
14 8c368a17 Daofeng Li
  defaultPosition varchar(255) not null,
15 8c368a17 Daofeng Li
  defaultDataset varchar(255) not null,
16 8c368a17 Daofeng Li
  defaultDecor text null,
17 8c368a17 Daofeng Li
  defaultScaffold text not null,
18 8c368a17 Daofeng Li
  ideogram_wiggle1 varchar(255) null,
19 8c368a17 Daofeng Li
  ideogram_wiggle2 varchar(255) null,
20 8c368a17 Daofeng Li
  hasGene boolean not null,
21 8c368a17 Daofeng Li
  allowJuxtaposition boolean not null,
22 8c368a17 Daofeng Li
  keggSpeciesCode varchar(255) null,
23 8c368a17 Daofeng Li
  information text not null,
24 8c368a17 Daofeng Li
  runmode tinyint not null,
25 8c368a17 Daofeng Li
  initmatplot boolean not null
26 8c368a17 Daofeng Li
);
27 8c368a17 Daofeng Li
insert into config values(
28 8c368a17 Daofeng Li
"/srv/epgg/data/data/subtleKnife/b73_AGPv2/",
29 8c368a17 Daofeng Li
"/srv/epgg/data/data/subtleKnife/seq/AGPv2.gz",
30 8c368a17 Daofeng Li
"mock1,mock2,mock3,mock4,mock5,mock6,mock7,mock8,mock9,mock10,mock11,mock12,mock13,mock14,mock15,mock16,mock17,mock18,mock19,mock20", 
31 8c368a17 Daofeng Li
"Sample,mock term",
32 8c368a17 Daofeng Li
"gst23\\ngst40\\ngst8\\ngst30\\ngst14\\ngst11\\ngst12\\ngst16\\ngst7\\ngst19\\ngst41\\ngst9\\ngst35\\ngst24\\ngst31\\nBz2",
33 8c368a17 Daofeng Li
"3,http://vizhub.wustl.edu/hubSample/AGPv2/rand4.gz,1,http://vizhub.wustl.edu/hubSample/AGPv2/sample.gz,100,http://vizhub.wustl.edu/hubSample/AGPv2/hub.txt",
34 8c368a17 Daofeng Li
"chr1,11500000,chr1,12000000",
35 8c368a17 Daofeng Li
"mock",
36 8c368a17 Daofeng Li
"refGene,AGPv2_5a",
37 8c368a17 Daofeng Li
"chr1,chr2,chr3,chr4,chr5,chr6,chr7,chr8,chr9,chr10",
38 8c368a17 Daofeng Li
\N,\N,
39 8c368a17 Daofeng Li
true,
40 8c368a17 Daofeng Li
true,
41 8c368a17 Daofeng Li
"zma",
42 8c368a17 Daofeng Li
"Strain|B73|Assembly version|AGPv2|Sequence source|<a href=http://www.maizesequence.org target=_blank>maizesequence.org</a>|Date parsed|May 19, 2012|Chromosomes|13|Contigs|0|Total bases|3,232,254,451|Logo art|<a href=http://en.wikipedia.org/wiki/File:Zea_mays_-_K%C3%B6hler%E2%80%93s_Medizinal-Pflanzen-283.jpg target=_blank>link</a>",
43 8c368a17 Daofeng Li
0,
44 8c368a17 Daofeng Li
false
45 8c368a17 Daofeng Li
);
46 8c368a17 Daofeng Li
47 8c368a17 Daofeng Li
-- grouping types on genomic features
48 8c368a17 Daofeng Li
-- table name defined in macro: TBN_GF_GRP
49 8c368a17 Daofeng Li
drop table if exists gfGrouping;
50 8c368a17 Daofeng Li
create table gfGrouping (
51 8c368a17 Daofeng Li
  id TINYINT not null primary key,
52 8c368a17 Daofeng Li
  name char(50) not null
53 8c368a17 Daofeng Li
);
54 8c368a17 Daofeng Li
insert into gfGrouping values (2, "Genes");
55 8c368a17 Daofeng Li
insert into gfGrouping values (4, "TE Consortium repeats");
56 8c368a17 Daofeng Li
insert into gfGrouping values (5, "Others");
57 8c368a17 Daofeng Li
58 8c368a17 Daofeng Li
59 8c368a17 Daofeng Li
60 8c368a17 Daofeng Li
61 8c368a17 Daofeng Li
drop table if exists decorInfo;
62 8c368a17 Daofeng Li
create table decorInfo (
63 8c368a17 Daofeng Li
  name char(50) not null primary key,
64 8c368a17 Daofeng Li
  printname char(100) not null,
65 8c368a17 Daofeng Li
  parent char(50) null,
66 8c368a17 Daofeng Li
  grp tinyint not null,
67 8c368a17 Daofeng Li
  fileType tinyint not null,
68 8c368a17 Daofeng Li
  hasStruct tinyint null,
69 8c368a17 Daofeng Li
  queryUrl varchar(255) null
70 8c368a17 Daofeng Li
);
71 8c368a17 Daofeng Li
load data local infile 'decorInfo' into table decorInfo;
72 8c368a17 Daofeng Li
/*
73 8c368a17 Daofeng Li
insert into decorInfo values('AGPv2_5a','Maize genes',\N,2,0,1,'http://www.maizesequence.org/Zea_mays/Gene?db=core;gene=');
74 8c368a17 Daofeng Li
insert into decorInfo values('AGPv2_5apromoter','promoters (RefSeq genes)','AGPv2_5a',2,0,0,\N);
75 8c368a17 Daofeng Li
insert into decorInfo values('AGPv2_5autr3',"3' UTRs (RefSeq genes)",'AGPv2_5a',2,0,0,\N);
76 8c368a17 Daofeng Li
insert into decorInfo values('AGPv2_5autr5',"5' UTRs (RefSeq genes)",'AGPv2_5a',2,0,0,\N);
77 8c368a17 Daofeng Li
insert into decorInfo values('AGPv2_5aexons','exons (RefSeq genes)','AGPv2_5a',2,0,0,\N);
78 8c368a17 Daofeng Li
insert into decorInfo values('AGPv2_5aintrons','introns (RefSeq genes)','AGPv2_5a',2,0,0,\N);
79 8c368a17 Daofeng Li
insert into decorInfo values('refGene','RefSeq genes',\N,2,0,1,'http://www.ncbi.nlm.nih.gov/gene/?term=');
80 8c368a17 Daofeng Li
insert into decorInfo values('refGenepromoter','promoters (RefSeq genes)','refGene',2,0,0,\N);
81 8c368a17 Daofeng Li
insert into decorInfo values('refGeneutr3',"3' UTRs (RefSeq genes)",'refGene',2,0,0,\N);
82 8c368a17 Daofeng Li
insert into decorInfo values('refGeneutr5',"5' UTRs (RefSeq genes)",'refGene',2,0,0,\N);
83 8c368a17 Daofeng Li
insert into decorInfo values('refGeneexons','exons (RefSeq genes)','refGene',2,0,0,\N);
84 8c368a17 Daofeng Li
insert into decorInfo values('refGeneintrons','introns (RefSeq genes)','refGene',2,0,0,\N);
85 8c368a17 Daofeng Li
86 8c368a17 Daofeng Li
insert into decorInfo values ('MTECrepeats','All repeats',\N, 4, 0, 0,\N);
87 8c368a17 Daofeng Li
insert into decorInfo values ('LINE','LINE',\N, 4, 0, 0,\N);
88 8c368a17 Daofeng Li
insert into decorInfo values ('LINE [RIL] L1','LINE [RIL] L1','LINE', 4, 0, 0,\N);
89 8c368a17 Daofeng Li
insert into decorInfo values ('LINE [RIX] Unknown','LINE [RIX] Unknown','LINE', 4, 0, 0,\N);
90 8c368a17 Daofeng Li
insert into decorInfo values ('LTR','LTR',\N, 4, 0, 0,\N);
91 8c368a17 Daofeng Li
insert into decorInfo values ('LTR [RLC] Copia','LTR [RLC] Copia','LTR', 4, 0, 0,\N);
92 8c368a17 Daofeng Li
insert into decorInfo values ('LTR [RLG] Gypsy','LTR [RLG] Gypsy','LTR', 4, 0, 0,\N);
93 8c368a17 Daofeng Li
insert into decorInfo values ('LTR [RLX] Unknown','LTR [RLX] Unknown','LTR', 4, 0, 0,\N);
94 8c368a17 Daofeng Li
insert into decorInfo values ('TIR','TIR',\N, 4, 0, 0,\N);
95 8c368a17 Daofeng Li
insert into decorInfo values ('TIR [DTA] hAT','TIR [DTA] hAT', 'TIR', 4, 0, 0,\N);
96 8c368a17 Daofeng Li
insert into decorInfo values ('TIR [DTC] CACTA','TIR [DTC] CACTA', 'TIR', 4, 0, 0,\N);
97 8c368a17 Daofeng Li
insert into decorInfo values ('TIR [DTH] Pif-Harbinger','TIR [DTH] Pif-Harbinger', 'TIR', 4, 0, 0,\N);
98 8c368a17 Daofeng Li
insert into decorInfo values ('TIR [DTM] Mutator','TIR [DTM] Mutator', 'TIR', 4, 0, 0,\N);
99 8c368a17 Daofeng Li
insert into decorInfo values ('TIR [DTT] Tc1-Mariner','TIR [DTT] Tc1-Mariner', 'TIR', 4, 0, 0,\N);
100 8c368a17 Daofeng Li
101 8c368a17 Daofeng Li
insert into decorInfo values ('gc5Base','GC percent', \N,5, 8, 0,\N);
102 8c368a17 Daofeng Li
*/
103 8c368a17 Daofeng Li
104 8c368a17 Daofeng Li
drop table if exists track2Label;
105 8c368a17 Daofeng Li
create table track2Label (
106 8c368a17 Daofeng Li
  name varchar(255) not null primary key,
107 8c368a17 Daofeng Li
  label text null
108 8c368a17 Daofeng Li
);
109 8c368a17 Daofeng Li
load data local infile 'track2Label' into table track2Label;
110 8c368a17 Daofeng Li
111 8c368a17 Daofeng Li
drop table if exists track2ProcessInfo;
112 8c368a17 Daofeng Li
create table track2ProcessInfo (
113 8c368a17 Daofeng Li
  name varchar(255) not null primary key,
114 8c368a17 Daofeng Li
  detail text null
115 8c368a17 Daofeng Li
);
116 8c368a17 Daofeng Li
load data local infile 'track2ProcessInfo' into table track2ProcessInfo;
117 8c368a17 Daofeng Li
118 8c368a17 Daofeng Li
drop table if exists track2BamInfo;
119 8c368a17 Daofeng Li
create table track2BamInfo (
120 8c368a17 Daofeng Li
  name varchar(255) not null,
121 8c368a17 Daofeng Li
  bamfile varchar(255) not null,
122 8c368a17 Daofeng Li
  bamfilelabel varchar(255) not null
123 8c368a17 Daofeng Li
);
124 8c368a17 Daofeng Li
load data local infile "track2BamInfo" into table track2BamInfo;
125 8c368a17 Daofeng Li
126 8c368a17 Daofeng Li
drop table if exists track2Detail;
127 8c368a17 Daofeng Li
create table track2Detail (
128 8c368a17 Daofeng Li
  name varchar(255) not null primary key,
129 8c368a17 Daofeng Li
  detail text null
130 8c368a17 Daofeng Li
);
131 8c368a17 Daofeng Li
load data local infile 'track2Detail' into table track2Detail;
132 8c368a17 Daofeng Li
133 8c368a17 Daofeng Li
drop table if exists track2GEO;
134 8c368a17 Daofeng Li
create table track2GEO (
135 8c368a17 Daofeng Li
  name varchar(255) not null primary key,
136 8c368a17 Daofeng Li
  geo char(20) not null
137 8c368a17 Daofeng Li
);
138 8c368a17 Daofeng Li
load data local infile 'track2GEO' into table track2GEO;
139 8c368a17 Daofeng Li
140 8c368a17 Daofeng Li
drop table if exists track2VersionInfo;
141 8c368a17 Daofeng Li
create table track2VersionInfo (
142 8c368a17 Daofeng Li
  name varchar(255) not null primary key,
143 8c368a17 Daofeng Li
  info varchar(255) not null
144 8c368a17 Daofeng Li
);
145 8c368a17 Daofeng Li
load data local infile 'track2VersionInfo' into table track2VersionInfo;
146 8c368a17 Daofeng Li
147 8c368a17 Daofeng Li
-- new trackDetail end here
148 8c368a17 Daofeng Li
149 8c368a17 Daofeng Li
drop table if exists track2Annotation;
150 8c368a17 Daofeng Li
create table track2Annotation (
151 8c368a17 Daofeng Li
  name varchar(255) not null primary key,
152 8c368a17 Daofeng Li
  attridx varchar(255) not null
153 8c368a17 Daofeng Li
);
154 8c368a17 Daofeng Li
load data local infile "track2Annotation" into table track2Annotation;
155 8c368a17 Daofeng Li
156 8c368a17 Daofeng Li
drop table if exists track2Ft;
157 8c368a17 Daofeng Li
create table track2Ft (
158 8c368a17 Daofeng Li
  name varchar(255) not null primary key,
159 8c368a17 Daofeng Li
  ft tinyint not null
160 8c368a17 Daofeng Li
);
161 8c368a17 Daofeng Li
load data local infile "track2Ft" into table track2Ft;
162 8c368a17 Daofeng Li
163 8c368a17 Daofeng Li
drop table if exists track2Style;
164 8c368a17 Daofeng Li
create table track2Style (
165 8c368a17 Daofeng Li
  name varchar(255) not null primary key,
166 8c368a17 Daofeng Li
  style text not null
167 8c368a17 Daofeng Li
);
168 8c368a17 Daofeng Li
load data local infile "track2Style" into table track2Style;
169 8c368a17 Daofeng Li
170 8c368a17 Daofeng Li
drop table if exists track2Regions;
171 8c368a17 Daofeng Li
create table track2Regions (
172 8c368a17 Daofeng Li
  name varchar(255) not null primary key,
173 8c368a17 Daofeng Li
    regionname varchar(255) not null,
174 8c368a17 Daofeng Li
          regions text not null
175 8c368a17 Daofeng Li
           );
176 8c368a17 Daofeng Li
177 8c368a17 Daofeng Li
178 8c368a17 Daofeng Li
drop table if exists metadataVocabulary;
179 8c368a17 Daofeng Li
create table metadataVocabulary (
180 8c368a17 Daofeng Li
  child varchar(255) not null,
181 8c368a17 Daofeng Li
  parent varchar(255) not null
182 8c368a17 Daofeng Li
);
183 8c368a17 Daofeng Li
load data local infile "metadataVocabulary" into table metadataVocabulary;
184 8c368a17 Daofeng Li
185 8c368a17 Daofeng Li
drop table if exists trackAttr2idx;
186 8c368a17 Daofeng Li
create table trackAttr2idx (
187 8c368a17 Daofeng Li
  idx varchar(255) not null primary key,
188 8c368a17 Daofeng Li
  attr varchar(255) not null,
189 8c368a17 Daofeng Li
  note varchar(255) null,
190 8c368a17 Daofeng Li
  description text null
191 8c368a17 Daofeng Li
);
192 8c368a17 Daofeng Li
load data local infile "trackAttr2idx" into table trackAttr2idx;
193 8c368a17 Daofeng Li
194 8c368a17 Daofeng Li
195 8c368a17 Daofeng Li
drop table if exists tempURL;
196 8c368a17 Daofeng Li
create table tempURL (
197 8c368a17 Daofeng Li
  session varchar(100) not null,
198 8c368a17 Daofeng Li
  offset INT unsigned not null,
199 8c368a17 Daofeng Li
  urlpiece text not null
200 8c368a17 Daofeng Li
);
201 8c368a17 Daofeng Li
202 8c368a17 Daofeng Li
203 8c368a17 Daofeng Li
204 8c368a17 Daofeng Li
drop table if exists dataset;
205 8c368a17 Daofeng Li
create table dataset (
206 8c368a17 Daofeng Li
  tablename varchar(255) not null,
207 8c368a17 Daofeng Li
  logo varchar(255) null,
208 8c368a17 Daofeng Li
  name varchar(255) not null,
209 8c368a17 Daofeng Li
  url varchar(255) null,
210 8c368a17 Daofeng Li
  description text not null
211 8c368a17 Daofeng Li
);
212 8c368a17 Daofeng Li
load data local infile "dataset" into table dataset;
213 8c368a17 Daofeng Li
214 8c368a17 Daofeng Li
drop table if exists mock;
215 8c368a17 Daofeng Li
create table mock (
216 8c368a17 Daofeng Li
  tkname varchar(255) not null
217 8c368a17 Daofeng Li
);
218 8c368a17 Daofeng Li
load data local infile "mock" into table mock;
219 8c368a17 Daofeng Li
220 8c368a17 Daofeng Li
drop table if exists scaffoldInfo;
221 8c368a17 Daofeng Li
create table scaffoldInfo (
222 8c368a17 Daofeng Li
  parent varchar(255) not null,
223 8c368a17 Daofeng Li
  child varchar(255) not null,
224 8c368a17 Daofeng Li
  childLength int unsigned not null
225 8c368a17 Daofeng Li
  );
226 8c368a17 Daofeng Li
load data local infile "scaffoldInfo" into table scaffoldInfo;
227 8c368a17 Daofeng Li
228 8c368a17 Daofeng Li
229 8c368a17 Daofeng Li
drop table if exists cytoband;
230 8c368a17 Daofeng Li
create table cytoband (
231 8c368a17 Daofeng Li
  id int null auto_increment primary key,
232 8c368a17 Daofeng Li
  chrom char(20) not null,
233 8c368a17 Daofeng Li
  start int not null,
234 8c368a17 Daofeng Li
  stop int not null,
235 8c368a17 Daofeng Li
  name char(20) not null,
236 8c368a17 Daofeng Li
  colorIdx int not null
237 8c368a17 Daofeng Li
);
238 8c368a17 Daofeng Li
load data local infile "cytoband" into table cytoband;
239 8c368a17 Daofeng Li
240 8c368a17 Daofeng Li
/*
241 8c368a17 Daofeng Li
DROP TABLE IF EXISTS `rmsk`;
242 8c368a17 Daofeng Li
CREATE TABLE `rmsk` (
243 8c368a17 Daofeng Li
  `bin` smallint(5) unsigned NOT NULL default '0',
244 8c368a17 Daofeng Li
  `swScore` int(10) unsigned NOT NULL default '0',
245 8c368a17 Daofeng Li
  `milliDiv` int(10) unsigned NOT NULL default '0',
246 8c368a17 Daofeng Li
  `milliDel` int(10) unsigned NOT NULL default '0',
247 8c368a17 Daofeng Li
  `milliIns` int(10) unsigned NOT NULL default '0',
248 8c368a17 Daofeng Li
  `genoName` varchar(255) NOT NULL default '',
249 8c368a17 Daofeng Li
  `genoStart` int(10) unsigned NOT NULL default '0',
250 8c368a17 Daofeng Li
  `genoEnd` int(10) unsigned NOT NULL default '0',
251 8c368a17 Daofeng Li
  `genoLeft` int(11) NOT NULL default '0',
252 8c368a17 Daofeng Li
  `strand` char(1) NOT NULL default '',
253 8c368a17 Daofeng Li
  `repName` varchar(255) NOT NULL default '',
254 8c368a17 Daofeng Li
  `repClass` varchar(255) NOT NULL default '',
255 8c368a17 Daofeng Li
  `repFamily` varchar(255) NOT NULL default '',
256 8c368a17 Daofeng Li
  `repStart` int(11) NOT NULL default '0',
257 8c368a17 Daofeng Li
  `repEnd` int(11) NOT NULL default '0',
258 8c368a17 Daofeng Li
  `repLeft` int(11) NOT NULL default '0',
259 8c368a17 Daofeng Li
  `id` char(1) NOT NULL default '',
260 8c368a17 Daofeng Li
  KEY `genoName` (`genoName`(14),`bin`)
261 8c368a17 Daofeng Li
);
262 8c368a17 Daofeng Li
load data local infile 'rmsk.txt' into table rmsk;
263 8c368a17 Daofeng Li
*/
264 8c368a17 Daofeng Li
265 8c368a17 Daofeng Li