Tripal
Functions
tripal_chado.cv.api.inc File Reference

Functions

 chado_get_cv ($identifiers, $options=[])
 
 chado_get_cv_select_options ()
 
 chado_get_cvterm ($identifiers, $options=[])
 
 chado_get_cvterm_select_options ($cv_id, $rel_type=FALSE)
 
 tripal_update_cvtermpath_old ($cv_id, $job_id=NULL)
 
 chado_clear_cvtermpath ($cv_id)
 
 chado_update_cvtermpath ($cv_id, $job=NULL)
 
 _chado_update_cvtermpath_root ($cv_id, $root_id, $root_name, &$cache, $job, &$num_handled, $root_depth=0)
 
 _chado_update_cvtermpath_process_children ($cv_id, $root_id, $cvterm_id, $path, &$cache, $depth=1)
 
 _chado_update_cvtermpath_add_relationship ($type_id, $cvterm_id, $root_id, $cv_id, $depth)
 
 chado_insert_cv ($name, $definition)
 
 chado_insert_cvterm ($term, $options=[])
 
 chado_submit_obo_job ($obo)
 
 chado_insert_obo ($name, $path)
 
 chado_get_obo ($values)
 
 chado_autocomplete_cv ($string='')
 
 chado_autocomplete_cvterm ($cv_id, $string='')
 
 chado_associate_cvterm ($basetable, $record_id, $cvterm, $options=[])
 

Detailed Description

Provides API functions specifically for managing controlled vocabulary records in Chado.

Function Documentation

◆ _chado_update_cvtermpath_add_relationship()

_chado_update_cvtermpath_add_relationship (   $type_id,
  $cvterm_id,
  $root_id,
  $cv_id,
  $depth 
)

Inserts values into the cvtermpath table.

After the entire tree below the current root term is traversed, this function is called and inserts all of the relationships that were found into the cvtermpath table.

Parameters
$visitedThe array contaiing relationships for all visited nodes in the tree. These elements will become the entries in the cvtermpath table.
$jobThe TripalJob instance.

◆ _chado_update_cvtermpath_process_children()

_chado_update_cvtermpath_process_children (   $cv_id,
  $root_id,
  $cvterm_id,
  $path,
$cache,
  $depth = 1 
)

Handles a single node in the tree.

This is a recursive function which calls itself as the tree is descended. It performs a depth-first search of the tree.

Parameters
$cv_idThe vocaulary Id
$root_idThis root term's cvterm Id.
$cvterm_idThis term's cvterm Id.
$pathAn array used for storing the current path down the tree. This is the sequence of nodes visited to this point down a single branch.
$cacheThe cache used for lookups.
$depthThe current depth in the tree.

◆ _chado_update_cvtermpath_root()

_chado_update_cvtermpath_root (   $cv_id,
  $root_id,
  $root_name,
$cache,
  $job,
$num_handled,
  $root_depth = 0 
)

Treats a term within the ontology as a root.

In order to add all relationships between a term and it's descendents each term gets it's turn as a "root". The first time this function is called it should be called with the actual root's of the ontology. This function will then recursively treat each child term within the tree as a root in order to find all relationships.

Parameters
$cv_idThe vocaulary Id
$root_idThis root term's cvterm Id.
$root_nameThe name of this root term.
$cacheThe cache used for lookups.
$jobThe TripalJob instance.
$num_handledUsed to keep track of the number of nodes that have been handled for progress reporting.
$root_depthThe current depth in the tree of this term.

◆ chado_clear_cvtermpath()

chado_clear_cvtermpath (   $cv_id)
Parameters
unknown$cv_id