function tripal_phylogeny_add_cvterms
2.x tripal_phylogeny.install | tripal_phylogeny_add_cvterms() |
3.x tripal_phylogeny.install | tripal_phylogeny_add_cvterms() |
Adds controlled vocabulary terms needed by this module.
Related topics
2 calls to tripal_phylogeny_add_cvterms()
- tripal_phylogeny_install in tripal_phylogeny/
tripal_phylogeny.install - Implements hook_install().
- tripal_phylogeny_update_7200 in tripal_phylogeny/
tripal_phylogeny.install - Adds the vocabulary needed for storing taxonmies.
File
- tripal_phylogeny/
tripal_phylogeny.install, line 130 - Installation of the phylotree module
Code
function tripal_phylogeny_add_cvterms() {
tripal_insert_cv(
'tripal_phylogeny',
'Terms used by the Tripal phylotree module for phylogenetic and taxonomic trees.'
);
// Add the terms used to identify nodes in the tree.
tripal_insert_cvterm(
array(
'name' => 'phylo_leaf',
'definition' => 'A leaf node in a phylogenetic tree.',
'cv_name' => 'tripal_phylogeny',
'is_relationship' => 0,
'db_name' => 'tripal'
),
array('update_existing' => TRUE)
);
// Add the terms used to identify nodes in the tree.
tripal_insert_cvterm(
array(
'name' => 'phylo_root',
'definition' => 'The root node of a phylogenetic tree.',
'cv_name' => 'tripal_phylogeny',
'is_relationship' => 0,
'db_name' => 'tripal'
),
array('update_existing' => TRUE)
);
// Add the terms used to identify nodes in the tree.
tripal_insert_cvterm(
array(
'name' => 'phylo_interior',
'definition' => 'An interior node in a phylogenetic tree.',
'cv_name' => 'tripal_phylogeny',
'is_relationship' => 0,
'db_name' => 'tripal'
),
array('update_existing' => TRUE)
);
// Add the terms used to identify nodes in the tree.
tripal_insert_cvterm(
array(
'name' => 'taxonomy',
'definition' => 'A term used to indicate if a phylotree is a taxonomic tree',
'cv_name' => 'tripal_phylogeny',
'is_relationship' => 0,
'db_name' => 'tripal'
),
array('update_existing' => TRUE)
);
tripal_insert_cvterm(
array(
'name' => 'rank',
'definition' => 'A taxonmic rank',
'cv_name' => 'tripal_phylogeny',
'is_relationship' => 0,
'db_name' => 'tripal'
),
array('update_existing' => TRUE)
);
// // ----------------------------------------------
// // Add the terms for importing NCBI taxonomy data
// $values = array(
// 'name' => 'taxonomy',
// 'description' => 'The NCBI Taxonomy Database is a curated classification and nomenclature for all of the organisms in the public sequence databases. This currently represents about 10% of the described species of life on the planet.',
// 'url' => 'http://www.ncbi.nlm.nih.gov/taxonomy',
// 'urlprefix' => 'http://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?id=',
// );
// tripal_insert_db($values);
// tripal_insert_cv('taxonomy', 'A taxonomy for NCBI taxonomy ranks');
// $terms = array('rank', 'taxid', 'class', 'cohort', 'family', 'forma', 'genus', 'infraclass',
// 'infraorder', 'kingdom', 'no rank', 'order', 'parvorder', 'phylum',
// 'species', 'species group', 'species subgroup', 'subclass', 'subcohort',
// 'subfamily', 'subgenus', 'subkingdom', 'suborder', 'subphylum',
// 'subspecies', 'subtribe', 'superclass', 'superfamily', 'superkingdom',
// 'superorder', 'superphylum', 'tribe', 'varietas');
// $options = array('update_existing' => TRUE);
// foreach ($terms as $term) {
// $value = array(
// 'name' => $term,
// 'definition' => '',
// 'cv_name' => 'taxonomy',
// 'is_relationship' => 0,
// 'db_name' => 'taxonomy'
// );
// tripal_insert_cvterm($value, $options);
// }
$terms = array(
'lineage',
'genetic_code',
'genetic_code_name',
'mitochondrial_genetic_code',
'mitochondrial_genetic_code_name',
'division',
'genbank_common_name',
'synonym',
'other_name',
'equivalent_name',
'anamorph'
);
$options = array('update_existing' => TRUE);
foreach ($terms as $term) {
$value = array(
'name' => $term,
'definition' => '',
'cv_name' => 'organism_property',
'is_relationship' => 0,
'db_name' => 'tripal'
);
tripal_insert_cvterm($value, $options);
}
}