Browse Source

added chado schema v1.2

spficklin 12 years ago
parent
commit
5090079818

+ 24 - 10
tripal_core/chado_install.php

@@ -10,23 +10,37 @@
  *
  * @ingroup tripal_core
  */
-function tripal_core_chado_v1_11_load_form() {
+function tripal_core_chado_load_form() {
 
   $form['description'] = array(
     '#type' => 'item',
-    '#value' => t("Click the submit button below to install Chado into the Drupal "
-      ."database. <br /><font color=\"red\">WARNING:</font> use this only for a new "
-      ."chado installation or reinstall completely.  This will erase any data currently "
-      ."in the chado database.  If you are using chado in a database external to the "
+    '#value' => t("<font color=\"red\">WARNING:</font> A new install of Chado v1.2 or v1.11 "
+      ."will install Chado within the Drupal database in a \"chado\" schema. If the \"chado\" schema already exists it will "
+      ."be overwritten and all data will be lost.  You may choose to update an existing Chado v1.11 if it was installed with a previous "
+      ."version of Tripal (e.g. v0.3b or v0.3.1). The update will not erase any data. "
+      ."If you are using chado in a database external to the "
       ."Drupal database with a 'chado' entry in the 'settings.php' \$db_url argument "
-      ."then this option will intall chado but it will not be usable.  The external "
+      ."then Chado will be installed but will not be used .  The external "
       ."database specified in the settings.php file takes precedence."),
     '#weight' => 1,
   );
 
+  $form['action_to_do'] = array(
+     '#type' => 'radios',
+     '#title' => 'Installation/Upgrade Action',
+     '#options' => array(
+        'Chado v1.2' => t('New Install of Chado v1.2 (erases all existing Chado data if Chado already exists)'),
+        'Upgrade v1.11 to v1.2' => t('Upgrade existing Chado v1.11 to v1.2 (no data is lost)'),
+        'Chado v1.11' => t('New Install of Chado v1.11 (erases all existing Chado data if Chado already exists)')
+     ),
+     '#description' => t('Select an action to perform'),
+     '#required' => TRUE
+     
+  );
+
   $form['button'] = array(
     '#type' => 'submit',
-    '#value' => t('Install Chado'),
+    '#value' => t('Install/Upgrade Chado'),
     '#weight' => 2,
   );
 
@@ -40,11 +54,11 @@ function tripal_core_chado_v1_11_load_form() {
  */
 function tripal_core_chado_v1_11_load_form_submit($form, &$form_state) {
   global $user;
+  $action_to_do   = trim($form_state['values']['action_to_do']);
 
-  $args = array();
+  $args = array($action_to_do);
   tripal_add_job("Install Chado", 'tripal_core',
     'tripal_core_install_chado', $args, $user->uid);
-
 }
 
 /**
@@ -303,4 +317,4 @@ function tripal_core_chado_install_done() {
   global $active_db;
   pg_query($active_db, "set search_path to public,chado");
 
-}
+}

+ 0 - 0
tripal_core/initialize.sql → tripal_core/chado_schema/initialize-1.11.sql


+ 237 - 0
tripal_core/chado_schema/initialize-1.2.sql

@@ -0,0 +1,237 @@
+/* For load_gff3.pl */
+insert into organism (abbreviation, genus, species, common_name)
+       values ('H.sapiens', 'Homo','sapiens','human');
+insert into organism (abbreviation, genus, species, common_name)
+       values ('D.melanogaster', 'Drosophila','melanogaster','fruitfly');
+insert into organism (abbreviation, genus, species, common_name)
+       values ('M.musculus', 'Mus','musculus','mouse');
+insert into organism (abbreviation, genus, species, common_name)
+       values ('A.gambiae', 'Anopheles','gambiae','mosquito');
+insert into organism (abbreviation, genus, species, common_name)
+       values ('R.norvegicus', 'Rattus','norvegicus','rat');
+insert into organism (abbreviation, genus, species, common_name)
+       values ('A.thaliana', 'Arabidopsis','thaliana','mouse-ear cress');
+insert into organism (abbreviation, genus, species, common_name)
+       values ('C.elegans', 'Caenorhabditis','elegans','worm');
+insert into organism (abbreviation, genus, species, common_name)
+       values ('D.rerio', 'Danio','rerio','zebrafish');
+insert into organism (abbreviation, genus, species, common_name)
+       values ('O.sativa', 'Oryza','sativa','rice');
+insert into organism (abbreviation, genus, species, common_name)
+       values ('S.cerevisiae', 'Saccharomyces','cerevisiae','yeast');
+insert into organism (abbreviation, genus, species, common_name)
+       values ('X.laevis', 'Xenopus','laevis','frog');
+insert into organism (abbreviation, genus, species,common_name) 
+       values ('D.discoideum','Dictyostelium','discoideum','dicty');
+insert into contact (name) values ('Affymetrix');
+insert into contact (name,description) values ('null','null');
+insert into cv (name) values ('null');
+insert into cv (name,definition) values ('local','Locally created terms');
+insert into cv (name,definition) values ('Statistical Terms','Locally created terms for statistics');
+insert into db (name, description) values ('null','a fake database for local items');
+
+insert into dbxref (db_id,accession) values ((select db_id from db where name='null'), 'local:null');
+insert into cvterm (name,cv_id,dbxref_id) values ('null',(select cv_id from cv where name = 'null'),(select dbxref_id from dbxref where accession='local:null'));
+
+insert into dbxref (db_id,accession) values ((select db_id from db where name='null'), 'local:computer file');
+insert into cvterm (name,cv_id,dbxref_id) values ('computer file', (select cv_id from cv where name = 'null'),(select dbxref_id from dbxref where accession='local:computer file'));
+
+insert into dbxref (db_id,accession) values ((select db_id from db where name='null'), 'local:glass');
+insert into cvterm (name,definition,cv_id,dbxref_id) values ('glass','glass array',(select cv_id from cv where name = 'local'),(select dbxref_id from dbxref where accession='local:glass'));
+
+insert into dbxref (db_id,accession) values ((select db_id from db where name='null'), 'local:photochemical_oligo');
+insert into cvterm (name,definition,cv_id,dbxref_id) values ('photochemical_oligo','in-situ photochemically synthesized oligoes',(select cv_id from cv where name = 'local'),(select dbxref_id from dbxref where accession='local:photochemical_oligo'));
+
+insert into pub (miniref,uniquename,type_id) values ('null','null',(select cvterm_id from cvterm where name = 'null'));
+insert into db (name, description) values ('GFF_source', 'A collection of sources (ie, column 2) from GFF files');
+
+insert into db (name) values ('ATCC');
+
+insert into db (name) values ('refseq');
+insert into db (name) values ('genbank');
+insert into db (name) values ('EMBL');
+insert into db (name) values ('TIGR');
+insert into db (name) values ('ucsc');
+insert into db (name) values ('ucla');
+insert into db (name) values ('SGD');
+
+insert into db (name) values ('PFAM');
+insert into db (name) values ('SUPERFAMILY');
+insert into db (name) values ('PROFILE');
+insert into db (name) values ('PRODOM');
+insert into db (name) values ('PRINTS');
+insert into db (name) values ('SMART');
+insert into db (name) values ('TIGRFAMs');
+insert into db (name) values ('PIR');
+
+insert into db (name) values ('Affymetrix_U133');
+insert into db (name) values ('Affymetrix_U133PLUS');
+insert into db (name) values ('Affymetrix_U95');
+insert into db (name) values ('LocusLink');
+insert into db (name) values ('RefSeq_protein');
+insert into db (name) values ('GenBank_protein');
+insert into db (name) values ('OMIM');
+insert into db (name) values ('Swiss');
+insert into db (name) values ('RefSNP');
+insert into db (name) values ('TSC');
+--insert into db (name, contact_id, description, urlprefix) values ('affy:U133',(select contact_id from contact where name = 'null'),'Affymetrix U133','http://https://www.affymetrix.com/analysis/netaffx/fullrecord.affx?pk=HG-U133_PLUS_2:');
+--insert into db (name, contact_id, description, urlprefix) values ('affy:U95',(select contact_id from contact where name = 'null'),'Affymetrix U95','http://https://www.affymetrix.com/analysis/netaffx/fullrecord.affx?pk=HG-U95AV2:');
+
+insert into db (name, description) values ('GR','Gramene');
+insert into db (name, description, urlprefix) values ('uniprot','UniProt/TrEMBL','http://us.expasy.org/cgi-bin/niceprot.pl?');
+insert into db (name, description, urlprefix) values ('refseq:mrna','RefSeq mRNA','http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=search&db=nucleotide&dopt=GenBank&term=');
+insert into db (name, description, urlprefix) values ('refseq:protein','RefSeq Protein','http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=search&db=protein&dopt=GenBank&term=');
+insert into db (name, description, urlprefix) values ('unigene','Unigene','http://www.ncbi.nih.gov/entrez/query.fcgi?db=unigene&cmd=search&term=');
+insert into db (name, description, urlprefix) values ('omim','OMIM','http://www.ncbi.nlm.nih.gov/entrez/dispomim.cgi?id=');
+insert into db (name, description, urlprefix) values ('locuslink','LocusLink','http://www.ncbi.nlm.nih.gov/LocusLink/LocRpt.cgi?l=');
+insert into db (name, description, urlprefix) values ('genbank:mrna','GenBank mRNA','http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=search&db=nucleotide&dopt=GenBank&term=');
+insert into db (name, description, urlprefix) values ('genbank:protein','GenBank Protein','http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=search&db=protein&dopt=GenBank&term=');
+insert into db (name, description, urlprefix) values ('swissprot:display','SwissProt','http://us.expasy.org/cgi-bin/niceprot.pl?');
+insert into db (name, description, urlprefix) values ('pfam','Pfam','http://www.sanger.ac.uk/cgi-bin/Pfam/dql.pl?query=');
+
+insert into analysis (name,program,programversion) values ('dabg' ,'dabg' ,'dabg' );
+insert into analysis (name,program,programversion) values ('dchip','dchip','dchip');
+insert into analysis (name,program,programversion) values ('gcrma','gcrma','gcrma');
+insert into analysis (name,program,programversion) values ('mas5' ,'mas5' ,'mas5' );
+insert into analysis (name,program,programversion) values ('mpam' ,'mpam' ,'mpam' );
+insert into analysis (name,program,programversion) values ('plier','plier','plier');
+insert into analysis (name,program,programversion) values ('rma'  ,'rma'  ,'rma'  );
+insert into analysis (name,program,programversion) values ('sea'  ,'sea'  ,'sea'  );
+insert into analysis (name,program,programversion) values ('vsn'  ,'vsn'  ,'vsn'  );
+
+insert into arraydesign (name,manufacturer_id,platformtype_id) values ('unknown'                                    , (select contact_id from contact where name = 'null'),(select cvterm_id from cvterm where name = 'null'));
+insert into arraydesign (name,manufacturer_id,platformtype_id) values ('virtual array'                              , (select contact_id from contact where name = 'null'),(select cvterm_id from cvterm where name = 'null'));
+insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_HG-U133_Plus_2' , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
+insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_HG-U133A'       , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
+insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_HG-U133A_2'     , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
+insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_HG-U133B'       , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
+insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_HG-U95Av2'      , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
+insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_HG-U95B'        , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
+insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_HG-U95C'        , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
+insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_HG-U95D'        , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
+insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_HG-U95E'        , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
+insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_HuExon1'        , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
+insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_HuGeneFL'       , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
+insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_U74Av2'         , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
+insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_MG-U74Av2'      , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
+insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_MG-U74Bv2'      , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
+insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_MG-U74Cv2'      , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
+insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_RG-U34A'        , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
+insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_RG-U34B'        , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
+insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_RG-U34C'        , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
+insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_RT-U34'         , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
+insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_RN-U34'         , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
+insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_YG-S98'         , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
+insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_Yeast_2'        , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
+insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_RAE230A'        , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
+insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_RAE230B'        , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
+insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_Rat230_2'       , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
+insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_MOE430A'        , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
+insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_MOE430B'        , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
+insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_Mouse430_2'     , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
+insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_Mouse430A_2'    , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
+insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_ATH1-121501'    , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
+insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_Mapping100K_Hind240' , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
+insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_Mapping100K_Xba240'  , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
+insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_Mapping10K_Xba131'   , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
+insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_Mapping10K_Xba142'   , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
+insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_Mapping500K_NspI'    , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
+insert into arraydesign (name,manufacturer_id,platformtype_id,substratetype_id) values ('Affymetrix_Mapping500K_StyI'    , (select contact_id from contact where name = 'Affymetrix'),(select cvterm_id from cvterm where name = 'photochemical_oligo'),(select cvterm_id from cvterm where name = 'glass'));
+
+insert into cv (name) values ('developmental stages');
+insert into dbxref (db_id,accession) values ((select db_id from db where name='null'), 'developmental stages:fetus');
+insert into cvterm (name,cv_id,dbxref_id) values ('fetus',      (select cv_id from cv where name = 'local'),(select dbxref_id from dbxref where accession='developmental stages:fetus'));
+
+insert into dbxref (db_id,accession) values ((select db_id from db where name='null'), 'developmental stages:neonate');
+insert into cvterm (name,cv_id,dbxref_id) values ('neonate',    (select cv_id from cv where name = 'developmental stages'), (select dbxref_id from dbxref where accession='developmental stages:neonate'));
+
+insert into dbxref (db_id,accession) values ((select db_id from db where name='null'), 'developmental stages:child');
+insert into cvterm (name,cv_id,dbxref_id) values ('child',      (select cv_id from cv where name = 'developmental stages'), (select dbxref_id from dbxref where accession='developmental stages:child'));
+
+insert into dbxref (db_id,accession) values ((select db_id from db where name='null'), 'developmental stages:adult_young');
+insert into cvterm (name,cv_id,dbxref_id) values ('adult_young',(select cv_id from cv where name = 'developmental stages'),(select dbxref_id from dbxref where accession='developmental stages:adult_young'));
+
+insert into dbxref (db_id,accession) values ((select db_id from db where name='null'), 'developmental stages:adult');
+insert into cvterm (name,cv_id,dbxref_id) values ('adult',      (select cv_id from cv where name = 'developmental stages'),(select dbxref_id from dbxref where accession='developmental stages:adult'));
+
+insert into dbxref (db_id,accession) values ((select db_id from db where name='null'), 'developmental stages:adult_old');
+insert into cvterm (name,cv_id,dbxref_id) values ('adult_old',  (select cv_id from cv where name = 'developmental stages'), (select dbxref_id from dbxref where accession='developmental stages:adult_old'));
+
+insert into dbxref (db_id,accession) values ((select db_id from db where name='null'), 'local:survival_time');
+insert into cvterm (name,cv_id,dbxref_id) values ('survival_time',(select cv_id from cv where name = 'local'),(select dbxref_id from dbxref where accession='local:survival_time'));
+
+
+insert into dbxref (db_id,accession) values ((select db_id from db where name='null'), 'Statistical Terms:n');
+insert into cvterm (name,definition,cv_id,dbxref_id) values ('n','sensu statistica',  (select cv_id from cv where name = 'Statistical Terms'),(select dbxref_id from dbxref where accession='Statistical Terms:n'));
+
+insert into dbxref (db_id,accession) values ((select db_id from db where name='null'), 'Statistical Terms:minimum');
+insert into cvterm (name,definition,cv_id,dbxref_id) values ('minimum','sensu statistica',  (select cv_id from cv where name = 'Statistical Terms'),(select dbxref_id from dbxref where accession='Statistical Terms:minimum'));
+
+insert into dbxref (db_id,accession) values ((select db_id from db where name='null'), 'Statistical Terms:maximum');
+insert into cvterm (name,definition,cv_id,dbxref_id) values ('maximum','sensu statistica',  (select cv_id from cv where name = 'Statistical Terms'),(select dbxref_id from dbxref where accession='Statistical Terms:maximum'));
+
+insert into dbxref (db_id,accession) values ((select db_id from db where name='null'), 'Statistical Terms:modality');
+insert into cvterm (name,definition,cv_id,dbxref_id) values ('modality','sensu statistica',  (select cv_id from cv where name = 'Statistical Terms'),(select dbxref_id from dbxref where accession='Statistical Terms:modality'));
+
+insert into dbxref (db_id,accession) values ((select db_id from db where name='null'), 'Statistical Terms:modality p');
+insert into cvterm (name,definition,cv_id,dbxref_id) values ('modality p','sensu statistica',  (select cv_id from cv where name = 'Statistical Terms'),(select dbxref_id from dbxref where accession='Statistical Terms:modality p'));
+
+insert into dbxref (db_id,accession) values ((select db_id from db where name='null'), 'Statistical Terms:mean');
+insert into cvterm (name,definition,cv_id,dbxref_id) values ('mean','sensu statistica',  (select cv_id from cv where name = 'Statistical Terms'),(select dbxref_id from dbxref where accession='Statistical Terms:mean'));
+
+insert into dbxref (db_id,accession) values ((select db_id from db where name='null'), 'Statistical Terms:median');
+insert into cvterm (name,definition,cv_id,dbxref_id) values ('median','sensu statistica',  (select cv_id from cv where name = 'Statistical Terms'),(select dbxref_id from dbxref where accession='Statistical Terms:median'));
+
+insert into dbxref (db_id,accession) values ((select db_id from db where name='null'), 'Statistical Terms:mode');
+insert into cvterm (name,definition,cv_id,dbxref_id) values ('mode','sensu statistica',  (select cv_id from cv where name = 'Statistical Terms'),(select dbxref_id from dbxref where accession='Statistical Terms:mode'));
+
+insert into dbxref (db_id,accession) values ((select db_id from db where name='null'), 'Statistical Terms:quartile 1');
+insert into cvterm (name,definition,cv_id,dbxref_id) values ('quartile 1','sensu statistica',  (select cv_id from cv where name = 'Statistical Terms'),(select dbxref_id from dbxref where accession='Statistical Terms:quartile 1'));
+
+insert into dbxref (db_id,accession) values ((select db_id from db where name='null'), 'Statistical Terms:quartile 3');
+insert into cvterm (name,definition,cv_id,dbxref_id) values ('quartile 3','sensu statistica',  (select cv_id from cv where name = 'Statistical Terms'),(select dbxref_id from dbxref where accession='Statistical Terms:quartile 3'));
+
+insert into dbxref (db_id,accession) values ((select db_id from db where name='null'), 'Statistical Terms:skewness');
+insert into cvterm (name,definition,cv_id,dbxref_id) values ('skewness','sensu statistica',  (select cv_id from cv where name = 'Statistical Terms'),(select dbxref_id from dbxref where accession='Statistical Terms:skewness'));
+
+insert into dbxref (db_id,accession) values ((select db_id from db where name='null'), 'Statistical Terms:kurtosis');
+insert into cvterm (name,definition,cv_id,dbxref_id) values ('kurtosis','sensu statistica',  (select cv_id from cv where name = 'Statistical Terms'),(select dbxref_id from dbxref where accession='Statistical Terms:kurtosis'));
+
+insert into dbxref (db_id,accession) values ((select db_id from db where name='null'), 'Statistical Terms:chi square p');
+insert into cvterm (name,definition,cv_id,dbxref_id) values ('chi square p','sensu statistica',  (select cv_id from cv where name = 'Statistical Terms'),(select dbxref_id from dbxref where accession='Statistical Terms:chi square p'));
+
+insert into dbxref (db_id,accession) values ((select db_id from db where name='null'), 'Statistical Terms:standard deviation');
+insert into cvterm (name,definition,cv_id,dbxref_id) values ('standard deviation','sensu statistica',  (select cv_id from cv where name = 'Statistical Terms'),(select dbxref_id from dbxref where accession='Statistical Terms:standard deviation'));
+
+insert into dbxref (db_id,accession) values ((select db_id from db where name='null'), 'Statistical Terms:expectation maximization gaussian mean');
+insert into cvterm (name,definition,cv_id,dbxref_id) values ('expectation maximization gaussian mean','sensu statistica',  (select cv_id from cv where name = 'Statistical Terms'),(select dbxref_id from dbxref where accession='Statistical Terms:expectation maximization gaussian mean'));
+
+insert into dbxref (db_id,accession) values ((select db_id from db where name='null'), 'Statistical Terms:expectation maximization p');
+insert into cvterm (name,definition,cv_id,dbxref_id) values ('expectation maximization p','sensu statistica',  (select cv_id from cv where name = 'Statistical Terms'),(select dbxref_id from dbxref where accession='Statistical Terms:expectation maximization p'));
+
+insert into dbxref (db_id,accession) values ((select db_id from db where name='null'), 'Statistical Terms:histogram');
+insert into cvterm (name,definition,cv_id,dbxref_id) values ('histogram','sensu statistica',  (select cv_id from cv where name = 'Statistical Terms'),(select dbxref_id from dbxref where accession='Statistical Terms:histogram'));
+
+insert into cv (name,definition) values ('autocreated','Terms that are automatically inserted by loading software');
+
+insert into cv (name,definition) values ('chado_properties','Terms that are used in the chadoprop table to describe the state of the database');
+
+insert into dbxref (db_id,accession) values ((select db_id from db where name='null'), 'chado_properties:version');
+insert into cvterm (name,definition,cv_id,dbxref_id) values ('version','Chado schema version',(select cv_id from cv where name = 'chado_properties'),(select dbxref_id from dbxref where accession='chado_properties:version'));
+
+
+--this table will probably end up in general.sql
+ CREATE TABLE public.materialized_view   (       
+                                materialized_view_id SERIAL,
+                                last_update TIMESTAMP,
+                                refresh_time INT,
+                                name VARCHAR(64) UNIQUE,
+                                mv_schema VARCHAR(64),
+                                mv_table VARCHAR(128),
+                                mv_specs TEXT,
+                                indexed TEXT,
+                                query TEXT,
+                                special_index TEXT
+                                );
+
+

+ 16 - 1
tripal_core/jobs.php

@@ -45,6 +45,21 @@
  * @return
  *    The job_id of the registered job
  *
+ * Example usage:
+ * @code
+ *  $args = array($dfile, $organism_id, $type, $library_id, $re_name, $re_uname,
+ *        $re_accession, $db_id, $rel_type, $re_subject, $parent_type, $method,
+ *         $user->uid, $analysis_id, $match_type);
+ *
+ * tripal_add_job("Import FASTA file: $dfile", 'tripal_feature',
+ *   'tripal_feature_load_fasta', $args, $user->uid);
+ * @endcode
+ * The code above is copied from the tripal_feature/fasta_loader.php file. The 
+ * snipped first builds an array of arguments that will then be passed to the
+ * tripal_add_job function.  The number of arguments provided in the $arguments
+ * variable should match the argument set for the callback function provided
+ * as the third argument.
+ *
  * @ingroup tripal_jobs_api
  */
 function tripal_add_job($job_name, $modulename, $callback, $arguments, $uid, $priority = 10) {
@@ -450,4 +465,4 @@ function tripal_jobs_cancel($job_id) {
     drupal_set_message(t("Job %job_id cannot be cancelled. It is in progress or has finished.", array('%job_id' => $job_id)));
   }
   drupal_goto("admin/tripal/tripal_jobs");
-}
+}

+ 4 - 4
tripal_core/tripal_core.module

@@ -90,11 +90,11 @@ function tripal_core_menu() {
     'access arguments' => array('access administration pages'),
     'type' => MENU_CALLBACK | MENU_LINKS_TO_PARENT
   );
-  $items['admin/tripal/chado_1_11_install'] = array(
-    'title' => 'Install Chado v1.11',
-    'description' => 'Installs Chado version 1.11 inside the current Drupal database',
+  $items['admin/tripal/chado_install'] = array(
+    'title' => 'Install Chado Schema',
+    'description' => 'Installs the Chado database tables, views, etc., inside the current Drupal database',
     'page callback' => 'drupal_get_form',
-    'page arguments' => array('tripal_core_chado_v1_11_load_form'),
+    'page arguments' => array('tripal_core_chado_load_form'),
     'access arguments' => array('access administration pages'),
     'type' => MENU_NORMAL_ITEM,
   );