function tripal_phylogeny_install

2.x tripal_phylogeny.install tripal_phylogeny_install()
3.x tripal_phylogeny.install tripal_phylogeny_install()

Implements hook_install().

Related topics

File

legacy/tripal_phylogeny/tripal_phylogeny.install, line 12
Installation of the phylotree module

Code

function tripal_phylogeny_install() {

  // Add the vocabularies used by the feature module.
  tripal_phylogeny_add_cvterms();

  // Set the default vocabularies.
  tripal_set_default_cv('phylonode', 'type_id', 'tripal_phylogeny');
  tripal_set_default_cv('phylotree', 'type_id', 'sequence');

  // Add the materializedviews.
  tripal_phylogeny_add_mview();

  // We want to integrate the materialized views so that they
  // are available for Drupal Views, upon which our search forms are built.
  tripal_phylogeny_integrate_view();
  $mview_id = tripal_get_mview_id('phylotree_count');

  // SPF: commented out automatic populate of MView.  If the query fails
  // for some reason the install will not properly complete.
  // tripal_populate_mview($mview_id);

  // Add the custom tables.
  tripal_phylogeny_add_custom_tables();

  // Add an index on the phylonode table.
  $exists = chado_index_exists('phylonode', 'parent_phylonode_id');
  if (!$exists) {
    chado_add_index('phylonode', 'parent_phylonode_id', array('parent_phylonode_id'));
  }

  // Add in the variables that this module will use to store properties for
  // loading of the tree files.
  tripal_insert_variable('phylotree_name_re', 'The regular expression for matching a name in a string.');
  tripal_insert_variable('phylotree_use_uniquename', 'Set to 1 if features should be matched using the unqiuename rather than the name.');
  tripal_insert_variable('phylotree_tree_file', 'Holds the Drupal file ID for the uploaded tree file.');
}