Statistics
| Branch: | Revision:

root / hg19 / makeDb.sql @ 52e54a06

History | View | Annotate | Download (10.7 kB)

1 8c368a17 Daofeng Li
-- -------------------
2 8c368a17 Daofeng Li
--                  --
3 8c368a17 Daofeng Li
--    hg19heatmap   --
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 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 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) not 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/hg19/",
29 8c368a17 Daofeng Li
"/srv/epgg/data/data/subtleKnife/seq/hg19.gz",
30 8c368a17 Daofeng Li
"GSM959044_1,GSM521901,GSM469970,GSM521897,GSM521895,GSM521913,GSM469974,GSM521889,GSM469968,E12_25_bothAc_dense",
31 8c368a17 Daofeng Li
"Assay,Sample,Institution",
32 8c368a17 Daofeng Li
"CYP4Z1\\nCYP2A7\\nCYP2A6\\nCYP3A4\\nCYP1A1\\nCYP4V2\\nCYP51A1\\nCYP2C19\\nCYP26B1\\nCYP11B2\\nCYP24A1\\nCYP4B1\\nCYP2C8",
33 8c368a17 Daofeng Li
"3,http://vizhub.wustl.edu/hubSample/hg19/qual3.gz,1,http://vizhub.wustl.edu/hubSample/hg19/bed.gz,10,http://vizhub.wustl.edu/hubSample/hg19/K562POL2.gz,15,http://vizhub.wustl.edu/hubSample/hg19/sample.bigWig,100,http://vizhub.wustl.edu/hubSample/hg19/hub2.txt,18,http://vizhub.wustl.edu/hubSample/hg19/bam1.bam",
34 8c368a17 Daofeng Li
"chr7,27053398,chr7,27373766",
35 8c368a17 Daofeng Li
"roadmapepigenome,longrange",
36 8c368a17 Daofeng Li
"refGene,rmsk_ensemble",
37 8c368a17 Daofeng Li
"chr1,chr2,chr3,chr4,chr5,chr6,chr7,chr8,chr9,chr10,chr11,chr12,chr13,chr14,chr15,chr16,chr17,chr18,chr19,chr20,chr21,chr22,chrX,chrY,chrM",
38 8c368a17 Daofeng Li
"knownGene,0",
39 8c368a17 Daofeng Li
\N,
40 8c368a17 Daofeng Li
true,
41 8c368a17 Daofeng Li
true,
42 8c368a17 Daofeng Li
"hsa",
43 8c368a17 Daofeng Li
"Assembly version|hg19|Sequence source|<a href=http://hgdownload.cse.ucsc.edu/goldenPath/hg19/bigZips/ target=_blank>UCSC browser</a>|Date parsed|June 1, 2011|Chromosomes|25|Contigs & misc|68|Total bases|3,137,144,693|Logo art|<a href=http://turing.iimas.unam.mx/~cgg/gallery/EverybodysHive.html target=_blank>link</a>",
44 8c368a17 Daofeng Li
0,
45 8c368a17 Daofeng Li
false
46 8c368a17 Daofeng Li
);
47 8c368a17 Daofeng Li
48 8c368a17 Daofeng Li
49 8c368a17 Daofeng Li
-- grouping types on genomic features
50 8c368a17 Daofeng Li
drop table if exists gfGrouping;
51 8c368a17 Daofeng Li
create table gfGrouping (
52 8c368a17 Daofeng Li
  id TINYINT not null primary key,
53 8c368a17 Daofeng Li
  name char(50) not null
54 8c368a17 Daofeng Li
);
55 8c368a17 Daofeng Li
insert into gfGrouping values (2, "Genes");
56 8c368a17 Daofeng Li
-- insert into gfGrouping values (3, "non-coding RNA");
57 8c368a17 Daofeng Li
insert into gfGrouping values (4, "RepeatMasker");
58 8c368a17 Daofeng Li
insert into gfGrouping values (6, "Sequence conservation");
59 8c368a17 Daofeng Li
insert into gfGrouping values (5, "G/C related");
60 8c368a17 Daofeng Li
insert into gfGrouping values (7, "Mappability (ENCODE)");
61 8c368a17 Daofeng Li
62 8c368a17 Daofeng Li
63 8c368a17 Daofeng Li
-- for genomic features that can be used as horizontal axis
64 8c368a17 Daofeng Li
-- each type of gf (except genome) will have a corresponding covering table
65 8c368a17 Daofeng Li
66 8c368a17 Daofeng Li
67 8c368a17 Daofeng Li
/* for stuff that can be plotted as decorative tracks (no genome)
68 8c368a17 Daofeng Li
   the grp is also from gfGrouping table
69 8c368a17 Daofeng Li
   filetype: 0: server bigBed, 2: server bigWig
70 8c368a17 Daofeng Li
   name will be used to compose bbi file "name.bigBed"
71 8c368a17 Daofeng Li
72 8c368a17 Daofeng Li
   ambiguity with hasStruct field:
73 8c368a17 Daofeng Li
   if it is set to true, it indicates existance of both [x]symbol and [x]struct tables
74 8c368a17 Daofeng Li
   so currently it only works for gene model track (must belong to gene group)
75 8c368a17 Daofeng Li
   where generic genomic feature track wouldn't necessarily require [x]symbol table (might not be big trouble?)
76 8c368a17 Daofeng Li
*/
77 8c368a17 Daofeng Li
drop table if exists decorInfo;
78 8c368a17 Daofeng Li
create table decorInfo (
79 8c368a17 Daofeng Li
  name char(50) not null primary key,
80 8c368a17 Daofeng Li
  printname char(100) not null,
81 8c368a17 Daofeng Li
  parent char(50) null,
82 8c368a17 Daofeng Li
  grp tinyint not null,
83 8c368a17 Daofeng Li
  fileType tinyint not null,
84 8c368a17 Daofeng Li
  hasStruct tinyint null, /* value must be 0/1, must not be boolean */
85 8c368a17 Daofeng Li
  queryUrl varchar(255) null
86 8c368a17 Daofeng Li
);
87 8c368a17 Daofeng Li
load data local infile 'decorInfo' into table decorInfo;
88 8c368a17 Daofeng Li
89 8c368a17 Daofeng Li
-- insert into decorInfo values ('wgRna',"sno/miRNA",\N, 5, 0, 0,\N);
90 8c368a17 Daofeng Li
91 8c368a17 Daofeng Li
/*
92 8c368a17 Daofeng Li
insert into decorInfo values('decorTrackgrp7', 'no name', \N, 7, 11, 0, \N);
93 8c368a17 Daofeng Li
drop table if exists decorTrackselectiongrid;
94 8c368a17 Daofeng Li
create table decorTrackselectiongrid (
95 8c368a17 Daofeng Li
  groupname varchar(255) not null primary key,
96 8c368a17 Daofeng Li
  row_terms varchar(255) not null,
97 8c368a17 Daofeng Li
  col_terms varchar(255) not null
98 8c368a17 Daofeng Li
);
99 8c368a17 Daofeng Li
insert into decorTrackselectiongrid values('decorTrackgrp7','14018,14005,13047,14001,14028,11310,11101,13076','27001,27002,27003');
100 8c368a17 Daofeng Li
*/
101 8c368a17 Daofeng Li
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_roadmap' into table track2Label;
110 8c368a17 Daofeng Li
load data local infile 'track2Label_encode' into table track2Label;
111 8c368a17 Daofeng Li
load data local infile 'track2Label_longrange' into table track2Label;
112 8c368a17 Daofeng Li
load data local infile 'track2Label_mock' into table track2Label;
113 8c368a17 Daofeng Li
114 8c368a17 Daofeng Li
drop table if exists track2ProcessInfo;
115 8c368a17 Daofeng Li
create table track2ProcessInfo (
116 8c368a17 Daofeng Li
  name varchar(255) not null primary key,
117 8c368a17 Daofeng Li
  detail text null
118 8c368a17 Daofeng Li
);
119 8c368a17 Daofeng Li
load data local infile 'track2ProcessInfo_roadmap' into table track2ProcessInfo;
120 8c368a17 Daofeng Li
load data local infile 'track2ProcessInfo_encode' into table track2ProcessInfo;
121 8c368a17 Daofeng Li
122 8c368a17 Daofeng Li
drop table if exists track2BamInfo;
123 8c368a17 Daofeng Li
create table track2BamInfo (
124 8c368a17 Daofeng Li
  name varchar(255) not null,
125 8c368a17 Daofeng Li
  bamfile varchar(255) not null,
126 8c368a17 Daofeng Li
  bamfilelabel varchar(255) not null
127 8c368a17 Daofeng Li
);
128 8c368a17 Daofeng Li
load data local infile "track2BamInfo_roadmap" into table track2BamInfo;
129 8c368a17 Daofeng Li
load data local infile "track2BamInfo_encode" into table track2BamInfo;
130 8c368a17 Daofeng Li
load data local infile "track2BamInfo_test" into table track2BamInfo;
131 8c368a17 Daofeng Li
132 8c368a17 Daofeng Li
drop table if exists track2Detail;
133 8c368a17 Daofeng Li
create table track2Detail (
134 8c368a17 Daofeng Li
  name varchar(255) not null primary key,
135 8c368a17 Daofeng Li
  detail text null
136 8c368a17 Daofeng Li
);
137 8c368a17 Daofeng Li
load data local infile 'track2Detail_decor' into table track2Detail;
138 8c368a17 Daofeng Li
load data local infile 'track2Detail_roadmap' into table track2Detail;
139 8c368a17 Daofeng Li
load data local infile 'track2Detail_encode' into table track2Detail;
140 8c368a17 Daofeng Li
load data local infile 'track2Detail_longrange' into table track2Detail;
141 8c368a17 Daofeng Li
142 8c368a17 Daofeng Li
drop table if exists track2GEO;
143 8c368a17 Daofeng Li
create table track2GEO (
144 8c368a17 Daofeng Li
  name varchar(255) not null primary key,
145 8c368a17 Daofeng Li
  geo char(20) not null
146 8c368a17 Daofeng Li
);
147 8c368a17 Daofeng Li
load data local infile 'track2GEO_roadmap' into table track2GEO;
148 8c368a17 Daofeng Li
load data local infile 'track2GEO_encode' into table track2GEO;
149 8c368a17 Daofeng Li
load data local infile 'track2GEO_longrange' into table track2GEO;
150 8c368a17 Daofeng Li
151 8c368a17 Daofeng Li
drop table if exists track2VersionInfo;
152 8c368a17 Daofeng Li
create table track2VersionInfo (
153 8c368a17 Daofeng Li
  name varchar(255) not null primary key,
154 8c368a17 Daofeng Li
  info varchar(255) not null
155 8c368a17 Daofeng Li
);
156 8c368a17 Daofeng Li
load data local infile 'track2VersionInfo_roadmap' into table track2VersionInfo;
157 8c368a17 Daofeng Li
load data local infile 'track2VersionInfo_encode' into table track2VersionInfo;
158 8c368a17 Daofeng Li
159 8c368a17 Daofeng Li
160 8c368a17 Daofeng Li
drop table if exists track2Annotation;
161 8c368a17 Daofeng Li
create table track2Annotation (
162 8c368a17 Daofeng Li
  name varchar(255) not null primary key,
163 8c368a17 Daofeng Li
  attridx varchar(255) not null
164 8c368a17 Daofeng Li
);
165 8c368a17 Daofeng Li
load data local infile "track2Annotation_roadmap" into table track2Annotation;
166 8c368a17 Daofeng Li
load data local infile "track2Annotation_encode" into table track2Annotation;
167 8c368a17 Daofeng Li
load data local infile "track2Annotation_longrange" into table track2Annotation;
168 8c368a17 Daofeng Li
load data local infile "track2Annotation_mock" into table track2Annotation;
169 8c368a17 Daofeng Li
170 8c368a17 Daofeng Li
drop table if exists track2Ft;
171 8c368a17 Daofeng Li
create table track2Ft (
172 8c368a17 Daofeng Li
  name varchar(255) not null primary key,
173 8c368a17 Daofeng Li
  ft tinyint not null
174 8c368a17 Daofeng Li
);
175 8c368a17 Daofeng Li
load data local infile "track2Ft_roadmap" into table track2Ft;
176 8c368a17 Daofeng Li
load data local infile "track2Ft_encode" into table track2Ft;
177 8c368a17 Daofeng Li
load data local infile "track2Ft_longrange" into table track2Ft;
178 8c368a17 Daofeng Li
load data local infile "track2Ft_mock" into table track2Ft;
179 8c368a17 Daofeng Li
180 8c368a17 Daofeng Li
drop table if exists track2Categorical;
181 8c368a17 Daofeng Li
create table track2Categorical (
182 8c368a17 Daofeng Li
  name varchar(255) not null primary key,
183 8c368a17 Daofeng Li
  info text not null
184 8c368a17 Daofeng Li
);
185 8c368a17 Daofeng Li
load data local infile 'track2Categorical' into table track2Categorical;
186 8c368a17 Daofeng Li
187 8c368a17 Daofeng Li
drop table if exists track2Style;
188 8c368a17 Daofeng Li
create table track2Style (
189 8c368a17 Daofeng Li
  name varchar(255) not null primary key,
190 8c368a17 Daofeng Li
  style text not null
191 8c368a17 Daofeng Li
);
192 8c368a17 Daofeng Li
load data local infile 'track2Style' into table track2Style;
193 8c368a17 Daofeng Li
load data local infile 'track2Style_roadmap' into table track2Style;
194 8c368a17 Daofeng Li
load data local infile 'track2Style_encode' into table track2Style;
195 8c368a17 Daofeng Li
196 8c368a17 Daofeng Li
drop table if exists track2Regions;
197 8c368a17 Daofeng Li
create table track2Regions (
198 8c368a17 Daofeng Li
  name varchar(255) not null primary key,
199 8c368a17 Daofeng Li
  regionname varchar(255) not null,
200 8c368a17 Daofeng Li
  regions text not null
201 8c368a17 Daofeng Li
 );
202 8c368a17 Daofeng Li
 load data local infile 'track2Regions' into table track2Regions;
203 8c368a17 Daofeng Li
204 8c368a17 Daofeng Li
205 8c368a17 Daofeng Li
drop table if exists metadataVocabulary;
206 8c368a17 Daofeng Li
create table metadataVocabulary (
207 8c368a17 Daofeng Li
  child varchar(255) not null,
208 8c368a17 Daofeng Li
  parent varchar(255) not null
209 8c368a17 Daofeng Li
);
210 8c368a17 Daofeng Li
load data local infile "metadataVocabulary" into table metadataVocabulary;
211 8c368a17 Daofeng Li
212 8c368a17 Daofeng Li
drop table if exists trackAttr2idx;
213 8c368a17 Daofeng Li
create table trackAttr2idx (
214 8c368a17 Daofeng Li
  idx varchar(255) not null primary key,
215 8c368a17 Daofeng Li
  attr varchar(255) not null,
216 8c368a17 Daofeng Li
  note varchar(255) null,
217 8c368a17 Daofeng Li
  description text null
218 8c368a17 Daofeng Li
);
219 8c368a17 Daofeng Li
load data local infile "trackAttr2idx" into table trackAttr2idx;
220 8c368a17 Daofeng Li
221 8c368a17 Daofeng Li
222 8c368a17 Daofeng Li
223 8c368a17 Daofeng Li
drop table if exists tempURL;
224 8c368a17 Daofeng Li
create table tempURL (
225 8c368a17 Daofeng Li
  session varchar(100) not null,
226 8c368a17 Daofeng Li
  offset INT unsigned not null,
227 8c368a17 Daofeng Li
  urlpiece text not null
228 8c368a17 Daofeng Li
);
229 8c368a17 Daofeng Li
230 8c368a17 Daofeng Li
231 8c368a17 Daofeng Li
drop table if exists dataset;
232 8c368a17 Daofeng Li
create table dataset (
233 8c368a17 Daofeng Li
  tablename varchar(255) not null,
234 8c368a17 Daofeng Li
  logo varchar(255) null,
235 8c368a17 Daofeng Li
  name varchar(255) not null,
236 8c368a17 Daofeng Li
  url varchar(255) null,
237 8c368a17 Daofeng Li
  description text not null
238 8c368a17 Daofeng Li
);
239 8c368a17 Daofeng Li
load data local infile "dataset" into table dataset;
240 8c368a17 Daofeng Li
241 8c368a17 Daofeng Li
drop table if exists roadmapepigenome;
242 8c368a17 Daofeng Li
create table roadmapepigenome (
243 8c368a17 Daofeng Li
  tkname varchar(255) not null
244 8c368a17 Daofeng Li
);
245 8c368a17 Daofeng Li
load data local infile "roadmap" into table roadmapepigenome;
246 8c368a17 Daofeng Li
247 8c368a17 Daofeng Li
drop table if exists longrange;
248 8c368a17 Daofeng Li
create table longrange (
249 8c368a17 Daofeng Li
  tkname varchar(255) not null
250 8c368a17 Daofeng Li
);
251 8c368a17 Daofeng Li
load data local infile "longrange" into table longrange;
252 8c368a17 Daofeng Li
253 8c368a17 Daofeng Li
drop table if exists mock;
254 8c368a17 Daofeng Li
create table mock (
255 8c368a17 Daofeng Li
  tkname varchar(255) not null
256 8c368a17 Daofeng Li
);
257 8c368a17 Daofeng Li
load data local infile "mock" into table mock;
258 8c368a17 Daofeng Li
259 8c368a17 Daofeng Li
drop table if exists encode;
260 8c368a17 Daofeng Li
create table encode(
261 8c368a17 Daofeng Li
  tkname varchar(255) not null
262 8c368a17 Daofeng Li
);
263 8c368a17 Daofeng Li
load data local infile "encode" into table encode;
264 8c368a17 Daofeng Li
265 8c368a17 Daofeng Li
drop table if exists scaffoldInfo;
266 8c368a17 Daofeng Li
create table scaffoldInfo (
267 8c368a17 Daofeng Li
  parent varchar(255) not null,
268 8c368a17 Daofeng Li
  child varchar(255) not null,
269 8c368a17 Daofeng Li
  childLength int unsigned not null
270 8c368a17 Daofeng Li
);
271 8c368a17 Daofeng Li
load data local infile "scaffoldInfo" into table scaffoldInfo;
272 8c368a17 Daofeng Li
273 8c368a17 Daofeng Li
drop table if exists cytoband;
274 8c368a17 Daofeng Li
create table cytoband (
275 8c368a17 Daofeng Li
  id int null auto_increment primary key,
276 8c368a17 Daofeng Li
  chrom char(20) not null,
277 8c368a17 Daofeng Li
  start int not null,
278 8c368a17 Daofeng Li
  stop int not null,
279 8c368a17 Daofeng Li
  name char(20) not null,
280 8c368a17 Daofeng Li
  colorIdx int not null
281 8c368a17 Daofeng Li
);
282 8c368a17 Daofeng Li
load data local infile "cytoband" into table cytoband;
283 8c368a17 Daofeng Li
284 8c368a17 Daofeng Li
285 8c368a17 Daofeng Li
drop table if exists publichub;
286 8c368a17 Daofeng Li
create table publichub (
287 8c368a17 Daofeng Li
  name varchar(255) not null,
288 8c368a17 Daofeng Li
  logo text null,
289 8c368a17 Daofeng Li
  url text not null,
290 8c368a17 Daofeng Li
  institution text not null,
291 8c368a17 Daofeng Li
  description text not null
292 8c368a17 Daofeng Li
);
293 71d28e6f Daofeng Li
-- load data local infile "publichub" into table publichub;
294 8c368a17 Daofeng Li
/*
295 8c368a17 Daofeng Li
DROP TABLE IF EXISTS `rmsk`;
296 8c368a17 Daofeng Li
CREATE TABLE `rmsk` (
297 8c368a17 Daofeng Li
  `bin` smallint(5) unsigned NOT NULL default '0',
298 8c368a17 Daofeng Li
  `swScore` int(10) unsigned NOT NULL default '0',
299 8c368a17 Daofeng Li
  `milliDiv` int(10) unsigned NOT NULL default '0',
300 8c368a17 Daofeng Li
  `milliDel` int(10) unsigned NOT NULL default '0',
301 8c368a17 Daofeng Li
  `milliIns` int(10) unsigned NOT NULL default '0',
302 8c368a17 Daofeng Li
  `genoName` varchar(255) NOT NULL default '',
303 8c368a17 Daofeng Li
  `genoStart` int(10) unsigned NOT NULL default '0',
304 8c368a17 Daofeng Li
  `genoEnd` int(10) unsigned NOT NULL default '0',
305 8c368a17 Daofeng Li
  `genoLeft` int(11) NOT NULL default '0',
306 8c368a17 Daofeng Li
  `strand` char(1) NOT NULL default '',
307 8c368a17 Daofeng Li
  `repName` varchar(255) NOT NULL default '',
308 8c368a17 Daofeng Li
  `repClass` varchar(255) NOT NULL default '',
309 8c368a17 Daofeng Li
  `repFamily` varchar(255) NOT NULL default '',
310 8c368a17 Daofeng Li
  `repStart` int(11) NOT NULL default '0',
311 8c368a17 Daofeng Li
  `repEnd` int(11) NOT NULL default '0',
312 8c368a17 Daofeng Li
  `repLeft` int(11) NOT NULL default '0',
313 8c368a17 Daofeng Li
  `id` char(1) NOT NULL default '',
314 8c368a17 Daofeng Li
  KEY `genoName` (`genoName`(14),`bin`)
315 8c368a17 Daofeng Li
);
316 8c368a17 Daofeng Li
load data local infile 'rmsk.txt' into table rmsk;
317 8c368a17 Daofeng Li
*/