Browse Source

change to the cv api file that makes the cvtermupdatepath calls internal reference only

Shawna Spoor 6 years ago
parent
commit
360e12b22b

+ 16 - 16
tripal_chado/api/modules/tripal_chado.cv.api.inc

@@ -374,7 +374,7 @@ function tripal_update_cvtermpath_old($cv_id, $job_id = NULL) {
  *
  * Identifies all of the root terms of the controlled vocabulary. These
  * root terms are then processed by calling the
- * chado_update_cvtermpath_root_loop() function on each one.
+ * _chado_update_cvtermpath_root_loop() function on each one.
  *
  * @param $cvid
  *   The controlled vocabulary ID from the cv table of Chado (i.e. cv.cv_id).
@@ -401,7 +401,7 @@ function chado_update_cvtermpath($cv_id, $job_id = NULL){
     $roots = [];
 
     foreach ($record as $item){
-      chado_update_cvtermpath_root_loop($item->cvterm_id, $item->cv_id, $roots);
+      _chado_update_cvtermpath_root_loop($item->cvterm_id, $item->cv_id, $roots);
     }
   }
   catch (Exception $e) {
@@ -427,7 +427,7 @@ function chado_update_cvtermpath($cv_id, $job_id = NULL){
  *
  * @ingroup tripal_chado_cv_api
  */
-function chado_update_cvtermpath_root_loop($rootid, $cvid, &$roots) {
+function _chado_update_cvtermpath_root_loop($rootid, $cvid, &$roots) {
   $ttype = db_query(
     'SELECT cv.cvterm_id 
     FROM cvterm cv
@@ -454,7 +454,7 @@ function chado_update_cvtermpath_root_loop($rootid, $cvid, &$roots) {
   $matched_rows = [];
   $possible_start_of_loop = [];
   $depth = 0;
-  chado_update_cvtermpath_loop($rootid, $rootid, $cvid, $result->cvterm_id, $depth,
+  _chado_update_cvtermpath_loop($rootid, $rootid, $cvid, $result->cvterm_id, $depth,
                                 0, $tree_path, FALSE, $matched_rows, $possible_start_of_loop, FALSE);
 
   // Get's the children terms of this "root" term and then recursively calls
@@ -467,7 +467,7 @@ function chado_update_cvtermpath_root_loop($rootid, $cvid, &$roots) {
     [':rootid' => $rootid]
   );
   while ($cterm_result = $cterm->fetchAssoc()) {
-    chado_update_cvtermpath_root_loop($cterm_result['subject_id'], $cvid, $roots);
+    _chado_update_cvtermpath_root_loop($cterm_result['subject_id'], $cvid, $roots);
   }
 }
 
@@ -511,7 +511,7 @@ function chado_update_cvtermpath_root_loop($rootid, $cvid, &$roots) {
  * 
  * @ingroup tripal_chado_cv_api
  */
-function chado_update_cvtermpath_loop(
+function _chado_update_cvtermpath_loop(
   $origin,
   $child_id,
   $cv_id,
@@ -557,7 +557,7 @@ function chado_update_cvtermpath_loop(
         // and confirmed that this is a loop.
         $possible_loop == FALSE;
         $matched_rows = [];
-        chado_update_cvtermpath_loop_increment($origin, $child_id, $cv_id,
+        _chado_update_cvtermpath_loop_increment($origin, $child_id, $cv_id,
         $type_id, $depth + 1, $increment_of_depth, $tree_path, $possible_loop,
         $new_match_rows, $possible_start_of_loop, $no_loop_skip_test);
 
@@ -594,7 +594,7 @@ function chado_update_cvtermpath_loop(
           // and confirmed that this is a loop.
           $possible_loop == FALSE;
           $matched_rows = [];
-          chado_update_cvtermpath_loop_increment($origin, $child_id, $cv_id,
+          _chado_update_cvtermpath_loop_increment($origin, $child_id, $cv_id,
           $type_id, $depth + 1, $increment_of_depth, $tree_path, $possible_loop,
           $new_match_rows, $possible_start_of_loop, $no_loop_skip_test);
 
@@ -609,7 +609,7 @@ function chado_update_cvtermpath_loop(
       $no_loop_skip_test = TRUE;
       // There is not loop so pass it back the possible_start_of_loop info
       // and a flag telling it to skip the loop check.
-      chado_update_cvtermpath_loop_increment($possible_start_of_loop->subject_id,
+      _chado_update_cvtermpath_loop_increment($possible_start_of_loop->subject_id,
       $possible_start_of_loop->child_id, $possible_start_of_loop->cvid,
       $possible_start_of_loop->type_id, $possible_start_of_loop->depth,
       $increment_of_depth, $tree_path, $possible_loop, $matched_rows,
@@ -617,13 +617,13 @@ function chado_update_cvtermpath_loop(
     }
     // If $match_rows is not empty we need to keep trying rows.
     else {
-      chado_update_cvtermpath_loop_increment($origin, $child_id, $cv_id,
+      _chado_update_cvtermpath_loop_increment($origin, $child_id, $cv_id,
       $type_id, $depth + 1, $increment_of_depth, $tree_path, $possible_loop,
       $match_rows, $possible_start_of_loop, $no_loop_skip_test);
     }
   }
   elseif ($possible_loop === FALSE) {
-    chado_update_cvtermpath_loop_increment($origin, $child_id, $cv_id,
+    _chado_update_cvtermpath_loop_increment($origin, $child_id, $cv_id,
     $type_id, $depth + 1, $increment_of_depth, $tree_path, $possible_loop,
     $matched_rows, $possible_start_of_loop, $no_loop_skip_test);
   }
@@ -670,7 +670,7 @@ function chado_update_cvtermpath_loop(
  * 
  * @ingroup tripal_chado_cv_api
  */
-function chado_update_cvtermpath_loop_increment(
+function _chado_update_cvtermpath_loop_increment(
   $origin,
   $child_id,
   $cv_id,
@@ -787,7 +787,7 @@ function chado_update_cvtermpath_loop_increment(
     $possible_start_of_loop = [];
 
     // Get all of the relationships of this child term, and recursively
-    // call the chado_update_cvtermpath_loop_increment() function to continue
+    // call the _chado_update_cvtermpath_loop_increment() function to continue
     // descending down the tree.
     $query = db_select('cvterm_relationship', 'cvtr')
       ->fields('cvtr')
@@ -797,7 +797,7 @@ function chado_update_cvtermpath_loop_increment(
 
     foreach ($cterm_relationships as $item) {
       $increment_of_depth++;
-      chado_update_cvtermpath_loop_increment($origin, $item->subject_id, $cv_id,
+      _chado_update_cvtermpath_loop_increment($origin, $item->subject_id, $cv_id,
         $item->type_id, $depth + 1, $increment_of_depth, $tree_path, $possible_loop,
         $matched_rows, $possible_start_of_loop, $no_loop_skip_test);
     }
@@ -809,7 +809,7 @@ function chado_update_cvtermpath_loop_increment(
   }
   elseif ($possible_loop === TRUE) {
     // Get all of the relationships of this child term, and recursively
-    // call the chado_update_cvtermpath_loop() function to continue
+    // call the _chado_update_cvtermpath_loop() function to continue
     // descending down the tree.
     $query = db_select('cvterm_relationship', 'cvtr')
       ->fields('cvtr')
@@ -818,7 +818,7 @@ function chado_update_cvtermpath_loop_increment(
     $cterm_relationships = $query->fetchAll();
     foreach ($cterm_relationships as $item) {
       $increment_of_depth++;
-      chado_update_cvtermpath_loop($origin, $item->subject_id, $cv_id,
+      _chado_update_cvtermpath_loop($origin, $item->subject_id, $cv_id,
         $item->type_id, $depth + 1, $increment_of_depth, $tree_path, $possible_loop,
         $matched_rows, $possible_start_of_loop, $no_loop_skip_test);
     }

+ 0 - 115
tripal_chado/api/modules/tripal_chado.module.DEPRECATED.api.inc

@@ -223,121 +223,6 @@ function tripal_update_cvtermpath($cv_id, $job_id = null) {
   chado_update_cvtermpath($cv_id, $job_id);
 }
 
-/**
- *  Duplicate of _fill_cvtermpath4root() stored procedure in Chado.
- *
- *  This function process a "branch" of the ontology.  Initially, the
- *  "root" starts at the top of the tree. But, as the cvtermpath is populated
- *  the "root" becomes terms deeper in the tree.
- *
- * @param $rootid
- *   The term ID from the cvterm table of Chado (i.e. cvterm.cvterm_id).
- * @param $cvid
- *   The controlled vocabulary ID from the cv table of Chado (i.e. cv.cv_id).
- *
- * @ingroup tripal_chado_module_DEPRECATED_api
- */
-function tripal_update_cvtermpath_root_loop($rootid, $cvid, &$roots) {
-  chado_update_cvtermpath_root_loop($rootid, $cvid, $roots);
-}
-
-/**
- *
- * @param $origin
- *   The root terms cvterm_id.
- * @param $child_id
- *   The cvterm_id of the current child term.  The child term is a descendent
- *   of the origin.
- * @param $cv_id
- *   The controlled vocabulary ID from the cv table of Chado (i.e. cv.cv_id).
- * @param $type_id
- *   The relationship type between the origin term and the child.
- * @param $depth
- *   The depth of the recursion.
- * @param $increment_of_depth.
- *   An integer tailing the number of children that have been walked down.
- * @param $tree_path.
- *   The array of every term between the current child and the origin. Each
- *   element in the array is an associative array with the keys:
- *     -build_id: an string identifier for the child that combines the origin,
- *      child cvterm_id,cv_id, and the type_id.
- *     -depth: the depth that a child was inserted into the cvtermpath table.
- * @param $possible_loop
- *    A boolean flag.
- * @param $matched_row
- *    An array of rows that are currently in the cvtermpath table that match the
- *    build_id of the current term trying to be written to the table
- * @param $possible_start_of_ loop
- *    The array of the possible loop item between the current child and the 
- *    origin. Each element in the array is an associative array with the keys:
- *     - cvid : $cv_id
- *     - subject_id:
- *     - child_id : $child_id,
- *     - type_id : $type_id,
- *     - depth : $depth,
- * @param $no_loop_skip_test
- *     A boolean used when the possible loop has been ruled out as a loop.
- * 
- * 
- * @ingroup tripal_chado_module_DEPRECATED_api
- */
-function tripal_update_cvtermpath_loop($origin, $child_id, $cv_id, $type_id,
-  $depth, $increment_of_depth, $tree_path, $possible_loop, $matched_rows,
-  $possible_start_of_loop, $no_loop_skip_test) {
-  chado_update_cvtermpath_loop($origin, $child_id, $cv_id, $type_id, $depth,
-    $increment_of_depth, $tree_path, $possible_loop, $matched_rows,
-    $possible_start_of_loop, $no_loop_skip_test); 
-}
-
-/**
- *
- * @param $origin
- *   The root terms cvterm_id.
- * @param $child_id
- *   The cvterm_id of the current child term.  The child term is a descendent
- *   of the origin.
- * @param $cv_id
- *   The controlled vocabulary ID from the cv table of Chado (i.e. cv.cv_id).
- * @param $type_id
- *   The relationship type between the origin term and the child.
- * @param $depth
- *   The depth of the recursion.
- * @param $increment_of_depth.
- *   An integer.
- * @param $tree_path.
- *   The array of every term between the current child and the origin. Each
- *   element in the array is an associative array with the keys:
- *     -build_id: an string identifier for the child that combines the origin,
- *      child cvterm_id,cv_id, and the type_id.
- *     -depth: the depth that a child was inserted into the cvtermpath table.
- * @param $possible_loop
- *    A boolean flag.
- * @param $matched_row
- *    An array of rows that are currently in the cvtermpath table that match the
- *    build_id of the current term trying to be written to the table
- * @param $possible_start_of_ loop
- *    The array of the possible loop item between the current child and the origin.
- *    Each element in the array is an associative array with the keys:
- *     - cvid : $cv_id
- *     - subject_id:
- *     - child_id : $child_id,
- *     - type_id : $type_id,
- *     - depth : $depth,
- * @param $no_loop_skip_test
- *     A boolean used when the possible loop has been ruled out as a loop.
- * @return multitype: Either a number that represents the row count of existing 
- * rows that already match these specification or a Boolean false.
- * 
- * @ingroup tripal_chado_module_DEPRECATED_api
- */
-function tripal_update_cvtermpath_loop_increment($origin, $child_id, $cv_id,
-  $type_id, $depth, $increment_of_depth, $tree_path, $possible_loop, $matched_rows,
-  &$possible_start_of_loop, $no_loop_skip_test) {
-  chado_update_cvtermpath_loop_increment($origin, $child_id, $cv_id, $type_id,
-    $depth, $increment_of_depth, $tree_path, $possible_loop, $matched_rows,
-    $possible_start_of_loop, $no_loop_skip_test);
-}
-
 /**
  * Adds a controlled vocabulary to the CV table of Chado.
  *