  */
 DROP TABLE IF EXISTS stats_rrplus_results;
 CREATE TABLE stats_rrplus_results (
-  id                               INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
-  control_id                       INT(10) UNSIGNED,
-  experimental_id                  INT(10) UNSIGNED,
-  experimental_zygosity            ENUM('homozygote', 'heterozygote', 'hemizygote', 'not_applicable'),
-  external_db_id                   INT(10),
-  project_id                       INT(10) UNSIGNED,
-  organisation_id                  INT(10) UNSIGNED,
-  pipeline_id                      INT(10) UNSIGNED,
-  procedure_id                     INT(10) UNSIGNED,
-  parameter_id                     INT(10) UNSIGNED,
-  colony_id                        VARCHAR(200),
-  dependent_variable               VARCHAR(200),
-  control_selection_strategy       VARCHAR(100),
-  mp_acc                           VARCHAR(20)      NULL,
-  mp_db_id                         INT(10)          NULL,
-  male_mp_acc                      VARCHAR(20)      NULL,
-  female_mp_acc                    VARCHAR(20)      NULL,
-  male_controls                    INT(10) UNSIGNED,
-  male_mutants                     INT(10) UNSIGNED,
-  female_controls                  INT(10) UNSIGNED,
-  female_mutants                   INT(10) UNSIGNED,
-  female_control_mean              DOUBLE NULL,
-  male_control_mean                DOUBLE NULL,
-  female_experimental_mean         DOUBLE NULL,
-  male_experimental_mean           DOUBLE NULL,
-  metadata_group                   VARCHAR(50) DEFAULT '',
-  statistical_method               VARCHAR(200),
-  workflow                         VARCHAR(50),
-  weight_available                 VARCHAR(50),
-  status                           VARCHAR(200),
-  batch_significance               BOOLEAN,
-  variance_significance            BOOLEAN,
-  null_test_significance           DOUBLE,
-  genotype_parameter_estimate      VARCHAR(200),
-  genotype_stderr_estimate         DOUBLE,
-  genotype_effect_pvalue           VARCHAR(200),
-  genotype_percentage_change       VARCHAR(200),
-  gender_parameter_estimate        VARCHAR(200),
-  gender_stderr_estimate           DOUBLE,
-  gender_effect_pvalue             VARCHAR(200),
-  weight_parameter_estimate        DOUBLE,
-  weight_stderr_estimate           DOUBLE,
-  weight_effect_pvalue             DOUBLE,
-  gp1_genotype                     VARCHAR(200),
-  gp1_residuals_normality_test     DOUBLE,
-  gp2_genotype                     VARCHAR(200),
-  gp2_residuals_normality_test     DOUBLE,
-  blups_test                       DOUBLE,
-  rotated_residuals_normality_test DOUBLE,
-  intercept_estimate               DOUBLE,
-  intercept_stderr_estimate        DOUBLE,
-  interaction_significance         BOOLEAN,
-  interaction_effect_pvalue        DOUBLE,
-  gender_female_ko_estimate        VARCHAR(200),
-  gender_female_ko_stderr_estimate DOUBLE,
-  gender_female_ko_pvalue          VARCHAR(200),
-  gender_male_ko_estimate          VARCHAR(200),
-  gender_male_ko_stderr_estimate   DOUBLE,
-  gender_male_ko_pvalue            VARCHAR(200),
-  classification_tag               VARCHAR(200),
-  additional_information           TEXT,
-  raw_output                       MEDIUMTEXT,
-  authoritative                    BOOLEAN,
-
-  PRIMARY KEY (id),
-  KEY organisation_idx (organisation_id),
-  KEY pipeline_idx (pipeline_id),
-  KEY parameter_idx (parameter_id)
+	id                               INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
+	control_id                       INT(10) UNSIGNED,
+	experimental_id                  INT(10) UNSIGNED,
+	experimental_zygosity            ENUM('homozygote', 'heterozygote', 'hemizygote', 'not_applicable'),
+	external_db_id                   INT(10),
+	project_id                       INT(10) UNSIGNED,
+	organisation_id                  INT(10) UNSIGNED,
+	pipeline_id                      INT(10) UNSIGNED,
+	procedure_id                     INT(10) UNSIGNED,
+	parameter_id                     INT(10) UNSIGNED,
+	colony_id                        VARCHAR(200),
+	dependent_variable               VARCHAR(200),
+	control_selection_strategy       VARCHAR(100),
+	mp_acc                           VARCHAR(20)      NULL,
+	mp_db_id                         INT(10)          NULL,
+	male_mp_acc                      VARCHAR(20)      NULL,
+	female_mp_acc                    VARCHAR(20)      NULL,
+	male_controls                    INT(10) UNSIGNED,
+	male_mutants                     INT(10) UNSIGNED,
+	female_controls                  INT(10) UNSIGNED,
+	female_mutants                   INT(10) UNSIGNED,
+	female_control_mean              DOUBLE NULL,
+	male_control_mean                DOUBLE NULL,
+	female_experimental_mean         DOUBLE NULL,
+	male_experimental_mean           DOUBLE NULL,
+	metadata_group                   VARCHAR(50) DEFAULT '',
+	statistical_method               VARCHAR(200),
+	workflow                         VARCHAR(50),
+	weight_available                 VARCHAR(50),
+	status                           VARCHAR(200),
+	batch_significance               BOOLEAN,
+	variance_significance            BOOLEAN,
+	null_test_significance           DOUBLE,
+	genotype_parameter_estimate      VARCHAR(200),
+	genotype_stderr_estimate         DOUBLE,
+	genotype_effect_pvalue           VARCHAR(200),
+	genotype_percentage_change       VARCHAR(200),
+	gender_parameter_estimate        VARCHAR(200),
+	gender_stderr_estimate           DOUBLE,
+	gender_effect_pvalue             VARCHAR(200),
+	weight_parameter_estimate        DOUBLE,
+	weight_stderr_estimate           DOUBLE,
+	weight_effect_pvalue             DOUBLE,
+	gp1_genotype                     VARCHAR(200),
+	gp1_residuals_normality_test     DOUBLE,
+	gp2_genotype                     VARCHAR(200),
+	gp2_residuals_normality_test     DOUBLE,
+	blups_test                       DOUBLE,
+	rotated_residuals_normality_test DOUBLE,
+	intercept_estimate               DOUBLE,
+	intercept_stderr_estimate        DOUBLE,
+	interaction_significance         BOOLEAN,
+	interaction_effect_pvalue        DOUBLE,
+	gender_female_ko_estimate        VARCHAR(200),
+	gender_female_ko_stderr_estimate DOUBLE,
+	gender_female_ko_pvalue          VARCHAR(200),
+	gender_male_ko_estimate          VARCHAR(200),
+	gender_male_ko_stderr_estimate   DOUBLE,
+	gender_male_ko_pvalue            VARCHAR(200),
+	classification_tag               VARCHAR(200),
+	additional_information           TEXT,
+	raw_output                       MEDIUMTEXT,
+	authoritative                    BOOLEAN,
+
+	PRIMARY KEY (id),
+	KEY organisation_idx (organisation_id),
+	KEY pipeline_idx (pipeline_id),
+	KEY parameter_idx (parameter_id)
 
 )  COLLATE =utf8_general_ci ENGINE =MyISAM;
 




 /*
 ** FOR META INFO LOADING
 */
insert into meta_info(property_key, property_value, description) values('code_version', 'beta-release-0_1_4', '');
insert into meta_info(property_key, property_value, description) values('assembly_version', 'GRCm38', 'Genome Reference Consortium GRCm38');
insert into meta_info(property_key, property_value, description) values('species', 'Mus musculus', 'Mus musculus phenotype database');


 /*
 ** FOR HIGHER LEVEL ANNOTATION LOADING
  */
INSERT INTO higher_level_annotation VALUES
 ('MA:0000004')
,('MA:0000007')
,('MA:0000009')
,('MA:0000010')
,('MA:0002418')
,('MA:0000012')
,('MA:0002711')
,('MA:0002411')
,('MA:0000014')
,('MA:0000016')
,('MA:0000327')
,('MA:0002431')
,('MA:0000325')
,('MA:0000326')
,('MA:0000017')
,('MA:0002887') 				-- set of connective tissues
;

INSERT INTO higher_level_annotation VALUES
 ('EMAPA:16104')        -- cardiovascular system
,('EMAPA:16192')        -- sensory organ system
,('EMAPA:16246')        -- alimentary system
,('EMAPA:16405')        -- limb
,('EMAPA:16469')        -- nervous system
,('EMAPA:16727')        -- respiratory system
,('EMAPA:16748')        -- tail
,('EMAPA:16840')        -- liver and biliary system
,('EMAPA:17524')        -- integumental system
,('EMAPA:31858')        -- head
;



 /*
 ** FOR IMPC STATUS CODE LOADING
  */
/**
 * status code information about experiments, procedures or parameters from the DCC
 */


	PRIMARY KEY (id),
	KEY observation_id_idx (observation_id),
	UNIQUE KEY parameter_association_uk (observation_id, parameter_id, parameter_association_value(287))	-- 287 is the maximum key length. Anything greater throws a 'key too long' error.

) COLLATE=utf8_general_ci ENGINE=MyISAM ;

