table.sql 40.8 KB
Newer Older
1
CREATE TABLE `alt_allele` (
2
  `alt_allele_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
3
  `alt_allele_group_id` int(10) unsigned NOT NULL,
4
  `gene_id` int(10) unsigned NOT NULL,
5
  PRIMARY KEY (`alt_allele_id`),
6
  UNIQUE KEY `gene_idx` (`gene_id`),
7
  KEY `gene_id` (`gene_id`,`alt_allele_group_id`)
8
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
9 10 11 12 13

CREATE TABLE `alt_allele_attrib` (
  `alt_allele_id` int(10) unsigned DEFAULT NULL,
  `attrib` enum('IS_REPRESENTATIVE','IS_MOST_COMMON_ALLELE','IN_CORRECTED_ASSEMBLY','HAS_CODING_POTENTIAL','IN_ARTIFICIALLY_DUPLICATED_ASSEMBLY','IN_SYNTENIC_REGION','HAS_SAME_UNDERLYING_DNA_SEQUENCE','IN_BROKEN_ASSEMBLY_REGION','IS_VALID_ALTERNATE','SAME_AS_REPRESENTATIVE','SAME_AS_ANOTHER_ALLELE','MANUALLY_ASSIGNED','AUTOMATICALLY_ASSIGNED') DEFAULT NULL,
  KEY `aa_idx` (`alt_allele_id`,`attrib`)
14
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
15 16 17 18

CREATE TABLE `alt_allele_group` (
  `alt_allele_group_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  PRIMARY KEY (`alt_allele_group_id`)
19
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
20

21
CREATE TABLE `analysis` (
22
  `analysis_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
23
  `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
Magali Ruffier's avatar
Magali Ruffier committed
24 25 26 27 28 29 30
  `logic_name` varchar(40) COLLATE latin1_bin NOT NULL DEFAULT '',
  `db` varchar(120) COLLATE latin1_bin DEFAULT NULL,
  `db_version` varchar(40) COLLATE latin1_bin DEFAULT NULL,
  `db_file` varchar(120) COLLATE latin1_bin DEFAULT NULL,
  `program` varchar(80) COLLATE latin1_bin DEFAULT NULL,
  `program_version` varchar(40) COLLATE latin1_bin DEFAULT NULL,
  `program_file` varchar(80) COLLATE latin1_bin DEFAULT NULL,
31
  `parameters` text COLLATE latin1_bin,
Magali Ruffier's avatar
Magali Ruffier committed
32 33 34 35
  `module` varchar(80) COLLATE latin1_bin DEFAULT NULL,
  `module_version` varchar(40) COLLATE latin1_bin DEFAULT NULL,
  `gff_source` varchar(40) COLLATE latin1_bin DEFAULT NULL,
  `gff_feature` varchar(40) COLLATE latin1_bin DEFAULT NULL,
36
  PRIMARY KEY (`analysis_id`),
Magali Ruffier's avatar
Magali Ruffier committed
37
  UNIQUE KEY `logic_name_idx` (`logic_name`)
Magali Ruffier's avatar
Magali Ruffier committed
38
) ENGINE=MyISAM AUTO_INCREMENT=39 DEFAULT CHARSET=latin1 COLLATE=latin1_bin;
39 40

CREATE TABLE `analysis_description` (
41 42
  `analysis_id` int(10) unsigned NOT NULL DEFAULT '0',
  `description` text COLLATE latin1_bin,
Magali Ruffier's avatar
Magali Ruffier committed
43
  `display_label` varchar(255) COLLATE latin1_bin DEFAULT NULL,
44
  `displayable` tinyint(1) NOT NULL DEFAULT '1',
45
  `web_data` text COLLATE latin1_bin,
Magali Ruffier's avatar
Magali Ruffier committed
46
  UNIQUE KEY `analysis_idx` (`analysis_id`)
47
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_bin;
48 49

CREATE TABLE `assembly` (
50 51 52 53 54 55 56
  `asm_seq_region_id` int(10) unsigned NOT NULL DEFAULT '0',
  `cmp_seq_region_id` int(10) unsigned NOT NULL DEFAULT '0',
  `asm_start` int(10) NOT NULL DEFAULT '0',
  `asm_end` int(10) NOT NULL DEFAULT '0',
  `cmp_start` int(10) NOT NULL DEFAULT '0',
  `cmp_end` int(10) NOT NULL DEFAULT '0',
  `ori` tinyint(4) NOT NULL DEFAULT '0',
57
  UNIQUE KEY `all_idx` (`asm_seq_region_id`,`cmp_seq_region_id`,`asm_start`,`asm_end`,`cmp_start`,`cmp_end`,`ori`),
58 59 60
  KEY `cmp_seq_region_id` (`cmp_seq_region_id`),
  KEY `asm_seq_region_id` (`asm_seq_region_id`,`asm_start`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_bin;
61

62 63
CREATE TABLE `assembly_exception` (
  `assembly_exception_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
64 65 66
  `seq_region_id` int(11) NOT NULL DEFAULT '0',
  `seq_region_start` int(11) NOT NULL DEFAULT '0',
  `seq_region_end` int(11) NOT NULL DEFAULT '0',
Magali Ruffier's avatar
Magali Ruffier committed
67
  `exc_type` enum('HAP','PAR','PATCH_NOVEL','PATCH_FIX') COLLATE latin1_bin NOT NULL DEFAULT 'HAP',
68 69 70 71
  `exc_seq_region_id` int(11) NOT NULL DEFAULT '0',
  `exc_seq_region_start` int(11) NOT NULL DEFAULT '0',
  `exc_seq_region_end` int(11) NOT NULL DEFAULT '0',
  `ori` int(11) NOT NULL DEFAULT '0',
72 73 74
  PRIMARY KEY (`assembly_exception_id`),
  KEY `sr_idx` (`seq_region_id`,`seq_region_start`),
  KEY `ex_idx` (`exc_seq_region_id`,`exc_seq_region_start`)
75
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_bin;
76

77 78 79 80
CREATE TABLE `associated_group` (
  `associated_group_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `description` varchar(128) DEFAULT NULL,
  PRIMARY KEY (`associated_group_id`)
81
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
82

83 84 85 86 87 88 89 90 91 92 93 94 95 96
CREATE TABLE `associated_xref` (
  `associated_xref_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `object_xref_id` int(10) unsigned NOT NULL DEFAULT '0',
  `xref_id` int(10) unsigned NOT NULL DEFAULT '0',
  `source_xref_id` int(10) unsigned DEFAULT NULL,
  `condition_type` varchar(128) DEFAULT NULL,
  `associated_group_id` int(10) unsigned DEFAULT NULL,
  `rank` int(10) unsigned DEFAULT '0',
  PRIMARY KEY (`associated_xref_id`),
  UNIQUE KEY `object_associated_source_type_idx` (`object_xref_id`,`xref_id`,`source_xref_id`,`condition_type`,`associated_group_id`),
  KEY `associated_source_idx` (`source_xref_id`),
  KEY `associated_object_idx` (`object_xref_id`),
  KEY `associated_idx` (`xref_id`),
  KEY `associated_group_idx` (`associated_group_id`)
97
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
98

99 100
CREATE TABLE `attrib_type` (
  `attrib_type_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
Magali Ruffier's avatar
Magali Ruffier committed
101 102
  `code` varchar(20) COLLATE latin1_bin NOT NULL DEFAULT '',
  `name` varchar(255) COLLATE latin1_bin NOT NULL DEFAULT '',
103
  `description` text COLLATE latin1_bin,
104
  PRIMARY KEY (`attrib_type_id`),
Magali Ruffier's avatar
Magali Ruffier committed
105
  UNIQUE KEY `code_idx` (`code`)
Magali Ruffier's avatar
Magali Ruffier committed
106
) ENGINE=MyISAM AUTO_INCREMENT=391 DEFAULT CHARSET=latin1 COLLATE=latin1_bin;
107

108 109 110 111 112 113 114 115 116 117 118
CREATE TABLE `coord_system` (
  `coord_system_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `species_id` int(10) unsigned NOT NULL DEFAULT '1',
  `name` varchar(40) NOT NULL,
  `version` varchar(255) DEFAULT NULL,
  `rank` int(11) NOT NULL,
  `attrib` set('default_version','sequence_level') DEFAULT NULL,
  PRIMARY KEY (`coord_system_id`),
  UNIQUE KEY `rank_idx` (`rank`,`species_id`),
  UNIQUE KEY `name_idx` (`name`,`version`,`species_id`),
  KEY `species_idx` (`species_id`)
Magali Ruffier's avatar
Magali Ruffier committed
119
) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
120

121
CREATE TABLE `data_file` (
122 123 124
  `data_file_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `coord_system_id` int(10) unsigned NOT NULL,
  `analysis_id` smallint(5) unsigned NOT NULL,
125 126 127 128
  `name` varchar(100) NOT NULL,
  `version_lock` tinyint(1) NOT NULL DEFAULT '0',
  `absolute` tinyint(1) NOT NULL DEFAULT '0',
  `url` text,
129
  `file_type` enum('BAM','BAMCOV','BIGBED','BIGWIG','VCF') DEFAULT NULL,
130 131 132 133
  PRIMARY KEY (`data_file_id`),
  UNIQUE KEY `df_unq_idx` (`coord_system_id`,`analysis_id`,`name`,`file_type`),
  KEY `df_name_idx` (`name`),
  KEY `df_analysis_idx` (`analysis_id`)
134
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
135

136
CREATE TABLE `density_feature` (
137 138 139 140 141 142
  `density_feature_id` int(11) NOT NULL AUTO_INCREMENT,
  `density_type_id` int(11) NOT NULL DEFAULT '0',
  `seq_region_id` int(11) NOT NULL DEFAULT '0',
  `seq_region_start` int(11) NOT NULL DEFAULT '0',
  `seq_region_end` int(11) NOT NULL DEFAULT '0',
  `density_value` float NOT NULL DEFAULT '0',
143 144 145
  PRIMARY KEY (`density_feature_id`),
  KEY `seq_region_idx` (`density_type_id`,`seq_region_id`,`seq_region_start`),
  KEY `seq_region_id_idx` (`seq_region_id`)
146
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_bin;
147

148
CREATE TABLE `density_type` (
149 150 151 152
  `density_type_id` int(11) NOT NULL AUTO_INCREMENT,
  `analysis_id` int(11) NOT NULL DEFAULT '0',
  `block_size` int(11) NOT NULL DEFAULT '0',
  `region_features` int(11) NOT NULL DEFAULT '0',
Magali Ruffier's avatar
Magali Ruffier committed
153
  `value_type` enum('sum','ratio') COLLATE latin1_bin NOT NULL DEFAULT 'sum',
154
  PRIMARY KEY (`density_type_id`),
155 156
  UNIQUE KEY `analysis_id` (`analysis_id`,`block_size`,`region_features`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_bin;
157

158 159 160 161 162 163 164
CREATE TABLE `dependent_xref` (
  `object_xref_id` int(10) unsigned NOT NULL,
  `master_xref_id` int(10) unsigned NOT NULL,
  `dependent_xref_id` int(10) unsigned NOT NULL,
  PRIMARY KEY (`object_xref_id`),
  KEY `dependent` (`dependent_xref_id`),
  KEY `master_idx` (`master_xref_id`)
165
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
166 167

CREATE TABLE `ditag` (
168 169 170 171 172
  `ditag_id` int(10) NOT NULL AUTO_INCREMENT,
  `name` varchar(30) DEFAULT NULL,
  `type` varchar(30) DEFAULT NULL,
  `tag_count` smallint(6) DEFAULT '1',
  `sequence` text,
173
  PRIMARY KEY (`ditag_id`)
174
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
175

176 177 178 179 180 181 182 183
CREATE TABLE `ditag_feature` (
  `ditag_feature_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `ditag_id` int(10) unsigned NOT NULL DEFAULT '0',
  `ditag_pair_id` int(10) unsigned NOT NULL DEFAULT '0',
  `seq_region_id` int(10) unsigned NOT NULL DEFAULT '0',
  `seq_region_start` int(10) unsigned NOT NULL DEFAULT '0',
  `seq_region_end` int(10) unsigned NOT NULL DEFAULT '0',
  `seq_region_strand` tinyint(1) NOT NULL DEFAULT '0',
184
  `analysis_id` int(10) unsigned NOT NULL DEFAULT '0',
185 186 187
  `hit_start` int(10) unsigned NOT NULL DEFAULT '0',
  `hit_end` int(10) unsigned NOT NULL DEFAULT '0',
  `hit_strand` tinyint(1) NOT NULL DEFAULT '0',
188 189
  `cigar_line` text,
  `ditag_side` char(1) DEFAULT '',
190
  PRIMARY KEY (`ditag_feature_id`),
191
  KEY `ditag_id` (`ditag_id`),
Magali Ruffier's avatar
Magali Ruffier committed
192
  KEY `ditag_pair_id` (`ditag_pair_id`),
Magali Ruffier's avatar
Magali Ruffier committed
193
  KEY `seq_region_idx` (`seq_region_id`,`seq_region_start`,`seq_region_end`)
194
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
195 196

CREATE TABLE `dna` (
197
  `seq_region_id` int(10) unsigned NOT NULL DEFAULT '0',
Magali Ruffier's avatar
Magali Ruffier committed
198
  `sequence` mediumtext COLLATE latin1_bin NOT NULL,
199
  PRIMARY KEY (`seq_region_id`)
200
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_bin MAX_ROWS=750000 AVG_ROW_LENGTH=19000;
201

202 203
CREATE TABLE `dna_align_feature` (
  `dna_align_feature_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
204 205 206 207 208 209 210
  `seq_region_id` int(10) unsigned NOT NULL DEFAULT '0',
  `seq_region_start` int(10) unsigned NOT NULL DEFAULT '0',
  `seq_region_end` int(10) unsigned NOT NULL DEFAULT '0',
  `seq_region_strand` tinyint(1) NOT NULL DEFAULT '0',
  `hit_start` int(11) NOT NULL DEFAULT '0',
  `hit_end` int(11) NOT NULL DEFAULT '0',
  `hit_strand` tinyint(1) NOT NULL DEFAULT '0',
Magali Ruffier's avatar
Magali Ruffier committed
211
  `hit_name` varchar(40) COLLATE latin1_bin NOT NULL DEFAULT '',
212
  `analysis_id` int(10) unsigned NOT NULL DEFAULT '0',
213 214 215
  `score` double DEFAULT NULL,
  `evalue` double DEFAULT NULL,
  `perc_ident` float DEFAULT NULL,
216 217
  `cigar_line` text COLLATE latin1_bin,
  `external_db_id` smallint(5) unsigned DEFAULT NULL,
218
  `hcoverage` double DEFAULT NULL,
219
  `external_data` text COLLATE latin1_bin,
220 221 222 223 224
  PRIMARY KEY (`dna_align_feature_id`),
  KEY `seq_region_idx` (`seq_region_id`,`analysis_id`,`seq_region_start`,`score`),
  KEY `seq_region_idx_2` (`seq_region_id`,`seq_region_start`),
  KEY `hit_idx` (`hit_name`),
  KEY `analysis_idx` (`analysis_id`),
225
  KEY `external_db_idx` (`external_db_id`)
226
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_bin MAX_ROWS=100000000 AVG_ROW_LENGTH=80;
227

228 229 230 231 232 233 234 235 236 237 238
CREATE TABLE `exon` (
  `exon_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `seq_region_id` int(10) unsigned NOT NULL,
  `seq_region_start` int(10) unsigned NOT NULL,
  `seq_region_end` int(10) unsigned NOT NULL,
  `seq_region_strand` tinyint(2) NOT NULL,
  `phase` tinyint(2) NOT NULL,
  `end_phase` tinyint(2) NOT NULL,
  `is_current` tinyint(1) NOT NULL DEFAULT '1',
  `is_constitutive` tinyint(1) NOT NULL DEFAULT '0',
  `stable_id` varchar(128) DEFAULT NULL,
Magali Ruffier's avatar
Magali Ruffier committed
239
  `version` smallint(5) unsigned DEFAULT NULL,
240 241 242 243 244
  `created_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `modified_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY (`exon_id`),
  KEY `seq_region_idx` (`seq_region_id`,`seq_region_start`),
  KEY `stable_id_idx` (`stable_id`,`version`)
Magali Ruffier's avatar
Magali Ruffier committed
245
) ENGINE=MyISAM AUTO_INCREMENT=6885 DEFAULT CHARSET=latin1;
246

247
CREATE TABLE `exon_transcript` (
248 249 250
  `exon_id` int(10) unsigned NOT NULL DEFAULT '0',
  `transcript_id` int(10) unsigned NOT NULL DEFAULT '0',
  `rank` int(10) NOT NULL DEFAULT '0',
251 252 253
  PRIMARY KEY (`exon_id`,`transcript_id`,`rank`),
  KEY `transcript` (`transcript_id`),
  KEY `exon` (`exon_id`)
254
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_bin;
255

256
CREATE TABLE `external_db` (
257
  `external_db_id` int(11) NOT NULL DEFAULT '0',
Magali Ruffier's avatar
Magali Ruffier committed
258 259 260
  `db_name` varchar(27) COLLATE latin1_bin NOT NULL DEFAULT '',
  `db_release` varchar(40) COLLATE latin1_bin NOT NULL DEFAULT '',
  `status` enum('KNOWNXREF','KNOWN','XREF','PRED','ORTH','PSEUDO') COLLATE latin1_bin NOT NULL DEFAULT 'KNOWNXREF',
261
  `priority` int(11) NOT NULL DEFAULT '0',
Magali Ruffier's avatar
Magali Ruffier committed
262 263 264 265
  `db_display_name` varchar(255) COLLATE latin1_bin DEFAULT NULL,
  `type` enum('ARRAY','ALT_TRANS','ALT_GENE','MISC','LIT','PRIMARY_DB_SYNONYM','ENSEMBL') COLLATE latin1_bin DEFAULT NULL,
  `secondary_db_name` varchar(255) COLLATE latin1_bin DEFAULT NULL,
  `secondary_db_table` varchar(255) COLLATE latin1_bin DEFAULT NULL,
266
  `description` text COLLATE latin1_bin,
Magali Ruffier's avatar
Magali Ruffier committed
267 268
  PRIMARY KEY (`external_db_id`),
  UNIQUE KEY `db_name_db_release_idx` (`db_name`,`db_release`)
269
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_bin;
270

271
CREATE TABLE `external_synonym` (
272
  `xref_id` int(10) unsigned NOT NULL DEFAULT '0',
Magali Ruffier's avatar
Magali Ruffier committed
273
  `synonym` varchar(40) COLLATE latin1_bin NOT NULL DEFAULT '',
274 275
  PRIMARY KEY (`xref_id`,`synonym`),
  KEY `name_index` (`synonym`)
276
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_bin;
277

278 279 280 281 282 283 284 285 286
CREATE TABLE `gene` (
  `gene_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `biotype` varchar(40) NOT NULL,
  `analysis_id` smallint(5) unsigned NOT NULL,
  `seq_region_id` int(10) unsigned NOT NULL,
  `seq_region_start` int(10) unsigned NOT NULL,
  `seq_region_end` int(10) unsigned NOT NULL,
  `seq_region_strand` tinyint(2) NOT NULL,
  `display_xref_id` int(10) unsigned DEFAULT NULL,
287
  `source` varchar(40) NOT NULL,
Magali Ruffier's avatar
Magali Ruffier committed
288
  `status` enum('KNOWN','NOVEL','PUTATIVE','PREDICTED','KNOWN_BY_PROJECTION','UNKNOWN','ANNOTATED') DEFAULT NULL,
289 290 291 292
  `description` text,
  `is_current` tinyint(1) NOT NULL DEFAULT '1',
  `canonical_transcript_id` int(10) unsigned NOT NULL,
  `stable_id` varchar(128) DEFAULT NULL,
Magali Ruffier's avatar
Magali Ruffier committed
293
  `version` smallint(5) unsigned DEFAULT NULL,
294 295 296 297 298 299
  `created_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `modified_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY (`gene_id`),
  KEY `seq_region_idx` (`seq_region_id`,`seq_region_start`),
  KEY `xref_id_index` (`display_xref_id`),
  KEY `analysis_idx` (`analysis_id`),
Magali Ruffier's avatar
Magali Ruffier committed
300 301
  KEY `stable_id_idx` (`stable_id`,`version`),
  KEY `canonical_transcript_id_idx` (`canonical_transcript_id`)
Magali Ruffier's avatar
Magali Ruffier committed
302
) ENGINE=MyISAM AUTO_INCREMENT=6885 DEFAULT CHARSET=latin1;
303 304

CREATE TABLE `gene_archive` (
Magali Ruffier's avatar
Magali Ruffier committed
305
  `gene_stable_id` varchar(128) COLLATE latin1_bin NOT NULL DEFAULT '',
306
  `gene_version` smallint(6) NOT NULL DEFAULT '0',
Magali Ruffier's avatar
Magali Ruffier committed
307
  `transcript_stable_id` varchar(128) COLLATE latin1_bin NOT NULL DEFAULT '',
308
  `transcript_version` smallint(6) NOT NULL DEFAULT '0',
Magali Ruffier's avatar
Magali Ruffier committed
309
  `translation_stable_id` varchar(128) COLLATE latin1_bin NOT NULL DEFAULT '',
310 311 312
  `translation_version` smallint(6) NOT NULL DEFAULT '0',
  `peptide_archive_id` int(11) NOT NULL DEFAULT '0',
  `mapping_session_id` int(11) NOT NULL DEFAULT '0',
313 314
  KEY `gene_idx` (`gene_stable_id`,`gene_version`),
  KEY `transcript_idx` (`transcript_stable_id`,`transcript_version`),
Magali Ruffier's avatar
Magali Ruffier committed
315 316
  KEY `translation_idx` (`translation_stable_id`,`translation_version`),
  KEY `peptide_archive_id_idx` (`peptide_archive_id`)
317
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_bin;
318 319 320 321

CREATE TABLE `gene_attrib` (
  `gene_id` int(10) unsigned NOT NULL DEFAULT '0',
  `attrib_type_id` smallint(5) unsigned NOT NULL DEFAULT '0',
Magali Ruffier's avatar
Magali Ruffier committed
322
  `value` text COLLATE latin1_bin NOT NULL,
323
  UNIQUE KEY `gene_attribx` (`gene_id`,`attrib_type_id`,`value`(500)),
324
  KEY `type_val_idx` (`attrib_type_id`,`value`(40)),
Magali Ruffier's avatar
Magali Ruffier committed
325
  KEY `val_only_idx` (`value`(40)),
326
  KEY `gene_idx` (`gene_id`)
327
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_bin;
328 329 330 331

CREATE TABLE `genome_statistics` (
  `genome_statistics_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `statistic` varchar(128) NOT NULL,
332
  `value` bigint(11) unsigned NOT NULL DEFAULT '0',
333 334 335 336
  `species_id` int(10) unsigned DEFAULT '1',
  `attrib_type_id` int(10) unsigned DEFAULT NULL,
  `timestamp` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY (`genome_statistics_id`),
Magali Ruffier's avatar
Magali Ruffier committed
337
  UNIQUE KEY `stats_uniq` (`statistic`,`attrib_type_id`,`species_id`)
338
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
339

340
CREATE TABLE `identity_xref` (
341
  `object_xref_id` int(10) unsigned NOT NULL DEFAULT '0',
342 343 344 345 346 347
  `xref_identity` int(5) DEFAULT NULL,
  `ensembl_identity` int(5) DEFAULT NULL,
  `xref_start` int(11) DEFAULT NULL,
  `xref_end` int(11) DEFAULT NULL,
  `ensembl_start` int(11) DEFAULT NULL,
  `ensembl_end` int(11) DEFAULT NULL,
348
  `cigar_line` text COLLATE latin1_bin,
349 350 351
  `score` double DEFAULT NULL,
  `evalue` double DEFAULT NULL,
  PRIMARY KEY (`object_xref_id`)
352
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_bin;
353

354
CREATE TABLE `interpro` (
Magali Ruffier's avatar
Magali Ruffier committed
355 356
  `interpro_ac` varchar(40) COLLATE latin1_bin NOT NULL DEFAULT '',
  `id` varchar(40) COLLATE latin1_bin NOT NULL DEFAULT '',
Magali Ruffier's avatar
Magali Ruffier committed
357 358
  UNIQUE KEY `accession_idx` (`interpro_ac`,`id`),
  KEY `id_idx` (`id`)
359
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_bin;
360

361 362 363 364 365 366 367 368 369 370 371 372
CREATE TABLE `intron_supporting_evidence` (
  `intron_supporting_evidence_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `analysis_id` smallint(5) unsigned NOT NULL,
  `seq_region_id` int(10) unsigned NOT NULL,
  `seq_region_start` int(10) unsigned NOT NULL,
  `seq_region_end` int(10) unsigned NOT NULL,
  `seq_region_strand` tinyint(2) NOT NULL,
  `hit_name` varchar(100) NOT NULL,
  `score` decimal(10,3) DEFAULT NULL,
  `score_type` enum('NONE','DEPTH') DEFAULT 'NONE',
  `is_splice_canonical` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`intron_supporting_evidence_id`),
373 374
  UNIQUE KEY `analysis_id` (`analysis_id`,`seq_region_id`,`seq_region_start`,`seq_region_end`,`seq_region_strand`,`hit_name`),
  KEY `seq_region_idx` (`seq_region_id`,`seq_region_start`)
375
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
376

377 378
CREATE TABLE `karyotype` (
  `karyotype_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
379 380 381
  `seq_region_id` int(10) unsigned NOT NULL DEFAULT '0',
  `seq_region_start` int(10) NOT NULL DEFAULT '0',
  `seq_region_end` int(10) NOT NULL DEFAULT '0',
Magali Ruffier's avatar
Magali Ruffier committed
382 383
  `band` varchar(40) COLLATE latin1_bin DEFAULT NULL,
  `stain` varchar(40) COLLATE latin1_bin DEFAULT NULL,
384 385
  PRIMARY KEY (`karyotype_id`),
  KEY `region_band_idx` (`seq_region_id`,`band`)
386
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_bin;
387 388 389

CREATE TABLE `map` (
  `map_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
Magali Ruffier's avatar
Magali Ruffier committed
390
  `map_name` varchar(30) COLLATE latin1_bin NOT NULL DEFAULT '',
391
  PRIMARY KEY (`map_id`)
392
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_bin;
393

394
CREATE TABLE `mapping_session` (
395
  `mapping_session_id` int(11) NOT NULL AUTO_INCREMENT,
Magali Ruffier's avatar
Magali Ruffier committed
396 397 398 399 400 401
  `old_db_name` varchar(80) COLLATE latin1_bin NOT NULL DEFAULT '',
  `new_db_name` varchar(80) COLLATE latin1_bin NOT NULL DEFAULT '',
  `old_release` varchar(5) COLLATE latin1_bin NOT NULL DEFAULT '',
  `new_release` varchar(5) COLLATE latin1_bin NOT NULL DEFAULT '',
  `old_assembly` varchar(20) COLLATE latin1_bin NOT NULL DEFAULT '',
  `new_assembly` varchar(20) COLLATE latin1_bin NOT NULL DEFAULT '',
402 403
  `created` datetime NOT NULL,
  PRIMARY KEY (`mapping_session_id`)
404
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_bin;
405

406 407
CREATE TABLE `mapping_set` (
  `mapping_set_id` int(10) unsigned NOT NULL,
408 409
  `internal_schema_build` varchar(20) NOT NULL,
  `external_schema_build` varchar(20) NOT NULL,
Andy Yates's avatar
Andy Yates committed
410
  PRIMARY KEY (`mapping_set_id`),
411
  UNIQUE KEY `mapping_idx` (`internal_schema_build`,`external_schema_build`)
412
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
413 414 415 416

CREATE TABLE `marker` (
  `marker_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `display_marker_synonym_id` int(10) unsigned DEFAULT NULL,
Magali Ruffier's avatar
Magali Ruffier committed
417 418
  `left_primer` varchar(100) COLLATE latin1_bin NOT NULL DEFAULT '',
  `right_primer` varchar(100) COLLATE latin1_bin NOT NULL DEFAULT '',
419 420
  `min_primer_dist` int(10) unsigned NOT NULL DEFAULT '0',
  `max_primer_dist` int(10) unsigned NOT NULL DEFAULT '0',
421
  `priority` int(11) DEFAULT NULL,
Magali Ruffier's avatar
Magali Ruffier committed
422
  `type` enum('est','microsatellite') COLLATE latin1_bin DEFAULT NULL,
423
  PRIMARY KEY (`marker_id`),
Magali Ruffier's avatar
Magali Ruffier committed
424 425
  KEY `marker_idx` (`marker_id`,`priority`),
  KEY `display_idx` (`display_marker_synonym_id`)
426
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_bin;
427

428 429
CREATE TABLE `marker_feature` (
  `marker_feature_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
430 431 432 433 434
  `marker_id` int(10) unsigned NOT NULL DEFAULT '0',
  `seq_region_id` int(10) unsigned NOT NULL DEFAULT '0',
  `seq_region_start` int(10) unsigned NOT NULL DEFAULT '0',
  `seq_region_end` int(10) unsigned NOT NULL DEFAULT '0',
  `analysis_id` int(10) unsigned NOT NULL DEFAULT '0',
435 436 437 438
  `map_weight` int(10) unsigned DEFAULT NULL,
  PRIMARY KEY (`marker_feature_id`),
  KEY `seq_region_idx` (`seq_region_id`,`seq_region_start`),
  KEY `analysis_idx` (`analysis_id`)
439
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_bin;
440

441
CREATE TABLE `marker_map_location` (
442 443
  `marker_id` int(10) unsigned NOT NULL DEFAULT '0',
  `map_id` int(10) unsigned NOT NULL DEFAULT '0',
Magali Ruffier's avatar
Magali Ruffier committed
444
  `chromosome_name` varchar(15) COLLATE latin1_bin NOT NULL DEFAULT '',
445
  `marker_synonym_id` int(10) unsigned NOT NULL DEFAULT '0',
Magali Ruffier's avatar
Magali Ruffier committed
446
  `position` varchar(15) COLLATE latin1_bin NOT NULL DEFAULT '',
447 448 449
  `lod_score` double DEFAULT NULL,
  PRIMARY KEY (`marker_id`,`map_id`),
  KEY `map_idx` (`map_id`,`chromosome_name`,`position`)
450
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_bin;
451

452 453
CREATE TABLE `marker_synonym` (
  `marker_synonym_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
454
  `marker_id` int(10) unsigned NOT NULL DEFAULT '0',
Magali Ruffier's avatar
Magali Ruffier committed
455 456
  `source` varchar(20) COLLATE latin1_bin DEFAULT NULL,
  `name` varchar(30) COLLATE latin1_bin DEFAULT NULL,
457 458 459
  PRIMARY KEY (`marker_synonym_id`),
  KEY `marker_synonym_idx` (`marker_synonym_id`,`name`),
  KEY `marker_idx` (`marker_id`)
460
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_bin;
461

462 463 464 465
CREATE TABLE `meta` (
  `meta_id` int(11) NOT NULL AUTO_INCREMENT,
  `species_id` int(10) unsigned DEFAULT '1',
  `meta_key` varchar(40) NOT NULL,
466
  `meta_value` varchar(255) NOT NULL,
467 468 469
  PRIMARY KEY (`meta_id`),
  UNIQUE KEY `species_key_value_idx` (`species_id`,`meta_key`,`meta_value`),
  KEY `species_value_idx` (`species_id`,`meta_value`)
Matthew Laird's avatar
Matthew Laird committed
470
) ENGINE=MyISAM AUTO_INCREMENT=101 DEFAULT CHARSET=latin1;
471 472

CREATE TABLE `meta_coord` (
Magali Ruffier's avatar
Magali Ruffier committed
473
  `table_name` varchar(40) COLLATE latin1_bin NOT NULL DEFAULT '',
474
  `coord_system_id` int(11) NOT NULL DEFAULT '0',
475
  `max_length` int(11) DEFAULT NULL,
Magali Ruffier's avatar
Magali Ruffier committed
476
  UNIQUE KEY `cs_table_name_idx` (`coord_system_id`,`table_name`)
477
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_bin;
478

479 480 481
CREATE TABLE `misc_attrib` (
  `misc_feature_id` int(10) unsigned NOT NULL DEFAULT '0',
  `attrib_type_id` smallint(5) unsigned NOT NULL DEFAULT '0',
Magali Ruffier's avatar
Magali Ruffier committed
482
  `value` text COLLATE latin1_bin NOT NULL,
483
  UNIQUE KEY `misc_attribx` (`misc_feature_id`,`attrib_type_id`,`value`(500)),
484
  KEY `type_val_idx` (`attrib_type_id`,`value`(40)),
Magali Ruffier's avatar
Magali Ruffier committed
485
  KEY `val_only_idx` (`value`(40)),
486
  KEY `misc_feature_idx` (`misc_feature_id`)
487
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_bin;
488

489 490 491 492 493 494 495 496
CREATE TABLE `misc_feature` (
  `misc_feature_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `seq_region_id` int(10) unsigned NOT NULL DEFAULT '0',
  `seq_region_start` int(10) unsigned NOT NULL DEFAULT '0',
  `seq_region_end` int(10) unsigned NOT NULL DEFAULT '0',
  `seq_region_strand` tinyint(4) NOT NULL DEFAULT '0',
  PRIMARY KEY (`misc_feature_id`),
  KEY `seq_region_idx` (`seq_region_id`,`seq_region_start`)
497
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_bin;
498 499 500 501 502 503

CREATE TABLE `misc_feature_misc_set` (
  `misc_feature_id` int(10) unsigned NOT NULL DEFAULT '0',
  `misc_set_id` smallint(5) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`misc_feature_id`,`misc_set_id`),
  KEY `reverse_idx` (`misc_set_id`,`misc_feature_id`)
504
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_bin;
505

506 507
CREATE TABLE `misc_set` (
  `misc_set_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
Magali Ruffier's avatar
Magali Ruffier committed
508 509 510
  `code` varchar(25) COLLATE latin1_bin NOT NULL DEFAULT '',
  `name` varchar(255) COLLATE latin1_bin NOT NULL DEFAULT '',
  `description` text COLLATE latin1_bin NOT NULL,
511
  `max_length` int(10) unsigned NOT NULL DEFAULT '0',
512
  PRIMARY KEY (`misc_set_id`),
Magali Ruffier's avatar
Magali Ruffier committed
513
  UNIQUE KEY `code_idx` (`code`)
514
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_bin;
515

516
CREATE TABLE `object_xref` (
517 518
  `object_xref_id` int(11) NOT NULL AUTO_INCREMENT,
  `ensembl_id` int(10) unsigned NOT NULL DEFAULT '0',
Magali Ruffier's avatar
Magali Ruffier committed
519
  `ensembl_object_type` enum('RawContig','Transcript','Gene','Translation','regulatory_factor','regulatory_feature','Marker') COLLATE latin1_bin NOT NULL DEFAULT 'RawContig',
520
  `xref_id` int(10) unsigned NOT NULL,
Magali Ruffier's avatar
Magali Ruffier committed
521
  `linkage_annotation` varchar(255) COLLATE latin1_bin DEFAULT NULL,
522
  `analysis_id` smallint(5) unsigned NOT NULL,
Magali Ruffier's avatar
Magali Ruffier committed
523
  PRIMARY KEY (`object_xref_id`),
Magali Ruffier's avatar
Magali Ruffier committed
524 525
  UNIQUE KEY `xref_idx` (`xref_id`,`ensembl_object_type`,`ensembl_id`,`analysis_id`),
  KEY `ensembl_idx` (`ensembl_object_type`,`ensembl_id`),
Magali Ruffier's avatar
Magali Ruffier committed
526
  KEY `analysis_idx` (`analysis_id`)
Magali Ruffier's avatar
Magali Ruffier committed
527
) ENGINE=MyISAM AUTO_INCREMENT=81424 DEFAULT CHARSET=latin1 COLLATE=latin1_bin;
528

529 530
CREATE TABLE `ontology_xref` (
  `object_xref_id` int(10) unsigned NOT NULL DEFAULT '0',
531
  `linkage_type` varchar(3) DEFAULT NULL,
532
  `source_xref_id` int(10) unsigned DEFAULT NULL,
Magali Ruffier's avatar
Magali Ruffier committed
533 534 535
  UNIQUE KEY `object_source_type_idx` (`object_xref_id`,`source_xref_id`,`linkage_type`),
  KEY `object_idx` (`object_xref_id`),
  KEY `source_idx` (`source_xref_id`)
536
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
537

538 539 540 541 542 543 544 545 546
CREATE TABLE `operon` (
  `operon_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `seq_region_id` int(10) unsigned NOT NULL,
  `seq_region_start` int(10) unsigned NOT NULL,
  `seq_region_end` int(10) unsigned NOT NULL,
  `seq_region_strand` tinyint(2) NOT NULL,
  `display_label` varchar(255) DEFAULT NULL,
  `analysis_id` smallint(5) unsigned NOT NULL,
  `stable_id` varchar(128) DEFAULT NULL,
Magali Ruffier's avatar
Magali Ruffier committed
547
  `version` smallint(5) unsigned DEFAULT NULL,
548 549 550 551 552 553
  `created_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `modified_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY (`operon_id`),
  KEY `seq_region_idx` (`seq_region_id`,`seq_region_start`),
  KEY `name_idx` (`display_label`),
  KEY `stable_id_idx` (`stable_id`,`version`)
554
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
555

556 557 558 559 560 561 562 563 564 565
CREATE TABLE `operon_transcript` (
  `operon_transcript_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `seq_region_id` int(10) unsigned NOT NULL,
  `seq_region_start` int(10) unsigned NOT NULL,
  `seq_region_end` int(10) unsigned NOT NULL,
  `seq_region_strand` tinyint(2) NOT NULL,
  `operon_id` int(10) unsigned NOT NULL,
  `display_label` varchar(255) DEFAULT NULL,
  `analysis_id` smallint(5) unsigned NOT NULL,
  `stable_id` varchar(128) DEFAULT NULL,
Magali Ruffier's avatar
Magali Ruffier committed
566
  `version` smallint(5) unsigned DEFAULT NULL,
567 568 569 570 571 572
  `created_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `modified_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY (`operon_transcript_id`),
  KEY `operon_idx` (`operon_id`),
  KEY `seq_region_idx` (`seq_region_id`,`seq_region_start`),
  KEY `stable_id_idx` (`stable_id`,`version`)
573
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
574 575 576 577 578

CREATE TABLE `operon_transcript_gene` (
  `operon_transcript_id` int(10) unsigned DEFAULT NULL,
  `gene_id` int(10) unsigned DEFAULT NULL,
  KEY `operon_transcript_gene_idx` (`operon_transcript_id`,`gene_id`)
579
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
580

581
CREATE TABLE `peptide_archive` (
582
  `peptide_archive_id` int(11) NOT NULL AUTO_INCREMENT,
Magali Ruffier's avatar
Magali Ruffier committed
583 584
  `md5_checksum` varchar(32) COLLATE latin1_bin DEFAULT NULL,
  `peptide_seq` mediumtext COLLATE latin1_bin NOT NULL,
585 586
  PRIMARY KEY (`peptide_archive_id`),
  KEY `checksum` (`md5_checksum`)
587
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_bin;
588

589 590
CREATE TABLE `prediction_exon` (
  `prediction_exon_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
591 592 593 594 595 596 597
  `prediction_transcript_id` int(10) unsigned NOT NULL DEFAULT '0',
  `exon_rank` smallint(5) unsigned NOT NULL DEFAULT '0',
  `seq_region_id` int(10) unsigned NOT NULL DEFAULT '0',
  `seq_region_start` int(10) unsigned NOT NULL DEFAULT '0',
  `seq_region_end` int(10) unsigned NOT NULL DEFAULT '0',
  `seq_region_strand` tinyint(4) NOT NULL DEFAULT '0',
  `start_phase` tinyint(4) NOT NULL DEFAULT '0',
598 599 600
  `score` double DEFAULT NULL,
  `p_value` double DEFAULT NULL,
  PRIMARY KEY (`prediction_exon_id`),
601 602 603
  KEY `prediction_transcript_id` (`prediction_transcript_id`),
  KEY `seq_region_id` (`seq_region_id`,`seq_region_start`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_bin;
604

605 606
CREATE TABLE `prediction_transcript` (
  `prediction_transcript_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
607 608 609 610 611
  `seq_region_id` int(10) unsigned NOT NULL DEFAULT '0',
  `seq_region_start` int(10) unsigned NOT NULL DEFAULT '0',
  `seq_region_end` int(10) unsigned NOT NULL DEFAULT '0',
  `seq_region_strand` tinyint(4) NOT NULL DEFAULT '0',
  `analysis_id` int(11) DEFAULT NULL,
Magali Ruffier's avatar
Magali Ruffier committed
612
  `display_label` varchar(255) COLLATE latin1_bin DEFAULT NULL,
613
  PRIMARY KEY (`prediction_transcript_id`),
Magali Ruffier's avatar
Magali Ruffier committed
614
  KEY `seq_region_idx` (`seq_region_id`,`seq_region_start`),
615
  KEY `analysis_idx` (`analysis_id`)
616
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_bin;
617

618 619
CREATE TABLE `protein_align_feature` (
  `protein_align_feature_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
620 621 622
  `seq_region_id` int(10) unsigned NOT NULL DEFAULT '0',
  `seq_region_start` int(10) unsigned NOT NULL DEFAULT '0',
  `seq_region_end` int(10) unsigned NOT NULL DEFAULT '0',
623
  `seq_region_strand` tinyint(1) NOT NULL DEFAULT '1',
624 625
  `hit_start` int(10) NOT NULL DEFAULT '0',
  `hit_end` int(10) NOT NULL DEFAULT '0',
Magali Ruffier's avatar
Magali Ruffier committed
626
  `hit_name` varchar(40) COLLATE latin1_bin NOT NULL DEFAULT '',
627
  `analysis_id` int(10) unsigned NOT NULL DEFAULT '0',
628 629 630
  `score` double DEFAULT NULL,
  `evalue` double DEFAULT NULL,
  `perc_ident` float DEFAULT NULL,
631 632
  `cigar_line` text COLLATE latin1_bin,
  `external_db_id` smallint(5) unsigned DEFAULT NULL,
633 634 635 636 637 638 639
  `hcoverage` double DEFAULT NULL,
  PRIMARY KEY (`protein_align_feature_id`),
  KEY `seq_region_idx` (`seq_region_id`,`analysis_id`,`seq_region_start`,`score`),
  KEY `seq_region_idx_2` (`seq_region_id`,`seq_region_start`),
  KEY `hit_idx` (`hit_name`),
  KEY `analysis_idx` (`analysis_id`),
  KEY `external_db_idx` (`external_db_id`)
640
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_bin MAX_ROWS=100000000 AVG_ROW_LENGTH=80;
641

642 643
CREATE TABLE `protein_feature` (
  `protein_feature_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
644 645 646 647 648
  `translation_id` int(11) NOT NULL DEFAULT '0',
  `seq_start` int(10) NOT NULL DEFAULT '0',
  `seq_end` int(10) NOT NULL DEFAULT '0',
  `hit_start` int(10) NOT NULL DEFAULT '0',
  `hit_end` int(10) NOT NULL DEFAULT '0',
Magali Ruffier's avatar
Magali Ruffier committed
649
  `hit_name` varchar(40) COLLATE latin1_bin NOT NULL DEFAULT '',
650 651
  `analysis_id` int(10) unsigned NOT NULL DEFAULT '0',
  `score` double NOT NULL DEFAULT '0',
652 653
  `evalue` double DEFAULT NULL,
  `perc_ident` float DEFAULT NULL,
654 655
  `external_data` text COLLATE latin1_bin,
  `hit_description` text COLLATE latin1_bin,
656
  PRIMARY KEY (`protein_feature_id`),
Magali Ruffier's avatar
Magali Ruffier committed
657
  UNIQUE KEY `aln_idx` (`translation_id`,`hit_name`,`seq_start`,`seq_end`,`hit_start`,`hit_end`),
Magali Ruffier's avatar
Magali Ruffier committed
658 659
  KEY `translation_idx` (`translation_id`),
  KEY `hitname_idx` (`hit_name`),
660
  KEY `analysis_idx` (`analysis_id`)
Magali Ruffier's avatar
Magali Ruffier committed
661
) ENGINE=MyISAM AUTO_INCREMENT=24117 DEFAULT CHARSET=latin1 COLLATE=latin1_bin;
662

663 664
CREATE TABLE `repeat_consensus` (
  `repeat_consensus_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
Magali Ruffier's avatar
Magali Ruffier committed
665 666 667
  `repeat_name` varchar(255) COLLATE latin1_bin NOT NULL DEFAULT '',
  `repeat_class` varchar(100) COLLATE latin1_bin NOT NULL DEFAULT '',
  `repeat_type` varchar(40) COLLATE latin1_bin NOT NULL DEFAULT '',
668
  `repeat_consensus` text COLLATE latin1_bin,
669 670 671 672 673
  PRIMARY KEY (`repeat_consensus_id`),
  KEY `name` (`repeat_name`),
  KEY `class` (`repeat_class`),
  KEY `consensus` (`repeat_consensus`(10)),
  KEY `type` (`repeat_type`)
674
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_bin;
675

676 677
CREATE TABLE `repeat_feature` (
  `repeat_feature_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
678 679 680
  `seq_region_id` int(10) unsigned NOT NULL DEFAULT '0',
  `seq_region_start` int(10) unsigned NOT NULL DEFAULT '0',
  `seq_region_end` int(10) unsigned NOT NULL DEFAULT '0',
681
  `seq_region_strand` tinyint(1) NOT NULL DEFAULT '1',
682 683 684 685
  `repeat_start` int(10) NOT NULL DEFAULT '0',
  `repeat_end` int(10) NOT NULL DEFAULT '0',
  `repeat_consensus_id` int(10) unsigned NOT NULL DEFAULT '0',
  `analysis_id` int(10) unsigned NOT NULL DEFAULT '0',
686 687 688 689 690
  `score` double DEFAULT NULL,
  PRIMARY KEY (`repeat_feature_id`),
  KEY `seq_region_idx` (`seq_region_id`,`seq_region_start`),
  KEY `repeat_idx` (`repeat_consensus_id`),
  KEY `analysis_idx` (`analysis_id`)
691
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_bin MAX_ROWS=100000000 AVG_ROW_LENGTH=80;
692 693 694

CREATE TABLE `seq_region` (
  `seq_region_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
Magali Ruffier's avatar
Magali Ruffier committed
695
  `name` varchar(40) COLLATE latin1_bin NOT NULL DEFAULT '',
696 697
  `coord_system_id` int(10) NOT NULL DEFAULT '0',
  `length` int(10) NOT NULL DEFAULT '0',
698
  PRIMARY KEY (`seq_region_id`),
Magali Ruffier's avatar
Magali Ruffier committed
699 700
  UNIQUE KEY `name_cs_idx` (`name`,`coord_system_id`),
  KEY `cs_idx` (`coord_system_id`)
Magali Ruffier's avatar
Magali Ruffier committed
701
) ENGINE=MyISAM AUTO_INCREMENT=14 DEFAULT CHARSET=latin1 COLLATE=latin1_bin;
702

703 704 705
CREATE TABLE `seq_region_attrib` (
  `seq_region_id` int(10) unsigned NOT NULL DEFAULT '0',
  `attrib_type_id` smallint(5) unsigned NOT NULL DEFAULT '0',
Magali Ruffier's avatar
Magali Ruffier committed
706
  `value` text COLLATE latin1_bin NOT NULL,
707
  UNIQUE KEY `region_attribx` (`seq_region_id`,`attrib_type_id`,`value`(500)),
708
  KEY `type_val_idx` (`attrib_type_id`,`value`(40)),
Magali Ruffier's avatar
Magali Ruffier committed
709
  KEY `val_only_idx` (`value`(40)),
710
  KEY `seq_region_idx` (`seq_region_id`)
711
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_bin;
712

713 714 715 716
CREATE TABLE `seq_region_mapping` (
  `external_seq_region_id` int(10) unsigned NOT NULL,
  `internal_seq_region_id` int(10) unsigned NOT NULL,
  `mapping_set_id` int(10) unsigned NOT NULL,
Magali Ruffier's avatar
Magali Ruffier committed
717
  KEY `mapping_set_idx` (`mapping_set_id`)
718
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
719

720 721 722
CREATE TABLE `seq_region_synonym` (
  `seq_region_synonym_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `seq_region_id` int(10) unsigned NOT NULL,
723
  `synonym` varchar(250) NOT NULL,
724
  `external_db_id` smallint(5) unsigned DEFAULT NULL,
Andy Yates's avatar