|
@@ -126,6 +126,12 @@ function tripal_chado_prepare_chado() {
|
|
|
|
|
|
try {
|
|
|
|
|
|
+ // We want to provide a set of commonly used entity types by default. This
|
|
|
+ // way when a user first installs Tripal there are some commonly used
|
|
|
+ // formats.
|
|
|
+ module_load_include('inc', 'tripal', 'api/tripal.api');
|
|
|
+ module_load_include('inc', 'tripal', 'includes/tripal.admin');
|
|
|
+
|
|
|
// Get the effective version. Pass true as second argument
|
|
|
// to warn the user if the current version is not compatible.
|
|
|
$version = chado_get_version(FALSE, FALSE);
|
|
@@ -148,64 +154,15 @@ function tripal_chado_prepare_chado() {
|
|
|
// add new content types it simplifies the form for them.
|
|
|
tripal_chado_map_cvterms();
|
|
|
|
|
|
- // Add the cv_root_mview.
|
|
|
- tripal_chado_add_cv_root_mview_mview();
|
|
|
-
|
|
|
- // Support for Analyses
|
|
|
- // we may need the analysisfeatureprop table if it doesn't already exist
|
|
|
- tripal_chado_add_analysisfeatureprop_table();
|
|
|
-
|
|
|
- // add materialized views
|
|
|
- tripal_chado_add_analysis_organism_mview();
|
|
|
-
|
|
|
- // Support for Contacts
|
|
|
- // Add the contactprop table to Chado.
|
|
|
- tripal_chado_add_contactprop_table();
|
|
|
-
|
|
|
- // Support for Features
|
|
|
- // Add the materialized view.
|
|
|
- tripal_chado_add_organism_feature_count_mview();
|
|
|
-
|
|
|
- // Add the custom tables for the GFF loader.
|
|
|
- tripal_chado_add_tripal_gff_temp_table();
|
|
|
- tripal_chado_add_tripal_gffcds_temp_table();
|
|
|
- tripal_chado_add_tripal_gffprotein_temp_table();
|
|
|
-
|
|
|
- // Support for FeatureMaps.
|
|
|
- // add the featuremapprop table to Chado
|
|
|
- tripal_chado_add_featuremap_dbxref_table();
|
|
|
- tripal_chado_add_featuremapprop_table();
|
|
|
- //tripal_chado_add_featuremappos_table();
|
|
|
-
|
|
|
- // Support for Libraries.
|
|
|
- // add the materialized view
|
|
|
- tripal_chado_add_library_feature_count_mview();
|
|
|
-
|
|
|
- // Support for Pubs.
|
|
|
- // add the custom tables
|
|
|
- tripal_chado_add_pubauthor_contact_table();
|
|
|
- // Add the supported loaders
|
|
|
- variable_set('tripal_pub_supported_dbs', array('PMID', 'AGL'));
|
|
|
-
|
|
|
- // Support for Stocks.
|
|
|
- // add the materialized view
|
|
|
- tripal_chado_add_organism_stock_count_mview();
|
|
|
-
|
|
|
- // We want to provide a set of commonly used entity types by default. This
|
|
|
- // way when a user first installs Tripal there are some commonly used
|
|
|
- // formats.
|
|
|
- module_load_include('inc', 'tripal', 'api/tripal.api');
|
|
|
- module_load_include('inc', 'tripal', 'includes/tripal.admin');
|
|
|
-
|
|
|
// Create the 'Organism' entity type. This uses the obi:organism term.
|
|
|
$error = '';
|
|
|
$args = array(
|
|
|
- 'vocabulary' => 'OBI',
|
|
|
- 'accession' => '0100026',
|
|
|
- 'term_name' => 'organism',
|
|
|
- 'storage_args' => array(
|
|
|
- 'data_table' => 'organism',
|
|
|
- )
|
|
|
+ 'vocabulary' => 'OBI',
|
|
|
+ 'accession' => '0100026',
|
|
|
+ 'term_name' => 'organism',
|
|
|
+ 'storage_args' => array(
|
|
|
+ 'data_table' => 'organism',
|
|
|
+ )
|
|
|
);
|
|
|
$term = tripal_load_term_entity(array('vocabulary' => 'OBI', 'accession' => '0100026'));
|
|
|
$bundle = tripal_load_bundle_entity(array('term_id' => $term->id));
|
|
@@ -325,6 +282,49 @@ function tripal_chado_prepare_chado() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ // Add the cv_root_mview.
|
|
|
+ tripal_chado_add_cv_root_mview_mview();
|
|
|
+
|
|
|
+ // Support for Analyses
|
|
|
+ // we may need the analysisfeatureprop table if it doesn't already exist
|
|
|
+ tripal_chado_add_analysisfeatureprop_table();
|
|
|
+
|
|
|
+ // add materialized views
|
|
|
+ tripal_chado_add_analysis_organism_mview();
|
|
|
+
|
|
|
+ // Support for Contacts
|
|
|
+ // Add the contactprop table to Chado.
|
|
|
+ tripal_chado_add_contactprop_table();
|
|
|
+
|
|
|
+ // Support for Features
|
|
|
+ // Add the materialized view.
|
|
|
+ tripal_chado_add_organism_feature_count_mview();
|
|
|
+
|
|
|
+ // Add the custom tables for the GFF loader.
|
|
|
+ tripal_chado_add_tripal_gff_temp_table();
|
|
|
+ tripal_chado_add_tripal_gffcds_temp_table();
|
|
|
+ tripal_chado_add_tripal_gffprotein_temp_table();
|
|
|
+
|
|
|
+ // Support for FeatureMaps.
|
|
|
+ // add the featuremapprop table to Chado
|
|
|
+ tripal_chado_add_featuremap_dbxref_table();
|
|
|
+ tripal_chado_add_featuremapprop_table();
|
|
|
+ //tripal_chado_add_featuremappos_table();
|
|
|
+
|
|
|
+ // Support for Libraries.
|
|
|
+ // add the materialized view
|
|
|
+ tripal_chado_add_library_feature_count_mview();
|
|
|
+
|
|
|
+ // Support for Pubs.
|
|
|
+ // add the custom tables
|
|
|
+ tripal_chado_add_pubauthor_contact_table();
|
|
|
+ // Add the supported loaders
|
|
|
+ variable_set('tripal_pub_supported_dbs', array('PMID', 'AGL'));
|
|
|
+
|
|
|
+ // Support for Stocks.
|
|
|
+ // add the materialized view
|
|
|
+ tripal_chado_add_organism_stock_count_mview();
|
|
|
+
|
|
|
// Set a variable to indicate the site is prepared.
|
|
|
variable_set('tripal_chado_is_prepared', TRUE);
|
|
|
}
|
|
@@ -1094,7 +1094,7 @@ function tripal_chado_add_tripal_obo_temp_table() {
|
|
|
// do not want to use the Tripal Custom Table API because we don't want it to appear in the
|
|
|
// list of custom tables. It needs to be available for the Tripal Chado API so we create it
|
|
|
// here and then define it in the tripal_cv/api/tripal_cv.schema.api.inc
|
|
|
- if (!db_table_exists('chado.tripal_obo_temp')) {
|
|
|
+ if (!chado_table_exists('tripal_obo_temp')) {
|
|
|
$sql = "
|
|
|
CREATE TABLE {tripal_obo_temp} (
|
|
|
id character varying(255) NOT NULL,
|