function tripal_insert_phylotree

2.x tripal_phylogeny.api.inc tripal_insert_phylotree(&$options, &$errors, &$warnings)
3.x tripal_chado.module.DEPRECATED.api.inc tripal_insert_phylotree(&$options, &$errors, &$warnings)

Inserts a phylotree record into Chado.

This function validates the options passed prior to insertion of the record, and if validation passes then any values in the options array that needed validation lookups (such as the dbxref, analysis, leaf_type, etc) will have their approriate primary key values added to the options array.

Parameters

$options: An array of key value pairs with the following keys required: 'name': The name of the tree. This will be displayed to users. 'description: A description about the tree 'anlaysis_id: The ID of the analysis to which this phylotree should be associated. 'analysis': If the analysis_id key is not used then the analysis name may be provided to identify the analysis to which the tree should be associated. 'leaf_type': A sequence ontology term or the word 'organism'. If the type is 'organism' then this tree represents a taxonomic tree. The default, if not specified, is the term 'polypeptide'. 'tree_file': The path of the file containing the phylogenetic tree to import or a Drupal managed_file numeric ID. 'format': The file format. Currently only 'newick is supported'.

Optional keys: 'dbxref': A database cross-reference of the form DB:ACCESSION. Where DB is the database name, which is already present in Chado, and ACCESSION is the unique identifier for this tree in the remote database. 'name_re': If the leaf type is NOT 'taxonomy', then the value of this field can be a regular expression to pull out the name of the feature from the node label in the intput tree. If no value is provided the entire label is used. 'match': Set to 'uniquename' if the leaf nodes should be matched with the feature uniquename. 'load_now': If set, the tree will be loaded immediately if a tree_file is provided. Otherwise, the tree will be loaded via a Tripal jobs call. 'no_load': If set the tree file will not be loaded.

$errors: An empty array where validation error messages will be set. The keys of the array will be name of the field from the options array and the value is the error message.

$warnings: An empty array where validation warning messagges will be set. The warnings should not stop an insert or an update but should be provided to the user as information by a drupal_set_message() if appropriate. The keys of the array will be name of the field from the options array and the value is the error message.

Return value

TRUE for success and FALSE for failure.

3 calls to tripal_insert_phylotree()
chado_phylotree_insert in legacy/tripal_phylogeny/includes/tripal_phylogeny.chado_node.inc
Implements hook_insert().
drush_tripal_phylogeny_trp_insert_phylotree in legacy/tripal_phylogeny/tripal_phylogeny.drush.inc
Deletes a phylotree record.
TaxonomyImporter::initTree in tripal_chado/includes/TripalImporter/TaxonomyImporter.inc
Create the taxonomic tree in Chado.

File

tripal_chado/api/modules/tripal_chado.module.DEPRECATED.api.inc, line 1052
These api functions are deprecated, if your site is currently using them please update your code with the newer tripal_chado functions.

Code

function tripal_insert_phylotree(&$options, &$errors, &$warnings) {
  chado_insert_phylotree($options, $errors, $warnings);
}