function tripal_example_install
2.x tripal_example.install | tripal_example_install() |
Implements hook_install().
Performs actions when the modules is first installed.
File
- tripal_example/
tripal_example.install, line 70 - Installation of the example module
Code
function tripal_example_install() {
// EXPLANATION: Here is a good place to add any materialized views, controlled
// vocabularies CV, databases or CV terms needed by your module.
// To keep this module code short, create functions to do each of those tasks
// add any materialized view
tripal_example_add_mviews();
// add any external databases used by the example module.
tripal_example_add_dbs();
// add any controlled vocabularies used by the example module. You may need
// to add a vocabulary if you to set it as default (see next lines of code).
// For example, the Sequence Ontology (SO) is used by the feature module as
// the default vocabulary for the feature type_id field. But, that vocabulary
// does not yet exist in Chado until after the SO is loaded using the Tripal
// OBO loader. But, we can add it here as a place-holder so that we can then
// set it as a default vocabulary (see below).
tripal_example_add_cvs();
// add any controlled vocabulary terms
tripal_example_add_cvterms();
// EXPLANATION: Many tables in Chado have a 'type_id' column which allows for
// association of controlled vocabularies to describe the record. Chado places
// no restrictions on which vocabularies can be used, but Tripal can be
// instructed to provide a default vocabulary for any given field. For
// example, the feature.type_id column will typically use the Sequence
// Ontology. In that case, we can use the tripal_set_default_cv() function to
// specify the Sequence Ontology (sequence) as the default vocabulary.
tripal_set_default_cv('example', 'type_id', 'example_type');
tripal_set_default_cv('exampleprop', 'type_id', 'example_property');
tripal_set_default_cv('example_relationship', 'type_id', 'example_relationship');
// add any custom tables. For this case we will add an 'example' table to the
// chado schema
tripal_example_add_custom_tables();
}