function tripal_phylogeny_import_tree

2.x tripal_phylogeny.import_tree.inc tripal_phylogeny_import_tree(&$tree, $phylotree, $options, $vocab = array(), $parent = NULL)
3.x tripal_chado.module.DEPRECATED.api.inc tripal_phylogeny_import_tree(&$tree, $phylotree, $options, $vocab = array(), $parent = null)

Iterates through the tree array and creates phylonodes in Chado.

The function iterates through the tree in a top-down approach adding parent internal nodes prior to leaf nodes. Each node of the tree should have the following fields:

-name: The name (or label) for this node. -depth: The depth of the node in the tree. -is_root: Set to 1 if this node is a root node. -is_leaf: Set to 1 if this node is a leaf node. -is_internal: Set to 1 if this node is an internal node. -left_index: The index of the node to the left in the tree. -right_index: The index of the node to the right in the tree. -branch_set: An array containing a list of nodes of that are children of the node. -parent: The name of the parent node. -organism_id: The organism_id for associtating the node with an organism. -properties: An array of key/value pairs where the key is the cvterm_id and the value is the property value. These properties will be assocaited with the phylonode.

Prior to importing the tree the indicies can be set by using the chado_assign_phylogeny_tree_indices() function.

Parameters

$tree: The tree array.

$phylotree.: The phylotree object (from Chado).

$options: The options provide some direction for how the tree is imported. The following keys can be used: -taxonomy: Set to 1 if this tree is a taxonomic tree. Set to 0 otherwise. -leaf_type: Set to the leaf type name. If this is a non-taxonomic tree that is associated with features, then this should be the Sequence Ontology term for the feature (e.g. polypeptide). If this is a taxonomic tree then this option is not needed. -match: Set to either 'name' or 'uniquename'. This is used for matching the feature name or uniquename with the node name. This is not needed for taxonomic trees. -match_re: Set to a regular that can be used for matching the node name with the feature name if the node name is not identical to the feature name.

$vocab: Optional. An array containing a set of key/value pairs that maps node types to CV terms. The keys must be 'root', 'internal' or 'leaf'. If no vocab is provded then the terms provided by the tripal_phylogeny CV will be used.

$parent: This argument is not needed when the funtion is first called. This function is recursive and this argument is used on recursive calls.

File

tripal_chado/api/modules/tripal_chado.module.DEPRECATED.api.inc, line 1190
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_phylogeny_import_tree(&$tree, $phylotree, $options, $vocab = array(), $parent = null) {
  chado_phylogeny_import_tree($tree, $phylotree, $options, $vocab, $parent);
}