|
@@ -57,14 +57,6 @@ function tripal_feature_install() {
|
|
|
// $obo_id = tripal_insert_obo('Chado Feature Properties', $obo_path);
|
|
|
// tripal_submit_obo_job(array('obo_id' => $obo_id));
|
|
|
|
|
|
- // Add the materialized view.
|
|
|
- tripal_feature_add_organism_count_mview();
|
|
|
-
|
|
|
- // Add the custom tables.
|
|
|
- tripal_feature_add_tripal_gff_temp_table();
|
|
|
- tripal_feature_add_tripal_gffcds_temp_table();
|
|
|
- tripal_feature_add_tripal_gffprotein_temp_table();
|
|
|
-
|
|
|
// Add the vocabularies used by the feature module.
|
|
|
tripal_feature_add_cvs();
|
|
|
|
|
@@ -82,119 +74,6 @@ function tripal_feature_install() {
|
|
|
function tripal_feature_uninstall() {
|
|
|
|
|
|
}
|
|
|
-// This function was moved to tripal_chado/includes/setup/tripal_chado.setup.inc
|
|
|
-/* function tripal_feature_add_tripal_gff_temp_table() {
|
|
|
- $schema = array(
|
|
|
- 'table' => 'tripal_gff_temp',
|
|
|
- 'fields' => array(
|
|
|
- 'feature_id' => array(
|
|
|
- 'type' => 'int',
|
|
|
- 'not null' => TRUE,
|
|
|
- ),
|
|
|
- 'organism_id' => array(
|
|
|
- 'type' => 'int',
|
|
|
- 'not null' => TRUE,
|
|
|
- ),
|
|
|
- 'uniquename' => array(
|
|
|
- 'type' => 'text',
|
|
|
- 'not null' => TRUE,
|
|
|
- ),
|
|
|
- 'type_name' => array(
|
|
|
- 'type' => 'varchar',
|
|
|
- 'length' => '1024',
|
|
|
- 'not null' => TRUE,
|
|
|
- ),
|
|
|
- ),
|
|
|
- 'indexes' => array(
|
|
|
- 'tripal_gff_temp_idx0' => array('feature_id'),
|
|
|
- 'tripal_gff_temp_idx0' => array('organism_id'),
|
|
|
- 'tripal_gff_temp_idx1' => array('uniquename'),
|
|
|
- ),
|
|
|
- 'unique keys' => array(
|
|
|
- 'tripal_gff_temp_uq0' => array('feature_id'),
|
|
|
- 'tripal_gff_temp_uq1' => array('uniquename', 'organism_id', 'type_name'),
|
|
|
- ),
|
|
|
- );
|
|
|
- chado_create_custom_table('tripal_gff_temp', $schema, TRUE);
|
|
|
-} */
|
|
|
-
|
|
|
-/**
|
|
|
- *
|
|
|
- */
|
|
|
-// This function was moved to tripal_chado/includes/setup/tripal_chado.setup.inc
|
|
|
-/* function tripal_feature_add_tripal_gffcds_temp_table($skip_recreate = TRUE) {
|
|
|
- $schema = array(
|
|
|
- 'table' => 'tripal_gffcds_temp',
|
|
|
- 'fields' => array(
|
|
|
- 'feature_id' => array(
|
|
|
- 'type' => 'int',
|
|
|
- 'not null' => TRUE,
|
|
|
- ),
|
|
|
- 'parent_id' => array(
|
|
|
- 'type' => 'int',
|
|
|
- 'not null' => TRUE,
|
|
|
- ),
|
|
|
- 'phase' => array(
|
|
|
- 'type' => 'int',
|
|
|
- 'not null' => FALSE,
|
|
|
- ),
|
|
|
- 'strand' => array(
|
|
|
- 'type' => 'int',
|
|
|
- 'not null' => TRUE,
|
|
|
- ),
|
|
|
- 'fmin' => array(
|
|
|
- 'type' => 'int',
|
|
|
- 'not null' => TRUE,
|
|
|
- ),
|
|
|
- 'fmax' => array(
|
|
|
- 'type' => 'int',
|
|
|
- 'not null' => TRUE,
|
|
|
- ),
|
|
|
- ),
|
|
|
- 'indexes' => array(
|
|
|
- 'tripal_gff_temp_idx0' => array('feature_id'),
|
|
|
- 'tripal_gff_temp_idx0' => array('parent_id'),
|
|
|
- ),
|
|
|
- );
|
|
|
- chado_create_custom_table('tripal_gffcds_temp', $schema, $skip_recreate);
|
|
|
-} */
|
|
|
-
|
|
|
-/**
|
|
|
- *
|
|
|
- */
|
|
|
-// This function was moved to tripal_chado/includes/setup/tripal_chado.setup.inc
|
|
|
-/* function tripal_feature_add_tripal_gffprotein_temp_table() {
|
|
|
- $schema = array(
|
|
|
- 'table' => 'tripal_gffprotein_temp',
|
|
|
- 'fields' => array(
|
|
|
- 'feature_id' => array(
|
|
|
- 'type' => 'int',
|
|
|
- 'not null' => TRUE,
|
|
|
- ),
|
|
|
- 'parent_id' => array(
|
|
|
- 'type' => 'int',
|
|
|
- 'not null' => TRUE,
|
|
|
- ),
|
|
|
- 'fmin' => array(
|
|
|
- 'type' => 'int',
|
|
|
- 'not null' => TRUE,
|
|
|
- ),
|
|
|
- 'fmax' => array(
|
|
|
- 'type' => 'int',
|
|
|
- 'not null' => TRUE,
|
|
|
- ),
|
|
|
- ),
|
|
|
- 'indexes' => array(
|
|
|
- 'tripal_gff_temp_idx0' => array('feature_id'),
|
|
|
- 'tripal_gff_temp_idx0' => array('parent_id'),
|
|
|
- ),
|
|
|
- 'unique keys' => array(
|
|
|
- 'tripal_gff_temp_uq0' => array('feature_id'),
|
|
|
- ),
|
|
|
- );
|
|
|
- chado_create_custom_table('tripal_gffprotein_temp', $schema, TRUE);
|
|
|
-} */
|
|
|
-
|
|
|
/**
|
|
|
* Implementation of hook_schema().
|
|
|
*
|
|
@@ -240,76 +119,6 @@ function tripal_feature_schema() {
|
|
|
return $schema;
|
|
|
};
|
|
|
|
|
|
-/**
|
|
|
- * Creates a materialized view that stores the type & number of features per organism
|
|
|
- *
|
|
|
- * @ingroup tripal_feature
|
|
|
- */
|
|
|
-// This function was moved to tripal_chado/includes/setup/tripal_chado.setup.inc
|
|
|
-/* function tripal_feature_add_organism_count_mview() {
|
|
|
- $view_name = 'organism_feature_count';
|
|
|
- $comment = 'Stores the type and number of features per organism';
|
|
|
-
|
|
|
- $schema = array(
|
|
|
- 'description' => $comment,
|
|
|
- 'table' => $view_name,
|
|
|
- 'fields' => array(
|
|
|
- 'organism_id' => array(
|
|
|
- 'size' => 'big',
|
|
|
- 'type' => 'int',
|
|
|
- 'not null' => TRUE,
|
|
|
- ),
|
|
|
- 'genus' => array(
|
|
|
- 'type' => 'varchar',
|
|
|
- 'length' => '255',
|
|
|
- 'not null' => TRUE,
|
|
|
- ),
|
|
|
- 'species' => array(
|
|
|
- 'type' => 'varchar',
|
|
|
- 'length' => '255',
|
|
|
- 'not null' => TRUE,
|
|
|
- ),
|
|
|
- 'common_name' => array(
|
|
|
- 'type' => 'varchar',
|
|
|
- 'length' => '255',
|
|
|
- 'not null' => FALSE,
|
|
|
- ),
|
|
|
- 'num_features' => array(
|
|
|
- 'type' => 'int',
|
|
|
- 'not null' => TRUE,
|
|
|
- ),
|
|
|
- 'cvterm_id' => array(
|
|
|
- 'size' => 'big',
|
|
|
- 'type' => 'int',
|
|
|
- 'not null' => TRUE,
|
|
|
- ),
|
|
|
- 'feature_type' => array(
|
|
|
- 'type' => 'varchar',
|
|
|
- 'length' => '255',
|
|
|
- 'not null' => TRUE,
|
|
|
- ),
|
|
|
- ),
|
|
|
- 'indexes' => array(
|
|
|
- 'organism_feature_count_idx1' => array('organism_id'),
|
|
|
- 'organism_feature_count_idx2' => array('cvterm_id'),
|
|
|
- 'organism_feature_count_idx3' => array('feature_type'),
|
|
|
- ),
|
|
|
- );
|
|
|
-
|
|
|
- $sql = "
|
|
|
- SELECT
|
|
|
- O.organism_id, O.genus, O.species, O.common_name,
|
|
|
- count(F.feature_id) as num_features,
|
|
|
- CVT.cvterm_id, CVT.name as feature_type
|
|
|
- FROM organism O
|
|
|
- INNER JOIN feature F ON O.Organism_id = F.organism_id
|
|
|
- INNER JOIN cvterm CVT ON F.type_id = CVT.cvterm_id
|
|
|
- GROUP BY
|
|
|
- O.Organism_id, O.genus, O.species, O.common_name, CVT.cvterm_id, CVT.name
|
|
|
- ";
|
|
|
-
|
|
|
- tripal_add_mview($view_name, 'tripal_feature', $schema, $sql, $comment);
|
|
|
-} */
|
|
|
/**
|
|
|
* Add cvs related to publications
|
|
|
*
|