浏览代码

changes to bring the tripal chado api module files into naming standards setout in ticket 330

Shawna Spoor 6 年之前
父节点
当前提交
d4ccef15fc
共有 53 个文件被更改,包括 2201 次插入519 次删除
  1. 4 4
      tripal_chado/api/modules/tripal_chado.analysis.api.inc
  2. 4 4
      tripal_chado/api/modules/tripal_chado.contact.api.inc
  3. 57 55
      tripal_chado/api/modules/tripal_chado.cv.api.inc
  4. 22 22
      tripal_chado/api/modules/tripal_chado.db.api.inc
  5. 22 22
      tripal_chado/api/modules/tripal_chado.feature.api.inc
  6. 1678 0
      tripal_chado/api/modules/tripal_chado.module.DEPRECATED.api.inc
  7. 13 13
      tripal_chado/api/modules/tripal_chado.organism.api.inc
  8. 21 21
      tripal_chado/api/modules/tripal_chado.phylotree.api.inc
  9. 16 16
      tripal_chado/api/modules/tripal_chado.pub.api.inc
  10. 9 9
      tripal_chado/api/modules/tripal_chado.stock.api.inc
  11. 7 7
      tripal_chado/api/tripal_chado.DEPRECATED.api.inc
  12. 4 4
      tripal_chado/api/tripal_chado.api.inc
  13. 2 2
      tripal_chado/api/tripal_chado.custom_tables.api.inc
  14. 7 7
      tripal_chado/api/tripal_chado.semweb.api.inc
  15. 3 3
      tripal_chado/includes/TripalFields/chado_linker__prop/chado_linker__prop.inc
  16. 1 1
      tripal_chado/includes/TripalFields/chado_linker__prop/chado_linker__prop_widget.inc
  17. 2 2
      tripal_chado/includes/TripalFields/data__accession/data__accession_widget.inc
  18. 5 5
      tripal_chado/includes/TripalFields/data__sequence/data__sequence.inc
  19. 1 1
      tripal_chado/includes/TripalFields/go__gene_expression/go__gene_expression.inc
  20. 1 1
      tripal_chado/includes/TripalFields/obi__organism/obi__organism_widget.inc
  21. 1 1
      tripal_chado/includes/TripalFields/sbo__database_cross_reference/sbo__database_cross_reference.inc
  22. 2 2
      tripal_chado/includes/TripalFields/sbo__database_cross_reference/sbo__database_cross_reference_formatter.inc
  23. 1 1
      tripal_chado/includes/TripalFields/sbo__database_cross_reference/sbo__database_cross_reference_widget.inc
  24. 5 5
      tripal_chado/includes/TripalFields/sbo__relationship/sbo__relationship.inc
  25. 7 7
      tripal_chado/includes/TripalFields/sbo__relationship/sbo__relationship_widget.inc
  26. 2 2
      tripal_chado/includes/TripalFields/schema__additional_type/schema__additional_type_widget.inc
  27. 1 1
      tripal_chado/includes/TripalFields/schema__publication/schema__publication.inc
  28. 1 1
      tripal_chado/includes/TripalFields/schema__publication/schema__publication_widget.inc
  29. 1 1
      tripal_chado/includes/TripalFields/sio__annotation/sio__annotation_formatter.inc
  30. 2 2
      tripal_chado/includes/TripalFields/sio__annotation/sio__annotation_widget.inc
  31. 1 1
      tripal_chado/includes/TripalFields/sio__references/sio__references.inc
  32. 1 1
      tripal_chado/includes/TripalFields/sio__vocabulary/sio__vocabulary_widget.inc
  33. 2 2
      tripal_chado/includes/TripalFields/so__cds/so__cds.inc
  34. 2 2
      tripal_chado/includes/TripalFields/taxrank__infraspecific_taxon/taxrank__infraspecific_taxon_widget.inc
  35. 2 2
      tripal_chado/includes/TripalFields/uo__unit/uo__unit_widget.inc
  36. 5 5
      tripal_chado/includes/TripalImporter/GFF3Importer.inc
  37. 3 3
      tripal_chado/includes/TripalImporter/NewickImporter.inc
  38. 16 16
      tripal_chado/includes/TripalImporter/OBOImporter.inc
  39. 13 13
      tripal_chado/includes/TripalImporter/TaxonomyImporter.inc
  40. 1 1
      tripal_chado/includes/exporters/tripal_chado.seq_extract.inc
  41. 1 1
      tripal_chado/includes/loaders/tripal_chado.pub_importer_AGL.inc
  42. 3 3
      tripal_chado/includes/loaders/tripal_chado.pub_importer_PMID.inc
  43. 7 7
      tripal_chado/includes/loaders/tripal_chado.pub_importers.inc
  44. 8 8
      tripal_chado/includes/loaders/tripal_cv.owl_loader.php
  45. 6 6
      tripal_chado/includes/setup/tripal_chado.setup.inc
  46. 4 4
      tripal_chado/includes/tripal_chado.cv.inc
  47. 3 3
      tripal_chado/includes/tripal_chado.field_storage.inc
  48. 131 131
      tripal_chado/includes/tripal_chado.semweb.inc
  49. 1 1
      tripal_chado/includes/tripal_chado.seq_extract.inc
  50. 3 3
      tripal_chado/includes/tripal_chado.vocab_storage.inc
  51. 3 3
      tripal_chado/tripal_chado.drush.inc
  52. 75 75
      tripal_chado/tripal_chado.install
  53. 8 6
      tripal_chado/tripal_chado.module

+ 4 - 4
tripal_chado/api/modules/tripal_chado.analysis.api.inc

@@ -42,7 +42,7 @@
  *
  * @ingroup tripal_analysis_api
  */
-function tripal_get_analysis($identifier, $options) {
+function chado_get_analysis($identifier, $options) {
 
   // Set Defaults
   if (!isset($options['include_fk'])) {
@@ -102,7 +102,7 @@ function tripal_get_analysis($identifier, $options) {
     tripal_report_error(
       'tripal_analysis_api',
       TRIPAL_ERROR,
-      "tripal_get_analysis: The identifiers you passed in were not unique. You passed in %identifier.",
+      "chado_get_analysis: The identifiers you passed in were not unique. You passed in %identifier.",
       array(
         '%identifier'=> print_r($identifiers, TRUE)
       )
@@ -115,7 +115,7 @@ function tripal_get_analysis($identifier, $options) {
     tripal_report_error(
       'tripal_analysis_api',
       TRIPAL_ERROR,
-      "tripal_get_analysis: chado_generate_var() failed to return a analysis based on the identifiers
+      "chado_get_analysis: chado_generate_var() failed to return a analysis based on the identifiers
         you passed in. You should check that your identifiers are correct, as well as, look
         for a chado_generate_var error for additional clues. You passed in %identifier.",
       array(
@@ -142,7 +142,7 @@ function tripal_get_analysis($identifier, $options) {
  *
  * @ingroup tripal_analysis_api
  */
-function tripal_get_analysis_select_options($syncd_only = TRUE) {
+function chado_get_analysis_select_options($syncd_only = TRUE) {
   $analysis_list = array();
   $analysis_list[] = 'Select an analysis';
 

+ 4 - 4
tripal_chado/api/modules/tripal_chado.contact.api.inc

@@ -33,7 +33,7 @@
  *
  * @ingroup tripal_contact_api
  */
-function tripal_insert_contact($values) {
+function chado_insert_contact($values) {
 
   $name = $values['name'];
   $description = $values['description'];
@@ -46,7 +46,7 @@ function tripal_insert_contact($values) {
   $contact = chado_select_record('contact', array('contact_id'), $values, $options);
 
   if (count($contact) == 0) {
-    $cvterm = tripal_get_cvterm(array(
+    $cvterm = chado_get_cvterm(array(
       'name' => $type,
       'cv_id' => array('name' => 'tripal_contact')
     ));
@@ -123,7 +123,7 @@ function tripal_insert_contact($values) {
  *
  * @ingroup tripal_contact_api
  */
-function tripal_autocomplete_contact($text) {
+function chado_autocomplete_contact($text) {
   $matches = array();
 
   $sql = "SELECT * FROM {contact} WHERE lower(name) like lower(:name) ";
@@ -141,4 +141,4 @@ function tripal_autocomplete_contact($text) {
     $items[$contact->name] = $contact->name;
   }
   drupal_json_output($items);
-}
+}

+ 57 - 55
tripal_chado/api/modules/tripal_chado.cv.api.inc

@@ -38,7 +38,7 @@
  *
  * @ingroup tripal_chado_cv_api
  */
-function tripal_get_cv($identifiers, $options = array()) {
+function chado_get_cv($identifiers, $options = array()) {
 
   // Set Defaults.
   if (!isset($options['include_fk'])) {
@@ -51,7 +51,7 @@ function tripal_get_cv($identifiers, $options = array()) {
     tripal_report_error(
       'tripal_chado_api',
       TRIPAL_ERROR,
-      "tripal_get_cv: The identifier passed in is expected to be an array with the key
+      "chado_get_cv: The identifier passed in is expected to be an array with the key
         matching a column name in the cv table (ie: cv_id or name). You passed in %identifier.",
       array(
         '%identifier'=> print_r($identifiers, TRUE)
@@ -62,7 +62,7 @@ function tripal_get_cv($identifiers, $options = array()) {
     tripal_report_error(
       'tripal_chado_api',
       TRIPAL_ERROR,
-      "tripal_get_cv: You did not pass in anything to identify the cv you want. The identifier
+      "chado_get_cv: You did not pass in anything to identify the cv you want. The identifier
         is expected to be an array with the key matching a column name in the cv table
         (ie: cv_id or name). You passed in %identifier.",
       array(
@@ -83,7 +83,7 @@ function tripal_get_cv($identifiers, $options = array()) {
     tripal_report_error(
       'tripal_chado_api',
       TRIPAL_ERROR,
-      "tripal_get_cv: The identifiers you passed in were not unique. You passed in %identifier.",
+      "chado_get_cv: The identifiers you passed in were not unique. You passed in %identifier.",
       array(
         '%identifier'=> print_r($identifiers, TRUE)
       )
@@ -95,7 +95,7 @@ function tripal_get_cv($identifiers, $options = array()) {
     tripal_report_error(
       'tripal_chado_api',
       TRIPAL_ERROR,
-      "tripal_get_cv: chado_generate_var() failed to return a cv based on the identifiers
+      "chado_get_cv: chado_generate_var() failed to return a cv based on the identifiers
         you passed in. You should check that your identifiers are correct, as well as, look
         for a chado_generate_var error for additional clues. You passed in %identifier.",
       array(
@@ -119,7 +119,7 @@ function tripal_get_cv($identifiers, $options = array()) {
  *
  * @ingroup tripal_chado_cv_api
  */
-function tripal_get_cv_select_options() {
+function chado_get_cv_select_options() {
 
   $results = chado_select_record('cv', array('cv_id', 'name'), array(), array('order_by' => array('name' => 'ASC')));
 
@@ -168,7 +168,7 @@ function tripal_get_cv_select_options() {
  *
  * @ingroup tripal_chado_cv_api
  */
-function tripal_get_cvterm($identifiers, $options = array()) {
+function chado_get_cvterm($identifiers, $options = array()) {
 
   // Set Defaults.
   if (!isset($options['include_fk'])) {
@@ -179,14 +179,14 @@ function tripal_get_cvterm($identifiers, $options = array()) {
   // Error Checking of parameters.
   if (!is_array($identifiers)) {
     tripal_report_error('tripal_cv_api', TRIPAL_ERROR,
-      "tripal_get_cvterm: The identifier passed in is expected to be an array with the key
+      "chado_get_cvterm: The identifier passed in is expected to be an array with the key
         matching a column name in the cvterm table (ie: cvterm_id or name). You passed in %identifier.",
       array('%identifier'=> print_r($identifiers, TRUE))
     );
   }
   elseif (empty($identifiers)) {
     tripal_report_error('tripal_cv_api', TRIPAL_ERROR,
-      "tripal_get_cvterm: You did not pass in anything to identify the cvterm you want. The identifier
+      "chado_get_cvterm: You did not pass in anything to identify the cvterm you want. The identifier
         is expected to be an array with the key matching a column name in the cvterm table
         (ie: cvterm_id or name). You passed in %identifier.",
       array('%identifier'=> print_r($identifiers, TRUE))
@@ -256,7 +256,7 @@ function tripal_get_cvterm($identifiers, $options = array()) {
     tripal_report_error(
       'tripal_cv_api',
       TRIPAL_ERROR,
-      "tripal_get_cvterm: The identifiers you passed in were not unique. You passed in %identifier.",
+      "chado_get_cvterm: The identifiers you passed in were not unique. You passed in %identifier.",
       array(
         '%identifier'=> print_r($identifiers, TRUE)
       )
@@ -269,7 +269,7 @@ function tripal_get_cvterm($identifiers, $options = array()) {
     tripal_report_error(
       'tripal_cv_api',
       TRIPAL_ERROR,
-      "tripal_get_cvterm: chado_generate_var() failed to return a cvterm based on the identifiers
+      "chado_get_cvterm: chado_generate_var() failed to return a cvterm based on the identifiers
         you passed in. You should check that your identifiers are correct, as well as, look
         for a chado_generate_var error for additional clues. You passed in %identifier.",
       array(
@@ -302,7 +302,7 @@ function tripal_get_cvterm($identifiers, $options = array()) {
  *
  * @ingroup tripal_chado_cv_api
  */
-function tripal_get_cvterm_select_options($cv_id, $rel_type = FALSE) {
+function chado_get_cvterm_select_options($cv_id, $rel_type = FALSE) {
   $columns = array('cvterm_id', 'name');
   $values = array('cv_id' => $cv_id);
   if ($rel_type) {
@@ -368,7 +368,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
- * tripal_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).
@@ -376,7 +376,7 @@ function tripal_update_cvtermpath_old($cv_id, $job_id = NULL) {
  *
  * @ingroup tripal_chado_cv_api
  */
-function tripal_update_cvtermpath($cv_id, $job_id = NULL){
+function chado_update_cvtermpath($cv_id, $job_id = NULL){
   // TODO: there's a function to determine the current Chado instance.
   // we should use that.
   $prev_db = chado_set_active('chado');
@@ -395,7 +395,7 @@ function tripal_update_cvtermpath($cv_id, $job_id = NULL){
     $roots = [];
 
     foreach ($record as $item){
-      tripal_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) {
@@ -421,7 +421,7 @@ function tripal_update_cvtermpath($cv_id, $job_id = NULL){
  *
  * @ingroup tripal_chado_cv_api
  */
-function tripal_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
@@ -448,7 +448,7 @@ function tripal_update_cvtermpath_root_loop($rootid, $cvid, &$roots) {
   $matched_rows = [];
   $possible_start_of_loop = [];
   $depth = 0;
-  tripal_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
@@ -461,7 +461,7 @@ function tripal_update_cvtermpath_root_loop($rootid, $cvid, &$roots) {
     [':rootid' => $rootid]
   );
   while ($cterm_result = $cterm->fetchAssoc()) {
-    tripal_update_cvtermpath_root_loop($cterm_result['subject_id'], $cvid, $roots);
+    chado_update_cvtermpath_root_loop($cterm_result['subject_id'], $cvid, $roots);
   }
 }
 
@@ -505,7 +505,7 @@ function tripal_update_cvtermpath_root_loop($rootid, $cvid, &$roots) {
  * 
  * @ingroup tripal_chado_cv_api
  */
-function tripal_update_cvtermpath_loop(
+function chado_update_cvtermpath_loop(
   $origin,
   $child_id,
   $cv_id,
@@ -551,7 +551,7 @@ function tripal_update_cvtermpath_loop(
         // and confirmed that this is a loop.
         $possible_loop == FALSE;
         $matched_rows = [];
-        tripal_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);
 
@@ -588,7 +588,7 @@ function tripal_update_cvtermpath_loop(
           // and confirmed that this is a loop.
           $possible_loop == FALSE;
           $matched_rows = [];
-          tripal_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);
 
@@ -603,7 +603,7 @@ function tripal_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.
-      tripal_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,
@@ -611,13 +611,13 @@ function tripal_update_cvtermpath_loop(
     }
     // If $match_rows is not empty we need to keep trying rows.
     else {
-      tripal_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) {
-    tripal_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);
   }
@@ -664,7 +664,7 @@ function tripal_update_cvtermpath_loop(
  * 
  * @ingroup tripal_chado_cv_api
  */
-function tripal_update_cvtermpath_loop_increment(
+function chado_update_cvtermpath_loop_increment(
   $origin,
   $child_id,
   $cv_id,
@@ -772,7 +772,7 @@ function tripal_update_cvtermpath_loop_increment(
     $possible_start_of_loop = [];
 
     // Get all of the relationships of this child term, and recursively
-    // call the tripal_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')
@@ -782,7 +782,7 @@ function tripal_update_cvtermpath_loop_increment(
 
     foreach ($cterm_relationships as $item) {
       $increment_of_depth++;
-      tripal_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);
     }
@@ -794,7 +794,7 @@ function tripal_update_cvtermpath_loop_increment(
   }
   elseif ($possible_loop === TRUE) {
     // Get all of the relationships of this child term, and recursively
-    // call the tripal_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')
@@ -803,7 +803,7 @@ function tripal_update_cvtermpath_loop_increment(
     $cterm_relationships = $query->fetchAll();
     foreach ($cterm_relationships as $item) {
       $increment_of_depth++;
-      tripal_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);
     }
@@ -822,9 +822,9 @@ function tripal_update_cvtermpath_loop_increment(
  * @return
  *   An object populated with fields from the newly added database.
  *
- * @ingroup tripal_chado_api
+ * @ingroup tripal_chado_cv_api
  */
-function tripal_insert_cv($name, $definition) {
+function chado_insert_cv($name, $definition) {
 
   // Insert/update values.
   $ins_values = array(
@@ -901,9 +901,9 @@ function tripal_insert_cv($name, $definition) {
  * @return
  *   A cvterm object
  *
- * @ingroup tripal_chado_api
+ * @ingroup tripal_chado_cv_api
  */
-function tripal_insert_cvterm($term, $options = array()) {
+function chado_insert_cvterm($term, $options = array()) {
 
   // Get the term properties.
   $id = (isset($term['id'])) ? $term['id'] : '';
@@ -997,9 +997,9 @@ function tripal_insert_cvterm($term, $options = array()) {
   }
 
   // Make sure the CV name exists.
-  $cv = tripal_get_cv(array('name' => $cvname));
+  $cv = chado_get_cv(array('name' => $cvname));
   if (!$cv) {
-    $cv = tripal_insert_cv($cvname, '');
+    $cv = chado_insert_cv($cvname, '');
   }
   if (!$cv) {
     tripal_report_error('tripal_cv', TRIPAL_WARNING, "Cannot find namespace '$cvname' when adding/updating $id", NULL);
@@ -1022,9 +1022,9 @@ function tripal_insert_cvterm($term, $options = array()) {
 
   // Add the database. The function will just return the DB object if the
   // database already exists.
-  $db = tripal_get_db(array('name' => $dbname));
+  $db = chado_get_db(array('name' => $dbname));
   if (!$db) {
-    $db = tripal_insert_db(array('name' => $dbname));
+    $db = chado_insert_db(array('name' => $dbname));
   }
   if (!$db) {
     tripal_report_error('tripal_cv', TRIPAL_WARNING, "Cannot find database '$dbname' in Chado.", NULL);
@@ -1103,7 +1103,7 @@ function tripal_insert_cvterm($term, $options = array()) {
     if ($dbxref->accession != $accession) {
 
       // Get/add the dbxref for his term.
-      $dbxref_new =  tripal_insert_dbxref(array(
+      $dbxref_new = chado_insert_dbxref(array(
         'db_id' => $db->db_id,
         'accession' => $accession
       ));
@@ -1148,7 +1148,7 @@ function tripal_insert_cvterm($term, $options = array()) {
   if (!$cvterm) {
 
     // Check to see if the dbxref exists if not, add it.
-    $dbxref =  tripal_insert_dbxref(array(
+    $dbxref = chado_insert_dbxref(array(
       'db_id' => $db->db_id,
       'accession' => $accession
     ));
@@ -1222,7 +1222,7 @@ function tripal_insert_cvterm($term, $options = array()) {
     if (!$check) {
 
       // Check to see if the dbxref exists if not, add it.
-      $dbxref =  tripal_insert_dbxref(array(
+      $dbxref = chado_insert_dbxref(array(
         'db_id' => $db->db_id,
         'accession' => $accession
       ));
@@ -1288,9 +1288,9 @@ function tripal_insert_cvterm($term, $options = array()) {
  * @return
  *   returns the job_id of the submitted job or FALSE if the job was not added
  *
- * @ingroup tripal_chado_api
+ * @ingroup tripal_chado_cv_api
  */
-function tripal_submit_obo_job($obo) {
+function chado_submit_obo_job($obo) {
   global $user;
 
   // Set Defaults
@@ -1345,9 +1345,9 @@ function tripal_submit_obo_job($obo) {
  * @return
  *   Returns the ontology ID.
  *
- * @ingroup tripal_chado_api
+ * @ingroup tripal_chado_cv_api
  */
-function tripal_insert_obo($name, $path) {
+function chado_insert_obo($name, $path) {
   // Make sure an OBO with the same name doesn't already exist.
   $obo_id = db_select('tripal_cv_obo', 'tco')
     ->fields('tco', array('obo_id'))
@@ -1383,8 +1383,10 @@ function tripal_insert_obo($name, $path) {
  *
  * @return
  *   An instance of an OBO record object.
+ * 
+ * @ingroup tripal_chado_cv_api
  */
-function tripal_get_obo($values) {
+function chado_get_obo($values) {
   $query = db_select('tripal_cv_obo', 'tco')
     ->fields('tco');
 
@@ -1408,9 +1410,9 @@ function tripal_get_obo($values) {
  * @return
  * A json array of terms that begin with the provided string.
  *
- * @ingroup tripal_chado_api
+ * @ingroup tripal_chado_cv_api
  */
-function tripal_autocomplete_cv($string = '') {
+function chado_autocomplete_cv($string = '') {
   $sql = "
     SELECT CV.cv_id, CV.name
     FROM {cv} CV
@@ -1439,9 +1441,9 @@ function tripal_autocomplete_cv($string = '') {
  * @return
  * A json array of terms that begin with the provided string.
  *
- * @ingroup tripal_chado_api
+ * @ingroup tripal_chado_cv_api
  */
-function tripal_autocomplete_cvterm($cv_id, $string = '') {
+function chado_autocomplete_cvterm($cv_id, $string = '') {
   if ($cv_id) {
     $sql = "
       SELECT CVT.cvterm_id, CVT.name
@@ -1508,9 +1510,9 @@ function tripal_autocomplete_cvterm($cv_id, $string = '') {
  *     - insert_cvterm: Insert the cvterm if it doesn't already exist. FALSE is 
  *       the default.
  *
- * @ingroup tripal_chado_api
+ * @ingroup tripal_chado_cv_api
  */
-function tripal_associate_cvterm($basetable, $record_id, $cvterm, $options = array()) {
+function chado_associate_cvterm($basetable, $record_id, $cvterm, $options = array()) {
   $linking_table = $basetable . '_cvterm';
   $foreignkey_name = $basetable . '_id';
 
@@ -1533,7 +1535,7 @@ function tripal_associate_cvterm($basetable, $record_id, $cvterm, $options = arr
     }
     else {
       tripal_report_error('tripal_chado_api', TRIPAL_WARNING,
-        "tripal_associate_cvterm: The cvterm needs to have either the cv_name or cv_id
+        "chado_associate_cvterm: The cvterm needs to have either the cv_name or cv_id
           supplied. You were trying to associate a cvterm with the %base %record_id
           and supplied the cvterm values: %cvterm.",
         array('%base' => $basetable, '%record_id' => $record_id, '%cvterm' => print_r($cvterm,TRUE))
@@ -1549,13 +1551,13 @@ function tripal_associate_cvterm($basetable, $record_id, $cvterm, $options = arr
     }
     elseif ($options['insert_cvterm']) {
       // Insert the cvterm
-      $insert = tripal_insert_cvterm($values);
+      $insert = chado_insert_cvterm($values);
       if (isset($insert->cvterm_id)) {
         $cvterm['cvterm_id'] = $insert->cvterm_id;
       }
       else {
         tripal_report_error('tripal_chado_api', TRIPAL_WARNING,
-          "tripal_associate_cvterm: Unable to insert the cvterm using the cvterm values: %cvterm.",
+          "chado_associate_cvterm: Unable to insert the cvterm using the cvterm values: %cvterm.",
           array('%cvterm' => print_r($cvterm,TRUE))
         );
         return FALSE;
@@ -1563,7 +1565,7 @@ function tripal_associate_cvterm($basetable, $record_id, $cvterm, $options = arr
     }
     else {
       tripal_report_error('tripal_api', TRIPAL_WARNING,
-        "tripal_associate_cvterm: The cvterm doesn't already exist. You supplied the cvterm values: %cvterm.",
+        "chado_associate_cvterm: The cvterm doesn't already exist. You supplied the cvterm values: %cvterm.",
         array('%cvterm' => print_r($cvterm,TRUE))
       );
       return FALSE;

+ 22 - 22
tripal_chado/api/modules/tripal_chado.db.api.inc

@@ -20,7 +20,7 @@
  *   $select_values = array(
  *     'name' => 'SOFP'
  *   );
- *   $db_object = tripal_get_db($select_values);
+ *   $db_object = chado_get_db($select_values);
  * @endcode
  *  The above code selects the SOFP db and returns the following object:
  * @code
@@ -54,7 +54,7 @@
  *
  * @ingroup tripal_chado_database_api
  */
-function tripal_get_db($identifiers, $options = array()) {
+function chado_get_db($identifiers, $options = array()) {
 
   // Set Defaults.
   if (!isset($options['include_fk'])) {
@@ -67,7 +67,7 @@ function tripal_get_db($identifiers, $options = array()) {
     tripal_report_error(
       'tripal_chado_database_api',
       TRIPAL_ERROR,
-      "tripal_get_db: The identifier passed in is expected to be an array with the key
+      "chado_get_db: The identifier passed in is expected to be an array with the key
         matching a column name in the db table (ie: db_id or name). You passed in %identifier.",
       array(
         '%identifier'=> print_r($identifiers, TRUE)
@@ -78,7 +78,7 @@ function tripal_get_db($identifiers, $options = array()) {
     tripal_report_error(
       'tripal_chado_database_api',
       TRIPAL_ERROR,
-      "tripal_get_db: You did not pass in anything to identify the db you want. The identifier
+      "chado_get_db: You did not pass in anything to identify the db you want. The identifier
         is expected to be an array with the key matching a column name in the db table
         (ie: db_id or name). You passed in %identifier.",
       array(
@@ -99,7 +99,7 @@ function tripal_get_db($identifiers, $options = array()) {
     tripal_report_error(
       'tripal_chado_database_api',
       TRIPAL_ERROR,
-      "tripal_get_db: The identifiers you passed in were not unique. You passed in %identifier.",
+      "chado_get_db: The identifiers you passed in were not unique. You passed in %identifier.",
       array(
         '%identifier'=> print_r($identifiers, TRUE)
       )
@@ -111,7 +111,7 @@ function tripal_get_db($identifiers, $options = array()) {
     tripal_report_error(
       'tripal_chado_database_api',
       TRIPAL_ERROR,
-      "tripal_get_db: chado_generate_var() failed to return a db based on the identifiers
+      "chado_get_db: chado_generate_var() failed to return a db based on the identifiers
         you passed in. You should check that your identifiers are correct, as well as, look
         for a chado_generate_var error for additional clues. You passed in %identifier.",
       array(
@@ -135,7 +135,7 @@ function tripal_get_db($identifiers, $options = array()) {
  *
  * @ingroup tripal_chado_database_api
  */
-function tripal_get_db_select_options() {
+function chado_get_db_select_options() {
 
   $dbs = chado_query("SELECT db_id, name FROM {db} ORDER BY name");
 
@@ -161,7 +161,7 @@ function tripal_get_db_select_options() {
  *       'name' => 'SOFP'
  *     )
  *   );
- *   $dbxref_object = tripal_get_dbxref($identifiers);
+ *   $dbxref_object = chado_get_dbxref($identifiers);
  * @endcode
  *  The above code selects the synonym database reference and returns the 
  *  following object:
@@ -203,7 +203,7 @@ function tripal_get_db_select_options() {
  *
  * @ingroup tripal_chado_database_api
  */
-function tripal_get_dbxref($identifiers, $options = array()) {
+function chado_get_dbxref($identifiers, $options = array()) {
 
   // Set Defaults.
   if (!isset($options['include_fk'])) {
@@ -214,14 +214,14 @@ function tripal_get_dbxref($identifiers, $options = array()) {
   // Error Checking of parameters.
   if (!is_array($identifiers)) {
     tripal_report_error('tripal_db_api', TRIPAL_ERROR,
-      "tripal_get_dbxref: The identifier passed in is expected to be an array with the key
+      "chado_get_dbxref: The identifier passed in is expected to be an array with the key
         matching a column name in the dbxref table (ie: dbxref_id or name). You passed in %identifier.",
       array('%identifier'=> print_r($identifiers, TRUE))
     );
   }
   elseif (empty($identifiers)) {
     tripal_report_error('tripal_db_api', TRIPAL_ERROR,
-      "tripal_get_dbxref: You did not pass in anything to identify the dbxref you want. The identifier
+      "chado_get_dbxref: You did not pass in anything to identify the dbxref you want. The identifier
         is expected to be an array with the key matching a column name in the dbxref table
         (ie: dbxref_id or name). You passed in %identifier.",
       array('%identifier'=> print_r($identifiers, TRUE))
@@ -248,7 +248,7 @@ function tripal_get_dbxref($identifiers, $options = array()) {
   // Ensure the dbxref is singular. If it's an array then it is not singular.
   if (is_array($dbxref)) {
     tripal_report_error('tripal_db_api', TRIPAL_ERROR,
-      "tripal_get_dbxref: The identifiers you passed in were not unique. You passed in %identifier.",
+      "chado_get_dbxref: The identifiers you passed in were not unique. You passed in %identifier.",
       array('%identifier'=> print_r($identifiers, TRUE))
     );
   }
@@ -259,7 +259,7 @@ function tripal_get_dbxref($identifiers, $options = array()) {
     tripal_report_error(
       'tripal_db_api',
       TRIPAL_ERROR,
-      "tripal_get_dbxref: chado_generate_var() failed to return a dbxref based on the identifiers
+      "chado_get_dbxref: chado_generate_var() failed to return a dbxref based on the identifiers
         you passed in. You should check that your identifiers are correct, as well as, look
         for a chado_generate_var error for additional clues. You passed in %identifier.",
       array(
@@ -292,7 +292,7 @@ function tripal_get_dbxref($identifiers, $options = array()) {
  * 
  * @ingroup tripal_chado_database_api
  */
-function tripal_get_dbxref_url($dbxref) {
+function chado_get_dbxref_url($dbxref) {
   $final_url = '';
 
   // Create the URL for the term.
@@ -344,7 +344,7 @@ function tripal_get_dbxref_url($dbxref) {
  *
  * @ingroup tripal_chado_database_api
  */
-function tripal_insert_db($values, $options = array()) {
+function chado_insert_db($values, $options = array()) {
 
   // Default Values.
   $dbname = $values['name'];
@@ -407,7 +407,7 @@ function tripal_insert_db($values, $options = array()) {
  *
  * @ingroup tripal_chado_database_api
  */
-function tripal_insert_dbxref($values) {
+function chado_insert_dbxref($values) {
 
   $db_id = $values['db_id'];
   $accession = $values['accession'];
@@ -469,7 +469,7 @@ function tripal_insert_dbxref($values) {
  *
  * @ingroup tripal_chado_database_api
  */
-function tripal_associate_dbxref($basetable, $record_id, $dbxref, $options = array()) {
+function chado_associate_dbxref($basetable, $record_id, $dbxref, $options = array()) {
   $linking_table = $basetable . '_dbxref';
   $foreignkey_name = $basetable . '_id';
 
@@ -493,7 +493,7 @@ function tripal_associate_dbxref($basetable, $record_id, $dbxref, $options = arr
       tripal_report_error(
         'tripal_chado_database_api',
         TRIPAL_WARNING,
-        "tripal_associate_dbxref: The dbxref needs to have either the db_name or db_id
+        "chado_associate_dbxref: The dbxref needs to have either the db_name or db_id
           supplied. You were trying to associate a dbxref with the %base %record_id
           and supplied the dbxref values: %dbxref.",
         array('%base' => $basetable, '%record_id' => $record_id, '%dbxref' => print_r($dbxref,TRUE))
@@ -506,7 +506,7 @@ function tripal_associate_dbxref($basetable, $record_id, $dbxref, $options = arr
     }
     elseif ($options['insert_dbxref']) {
       // Insert the dbxref.
-      $insert = tripal_insert_dbxref($values);
+      $insert = chado_insert_dbxref($values);
       if (isset($insert->dbxref_id)) {
         $dbxref['dbxref_id'] = $insert->dbxref_id;
       }
@@ -514,7 +514,7 @@ function tripal_associate_dbxref($basetable, $record_id, $dbxref, $options = arr
         tripal_report_error(
           'tripal_chado_database_api',
           TRIPAL_WARNING,
-          "tripal_associate_dbxref: Unable to insert the dbxref using the dbxref values: %dbxref.",
+          "chado_associate_dbxref: Unable to insert the dbxref using the dbxref values: %dbxref.",
           array('%dbxref' => print_r($dbxref,TRUE))
         );
         return FALSE;
@@ -524,7 +524,7 @@ function tripal_associate_dbxref($basetable, $record_id, $dbxref, $options = arr
       tripal_report_error(
         'tripal_api',
         TRIPAL_WARNING,
-        "tripal_associate_dbxref: The dbxref doesn't already exist. You supplied the dbxref values: %dbxref.",
+        "chado_associate_dbxref: The dbxref doesn't already exist. You supplied the dbxref values: %dbxref.",
         array('%dbxref' => print_r($dbxref,TRUE))
       );
       return FALSE;
@@ -580,7 +580,7 @@ function tripal_associate_dbxref($basetable, $record_id, $dbxref, $options = arr
  *
  * @ingroup tripal_chado_database_api
  */
-function tripal_autocomplete_dbxref($db_id, $string = '') {
+function chado_autocomplete_dbxref($db_id, $string = '') {
   if (!$db_id) {
     return drupal_json_output(array());
   }

+ 22 - 22
tripal_chado/api/modules/tripal_chado.feature.api.inc

@@ -23,7 +23,7 @@
  *
  * @ingroup tripal_feature_api
  */
-function tripal_autocomplete_feature($string = '') {
+function chado_autocomplete_feature($string = '') {
   $items = array();
   $sql = "
     SELECT
@@ -57,7 +57,7 @@ function tripal_autocomplete_feature($string = '') {
  *
  * @ingroup tripal_feature_api
  */
-function tripal_reverse_compliment_sequence($sequence) {
+function chado_reverse_compliment_sequence($sequence) {
 
   $seq = strtoupper($sequence);
   $seq = strrev($seq);
@@ -132,7 +132,7 @@ function tripal_reverse_compliment_sequence($sequence) {
  *
  * @ingroup tripal_feature_api
  */
-function tripal_get_feature_sequences($feature, $options) {
+function chado_get_feature_sequences($feature, $options) {
 
   // Default values for finding the feature.
   $feature_id         = array_key_exists('feature_id', $feature)     ? $feature['feature_id']     : 0;
@@ -163,7 +163,7 @@ function tripal_get_feature_sequences($feature, $options) {
   // Make sure the sub_features variable is an array.
   if (!is_array($sub_features)) {
     tripal_report_error('tripal_feature', TRIPAL_ERROR,
-      "'sub_features' option must be an array for function tripal_get_feature_sequences().",
+      "'sub_features' option must be an array for function chado_get_feature_sequences().",
       array()
     );
     return array();
@@ -213,7 +213,7 @@ function tripal_get_feature_sequences($feature, $options) {
       if ($rel_part == "object") {
         $defline = "$feature->uniquename $feature->feature_type ($feature->genus $feature->species), $relationship, $feature_name";
       }
-      return tripal_get_feature_sequences(
+      return chado_get_feature_sequences(
         array(
           'feature_id' => $feature->feature_id,
           'name' => $defline,
@@ -453,7 +453,7 @@ function tripal_get_feature_sequences($feature, $options) {
       $dir = 'forward';
       $length = strlen($seq);
       if ($parent->strand < 0) {
-        $seq = tripal_reverse_compliment_sequence($seq);
+        $seq = chado_reverse_compliment_sequence($seq);
         $dir = 'reverse';
       }
       // Now format for display.
@@ -487,7 +487,7 @@ function tripal_get_feature_sequences($feature, $options) {
       $featureloc->srcfeature_id->organism_id->species = $parent->species;
       // Get a proper feature object.
       $f = chado_generate_var('feature', array('feature_id' => $feature_id));
-      $defline = tripal_get_fasta_defline($f, $notes, $featureloc, '', $length);
+      $defline = chado_get_fasta_defline($f, $notes, $featureloc, '', $length);
 
       $sequences[] = array(
         'types'         => $types,
@@ -517,7 +517,7 @@ function tripal_get_feature_sequences($feature, $options) {
     }
 
     // Get the definintion line for this feature.
-    $defline = tripal_get_fasta_defline($f, '', NULL, '', $length);
+    $defline = chado_get_fasta_defline($f, '', NULL, '', $length);
 
     // Add to the sequence array.
     $sequences[] = array(
@@ -584,7 +584,7 @@ function tripal_get_feature_sequences($feature, $options) {
  *
  * @ingroup tripal_feature_api
  */
-function tripal_get_bulk_feature_sequences($options) {
+function chado_get_bulk_feature_sequences($options) {
 
   // Default values for building the sequence
   $org_commonname     = array_key_exists('org_commonname', $options)     ? $options['org_commonname']    : '';
@@ -681,7 +681,7 @@ function tripal_get_bulk_feature_sequences($options) {
   $sequences = array();
   while ($feature = $q->fetchObject()) {
     // get the sequences
-    $seqs = tripal_get_feature_sequences(array('feature_id' => $feature->feature_id), $options);
+    $seqs = chado_get_feature_sequences(array('feature_id' => $feature->feature_id), $options);
     $sequences = array_merge($sequences, $seqs);
     $num_seqs++;
   }
@@ -715,7 +715,7 @@ function tripal_get_bulk_feature_sequences($options) {
  * 
  * @ingroup tripal_feature_api
  */
-function tripal_get_fasta_defline($feature, $notes = '', $featureloc = NULL, $type = '', $length = 0) {
+function chado_get_fasta_defline($feature, $notes = '', $featureloc = NULL, $type = '', $length = 0) {
 
   // Make sure the featureloc object has the srcfeature if not, then add it.
   if ($featureloc) {
@@ -746,7 +746,7 @@ function tripal_get_fasta_defline($feature, $notes = '', $featureloc = NULL, $ty
     $defline .= "length=" . $length . "bp|";
   }
   if ($featureloc) {
-    $defline .= "location=Sequence derived from alignment at " . tripal_get_location_string($featureloc);
+    $defline .= "location=Sequence derived from alignment at " . chado_get_location_string($featureloc);
     $defline .= " (" . $featureloc->srcfeature_id->organism_id->genus . " " . $featureloc->srcfeature_id->organism_id->species . ")|";
   }
   if ($notes) {
@@ -768,7 +768,7 @@ function tripal_get_fasta_defline($feature, $notes = '', $featureloc = NULL, $ty
  * 
  * @ingroup tripal_feature_api
  */
-function tripal_get_location_string($featureloc) {
+function chado_get_location_string($featureloc) {
   $feature = $featureloc->feature_id;
 
   $strand = '';
@@ -800,7 +800,7 @@ function tripal_get_location_string($featureloc) {
  *
  * @ingroup tripal_feature_api
  */
-function tripal_get_feature_relationships($feature) {
+function chado_get_feature_relationships($feature) {
   // Expand the feature object to include the feature relationships.
   $options = array(
     'return_array' => 1,
@@ -958,7 +958,7 @@ function chado_get_featureloc_sequences($feature_id, $featurelocs) {
   // Get the list of relationships (including any aggregators) and iterate
   // through each one to find information needed to color-code the reference 
   // sequence.
-  $relationships = _tripal_feature_get_aggregate_relationships($feature_id);
+  $relationships = _chado_feature_get_aggregate_relationships($feature_id);
   if (!$relationships) {
     return array();
   }
@@ -1063,7 +1063,7 @@ function chado_get_featureloc_sequences($feature_id, $featurelocs) {
       $sequence = chado_query($sql, $args)->fetchObject();
       $residues = $sequence->residues;
       if ($featureloc->strand < 0) {
-        $residues = tripal_reverse_compliment_sequence($residues);
+        $residues = chado_reverse_compliment_sequence($residues);
       }
       $strand = '.';
       if ($featureloc->strand == 1) {
@@ -1072,8 +1072,8 @@ function chado_get_featureloc_sequences($feature_id, $featurelocs) {
       elseif ($featureloc->strand == -1) {
         $strand = '-';
       }
-      $floc_sequences[$src]['location'] = tripal_get_location_string($featureloc);
-      $floc_sequences[$src]['defline'] = tripal_get_fasta_defline($featureloc->feature_id, '', $featureloc, '', strlen($residues));
+      $floc_sequences[$src]['location'] = chado_get_location_string($featureloc);
+      $floc_sequences[$src]['defline'] = chado_get_fasta_defline($featureloc->feature_id, '', $featureloc, '', strlen($residues));
       $floc_sequences[$src]['featureloc'] = $featureloc;
       $floc_sequences[$src]['residues'] = $residues;
       //$floc_sequences[$src]['formatted_seq'] =  tripal_feature_color_sequence($residues, $parts, $floc_sequences[$src]['defline']);
@@ -1246,7 +1246,7 @@ function chado_get_featurelocs($feature_id, $side = 'as_parent', $aggregate = 1)
   if ($aggregate and strcmp($side, 'as_parent')==0) {
   // Get the relationships for this feature without substituting any children
   // for the parent. We want all relationships.
-  $relationships = _tripal_feature_get_aggregate_relationships($feature_id, 0);
+  $relationships = _chado_feature_get_aggregate_relationships($feature_id, 0);
   foreach ($relationships as $rindex => $rel) {
     // Get the featurelocs for each of the relationship features.
     $rel_featurelocs = tripal_feature_load_featurelocs($rel->subject_id, 'as_child', 0);
@@ -1272,7 +1272,7 @@ function chado_get_featurelocs($feature_id, $side = 'as_parent', $aggregate = 1)
  * 
  *
  */
-function _tripal_feature_get_aggregate_relationships($feature_id, $substitute=1,
+function _chado_feature_get_aggregate_relationships($feature_id, $substitute=1,
     $levels=0, $base_type_id=NULL, $depth=0) {
 
   // we only want to recurse to as many levels deep as indicated by the
@@ -1283,7 +1283,7 @@ function _tripal_feature_get_aggregate_relationships($feature_id, $substitute=1,
   }
 
   // first get the relationships for this feature
-  return _tripal_feature_load_relationships($feature_id, 'as_object');
+  return _chado_feature_load_relationships($feature_id, 'as_object');
 
 }
 
@@ -1298,7 +1298,7 @@ function _tripal_feature_get_aggregate_relationships($feature_id, $substitute=1,
  * 
  *
  */
-function _tripal_feature_load_relationships($feature_id, $side = 'as_subject') {
+function _chado_feature_load_relationships($feature_id, $side = 'as_subject') {
   // Get the relationships for this feature.  The query below is used for both
   // querying the object and subject relationships
   $sql = "

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

@@ -0,0 +1,1678 @@
+<?php
+
+/**
+ * @file
+ *
+ * These api functions are deprecated, if your site is currently using them
+ * please update your code with the newer tripal_chado functions.
+ */
+
+/**
+ * @defgroup tripal_chado_module_DEPRECATED_api
+ * @ingroup tripal_chado_api
+ * @{
+ * Deprecated legacy api code.
+ * @}
+ */
+
+
+/**tripal_analysis_api*/
+/**
+ * Retrieves a chado analysis variable.
+ *
+ * @param $itentifier
+ *   an array with the key stating what the identifier is. Supported keys 
+ *   (only on of the following unique keys is required):
+ *    - analysis_id: the chado analysis.analysis_id primary key.
+ *    - nid: the drupal node.nid primary key.
+ *   There are also some specially handled keys. They are:
+ *    - property: An array/object describing the property to select records for. 
+ *      It should at least have either a type_name (if unique across cvs) or 
+ *      type_id. Other supported keys include: cv_id/cv_name (of the type), 
+ *      value and rank.
+ * @param $options
+ *   An array of options. Supported keys include:
+ *     - Any keys supported by chado_generate_var(). See that function 
+ *       definition for additional details.
+ *
+ * NOTE: the $identifier parameter can really be any array similar to $values 
+ * passed into chado_select_record(). It should fully specify the stock record 
+ * to be returned.
+ *
+ * @return
+ *   the analysis node matching the passed in identifier
+ *
+ * @ingroup tripal_chado_module_DEPRECATED_api
+ */
+function tripal_get_analysis($identifier, $options) {
+  chado_get_analysis($identifier, $options);
+}
+
+/**
+ * Returns a list of analyses that are currently synced with Drupal to use in 
+ * select lists.
+ *
+ * @param $syncd_only
+ *   Whether or not to return all chado analyses or just those sync'd with 
+ *   drupal. Defaults to TRUE (only sync'd analyses).
+ * @return
+ *   An array of analyses sync'd with Drupal where each value is the analysis 
+ *   scientific name and the keys are analysis_id's.
+ *
+ * @ingroup tripal_chado_module_DEPRECATED_api
+ */
+function tripal_get_analysis_select_options($syncd_only = true) {
+  chado_get_analysis_select_options($syncd_only);
+}
+
+/**tripal_contact_api*/
+/**
+ * Adds a contact to the Chado contact table.
+ *
+ * @param $values
+ *   An array of values to be inserted. Valid keys include:
+ *   - name: The name of the contact.
+ *   - description: Text describing the contact.
+ *   - type_name: The type of contact.  Must be a term in the tripal_contact 
+ *     vocabulary.
+ *   - properties: An associative array containing a list of key value pairs for
+ *     the properites. The key's must be valid terms in the tripal_contact 
+ *     vocabulary (e.g. Affiliation, Address, etc).
+ *
+ * @return
+ *   On success, an array is returned containing the fields of the contact
+ *   record including the newly added contact_id. On failure, FALSE is
+ *   returned.
+ *
+ * @ingroup tripal_chado_module_DEPRECATED_api
+ */
+function tripal_insert_contact($values) {
+  chado_insert_contact($values); 
+}
+
+/**
+ * This function is intended to be used in autocomplete forms for contacts.
+ *
+ * @param $text
+ *   The string to search for.
+ *
+ * @return
+ *   A json array of terms that begin with the provided string.
+ *
+ * @ingroup tripal_chado_module_DEPRECATED_api
+ */
+function tripal_autocomplete_contact($text) {
+  chado_autocomplete_contact($text);
+}
+
+/**tripal_chado_cv_api*/
+/**
+ * Retrieves a chado controlled vocabulary variable
+ *
+ * @param $identifier
+ *   An array with the key stating what the identifier is. Supported keys (only 
+ *   on of the following unique keys is required):
+ *    - cv_id: the chado cv.cv_id primary key.
+ *    - name: the chado cv.name field (assume unique).
+ * @param $options
+ *   An array of options. Supported keys include:
+ *     - Any keys supported by chado_generate_var(). See that function 
+ *       definition fot additional details.
+ *
+ * NOTE: the $identifier parameter can really be any array similar to $values 
+ * passed into chado_select_record(). It should fully specify the cv record to 
+ * be returned.
+ *
+ * @return
+ *   If unique values were passed in as an identifier then an object describing 
+ *   the cv will be returned (will be a chado variable from 
+ *   chado_generate_var()). Otherwise, FALSE will be returned.
+ *
+ * @ingroup tripal_chado_module_DEPRECATED_api
+ */
+function tripal_get_cv($identifiers, $options = array()) {
+  chado_get_cv($identifiers, $options);
+}
+
+/**
+ * Create an options array to be used in a form element which provides a
+ * list of all chado cvs.
+ *
+ * @return
+ *   An array(cv_id => name) for each cv in the chado cv table.
+ *
+ * @ingroup tripal_chado_module_DEPRECATED_api
+ */
+function tripal_get_cv_select_options() {
+  chado_get_cv_select_options();
+}
+
+/**
+ * Retrieves a chado controlled vocabulary term variable.
+ *
+ * @param $identifier
+ *   An array apropriate for use with the chado_generate_var for uniquely
+ *   identifying a cvterm record. Alternativley, there are also some specially
+ *   handled keys. They are:
+ *    - id: an ID for the term of the for [dbname]:[accession], where [dbname]
+ *      is the short name of the vocabulary and accession is the unique ID.
+ *    - cv_id:  an integer indicating the cv_id or an array with 'name' => the
+ *      name of the cv.
+ *    - synonym: an array with 'name' => the name of the synonym of the cvterm
+ *      you want returned; 'cv_id' => the cv_id of the synonym; 'cv_name' =>
+ *      the name of the cv of the synonym.
+ *    - property: An array/object describing the property to select records
+ *      for. It should at least have either a type_name (if unique across cvs)
+ *      or type_id. Other supported keys include: cv_id/cv_name (of the type),
+ *      value and rank.
+ * @param $options
+ *   An array of options. Supported keys include:
+ *     - Any keys supported by chado_generate_var(). See that function
+ *       definition for additional details.
+ *
+ * NOTE: the $identifier parameter can really be any array similar to $values
+ *   passed into chado_select_record(). It should fully specify the cvterm
+ *   record to be returned.
+ *
+ * @return
+ *   If unique values were passed in as an identifier then an object describing
+ *   the cvterm will be returned (will be a chado variable from
+ *   chado_generate_var()). Otherwise, FALSE will be returned.
+ *
+ * @ingroup tripal_chado_module_DEPRECATED_api
+ */
+function tripal_get_cvterm($identifiers, $options = array()) {
+  chado_get_cvterm($identifiers, $options);
+}
+
+/**
+ * Create an options array to be used in a form element
+ *   which provides a list of all chado cvterms.
+ *
+ * @param $cv_id
+ *   The chado cv_id; only cvterms with the supplied cv_id will be returnedl.
+ * @param $rel_type
+ *   Set to TRUE if the terms returned should only be relationship types in
+ *   the vocabulary.  This is useful for creating drop-downs of terms
+ *   used for relationship linker tables.
+ *
+ * @return
+ *   An associative array with the cvterm_id's as keys. The first
+ *   element in the array has a key of '0' and a value of 'Select a Type'.
+ *
+ * @ingroup tripal_chado_module_DEPRECATED_api
+ */
+function tripal_get_cvterm_select_options($cv_id, $rel_type = false) {
+  chado_get_cvterm_select_options($cv_id, $rel_type);
+}
+
+/**
+ * Duplicate of fill_cvtermpath() stored procedure in Chado.
+ *
+ * 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.
+ *
+ * @param $cvid
+ *   The controlled vocabulary ID from the cv table of Chado (i.e. cv.cv_id).
+ * @param $job_id
+ *
+ * @ingroup tripal_chado_module_DEPRECATED_api
+ */
+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.
+ *
+ * @param $name
+ *   The name of the controlled vocabulary. These are typically all lower case
+ *   with no special characters other than an undrescore (for spaces).
+ * @param $comment
+ *   A description or definition of the vocabulary.
+ *
+ * @return
+ *   An object populated with fields from the newly added database.
+ *
+ * @ingroup tripal_chado_module_DEPRECATED_api
+ */
+function tripal_insert_cv($name, $definition) {
+  chado_insert_cv($name, $definition);
+}
+
+/**
+ *  Add's a controlled vocabulary term to Chado.
+ *
+ *  This function will add a cvterm record (and a dbxref record if appropriate
+ *  values are provided). If the parent vocabulary does not exist then
+ *  that also is added to the cv table.  If the cvterm is a relationship term
+ *  then the 'is_relationship' value should be set.  All
+ *  terms must also have a corresponding database.  This is specified in the
+ *  term's ID just before the colon (e.g. GO:003824).  If the database does not
+ *  exist in the DB table then it will be added automatically.  The accession
+ *  (the value just after the colon in the term's ID) will be added to the
+ *  dbxref table.  If the CVterm already exists and $update is set (default)
+ *  then the cvterm is updated.  If the CVTerm already exists and $update is
+ *  not set, then no changes are made and the CVTerm object is returned.
+ *
+ * @param $term
+ *   An associative array with the following keys:
+ *    - id: the term accession. must be of the form <DB>:<ACCESSION>, where
+ *      <DB> is the name of the database to which the cvterm belongs and the
+ *      <ACCESSION> is the term's accession number in the database.
+ *    - name: the name of the term. usually meant to be human-readable.
+ *    - is_obsolete: is present and set to 1 if the term is defunct.
+ *    - definition: the definition of the term.
+ *    - cv_name: The CV name to which the term belongs.  If this arugment is
+ *        null or not provided then the function tries to find a record in the
+ *        CV table with the same name provided in the $term[namespace].  If
+ *        this field is provided then it overrides what the value in
+ *        $term[namespace].
+ *    - is_relationship: If this term is a relationship term then this value
+ *        should be 1.
+ *    - db_name: In some cases the database name will not be part of the
+ *        $term['id'] and it needs to be explicitly set.  Use this argument
+ *        only if the database name cannot be specififed in the term ID
+ *        (e.g. <DB>:<ACCESSION>).
+ * @param $options
+ *   An associative array with the following keys:
+ *    - update_existing: By default this is TRUE.  If the term exists it is
+ *      automatically updated.
+ *
+ * @return
+ *   A cvterm object
+ *
+ * @ingroup tripal_chado_module_DEPRECATED_api
+ */
+function tripal_insert_cvterm($term, $options = array()) {
+  chado_insert_cvterm($term, $options);
+}
+
+/**
+ * TODO: deprecate this function
+ *
+ * Avoid using this function as it will be deprecated in future releases.
+ * 
+ * This function allows other modules to programatically
+ * submit an ontology for loading into Chado.
+ *
+ * This function will add a job to the Jobs subsystem for parsing the ontology.
+ * You can either pass a known OBO ID to the function or the URL
+ * or full path the the ontology file.  If a URL or file name is
+ * passed then the $obo_name argument must also be provided.  If
+ * this is the first time the ontology has been provided to Tripal
+ * then it will be added to the database and will be assigned a
+ * unique OBO ID.
+ *
+ * @param $obo_id
+ *   If the ontology is already loaded into the Tripal tables then
+ *   use this argument to specify the unique ID for the ontology
+ *   that will be loaded.
+ * @param $obo_name
+ *   If the OBO has not been added before then use this argument
+ *   to specify the human readable name of the ontology.
+ * @param $obo_url
+ *   If the OBO to be loaded is located on a remote server then
+ *   use this argument to provide the URL.
+ * @param $obo_file
+ *   If the OBO is housed on the local file system of the server then
+ *   use this argument to specify the full path.
+ *
+ * @return
+ *   returns the job_id of the submitted job or FALSE if the job was not added
+ *
+ * @ingroup tripal_chado_module_DEPRECATED_api
+ */
+function tripal_submit_obo_job($obo) {
+  chado_submit_obo_job($obo);
+}
+
+/**
+ * Add the OBO to the tripal_cv_obo table in the Drupal database.
+ *
+ * If the OBO name already exists in the table then the path is updated.
+ *
+ * @param $name
+ *   The human readable name of this ontology.
+ * @param $path
+ *   The file path or URL of the ontology.
+ *
+ * @return
+ *   Returns the ontology ID.
+ *
+ * @ingroup tripal_chado_module_DEPRECATED_api
+ */
+function tripal_insert_obo($name, $path) {
+  chado_insert_obo($name, $path);
+}
+
+/**
+ * Retrieves an OBO record.
+ *
+ * @param $values
+ *   An associate array with the following allowed keys: obo_id, name.
+ *
+ * @return
+ *   An instance of an OBO record object.
+ * 
+ * @ingroup tripal_chado_module_DEPRECATED_api
+ */
+function tripal_get_obo($values) {
+  chado_get_obo($values);
+}
+
+/**
+ * This function is intended to be used in autocomplete forms.
+ *
+ * This function searches for a matching controlled vobulary name.
+ *
+ * @param $string
+ * The string to search for.
+ *
+ * @return
+ * A json array of terms that begin with the provided string.
+ *
+ * @ingroup tripal_chado_module_DEPRECATED_api
+ */
+function tripal_autocomplete_cv($string = '') {
+  chado_autocomplete_cv($string);
+}
+
+/**
+ * This function is intended to be used in autocomplete forms
+ * for searching for CV terms that begin with the provided string.
+ *
+ * @param $cv_id
+ * The CV ID in which to search for the term.
+ * @param $string
+ * The string to search for.
+ *
+ * @return
+ * A json array of terms that begin with the provided string.
+ *
+ * @ingroup tripal_chado_module_DEPRECATED_api
+ */
+function tripal_autocomplete_cvterm($cv_id, $string = '') {
+  chado_autocomplete_cvterm($cv_id, $string);
+}
+
+/**
+ * Add a record to a cvterm linking table (ie: feature_cvterm).
+ *
+ * @param $basetable
+ *   The base table to which the cvterm should be linked/associated. Thus to 
+ *   associate a cvterm to a feature the basetable=feature and cvterm_id is
+ *   added to the feature_cvterm table.
+ * @param $record_id
+ *   The primary key of the basetable to associate the cvterm with. This should 
+ *   be in integer.
+ * @param $cvterm
+ *   An associative array describing the cvterm. Valid keys include:
+ *     - name: the name for the cvterm,
+ *     - cv_name: the name of the cv the cvterm belongs to.
+ *     - cv_id: the primary key of the cv the cvterm belongs to.
+ * @param $options
+ *   An associative array of options. Valid keys include:
+ *     - insert_cvterm: Insert the cvterm if it doesn't already exist. FALSE is 
+ *       the default.
+ *
+ * @ingroup tripal_chado_module_DEPRECATED_api
+ */
+function tripal_associate_cvterm($basetable, $record_id, $cvterm, $options = array()) {
+  chado_associate_cvterm($basetable, $record_id, $cvterm, $options);
+}
+
+/**tripal_chado_database_api*/
+/**
+ * Retrieves a chado db variable.
+ *
+ * Example Usage:
+ * @code
+ *   $select_values = array(
+ *     'name' => 'SOFP'
+ *   );
+ *   $db_object = tripal_get_db($select_values);
+ * @endcode
+ *  The above code selects the SOFP db and returns the following object:
+ * @code
+ *   $db_object = stdClass Object (
+ *     [db_id] => 49
+ *     [name] => SOFP
+ *     [description] =>
+ *     [urlprefix] =>
+ *     [url] =>
+ *   );
+ * @endcode
+ *
+ * @param $identifier
+ *   An array with the key stating what the identifier is. Supported keys (only 
+ *   on of the following unique keys is required):
+ *    - db_id: the chado db.db_id primary key.
+ *    - name: the chado db.name field (assume unique).
+ * @param $options
+ *   An array of options. Supported keys include:
+ *     - Any keys supported by chado_generate_var(). See that function 
+ *       definition for additional details.
+ *
+ * NOTE: the $identifier parameter can really be any array similar to $values 
+ * passed into chado_select_record(). It should fully specify the db record to 
+ * be returned.
+ *
+ * @return
+ *   If unique values were passed in as an identifier then an object describing 
+ *   the cv will be returned (will be a chado variable from 
+ *   chado_generate_var()). Otherwise, an array of objects will be returned.
+ *
+ * @ingroup tripal_chado_module_DEPRECATED_api
+ */
+function tripal_get_db($identifiers, $options = array()) {
+  chado_get_db($identifiers, $options);
+}
+
+/**
+ * Create an options array to be used in a form element
+ *   which provides a list of all chado dbs.
+ *
+ * @return
+ *   An array(db_id => name) for each db in the chado db table.
+ *
+ * @ingroup tripal_chado_module_DEPRECATED_api
+ */
+function tripal_get_db_select_options() {
+  chado_get_db_select_options();
+}
+
+/**
+ * Retrieves a chado database reference variable.
+ *
+ * Example Usage:
+ * @code
+ *   $identifiers = array(
+ *     'accession' => 'synonym',
+ *     'db_id' => array(
+ *       'name' => 'SOFP'
+ *     )
+ *   );
+ *   $dbxref_object = tripal_get_dbxref($identifiers);
+ * @endcode
+ *  The above code selects the synonym database reference and returns the 
+ *  following object:
+ * @code
+ *  $dbxref_object = stdClass Object (
+ *     [dbxref_id] => 2581
+ *     [accession] => synonym
+ *     [description] =>
+ *     [version] =>
+ *     [db_db_id] => 49
+ *     [db_name] => SOFP
+ *     [db_description] =>
+ *     [db_urlprefix] =>
+ *     [db_url] =>
+ *   );
+ * @endcode
+ *
+ * @param $identifier
+ *   An array apropriate for use with the chado_generate_var for uniquely
+ *   identifying a dbxref record. Alternatively, there are also some specially
+ *   handled keys. They are:
+ *    - property: An array/object describing the property to select records for. 
+ *      It should at least have either a type_name (if unique across cvs) or 
+ *      type_id. Other supported keys include: cv_id/cv_name (of the type), 
+ *      value and rank.
+ * @param $options
+ *   An array of options. Supported keys include:
+ *     - Any keys supported by chado_generate_var(). See that function 
+ *       definition for additional details.
+ *
+ * NOTE: the $identifier parameter can really be any array similar to $values 
+ * passed into chado_select_record(). It should fully specify the dbxref record 
+ * to be returned.
+ *
+ * @return
+ *   If unique values were passed in as an identifier then an object describing 
+ *   the dbxref will be returned (will be a chado variable from 
+ *   chado_generate_var()). Otherwise, FALSE will be returned.
+ *
+ * @ingroup tripal_chado_module_DEPRECATED_api
+ */
+function tripal_get_dbxref($identifiers, $options = array()) {
+  chado_get_dbxref($identifiers, $options);
+}
+
+/**
+ * Generates a URL for the controlled vocabulary term.
+ *
+ * If the URL and URL prefix are provided for the database record of a cvterm
+ * then a URL can be created for the term.  By default, the db.name and
+ * dbxref.accession are concatenated and appended to the end of the db.urlprefix.
+ * But Tripal supports the use of {db} and {accession} tokens when if present
+ * in the db.urlprefix string will be replaced with the db.name and
+ * dbxref.accession respectively.
+ *
+ * @param $dbxref
+ *   A dbxref object as created by the chado_generate_var() function.
+ *
+ * @return
+ *   A string containing the URL.
+ * 
+ * @ingroup tripal_chado_module_DEPRECATED_api
+ */
+function tripal_get_dbxref_url($dbxref) {
+  chado_get_dbxref_url($dbxref);
+}
+
+/**
+ * Adds a new database to the Chado DB table and returns the DB object.
+ *
+ * @param $values
+ *   An associative array of the values of the db (those to be inserted):
+ *   - name: The name of the database. This name is usually used as the prefix 
+ *     for CV term accessions.
+ *   - description: (Optional) A description of the database.  By default no 
+ *     description is required.
+ *   - url: (Optional) The URL for the database.
+ *   - urlprefix: (Optional) The URL that is to be used as a prefix when 
+ *     constructing a link to a database term.
+ * @param $options
+ *   Optional. An associative array of options that can include:
+ *   - update_existing: Set this to '1' to force an update of the database if it
+ *     already exists. The default is to not update. If the database exists
+ *     then nothing is added.
+ *
+ * @return
+ *   An object populated with fields from the newly added database.  If the
+ *   database already exists it returns the values in the current entry.
+ *
+ * @ingroup tripal_chado_module_DEPRECATED_api
+ */
+function tripal_insert_db($values, $options = array()) {
+  chado_insert_db($values, $options);
+}
+
+/**
+ * Add a database reference.
+ *
+ * @param $values
+ *   An associative array of the values to be inserted including:
+ *    - db_id: the database_id of the database the reference is from.
+ *    - accession: the accession.
+ *    - version: (Optional) The version of the database reference.
+ *    - description: (Optional) A description of the database reference.
+ *
+ * @return
+ *   The newly inserted dbxref as an object, similar to that returned by
+ *   the chado_select_record() function.
+ *
+ * @ingroup tripal_chado_module_DEPRECATED_api
+ */
+function tripal_insert_dbxref($values) {
+  chado_insert_dbxref($values);
+}
+
+/**
+ * Add a record to a database reference linking table (ie: feature_dbxref).
+ *
+ * @param $basetable
+ *   The base table for which the dbxref should be associated. Thus to associate 
+ *   a dbxref with a feature the basetable=feature and dbxref_id is added to the
+ *   feature_dbxref table.
+ * @param $record_id
+ *   The primary key of the basetable to associate the dbxref with. This should 
+ *   be in integer.
+ * @param $dbxref
+ *   An associative array describing the dbxref. Valid keys include: 
+ *   'accession' => the accession for the dbxref, 'db_name' => the name of the 
+ *    database the dbxref belongs to.
+ *   'db_id' => the primary key of the database the dbxref belongs to.
+ * @param $options
+ *   An associative array of options. Valid keys include:
+ *    - insert_dbxref: Insert the dbxref if it doesn't already exist. TRUE is 
+ *      the default.
+ *
+ * @ingroup tripal_chado_module_DEPRECATED_api
+ */
+function tripal_associate_dbxref($basetable, $record_id, $dbxref, $options = array()) {
+  chado_associate_dbxref($basetable, $record_id, $dbxref, $options);
+}
+
+/**
+ * This function is intended to be used in autocomplete forms
+ * for searching for accession that begin with the provided string.
+ *
+ * @param $db_id
+ *   The DB ID in which to search for the term.
+ * @param $string
+ *   The string to search for.
+ *
+ * @return
+ *   A json array of terms that begin with the provided string.
+ *
+ * @ingroup tripal_chado_module_DEPRECATED_api
+ */
+function tripal_autocomplete_dbxref($db_id, $string = '') {
+  chado_autocomplete_dbxref($db_id, $string);
+}
+
+/**tripal_feature_api*/
+/**
+ * Used for autocomplete in forms for identifying for publications.
+ *
+ * @param $field
+ *   The field in the publication to search on.
+ * @param $string
+ *   The string to search for.
+ *
+ * @return
+ *   A json array of terms that begin with the provided string.
+ *
+ * @ingroup tripal_chado_module_DEPRECATED_api
+ */
+function tripal_autocomplete_feature($string = '') {
+  chado_autocomplete_feature($string);
+}
+
+/**
+ * Performs a reverse compliment of a nucleotide sequence.
+ *
+ * @param $sequence
+ *   The nucelotide sequence.
+ *
+ * @return
+ *   an upper-case reverse complemented sequence.
+ *
+ * @ingroup tripal_chado_module_DEPRECATED_api
+ */
+function tripal_reverse_compliment_sequence($sequence) {
+  chado_reverse_compliment_sequence($sequence);
+}
+
+/**
+ * Retrieves the sequences for a given feature.
+ *
+ * If a feature has multiple alignments or multiple relationships then
+ * multiple sequences will be returned.
+ *
+ * @param $feature
+ *   An associative array describing the feature. Valid keys include:
+ *    - feature_id: The feature_id of the feature for which the sequence will
+ *      be retrieved.
+ *    - name: The feature name. This will appear on the FASTA definition line.
+ *    - parent_id:  (optional) only retrieve a sequence if 'derive_from_parent'
+ *      is true and the parent matches this ID.
+ *    - featureloc_id: (optional) only retrieve a sequence if 
+ *      'derive_from_parent' is true and the alignment is defined with this 
+ *      featureloc_id.
+ * @param $options
+ *   An associative array of options. Valid keys include:
+ *    - width: Indicate the number of bases to use per line.  A new line will
+ *      be added after the specified number of bases on each line.
+ *    - is_html: Set to '1' if  the sequence is meant to be displayed on a web
+ *      page. This will cause a <br> tag to separate lines of the FASTA sequence.
+ *    - derive_from_parent: Set to '1' if the sequence should be obtained from
+ *      the parent to which this feature is aligned.
+ *    - aggregate: Set to '1' if the sequence should only contain sub features,
+ *      excluding intro sub feature sequence.  For example, set this option to
+ *      obtain just the coding sequence of an mRNA.
+ *    - upstream: An integer specifing the number of upstream bases to include
+ *      in the output.
+ *    - downstream: An integer specifying the number of downstream bases to
+ *      include in the output.
+ *    - sub_feature_types: Only include sub features (or child features) of
+ *      the types provided in the array.
+ *    - relationship_type: If a relationship name is provided (e.g. sequence_of)
+ *      then any sequences that are in relationships of this type with matched
+ *      sequences are also included.
+ *    - relationship_part: If a relationship is provided in the preceeding
+ *      argument then the rel_part must be either 'object' or 'subject' to
+ *      indicate which side of the relationship the matched features belong.
+ *
+ * @return
+ *   an array of matching sequence in the following keys for each sequence:
+ *    - types: an array of feature types that were used to derive
+ *      the sequence (e.g. from an aggregated sequence)
+ *    - upstream: the number of upstream bases included in the sequence
+ *    - downstream: the number of downstream bases included in the
+ *      sequence
+ *    - defline: the definintion line used to create a FASTA sequence
+ *    - residues: the residues
+ *    - featureloc_id: the featureloc_id if the sequences is from an
+ *        alignment
+ *
+ * @ingroup tripal_chado_module_DEPRECATED_api
+ */
+function tripal_get_feature_sequences($feature, $options) {
+  chado_get_feature_sequences($feature, $options);
+}
+
+/**
+ * Retrieves the bulk sequences for a given feature.
+ *
+ * @param $options
+ *   An associative array of options for selecting a feature. Valid keys include:
+ *    - org_commonname: The common name of the organism for which sequences
+ *      should be retrieved
+ *    - genus: The genus of the organism for which sequences should be retrieved
+ *    - species: The species of the organism for which sequences should be
+ *      retrieved
+ *    - analysis_name: The name of an analysis to which sequences belong. Only
+ *      those that are associated with the analysis will be retrieved.
+ *    - type: The type of feature (a sequence ontology term).
+ *    - feature_name: the name of the feature. Can be an array of feature names.
+ *    - feature_uname: the uniquename of the feature.  Can be an array of
+ *      feature unique names.
+ *    - upstream: An integer specifing the number of upstream bases to include
+ *      in the output
+ *    - downstream: An integer specifying the number of downstream bases to
+ *      include in the output.
+ *    - derive_from_parent: Set to '1' if the sequence should be obtained from
+ *      the parent to which this feature is aligned.
+ *    - aggregate: Set to '1' if the sequence should only contain sub features,
+ *      excluding intro sub feature sequence.  For example, set this option to
+ *      obtain just the coding sequence of an mRNA.
+ *    - sub_feature_types: Only include sub features (or child features) of
+ *      the types provided in the array
+ *    - relationship_type: If a relationship name is provided (e.g. sequence_of)
+ *      then any sequences that are in relationships of this type with matched
+ *      sequences are also included
+ *    - relationship_part: If a relationship is provided in the preceeding
+ *      argument then the rel_part must be either 'object' or 'subject' to
+ *      indicate which side of the relationship the matched features belong
+ *    - width: Indicate the number of bases to use per line.  A new line will
+ *      be added after the specified number of bases on each line.
+ *    - is_html: Set to '1' if  the sequence is meant to be displayed on a
+ *      web page. This will cause a <br> tag to separate lines of the FASTA
+ *      sequence.
+ * @return
+ *   Returns an array of sequences. The sequences will be in an array with the
+ *   following keys for each sequence:
+ *      'types'         => an array of feature types that were used to derive
+ *         the sequence (e.g. from an aggregated sequence)
+ *      'upstream'      => the number of upstream bases in the sequence
+ *      'downstream'    => the number of downstream bases in the sequence
+ *      'defline'       => the definintion line used to create a FASTA sequence
+ *      'residues'      => the residues
+ *      'featureloc_id' => the featureloc_id if from an alignment
+ *
+ * @ingroup tripal_chado_module_DEPRECATED_api
+ */
+function tripal_get_bulk_feature_sequences($options) {
+  chado_get_bulk_feature_sequences($options);
+}
+
+/**
+ * Returns a definition line that can be used in a FASTA file.
+ *
+ * @param $feature
+ *   A single feature object containing all the fields from the chado.feature 
+ *   table. Best case is to provide an object generated by the 
+ *   chado_generate_var() function.
+ * @param $notes
+ *   Optional: additional notes to be added to the definition line.
+ * @param $featureloc
+ *   Optional: a single featureloc object generated using chado_generate_var
+ *   that contains a record from the chado.featureloc table. Provide this if the
+ *   sequence was obtained by using the alignment rather than from the 
+ *   feature.residues column.
+ * @param $type
+ *   Optional: the type of sequence. By default the feature type is used.
+ * @param $length
+ *   Optional: the length of the sequence.
+ *
+ * @return
+ *   A string of the format: uniquename|name|type|feature_id
+ *   or if an alignment:  srcfeature_name:fmin..fmax[+-]; alignment of 
+ *   uniquename|name|type|feature_id.
+ * 
+ * @ingroup tripal_chado_module_DEPRECATED_api
+ */
+function tripal_get_fasta_defline($feature, $notes = '', $featureloc = null, $type = '', $length = 0) {
+  chado_get_fasta_defline($feature, $notes, $featureloc, $type, $length);
+}
+
+/**
+ * Returns a string representing a feature location in an alignment.
+ *
+ * @param $featureloc
+ *   A single featureloc object generated using chado_generate_var that
+ *   contains a record from the chado.featureloc table.
+ *
+ *  @return
+ *   A string of the format: uniquename:featurelocmin..featurelocmax.strand
+ * 
+ * @ingroup tripal_chado_module_DEPRECATED_api
+ */
+function tripal_get_location_string($featureloc) {
+  chado_get_location_string($featureloc);
+}
+
+/**
+ * Quickly retrieves relationships for a feature.
+ *
+ * Using the chado_expand_var function to retrieve a set
+ * of relationships can be very slow, especialy if there are many relationships.
+ * This function is intended to help speed up the retrieval of relationships
+ * by only retrieving the base information for the relationship and returning
+ * an array.
+ *
+ * @param $feature
+ *   The feature object
+
+ * @return
+ *   An array with two objects
+ *
+ * @ingroup tripal_chado_module_DEPRECATED_api
+ */
+function tripal_get_feature_relationships($feature) {
+  chado_get_feature_relationships($feature);
+}
+
+/**
+ * Retrieves a chado organism variable.
+ *
+ * @param $identifier
+ *   An array with the key stating what the identifier is. Supported keys (only 
+ *   on of the following unique keys is required):
+ *    - organism_id: the chado organism.organism_id primary key.
+ *    - genus & species: the chado organism.genus field & organism.species field.
+ *   There are also some specially handled keys. They are:
+ *    - property: An array/object describing the property to select records for. 
+ *      It should at least have either a type_name (if unique across cvs) or 
+ *      type_id. Other supported keys include: cv_id/cv_name (of the type), 
+ *      value and rank.
+ * @param $options
+ *   An array of options. Supported keys include:
+ *     - Any keys supported by chado_generate_var(). See that function 
+ *      definition for additional details.
+ *
+ * NOTE: the $identifier parameter can really be any array similar to $values 
+ * passed into chado_select_record(). It should fully specify the organism 
+ * record to be returned.
+ *
+ * @return
+ *   If unique values were passed in as an identifier then an object describing 
+ *   the organism will be returned (will be a chado variable from 
+ *   chado_generate_var()). Otherwise, FALSE will be returned.
+ *
+ * @ingroup tripal_chado_module_DEPRECATED_api
+ */
+function tripal_get_organism($identifiers, $options = array()) {
+  chado_get_organism($identifiers, $options);
+}
+
+/**
+ * Returns the full scientific name of an organism.
+ *
+ * @param $organism
+ *   An organism object.
+ * @return
+ *   The full scientific name of the organism.
+ *
+ * @ingroup tripal_chado_module_DEPRECATED_api
+ */
+function tripal_get_organism_scientific_name($organism) {
+  chado_get_organism_scientific_name($organism);
+}
+
+/**
+ * Returns a list of organisms that are currently synced with Drupal to use in 
+ * select lists.
+ *
+ * @param $syncd_only
+ *   Whether or not to return all chado organisms or just those sync'd with 
+ *   drupal. Defaults to TRUE (only sync'd organisms).
+ * @return
+ *   An array of organisms sync'd with Drupal where each value is the organism 
+ *   scientific name and the keys are organism_id's.
+ *
+ * @ingroup tripal_chado_module_DEPRECATED_api
+ */
+function tripal_get_organism_select_options($syncd_only = true) {
+  chado_get_organism_select_options($syncd_only);
+}
+
+/**
+ * Return the path for the organism image.
+ *
+ * @param $organism
+ *   An organism table record.
+ *
+ * @return
+ *   If the type parameter is 'url' (the default) then the fully qualified
+ *   url to the image is returend. If no image is present then NULL is returned.
+ *
+ * @ingroup tripal_chado_module_DEPRECATED_api
+ */
+function tripal_get_organism_image_url($organism) {
+  chado_get_organism_image_url($organism);
+}
+
+/**
+ * This function is intended to be used in autocomplete forms
+ * for searching for organisms that begin with the provided string.
+ *
+ * @param $text
+ *   The string to search for.
+ *
+ * @return
+ *   A json array of terms that begin with the provided string.
+ *
+ * @ingroup tripal_chado_module_DEPRECATED_api
+ */
+function tripal_autocomplete_organism($text) {
+  chado_autocomplete_organism($text);
+}
+
+/**
+ * A handy function to abbreviate the infraspecific rank.
+ *
+ * @param $rank
+ *   The rank below species.
+ * @return
+ *   The proper abbreviation for the rank.
+ *
+ * @ingroup tripal_chado_module_DEPRECATED_api
+ */
+function tripal_abbreviate_infraspecific_rank($rank) {
+  chado_abbreviate_infraspecific_rank($rank);
+}
+
+/** tripal_phylotree_api */
+/**
+ * Validates an $options array for insert or update of a phylotree record.
+ *
+ * If validation passes then any values that needed validation lookups
+ * (such as the dbxref, analysis, leaf_type, etc) will have their approriate
+ * primary_keys added to the $options array, and missing default values
+ * will also be added.
+ *
+ * @param $val_type
+ *   The type of validation. Can be either 'insert' or 'update'.
+ * @param $options
+ *   An array of key/value pairs containing any of the valid keys for
+ *   either the tripal_insert_phylotree() or tripal_update_phylotree()
+ *   functions.
+ * @param $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.
+ * @param $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
+ *   If validation failes then FALSE is returned.  Any options that do not pass
+ *   validation checks will be added in the $errors array with the key being
+ *   the option and the value being the error message.  If validation
+ *   is successful then TRUE is returned.
+ *
+ * @ingroup tripal_chado_module_DEPRECATED_api
+ */
+function tripal_validate_phylotree($val_type, &$options, &$errors, &$warnings) {
+  chado_validate_phylotree($val_type, $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.
+ *
+ * @param $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.
+ * @param $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.
+ * @param $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
+ *   TRUE for success and FALSE for failure.
+ *
+ * @ingroup tripal_chado_module_DEPRECATED_api
+ */
+function tripal_insert_phylotree(&$options, &$errors, &$warnings) {
+  chado_insert_phylotree($options, $errors, $warnings);
+}
+
+/**
+ * Updates a phylotree record into Chado.
+ *
+ * This function validates the options passed prior to update 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. A Drupal
+ * File object will be added to the options array for the tree file if one
+ * is provided.
+ *
+ *
+ * @param $phylotree_id
+ *   The ID of the phylotree to update.
+ * @param $options
+ *  An array of key value pairs with the following optional keys:
+ *     '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'
+ *     '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.
+ *
+ * @ingroup tripal_chado_module_DEPRECATED_api
+ */
+function tripal_update_phylotree($phylotree_id, &$options) {
+  chado_update_phylotree($phylotree_id, $options);
+}
+
+/**
+ * Deletes a phylotree record from Chado.
+ *
+ * @param $phylotree_id
+ *
+ * @return
+ *   TRUE on success, FALSE on failure.
+ *
+ * @ingroup tripal_chado_module_DEPRECATED_api
+ */
+function tripal_delete_phylotree($phylotree_id) {
+  chado_delete_phylotree($phylotree_id);
+}
+
+/**
+ * Iterates through the tree and sets the left and right indicies.
+ *
+ * @param $tree
+ *   The tree array.
+ * @param $index
+ *   This parameters is not used when the function is first called. It
+ *   is used for recursive calls.
+ *
+ * @ingroup tripal_chado_module_DEPRECATED_api
+ */
+function tripal_assign_phylogeny_tree_indices(&$tree, &$index = 1) {
+  chado_assign_phylogeny_tree_indices($tree, $index);
+}
+
+/**
+ * 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.
+ *
+ * @param $tree
+ *   The tree array.
+ * @param $phylotree.
+ *   The phylotree object (from Chado).
+ * @param $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.
+ * @param $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.
+ * @param $parent
+ *   This argument is not needed when the funtion is first called. This
+ *   function is recursive and this argument is used on recursive calls.
+ *
+ * @ingroup tripal_chado_module_DEPRECATED_api
+ */
+function tripal_phylogeny_import_tree(&$tree, $phylotree, $options, $vocab = array(), $parent = null) {
+  chado_phylogeny_import_tree($tree, $phylotree, $options, $vocab, $parent);
+}
+
+/**
+ * Get the vocabulary terms used to describe nodes in the tree.
+ *
+ * @return 
+ *  Array of vocab info or FALSE on failure.
+ * 
+ * @ingroup tripal_chado_module_DEPRECATED_api
+ */
+function tripal_phylogeny_get_node_types_vocab() {
+  chado_phylogeny_get_node_types_vocab();
+}
+
+/**
+ * Imports a tree file.
+ *
+ * This function is used as a wrapper for loading a phylogenetic tree using
+ * any number of file loaders.
+ *
+ * @param $file_name
+ *   The name of the file containing the phylogenetic tree to import.
+ * @param $format
+ *   The format of the file. Currently only the 'newick' file format is
+ *   supported.
+ * @param $options
+ *   Options if the phylotree record already exists:
+ *     'phylotree_id': The imported nodes will be associated with this tree.
+ *     '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'.
+ *     '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.
+ *
+ *  @ingroup tripal_chado_module_DEPRECATED_api
+ */
+function tripal_phylogeny_import_tree_file($file_name, $format, $options = array(), $job_id = null) {
+  chado_phylogeny_import_tree_file($file_name, $format, $options, $job_id);
+}
+
+/** tripal_pub_api */
+/**
+ * Retrieves a chado publication array.
+ *
+ * @param $identifier
+ *   An array used to uniquely identify a publication. This array has the same
+ *   format as that used by the chado_generate_var(). The following keys can be
+ *   useful for uniquely identifying a publication as they should be unique:
+ *    - pub_id: the chado pub.pub_id primary key.
+ *    - nid: the drupal nid of the publication.
+ *    - uniquename: A value to matach with the pub.uniquename field.
+ *   There are also some specially handled keys. They are:
+ *    - property: An array describing the property to select records for. It
+ *      should at least have either a 'type_name' key (if unique across cvs) or
+ *      'type_id' key. Other supported keys include: 'cv_id', 'cv_name' 
+ *      (of the type), 'value' and 'rank'
+ *    - dbxref: The database cross reference accession.  It should be in the 
+ *      form DB:ACCESSION, where DB is the database name and ACCESSION is the
+ *      unique publication identifier (e.g. PMID:4382934)
+ *    - dbxref_id:  The dbxref.dbxref_id of the publication.
+ * @param $options
+ *   An array of options. Supported keys include:
+ *     - Any keys supported by chado_generate_var(). See that function 
+ *       definition for additional details.
+ *
+ * NOTE: the $identifier parameter can really be any array similar to $values 
+ * passed into chado_select_record(). It should fully specify the pub record to 
+ * be returned.
+ *
+ * @return
+ *   If a singe publication is retreived using the identifiers, then a 
+ *   publication array will be returned.  The array is of the same format 
+ *   returned by the chado_generate_var() function. Otherwise, FALSE will be 
+ *   returned.
+ *
+ * @ingroup tripal_chado_module_DEPRECATED_api
+ */
+function tripal_get_publication($identifiers, $options = array()) {
+  chado_get_publication($identifiers, $options);
+}
+
+/**
+ * The publication table of Chado only has a unique constraint for the
+ * uniquename of the publiation, but in reality a publication can be considered
+ * unique by a combination of the title, publication type, published year and
+ * series name (e.g. journal name or conference name). The site administrator
+ * can configure how publications are determined to be unique.  This function
+ * uses the configuration specified by the administrator to look for publications
+ * that match the details specified by the $pub_details argument
+ * and indicates if one ore more publications match the criteria.
+ *
+ * @param $pub_details
+ *   An associative array with details about the publications. The expected keys
+ *   are:
+ *     'Title':              The title of the publication.
+ *     'Year':               The published year of the publication.
+ *     'Publication Type':   An array of publication types. A publication can 
+ *                           have more than one type.
+ *     'Series Name':        The series name of the publication.
+ *     'Journal Name':       An alternative to 'Series Name'.
+ *     'Conference Name':    An alternative to 'Series Name'.
+ *     'Citation':           The publication citation (this is the value saved 
+ *                           in the pub.uniquename field and must be unique).
+ *   
+ *     If this key is present it will also be checked
+ *     'Publication Dbxref': A database cross reference of the form DB:ACCESSION 
+ *                           where DB is the name of the database and ACCESSION 
+ *                           is the unique identifier (e.g PMID:3483139).
+ *
+ * @return
+ *   An array containing the pub_id's of matching publications. Returns an
+ *   empty array if no pubs match.
+ *
+ * @ingroup tripal_chado_module_DEPRECATED_api
+ */
+function tripal_publication_exists($pub_details) {
+  chado_publication_exists($pub_details);
+}
+
+/**
+ * Used for autocomplete in forms for identifying for publications.
+ *
+ * @param $field
+ *   The field in the publication to search on.
+ * @param $string
+ *   The string to search for.
+ *
+ * @return
+ *   A json array of terms that begin with the provided string.
+ *
+ * @ingroup tripal_chado_module_DEPRECATED_api
+ */
+function tripal_autocomplete_pub($string = '') {
+  chado_autocomplete_pub($string);
+}
+
+/**
+ * Imports a singe publication specified by a remote database cross reference.
+ *
+ * @param $pub_dbxref
+ *   The unique database ID for the record to update.  This value must
+ *   be of the format DB_NAME:ACCESSION where DB_NAME is the name of the
+ *   database (e.g. PMID or AGL) and the ACCESSION is the unique identifier
+ *   for the record in the database.
+ * @param $do_contact
+ *   Set to TRUE if authors should automatically have a contact record added
+ *   to Chado.
+ * @param $do_update
+ *   If set to TRUE then the publication will be updated if it already exists
+ *   in the database.
+ *
+ * @ingroup tripal_chado_module_DEPRECATED_api
+ */
+function tripal_import_pub_by_dbxref($pub_dbxref, $do_contact = false, $do_update = true) {
+  chado_import_pub_by_dbxref($pub_dbxref, $do_contact, $do_update);
+}
+
+/**
+ * Imports all publications for all active import setups.
+ *
+ * @param $report_email
+ *   A list of email address, separated by commas, that should be notified
+ *   once importing has completed.
+ * @param $do_update
+ *   If set to TRUE then publications that already exist in the Chado database
+ *   will be updated, whereas if FALSE only new publications will be added.
+ *
+ * @ingroup tripal_chado_module_DEPRECATED_api
+ */
+function tripal_execute_active_pub_importers($report_email = false, $do_update = false) {
+  chado_execute_active_pub_importers($report_email, $do_update);
+}
+
+/**
+ * Updates publication records.
+ *
+ * Updates publication records that currently exist in the Chado pub table
+ * with the most recent data in the remote database.
+ *
+ * @param $do_contact
+ *   Set to TRUE if authors should automatically have a contact record added
+ *   to Chado. Contacts are added using the name provided by the remote
+ *   database.
+ * @param $dbxref
+ *   The unique database ID for the record to update.  This value must
+ *   be of the format DB_NAME:ACCESSION where DB_NAME is the name of the
+ *   database (e.g. PMID or AGL) and the ACCESSION is the unique identifier
+ *   for the record in the database.
+ * @param $db
+ *   The name of the remote database to update.  If this value is provided and
+ *   no dbxref then all of the publications currently in the Chado database
+ *   for this remote database will be updated.
+ *
+ * @ingroup tripal_chado_module_DEPRECATED_api
+ */
+function tripal_reimport_publications($do_contact = false, $dbxref = null, $db = null) {
+  chado_reimport_publications($do_contact, $dbxref, $db);
+}
+
+/**
+ * Launch the Tripal job to generate citations.
+ *
+ * This function will recreate citations for all publications currently
+ * loaded into Tripal.  This is useful to create a consistent format for
+ * all citations.
+ *
+ * @param $options
+ *  Options pertaining to what publications to generate citations for.
+ *  One of the following must be present:
+ *   - all: Create and replace citation for all pubs.
+ *   - new: Create citation for pubs that don't already have one.
+ *
+ * @ingroup tripal_chado_module_DEPRECATED_api
+ */
+function tripal_pub_create_citations($options) {
+  chado_pub_create_citations($options);
+}
+
+/**
+ * This function generates citations for publications.  It requires
+ * an array structure with keys being the terms in the Tripal
+ * publication ontology.  This function is intended to be used
+ * for any function that needs to generate a citation.
+ *
+ * @param $pub
+ *   An array structure containing publication details where the keys
+ *   are the publication ontology term names and values are the
+ *   corresponding details.  The pub array can contain the following
+ *   keys with corresponding values:
+ *     - Publication Type:  an array of publication types. a publication can 
+ *       have more than one type.
+ *     - Authors: a  string containing all of the authors of a publication.
+ *     - Journal Name:  a string containing the journal name.
+ *     - Journal Abbreviation: a string containing the journal name abbreviation.
+ *     - Series Name: a string containing the series (e.g. conference 
+ *       proceedings) name.
+ *     - Series Abbreviation: a string containing the series name abbreviation
+ *     - Volume: the serives volume number.
+ *     - Issue: the series issue number.
+ *     - Pages: the page numbers for the publication.
+ *     - Publication Date:  A date in the format "Year Month Day".
+ *
+ * @return
+ *   A text string containing the citation.
+ *
+ * @ingroup tripal_chado_module_DEPRECATED_api
+ */
+function tripal_pub_create_citation($pub) {
+  chado_pub_create_citation($pub);
+}
+
+/**
+ * Retrieves the minimal information to uniquely describe any publication.
+ *
+ * The returned array is an associative array where the keys are
+ * the controlled vocabulary terms in the form [vocab]:[accession].
+ *
+ * @param $pub
+ *   A publication object as created by chado_generate_var().
+ *
+ * @return
+ *   An array with the following keys:  'Citation', 'Abstract', 'Authors',
+ *   'URL'. All keys are term names in the Tripal Publication Ontology :TPUB.
+ * 
+ * @ingroup tripal_chado_module_DEPRECATED_api
+ */
+function tripal_get_minimal_pub_info($pub) {
+  chado_get_minimal_pub_info($pub);
+}
+
+
+/** tripal_stock_api */
+/**
+ * Retrieves a chado stock variable
+ *
+ * @param $identifier
+ *   An array with the key stating what the identifier is. Supported keys (only 
+ *   one of the following unique keys is required):
+ *    - stock_id: the chado stock.stock_id primary key
+ *    - nid: the drupal nid of the stock
+ *   There are also some specially handled keys. They are:
+ *    - property: An array/object describing the property to select records for. 
+ *      It should at least have either a type_name (if unique across cvs) or 
+ *      type_id. Other supported keys include: cv_id/cv_name (of the type), 
+ *      value and rank
+ * @param $options
+ *   An array of options. Supported keys include:
+ *     - Any keys supported by chado_generate_var(). See that function 
+ *      definition for additional details.
+ *
+ * NOTE: the $identifier parameter can really be any array similar to $values
+ * passed into chado_select_record(). It should fully specify the stock record 
+ * to be returned.
+ *
+ * @return
+ *   If unique values were passed in as an identifier then an object describing 
+ *   the stock will be returned (will be a chado variable from 
+ *   chado_generate_var()). Otherwise, FALSE will be returned.
+ *
+ * @ingroup tripal_chado_module_DEPRECATED_api
+ */
+function tripal_get_stock($identifiers, $options = array()) {
+  chado_get_stock($identifiers, $options);
+}
+
+/**
+ * Retrieves a chado stock variable.
+ *
+ * @param $identifier
+ *   An array with the key stating what the identifier is. Supported keys 
+ *   include any field in the stock table. See the chado_select_record() $values
+ *   parameter for additional details including an example.
+ * @param $options
+ *   An array of options. Supported keys include:
+ *     - Any keys supported by chado_generate_var(). See that function 
+ *       definition for additional details.
+ *
+ * @return
+ *   An array of stock objects matching the criteria.
+ *
+ * @ingroup tripal_chado_module_DEPRECATED_api
+ */
+function tripal_get_multiple_stocks($identifiers, $options = array()) {
+  chado_get_multiple_stocks($identifiers, $options);
+}

+ 13 - 13
tripal_chado/api/modules/tripal_chado.organism.api.inc

@@ -40,7 +40,7 @@
  *
  * @ingroup tripal_organism_api
  */
-function tripal_get_organism($identifiers, $options = array()) {
+function chado_get_organism($identifiers, $options = array()) {
 
   // Set Defaults.
   if (!isset($options['include_fk'])) {
@@ -53,7 +53,7 @@ function tripal_get_organism($identifiers, $options = array()) {
     tripal_report_error(
       'tripal_organism_api',
       TRIPAL_ERROR,
-      "tripal_get_organism: The identifier passed in is expected to be an array with the key
+      "chado_get_organism: The identifier passed in is expected to be an array with the key
         matching a column name in the organism table (ie: organism_id or name). You passed in %identifier.",
       array(
         '%identifier'=> print_r($identifiers, TRUE)
@@ -64,7 +64,7 @@ function tripal_get_organism($identifiers, $options = array()) {
     tripal_report_error(
       'tripal_organism_api',
       TRIPAL_ERROR,
-      "tripal_get_organism: You did not pass in anything to identify the organism you want. The identifier
+      "chado_get_organism: You did not pass in anything to identify the organism you want. The identifier
         is expected to be an array with the key matching a column name in the organism table
         (ie: organism_id or name). You passed in %identifier.",
       array(
@@ -101,7 +101,7 @@ function tripal_get_organism($identifiers, $options = array()) {
     tripal_report_error(
       'tripal_organism_api',
       TRIPAL_ERROR,
-      "tripal_get_organism: The identifiers you passed in were not unique. You passed in %identifier.",
+      "chado_get_organism: The identifiers you passed in were not unique. You passed in %identifier.",
       array(
         '%identifier'=> print_r($identifiers, TRUE)
       )
@@ -114,7 +114,7 @@ function tripal_get_organism($identifiers, $options = array()) {
     tripal_report_error(
       'tripal_organism_api',
       TRIPAL_ERROR,
-      "tripal_get_organism: chado_generate_var() failed to return a organism based on the identifiers
+      "chado_get_organism: chado_generate_var() failed to return a organism based on the identifiers
         you passed in. You should check that your identifiers are correct, as well as, look
         for a chado_generate_var error for additional clues. You passed in %identifier.",
       array(
@@ -139,7 +139,7 @@ function tripal_get_organism($identifiers, $options = array()) {
  *
  * @ingroup tripal_organism_api
  */
-function tripal_get_organism_scientific_name($organism) {
+function chado_get_organism_scientific_name($organism) {
   $name = $organism->genus . ' ' . $organism->species;
 
   // For Chado v1.3 we have a type_id and infraspecific name.
@@ -152,14 +152,14 @@ function tripal_get_organism_scientific_name($organism) {
       }
     }
     else {
-      $rank_term = tripal_get_cvterm(array('cvterm_id' => $organism->type_id));
+      $rank_term = chado_get_cvterm(array('cvterm_id' => $organism->type_id));
       if ($rank_term) {
         $rank = $rank_term->name;
       }
     }
 
     if ($rank) {
-      $rank = tripal_abbreviate_infraspecific_rank($rank);
+      $rank = chado_abbreviate_infraspecific_rank($rank);
       $name .= ' ' . $rank . ' ' . $organism->infraspecific_name;
     }
     else if ($organism->infraspecific_name) {
@@ -182,7 +182,7 @@ function tripal_get_organism_scientific_name($organism) {
  *
  * @ingroup tripal_organism_api
  */
-function tripal_get_organism_select_options($syncd_only = TRUE) {
+function chado_get_organism_select_options($syncd_only = TRUE) {
   $org_list = array();
   $org_list[] = 'Select an organism';
 
@@ -225,7 +225,7 @@ function tripal_get_organism_select_options($syncd_only = TRUE) {
  *
  * @ingroup tripal_organism_api
  */
-function tripal_get_organism_image_url($organism) {
+function chado_get_organism_image_url($organism) {
   $url = '';
 
   if (!is_object($organism)) {
@@ -287,7 +287,7 @@ function tripal_get_organism_image_url($organism) {
  *
  * @ingroup tripal_organism_api
  */
-function tripal_autocomplete_organism($text) {
+function chado_autocomplete_organism($text) {
   $matches = array();
   $genus = $text;
   $species = '';
@@ -307,7 +307,7 @@ function tripal_autocomplete_organism($text) {
   $results = chado_query($sql, $args);
   $items = array();
   foreach ($results as $organism) {
-    $name = tripal_get_organism_scientific_name($organism);
+    $name = chado_get_organism_scientific_name($organism);
     $items["$name [id: $organism->organism_id]"] = $name;
   }
   drupal_json_output($items);
@@ -323,7 +323,7 @@ function tripal_autocomplete_organism($text) {
  *
  * @ingroup tripal_organism_api
  */
-function tripal_abbreviate_infraspecific_rank($rank) {
+function chado_abbreviate_infraspecific_rank($rank) {
   $abb = '';
   switch($rank) {
     case 'no_rank':

+ 21 - 21
tripal_chado/api/modules/tripal_chado.phylotree.api.inc

@@ -25,7 +25,7 @@
  *   The type of validation. Can be either 'insert' or 'update'.
  * @param $options
  *   An array of key/value pairs containing any of the valid keys for
- *   either the tripal_insert_phylotree() or tripal_update_phylotree()
+ *   either the chado_insert_phylotree() or chado_update_phylotree()
  *   functions.
  * @param $errors
  *   An empty array where validation error messages will be set. The keys
@@ -45,7 +45,7 @@
  *
  * @ingroup tripal_phylotree_api
  */
-function tripal_validate_phylotree($val_type, &$options, &$errors, &$warnings) {
+function chado_validate_phylotree($val_type, &$options, &$errors, &$warnings) {
 
   if ($val_type != 'insert' and $val_type != 'update') {
     tripal_report_error('tripal_phylogeny', TRIPAL_ERROR, "The $val_type argument must be either 'update or 'insert'.");
@@ -281,7 +281,7 @@ function tripal_validate_phylotree($val_type, &$options, &$errors, &$warnings) {
  *
  * @ingroup tripal_phylotree_api
  */
-function tripal_insert_phylotree(&$options, &$errors, &$warnings) {
+function chado_insert_phylotree(&$options, &$errors, &$warnings) {
   global $user;
 
   $options['name_re'] = trim($options['name_re']);
@@ -291,7 +291,7 @@ function tripal_insert_phylotree(&$options, &$errors, &$warnings) {
   $options['tree_file'] = trim($options['tree_file']);
 
   // Validate the incoming options.
-  $success = tripal_validate_phylotree('insert', $options, $errors, $warnings);
+  $success = chado_validate_phylotree('insert', $options, $errors, $warnings);
   if (!$success) {
     foreach ($errors as $field => $message) {
       tripal_report_error('tripal_phylogeny', TRIPAL_ERROR, $message);
@@ -341,7 +341,7 @@ function tripal_insert_phylotree(&$options, &$errors, &$warnings) {
         'match' => $options['match'] ? 'uniquename' : 'name',
         'name_re' => $options['name_re'],
       );
-      tripal_phylogeny_import_tree_file($real_file_path, $options['format'], $args);
+      chado_phylogeny_import_tree_file($real_file_path, $options['format'], $args);
     }
     else {
       $args = array(
@@ -355,7 +355,7 @@ function tripal_insert_phylotree(&$options, &$errors, &$warnings) {
           ),
       );
       if (tripal_add_job("Import Tree File: " . $file->filename, 'tripal_phylogeny',
-          'tripal_phylogeny_import_tree_file', $args, $user->uid)) {
+          'chado_phylogeny_import_tree_file', $args, $user->uid)) {
           drupal_set_message(t('The tree visualizations will appear once the tree is fully imported.'));
       }
     }
@@ -410,13 +410,13 @@ function tripal_insert_phylotree(&$options, &$errors, &$warnings) {
  *
  * @ingroup tripal_phylotree_api
  */
-function tripal_update_phylotree($phylotree_id, &$options) {
+function chado_update_phylotree($phylotree_id, &$options) {
   global $user;
 
   // Validate the incoming options.
   $errors = array();
   $warnings = array();
-  $success = tripal_validate_phylotree('update', $options, $errors, $warnings);
+  $success = chado_validate_phylotree('update', $options, $errors, $warnings);
   if (!$success) {
     foreach ($errors as $field => $message) {
       tripal_report_error('tripal_phylogeny', TRIPAL_ERROR, $message);
@@ -496,7 +496,7 @@ function tripal_update_phylotree($phylotree_id, &$options) {
         'match' => $options['match'] ? 'uniquename' : 'name',
         'name_re' => $options['name_re'],
       );
-      tripal_phylogeny_import_tree_file($real_file_path, $options['format'], $args);
+      chado_phylogeny_import_tree_file($real_file_path, $options['format'], $args);
     }
     else {
       $args = array(
@@ -510,7 +510,7 @@ function tripal_update_phylotree($phylotree_id, &$options) {
         ),
       );
       if (tripal_add_job("Import Tree File: " . $file->filename, 'tripal_phylogeny',
-          'tripal_phylogeny_import_tree_file', $args, $user->uid)) {
+          'chado_phylogeny_import_tree_file', $args, $user->uid)) {
         drupal_set_message(t('The tree visualizations will appear once the tree is fully imported.'));
       }
     }
@@ -529,7 +529,7 @@ function tripal_update_phylotree($phylotree_id, &$options) {
  *
  * @ingroup tripal_phylotree_api
  */
-function tripal_delete_phylotree($phylotree_id) {
+function chado_delete_phylotree($phylotree_id) {
 
   // If we don't have a phylotree id for this node then this isn't a node of
   // type chado_phylotree or the entry in the chado_phylotree table was lost.
@@ -555,7 +555,7 @@ function tripal_delete_phylotree($phylotree_id) {
  *
  * @ingroup tripal_phylotree_api
  */
-function tripal_assign_phylogeny_tree_indices(&$tree, &$index = 1) {
+function chado_assign_phylogeny_tree_indices(&$tree, &$index = 1) {
   // Assign a left and right index to each node.  The child node must
   // have a right and left index less than that of it's parents.  We
   // increment the index by 100 to give space for new nodes that might
@@ -568,7 +568,7 @@ function tripal_assign_phylogeny_tree_indices(&$tree, &$index = 1) {
   }
   if (array_key_exists('branch_set', $tree)) {
     foreach ($tree['branch_set'] as $key => $node) {
-      tripal_assign_phylogeny_tree_indices($tree['branch_set'][$key], $index);
+      chado_assign_phylogeny_tree_indices($tree['branch_set'][$key], $index);
       $tree['right_index'] = $index += 100;
     }
   }
@@ -597,7 +597,7 @@ function tripal_assign_phylogeny_tree_indices(&$tree, &$index = 1) {
  *                  will be assocaited with the phylonode.
  *
  * Prior to importing the tree the indicies can be set by using the
- * tripal_assign_phylogeny_tree_indices() function.
+ * chado_assign_phylogeny_tree_indices() function.
  *
  * @param $tree
  *   The tree array.
@@ -629,12 +629,12 @@ function tripal_assign_phylogeny_tree_indices(&$tree, &$index = 1) {
  *
  * @ingroup tripal_phylotree_api
  */
-function tripal_phylogeny_import_tree(&$tree, $phylotree, $options, $vocab = array(), $parent = NULL) {
+function chado_phylogeny_import_tree(&$tree, $phylotree, $options, $vocab = array(), $parent = NULL) {
 
   // Get the vocabulary terms used to describe nodes in the tree if one
   // wasn't provided.
   if (count($vocab) == 0) {
-    $vocab = tripal_phylogeny_get_node_types_vocab();
+    $vocab = chado_phylogeny_get_node_types_vocab();
   }
 
   if (is_array($tree) and array_key_exists('name', $tree)) {
@@ -738,7 +738,7 @@ function tripal_phylogeny_import_tree(&$tree, $phylotree, $options, $vocab = arr
   }
   if (is_array($tree) and array_key_exists('branch_set', $tree)) {
     foreach ($tree['branch_set'] as $key => $node) {
-      tripal_phylogeny_import_tree($tree['branch_set'][$key], $phylotree, $options, $vocab, $tree);
+      chado_phylogeny_import_tree($tree['branch_set'][$key], $phylotree, $options, $vocab, $tree);
     }
   }
 }
@@ -751,7 +751,7 @@ function tripal_phylogeny_import_tree(&$tree, $phylotree, $options, $vocab = arr
  * 
  * @ingroup tripal_phylotree_api
  */
-function tripal_phylogeny_get_node_types_vocab() {
+function chado_phylogeny_get_node_types_vocab() {
   // Get the vocabulary terms used to describe nodes in the tree.
   $values = array(
     'name' => 'phylo_leaf',
@@ -819,7 +819,7 @@ function tripal_phylogeny_get_node_types_vocab() {
  *
  *  @ingroup tripal_phylotree_api
  */
-function tripal_phylogeny_import_tree_file($file_name, $format, $options = array(), $job_id = NULL) {
+function chado_phylogeny_import_tree_file($file_name, $format, $options = array(), $job_id = NULL) {
 
   // Set some option details.
   if (!array_key_exists('leaf_type', $options)) {
@@ -867,11 +867,11 @@ function tripal_phylogeny_import_tree_file($file_name, $format, $options = array
       $tree = tripal_phylogeny_parse_newick_file($file_name);
 
       // Assign the right and left indecies to the tree ndoes.
-      tripal_assign_phylogeny_tree_indices($tree);
+      chado_assign_phylogeny_tree_indices($tree);
     }
     // Iterate through the tree nodes and add them to Chado in accordance
     // with the details in the $options array.
-    tripal_phylogeny_import_tree($tree, $phylotree, $options);
+    chado_phylogeny_import_tree($tree, $phylotree, $options);
   }
   catch (Exception $e) {
     $transaction->rollback();

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

@@ -48,7 +48,7 @@
  *
  * @ingroup tripal_pub_api
  */
-function tripal_get_publication($identifiers, $options = array()) {
+function chado_get_publication($identifiers, $options = array()) {
 
   // Error Checking of parameters
   if (!is_array($identifiers)) {
@@ -184,12 +184,12 @@ function tripal_get_publication($identifiers, $options = array()) {
  *
  * @ingroup tripal_pub_api
  */
-function tripal_publication_exists($pub_details) {
+function chado_publication_exists($pub_details) {
 
   // First try to find the publication using the accession number if that key 
   // exists in the details array.
   if (array_key_exists('Publication Dbxref', $pub_details)) {
-    $pub = tripal_get_publication(array('dbxref' => $pub_details['Publication Dbxref']));
+    $pub = chado_get_publication(array('dbxref' => $pub_details['Publication Dbxref']));
     if($pub) {
       return array($pub->pub_id);
     }
@@ -197,7 +197,7 @@ function tripal_publication_exists($pub_details) {
 
   // Make sure the citation is unique.
   if (array_key_exists('Citation', $pub_details)) {
-    $pub = tripal_get_publication(array('uniquename' => $pub_details['Citation']));
+    $pub = chado_get_publication(array('uniquename' => $pub_details['Citation']));
     if($pub) {
       return array($pub->pub_id);
     }
@@ -218,17 +218,17 @@ function tripal_publication_exists($pub_details) {
         'name' => 'tripal_pub',
       ),
     );
-    $pub_type = tripal_get_cvterm($identifiers);
+    $pub_type = chado_get_cvterm($identifiers);
   }
   else {
     tripal_report_error('tripal_pub', TRIPAL_ERROR,
-      "tripal_publication_exists(): The Publication Type is a " .
+      "chado_publication_exists(): The Publication Type is a " .
       "required property but is missing", array());
     return array();
   }
   if (!$pub_type) {
     tripal_report_error('tripal_pub', TRIPAL_ERROR,
-     "tripal_publication_exists(): Cannot find publication type: '%type'",
+      "chado_publication_exists(): Cannot find publication type: '%type'",
       array('%type' => $pub_details['Publication Type'][0]));
     return array();
   }
@@ -298,7 +298,7 @@ function tripal_publication_exists($pub_details) {
  *
  * @ingroup tripal_pub_api
  */
-function tripal_autocomplete_pub($string = '') {
+function chado_autocomplete_pub($string = '') {
   $items = array();
   $sql = "
     SELECT pub_id, title, uniquename
@@ -334,7 +334,7 @@ function tripal_autocomplete_pub($string = '') {
  *
  * @ingroup tripal_pub_api
  */
-function tripal_import_pub_by_dbxref($pub_dbxref, $do_contact = FALSE, $do_update = TRUE) {
+function chado_import_pub_by_dbxref($pub_dbxref, $do_contact = FALSE, $do_update = TRUE) {
   $num_to_retrieve = 1;
   $pager_id = 0;
   $page = 0;
@@ -410,7 +410,7 @@ function tripal_import_pub_by_dbxref($pub_dbxref, $do_contact = FALSE, $do_updat
  *
  * @ingroup tripal_pub_api
  */
-function tripal_execute_active_pub_importers($report_email = FALSE, $do_update = FALSE) {
+function chado_execute_active_pub_importers($report_email = FALSE, $do_update = FALSE) {
   $num_to_retrieve = 100;
   $page = 0;
 
@@ -528,7 +528,7 @@ function tripal_execute_active_pub_importers($report_email = FALSE, $do_update =
  *
  * @ingroup tripal_pub_api
  */
-function tripal_reimport_publications($do_contact = FALSE, $dbxref = NULL, $db = NULL) {
+function chado_reimport_publications($do_contact = FALSE, $dbxref = NULL, $db = NULL) {
 
   print "\nNOTE: Loading of publications is performed using a database transaction. \n" .
       "If the load fails or is terminated prematurely then the entire set of \n" .
@@ -633,7 +633,7 @@ function tripal_reimport_publications($do_contact = FALSE, $dbxref = NULL, $db =
  *
  * @ingroup tripal_pub_api
  */
-function tripal_pub_create_citations($options) {
+function chado_pub_create_citations($options) {
   $skip_existing = TRUE;
   $sql = "
     SELECT cvterm_id
@@ -669,7 +669,7 @@ function tripal_pub_create_citations($options) {
   while ($pub = $result->fetchObject()) {
     $pub_arr = tripal_pub_get_publication_array($pub->pub_id, $skip_existing);
     if ($pub_arr) {
-      $citation = tripal_pub_create_citation($pub_arr);
+      $citation = chado_pub_create_citation($pub_arr);
       print $citation . "\n\n";
       // Replace if citation exists. This condition is never TRUE if 
       // $skip_existing is TRUE.
@@ -726,7 +726,7 @@ function tripal_pub_create_citations($options) {
  *
  * @ingroup tripal_pub_api
  */
-function tripal_pub_create_citation($pub) {
+function chado_pub_create_citation($pub) {
   $citation = '';
   $pub_type = '';
 
@@ -1028,7 +1028,7 @@ function tripal_pub_create_citation($pub) {
  * 
  * @ingroup tripal_pub_api
  */
-function tripal_get_minimal_pub_info($pub) {
+function chado_get_minimal_pub_info($pub) {
   if (!$pub) {
     return array();
   }
@@ -1150,7 +1150,7 @@ function tripal_get_minimal_pub_info($pub) {
       'Pages' => $pub->pages,
       'Publication Date' => $pub->pyear,
     );
-    $citation = tripal_pub_create_citation($pub_info);
+    $citation = chado_pub_create_citation($pub_info);
   }
 
   return array(

+ 9 - 9
tripal_chado/api/modules/tripal_chado.stock.api.inc

@@ -40,7 +40,7 @@
  *
  * @ingroup tripal_stock_api
  */
-function tripal_get_stock($identifiers, $options = array()) {
+function chado_get_stock($identifiers, $options = array()) {
 
   // Set Defaults.
   if (!isset($options['include_fk'])) {
@@ -53,7 +53,7 @@ function tripal_get_stock($identifiers, $options = array()) {
     tripal_report_error(
       'tripal_stock_api',
       TRIPAL_ERROR,
-      "tripal_get_stock: The identifier passed in is expected to be an array with the key
+      "chado_get_stock: The identifier passed in is expected to be an array with the key
         matching a column name in the stock table (ie: stock_id or name). You passed in %identifier.",
       array(
         '%identifier'=> print_r($identifiers, TRUE)
@@ -64,7 +64,7 @@ function tripal_get_stock($identifiers, $options = array()) {
     tripal_report_error(
       'tripal_stock_api',
       TRIPAL_ERROR,
-      "tripal_get_stock: You did not pass in anything to identify the stock you want. The identifier
+      "chado_get_stock: You did not pass in anything to identify the stock you want. The identifier
         is expected to be an array with the key matching a column name in the stock table
         (ie: stock_id or name). You passed in %identifier.",
       array(
@@ -102,7 +102,7 @@ function tripal_get_stock($identifiers, $options = array()) {
     tripal_report_error(
       'tripal_stock_api',
       TRIPAL_ERROR,
-      "tripal_get_stock: The identifiers you passed in were not unique. You passed in %identifier.",
+      "chado_get_stock: The identifiers you passed in were not unique. You passed in %identifier.",
       array(
         '%identifier'=> print_r($identifiers, TRUE)
       )
@@ -114,7 +114,7 @@ function tripal_get_stock($identifiers, $options = array()) {
     tripal_report_error(
       'tripal_stock_api',
       TRIPAL_ERROR,
-      "tripal_get_stock: chado_generate_var() failed to return a stock based on the identifiers
+      "chado_get_stock: chado_generate_var() failed to return a stock based on the identifiers
         you passed in. You should check that your identifiers are correct, as well as, look
         for a chado_generate_var error for additional clues. You passed in %identifier.",
       array(
@@ -146,7 +146,7 @@ function tripal_get_stock($identifiers, $options = array()) {
  *
  * @ingroup tripal_stock_api
  */
-function tripal_get_multiple_stocks($identifiers, $options = array()) {
+function chado_get_multiple_stocks($identifiers, $options = array()) {
 
   // Set Defaults.
   if (!isset($options['include_fk'])) {
@@ -159,7 +159,7 @@ function tripal_get_multiple_stocks($identifiers, $options = array()) {
     tripal_report_error(
       'tripal_stock_api',
       TRIPAL_ERROR,
-      "tripal_get_stock: The identifier passed in is expected to be an array with the key
+      "chado_get_stock: The identifier passed in is expected to be an array with the key
         matching a column name in the stock table (ie: stock_id or name). You passed in %identifier.",
       array(
         '%identifier'=> print_r($identifiers, TRUE)
@@ -170,7 +170,7 @@ function tripal_get_multiple_stocks($identifiers, $options = array()) {
     tripal_report_error(
       'tripal_stock_api',
       TRIPAL_ERROR,
-      "tripal_get_stock: You did not pass in anything to identify the stock you want. The identifier
+      "chado_get_stock: You did not pass in anything to identify the stock you want. The identifier
         is expected to be an array with the key matching a column name in the stock table
         (ie: stock_id or name). You passed in %identifier.",
       array(
@@ -208,7 +208,7 @@ function tripal_get_multiple_stocks($identifiers, $options = array()) {
     tripal_report_error(
       'tripal_stock_api',
       TRIPAL_ERROR,
-      "tripal_get_stock: chado_generate_var() failed to return a stock based on the identifiers
+      "chado_get_stock: chado_generate_var() failed to return a stock based on the identifiers
         you passed in. You should check that your identifiers are correct, as well as, look
         for a chado_generate_var error for additional clues. You passed in %identifier.",
       array(

+ 7 - 7
tripal_chado/api/tripal_chado.DEPRECATED.api.inc

@@ -47,7 +47,7 @@ function tripal_chado_publish_records($values, $job_id = null) {
  * @ingroup tripal_chado_DEPRECATED_api
  */
 function tripal_get_chado_tokens($base_table) {
-  chado_get_chado_tokens($base_table);
+  chado_get_tokens($base_table);
 }
 
 /**
@@ -66,7 +66,7 @@ function tripal_get_chado_tokens($base_table) {
  *  @ingroup tripal_chado_DEPRECATED_api
  */
 function tripal_replace_chado_tokens($string, $record) {
-  chado_replace_chado_tokens($string, $record);
+  chado_replace_tokens($string, $record);
 }
 
 /**
@@ -325,7 +325,7 @@ function tripal_get_schema_name($schema = 'chado')
  */
 function tripal_add_chado_semweb_table($chado_table)
 {
-  chado_add_chado_semweb_table($chado_table);
+  chado_add_semweb_table($chado_table);
 }
 
 /**
@@ -362,7 +362,7 @@ function tripal_associate_chado_semweb_term(
   $term,
   $update = false
 ) {
-  chado_associate_chado_semweb_term(
+  chado_associate_semweb_term(
     $chado_table,
     $chado_column,
     $term,
@@ -392,7 +392,7 @@ function tripal_associate_chado_semweb_term(
  */
 function tripal_get_chado_semweb_term($chado_table, $chado_column, $options = array())
 {
-  chado_get_chado_semweb_term($chado_table, $chado_column, $options = array());
+  chado_get_semweb_term($chado_table, $chado_column, $options = array());
 }
 
 /**
@@ -407,7 +407,7 @@ function tripal_get_chado_semweb_term($chado_table, $chado_column, $options = ar
  */
 function tripal_format_chado_semweb_term($cvterm)
 {
-  chado_format_chado_semweb_term($cvterm);
+  chado_format_semweb_term($cvterm);
 }
 /**
  * Retreive the column name in a Chado table that matches a given term.
@@ -426,5 +426,5 @@ function tripal_format_chado_semweb_term($cvterm)
  */
 function tripal_get_chado_semweb_column($chado_table, $term)
 {
-  chado_get_chado_semweb_column($chado_table, $term);
+  chado_get_semweb_column($chado_table, $term);
 }

+ 4 - 4
tripal_chado/api/tripal_chado.api.inc

@@ -268,7 +268,7 @@ function chado_publish_records($values, $job_id = NULL) {
  * 
  * @ingroup tripal_chado_api
  */
-function chado_get_chado_tokens($base_table) {
+function chado_get_tokens($base_table) {
 
   $tokens = array();
   $table_descrip = chado_get_schema($base_table);
@@ -300,7 +300,7 @@ function chado_get_chado_tokens($base_table) {
         $sub_token_prefix = $base_table . '.' . $left_field;
         $sub_location_prefix = implode(' > ',array($base_table, $left_field));
 
-        $sub_tokens = chado_get_chado_tokens($table);
+        $sub_tokens = chado_get_tokens($table);
         if (is_array($sub_tokens)) {
           $tokens = array_merge($tokens, $sub_tokens);
         }
@@ -326,9 +326,9 @@ function chado_get_chado_tokens($base_table) {
  * 
  *  @ingroup tripal_chado_api
  */
-function chado_replace_chado_tokens($string, $record) {
+function chado_replace_tokens($string, $record) {
   // Get the list of tokens
-  $tokens = chado_get_chado_tokens($record->tablename);
+  $tokens = chado_get_tokens($record->tablename);
 
   // Determine which tokens were used in the format string
   if (preg_match_all('/\[[^]]+\]/', $string, $used_tokens)) {

+ 2 - 2
tripal_chado/api/tripal_chado.custom_tables.api.inc

@@ -72,7 +72,7 @@ function chado_edit_custom_table($table_id, $table_name, $schema, $skip_if_exist
 
     // Re-add the custom table to the semantic web interface to pick up any
     // changes in fields.
-    chado_add_chado_semweb_table($table_name);
+    chado_add_semweb_table($table_name);
   }
   catch (Exception $e) {
     $transaction->rollback();
@@ -203,7 +203,7 @@ function chado_create_custom_table($table, $schema, $skip_if_exists = TRUE,
     }
 
     // Add the custom table to the semantic web interface.
-    chado_add_chado_semweb_table($table);
+    chado_add_semweb_table($table);
   }
   catch (Exception $e) {
     $transaction->rollback();

+ 7 - 7
tripal_chado/api/tripal_chado.semweb.api.inc

@@ -22,7 +22,7 @@
  * the Chado schema, this function should be called to indicate that the
  * table should be included in the semantic web. No associations are made for
  * the columns. The associations should be added using the
- * chado_associate_chado_semweb_term() function.
+ * chado_associate_semweb_term() function.
  *
  * If the table has already been added previously then this function does
  * nothing. It will not overwrite existing assocations.
@@ -35,7 +35,7 @@
  * 
  * @ingroup tripal_chado_semweb_api
  */
-function chado_add_chado_semweb_table($chado_table) {
+function chado_add_semweb_table($chado_table) {
 
   // Don't include the tripal temp tables.
   if (preg_match('/tripal_.+_temp/', $chado_table)) {
@@ -92,7 +92,7 @@ function chado_add_chado_semweb_table($chado_table) {
  * 
  *  @ingroup tripal_chado_semweb_api
  */
-function chado_associate_chado_semweb_term($chado_table, $chado_column, $term,
+function chado_associate_semweb_term($chado_table, $chado_column, $term,
     $update = FALSE) {
 
   // Check for required arguments.
@@ -197,7 +197,7 @@ function chado_associate_chado_semweb_term($chado_table, $chado_column, $term,
  * 
  *  @ingroup tripal_chado_semweb_api
  */
-function chado_get_chado_semweb_term($chado_table, $chado_column, $options = array()) {
+function chado_get_semweb_term($chado_table, $chado_column, $options = array()) {
   $cvterm_id = db_select('chado_semweb', 'CS')
     ->fields('CS', array('cvterm_id'))
     ->condition('chado_column', $chado_column)
@@ -211,7 +211,7 @@ function chado_get_chado_semweb_term($chado_table, $chado_column, $options = arr
       return $cvterm;
     }
 
-    return chado_format_chado_semweb_term($cvterm);
+    return chado_format_semweb_term($cvterm);
   }
 }
 
@@ -225,7 +225,7 @@ function chado_get_chado_semweb_term($chado_table, $chado_column, $options = arr
  * 
  *  @ingroup tripal_chado_semweb_api
  */
-function chado_format_chado_semweb_term($cvterm) {
+function chado_format_semweb_term($cvterm) {
   if ($cvterm) {
     return $cvterm->dbxref_id->db_id->name . ':' . $cvterm->dbxref_id->accession;
   }
@@ -246,7 +246,7 @@ function chado_format_chado_semweb_term($cvterm) {
  * 
  *  @ingroup tripal_chado_semweb_api
  */
-function chado_get_chado_semweb_column($chado_table, $term) {
+function chado_get_semweb_column($chado_table, $term) {
   $columns = db_select('chado_semweb', 'CS')
     ->fields('CS')
     ->condition('chado_table', $chado_table)

+ 3 - 3
tripal_chado/includes/TripalFields/chado_linker__prop/chado_linker__prop.inc

@@ -70,7 +70,7 @@ class chado_linker__prop extends ChadoField {
 
     $vocabulary = $this->instance['settings']['term_vocabulary'];
     $accession = $this->instance['settings']['term_accession'];
-    $cvterm = tripal_get_cvterm(array(
+    $cvterm = chado_get_cvterm(array(
       'dbxref_id' => array(
         'db_id' => array(
           'name' => $vocabulary,
@@ -141,7 +141,7 @@ class chado_linker__prop extends ChadoField {
     $vocab = $this->instance['settings']['term_vocabulary'];
     $accession = $this->instance['settings']['term_accession'];
 
-    $cvterm = tripal_get_cvterm(array('id' => $vocab . ':' . $accession));
+    $cvterm = chado_get_cvterm(array('id' => $vocab . ':' . $accession));
 
     $this->queryJoinOnce($query, $prop_linker, $alias, "base.$bpkey = $alias.$bpkey");
     $query->condition("$alias.type_id", $cvterm->cvterm_id);
@@ -163,7 +163,7 @@ class chado_linker__prop extends ChadoField {
     $vocab = $this->instance['settings']['term_vocabulary'];
     $accession = $this->instance['settings']['term_accession'];
 
-    $cvterm = tripal_get_cvterm(array('id' => $vocab . ':' . $accession));
+    $cvterm = chado_get_cvterm(array('id' => $vocab . ':' . $accession));
 
     $this->queryJoinOnce($query, $prop_linker, $alias, "base.$bpkey = $alias.$bpkey AND $alias.type_id = $cvterm->cvterm_id", "LEFT OUTER");
     $query->orderBy("$alias.value", $order['direction']);

+ 1 - 1
tripal_chado/includes/TripalFields/chado_linker__prop/chado_linker__prop_widget.inc

@@ -66,7 +66,7 @@ class chado_linker__prop_widget extends ChadoFieldWidget {
     if (!$type_id) {
       $vocabulary = $this->instance['settings']['term_vocabulary'];
       $accession = $this->instance['settings']['term_accession'];
-      $cvterm = tripal_get_cvterm(array(
+      $cvterm = chado_get_cvterm(array(
         'dbxref_id' => array(
           'db_id' => array(
             'name' => $vocabulary,

+ 2 - 2
tripal_chado/includes/TripalFields/data__accession/data__accession_widget.inc

@@ -39,7 +39,7 @@ class data__accession_widget extends ChadoFieldWidget {
     }
 
     $schema = chado_get_schema('dbxref');
-    $options = tripal_get_db_select_options();
+    $options = chado_get_db_select_options();
 
     //$widget['#element_validate'] = array('chado_base__dbxref_id_widget_validate');
     $widget['#prefix'] =  "<span id='$field_name-dbxref--db-id'>";
@@ -137,7 +137,7 @@ class data__accession_widget extends ChadoFieldWidget {
           'db_id' => $db_id,
           'accession' => $accession,
         );
-        $dbxref = tripal_insert_dbxref($values);
+        $dbxref = chado_insert_dbxref($values);
         $form_state['values'][$field_name]['und'][$delta]['chado-' . $field_table . '__dbxref_id'] = $dbxref->dbxref_id;
         $form_state['values'][$field_name]['und'][$delta]['value'] = $dbxref->dbxref_id;
       }

+ 5 - 5
tripal_chado/includes/TripalFields/data__sequence/data__sequence.inc

@@ -120,7 +120,7 @@ class data__sequence extends ChadoField {
         '@type' => 'SO:0000316',
         'type' => 'coding_sequence',
         'label' => 'Coding sequence (CDS)',
-        'defline' => tripal_get_fasta_defline($feature, 'CDS', NULL, '', strlen($coding_seq)),
+        'defline' => chado_get_fasta_defline($feature, 'CDS', NULL, '', strlen($coding_seq)),
         'residues' => $coding_seq,
       );
     }
@@ -137,13 +137,13 @@ class data__sequence extends ChadoField {
         'residues' => $attrs['residues'],
         '@type' => 'SO:0000110',
         'type' => 'sequence_feature',
-        'defline' => tripal_get_fasta_defline($feature, '', $attrs['featureloc'], 'CDS', strlen($attrs['residues'])),
+        'defline' => chado_get_fasta_defline($feature, '', $attrs['featureloc'], 'CDS', strlen($attrs['residues'])),
         'label' => 'Sequence from alignment at ' . $attrs['location'],
       );
 
 
       // check to see if this alignment has any CDS. If so, generate a CDS sequence
-      $cds_sequence = tripal_get_feature_sequences(
+      $cds_sequence = chado_get_feature_sequences(
           array(
             'feature_id' => $feature->feature_id,
             'parent_id' => $attrs['featureloc']->srcfeature_id->feature_id,
@@ -159,7 +159,7 @@ class data__sequence extends ChadoField {
           );
 
       if (count($cds_sequence) > 0) {
-        // the tripal_get_feature_sequences() function can return multiple sequences
+        // the chado_get_feature_sequences() function can return multiple sequences
         // if a feature is aligned to multiple places. In the case of CDSs we expect
         // that one mRNA is only aligned to a single location on the assembly so we
         // can access the CDS sequence with index 0.
@@ -168,7 +168,7 @@ class data__sequence extends ChadoField {
             'residues' => $cds_sequence[0]['residues'],
             '@type' => 'SO:0000316',
             'type' => 'coding_sequence',
-            'defline' => tripal_get_fasta_defline($feature, '', $attrs['featureloc'], 'CDS', $cds_sequence[0]['length']),
+            'defline' => chado_get_fasta_defline($feature, '', $attrs['featureloc'], 'CDS', $cds_sequence[0]['length']),
             'label' => 'Coding sequence (CDS) from alignment at  ' . $attrs['location'],
           );
         }

+ 1 - 1
tripal_chado/includes/TripalFields/go__gene_expression/go__gene_expression.inc

@@ -124,7 +124,7 @@ class go__gene_expression extends ChadoField {
         // Add the pub information if a real pub is associated with the record.
         $pub = $exp_linker->pub_id;
         if ($pub->uniquename != 'null') {
-          $pub_details = tripal_get_minimal_pub_info($pub);
+          $pub_details = chado_get_minimal_pub_info($pub);
 
           $entity->{$field_name}['und'][$i]['value']['publication'] = $pub_details;
           $entity->{$field_name}['und'][$i]['value']['publication']['type'] = $pub->type_id->name;

+ 1 - 1
tripal_chado/includes/TripalFields/obi__organism/obi__organism_widget.inc

@@ -39,7 +39,7 @@ class obi__organism_widget extends ChadoFieldWidget {
       '#type' => 'value',
       '#value' => array_key_exists($delta, $items) ? $items[$delta]['value'] : '',
     );
-    $options = tripal_get_organism_select_options(FALSE);
+    $options = chado_get_organism_select_options(FALSE);
     $widget[$linker_field] = array(
       '#type' => 'select',
       '#title' => $element['#title'],

+ 1 - 1
tripal_chado/includes/TripalFields/sbo__database_cross_reference/sbo__database_cross_reference.inc

@@ -153,7 +153,7 @@ class sbo__database_cross_reference extends ChadoField {
           continue;
         }
 
-        $URL = tripal_get_dbxref_url($dbxref);
+        $URL = chado_get_dbxref_url($dbxref);
         $entity->{$field_name}['und'][$i] = array(
           'value' => array(
             $dbname_term => $dbxref->db_id->name,

+ 2 - 2
tripal_chado/includes/TripalFields/sbo__database_cross_reference/sbo__database_cross_reference_formatter.inc

@@ -31,8 +31,8 @@ class sbo__database_cross_reference_formatter extends ChadoFieldFormatter {
       }
       $content = $item['value'][$dbname_term] . ':' . $item['value'][$accession_term];
       if ($item['value'][$dburl_term]) {
-        $dbxref = tripal_get_dbxref(array('dbxref_id' => $item['chado-' . $linker_table . '__dbxref_id']));
-        $url = tripal_get_dbxref_url($dbxref);
+        $dbxref = chado_get_dbxref(array('dbxref_id' => $item['chado-' . $linker_table . '__dbxref_id']));
+        $url = chado_get_dbxref_url($dbxref);
         $content = l($content, $url, array('attributes' => array('target' => '_blank')));
       }
       $element[$delta] = array(

+ 1 - 1
tripal_chado/includes/TripalFields/sbo__database_cross_reference/sbo__database_cross_reference_widget.inc

@@ -73,7 +73,7 @@ class sbo__database_cross_reference_widget extends ChadoFieldWidget {
       '#type' => 'value',
       '#default_value' => $dbxref_id,
     );
-    $options = tripal_get_db_select_options();
+    $options = chado_get_db_select_options();
     $widget['db_id'] = array(
       '#type' => 'select',
       '#title' => t('Database'),

+ 5 - 5
tripal_chado/includes/TripalFields/sbo__relationship/sbo__relationship.inc

@@ -618,7 +618,7 @@ class sbo__relationship extends ChadoField {
     //         as the relationship types. This select box will replace the vocabulary select box if the
     //         following value is set.'
     //     );
-    $vocs = tripal_get_cv_select_options();
+    $vocs = chado_get_cv_select_options();
     $element['relationships']['option1'] = array(
       '#type' => 'item',
       '#title' => 'Option #1',
@@ -725,7 +725,7 @@ class sbo__relationship extends ChadoField {
           if (strpos($type, '|')) {
             $tmp = explode('|', $type, 2);
             $type = trim($tmp[1]);
-            $cv = tripal_get_cv(array('name' => trim($tmp[0])));
+            $cv = chado_get_cv(array('name' => trim($tmp[0])));
             if($cv) {
               $sql = "SELECT cvterm_id FROM {cvterm} WHERE name = :name AND cv_id = :cv_id";
               $results = chado_query($sql, array(':name' => $type, ':cv_id' => $cv->cv_id));
@@ -753,7 +753,7 @@ class sbo__relationship extends ChadoField {
           if (strpos($type, '|')) {
             $tmp = explode('|', $type, 2);
             $type = trim($tmp[1]);
-            $cv = tripal_get_cv(array('name' => trim($tmp[0])));
+            $cv = chado_get_cv(array('name' => trim($tmp[0])));
             if ($cv) {
               $sql = "SELECT cvterm_id FROM {cvterm} WHERE name = :name AND cv_id = :cv_id";
               $results = chado_query($sql, array(':name' => $type, ':cv_id' => $cv->cv_id));
@@ -774,14 +774,14 @@ class sbo__relationship extends ChadoField {
     if ($option2) {
       $cv_id = $settings['option2_vocab'];
       $supertype = $settings['option2_parent'];
-      $term = tripal_get_cvterm(array(
+      $term = chado_get_cvterm(array(
         'name' => trim($supertype),
         'cv_id' => $cv_id,
       ));
       // Tripal cv autocomplete also allow cvterm synonyms, if the parent term doesn't match
       // a cvterm, try cvtermsynonym
       if (!$term) {
-        $synonym = tripal_get_cvterm(
+        $synonym = chado_get_cvterm(
             array(
               'synonym' => array(
                 'name' => trim($supertype),

+ 7 - 7
tripal_chado/includes/TripalFields/sbo__relationship/sbo__relationship_widget.inc

@@ -194,13 +194,13 @@ class sbo__relationship_widget extends ChadoFieldWidget {
         if (trim($rtype) == '') {
           continue;
         }
-        $term = tripal_get_cvterm(array('name' => trim($rtype)));
+        $term = chado_get_cvterm(array('name' => trim($rtype)));
         // Try to get term with vocabulary specified
         if (!$term) {
           $tmp = explode('|', trim($rtype), 2);
-          $cv = tripal_get_cv(array('name' => trim($tmp[0])));
+          $cv = chado_get_cv(array('name' => trim($tmp[0])));
           $rtype = trim($tmp[1]);
-          $term = tripal_get_cvterm(array('name' => $rtype, 'cv_id' => $cv->cv_id));
+          $term = chado_get_cvterm(array('name' => $rtype, 'cv_id' => $cv->cv_id));
         }
         $rtype_options[$term->cvterm_id] = $term->name;
       }
@@ -220,7 +220,7 @@ class sbo__relationship_widget extends ChadoFieldWidget {
         'cv_id' => $option2_vocab,
         'name' => $option2_parent
       );
-      $parent_term = tripal_get_cvterm($values);
+      $parent_term = chado_get_cvterm($values);
 
       // If the term wasn't found then see if it's a synonym.
       if(!$parent_term) {
@@ -229,7 +229,7 @@ class sbo__relationship_widget extends ChadoFieldWidget {
             'name' => trim($option2_parent),
           )
         );
-        $synonym = tripal_get_cvterm($values);
+        $synonym = chado_get_cvterm($values);
         if ($synonym && $synonym->cv_id->cv_id == $option2_vocab) {
           $parent_term = $synonym;
         }
@@ -283,11 +283,11 @@ class sbo__relationship_widget extends ChadoFieldWidget {
     else {
       // Set up available cvterms for selection
       $vocs = array(0 => 'Select a vocabulary');
-      $vocs = tripal_get_cv_select_options();
+      $vocs = chado_get_cv_select_options();
       $cv_id = isset($form_state['values'][$field_name]['und'][0]['vocabulary']) ? $form_state['values'][$field_name]['und'][0]['vocabulary'] : 0;
       // Try getting the cv_id from cvterm for existing records
       if (!$cv_id && $type_id) {
-        $cvterm = tripal_get_cvterm(array('cvterm_id' => $type_id));
+        $cvterm = chado_get_cvterm(array('cvterm_id' => $type_id));
         if (isset($cvterm->cv_id->cv_id)) {
           $cv_id = $cvterm->cv_id->cv_id;
           $default_term = $cvterm->name;

+ 2 - 2
tripal_chado/includes/TripalFields/schema__additional_type/schema__additional_type_widget.inc

@@ -68,8 +68,8 @@ class schema__additional_type_widget extends ChadoFieldWidget {
       }
     }
     elseif ($vocabulary) {
-      $cv = tripal_get_cv(array('name' => $vocabulary));
-      $options = tripal_get_cvterm_select_options($cv->cv_id);
+      $cv = chado_get_cv(array('name' => $vocabulary));
+      $options = chado_get_cvterm_select_options($cv->cv_id);
     }
     // If no vocabulary or parent term are provided then just give a generic
     // term finder.

+ 1 - 1
tripal_chado/includes/TripalFields/schema__publication/schema__publication.inc

@@ -107,7 +107,7 @@ class schema__publication extends ChadoField {
       $i = 0;
       foreach ($record->$linker_table as $index => $linker) {
         $pub = $linker->pub_id;
-        $pub_details = tripal_get_minimal_pub_info($pub);
+        $pub_details = chado_get_minimal_pub_info($pub);
 
         $entity->{$field_name}['und'][$i]['value'] = $pub_details;
         $entity->{$field_name}['und'][$i]['chado-' . $field_table . '__' . $pkey] = $linker->$pkey;

+ 1 - 1
tripal_chado/includes/TripalFields/schema__publication/schema__publication_widget.inc

@@ -37,7 +37,7 @@ class schema__publication_widget extends ChadoFieldWidget {
       $fkey_value = tripal_get_field_item_keyval($items, $delta, 'chado-' . $table_name . '__' . $fkey, $fkey_value);
       $pub_id = tripal_get_field_item_keyval($items, $delta, 'chado-' . $table_name . '__pub_id', $pub_id);
       if ($pub_id) {
-        $pub = tripal_get_publication(array('pub_id' => $pub_id));
+        $pub = chado_get_publication(array('pub_id' => $pub_id));
         $title =  $pub->title . ' [id:' . $pub->pub_id . ']';
       }
     }

+ 1 - 1
tripal_chado/includes/TripalFields/sio__annotation/sio__annotation_formatter.inc

@@ -35,7 +35,7 @@ class sio__annotation_formatter extends ChadoFieldFormatter {
         // Build the accession.
         $accession = $dbxref->db_id->name . ':' . $dbxref->accession;
         if ($dbxref->db_id->urlprefix) {
-          $accession = l($accession, tripal_get_dbxref_url($dbxref), array('attributes' => array('target' => '_blank')));
+          $accession = l($accession, chado_get_dbxref_url($dbxref), array('attributes' => array('target' => '_blank')));
         }
 
         $row = array(

+ 2 - 2
tripal_chado/includes/TripalFields/sio__annotation/sio__annotation_widget.inc

@@ -118,7 +118,7 @@ class sio__annotation_widget extends ChadoFieldWidget {
       '#default_value' => $fk_value,
     );
 
-    $cvs = tripal_get_cv_select_options();
+    $cvs = chado_get_cv_select_options();
     $widget['cv_id'] = array(
       '#type' => 'select',
       '#title' => t('Vocabulary'),
@@ -214,7 +214,7 @@ class sio__annotation_widget extends ChadoFieldWidget {
       }
       // Use the NULL pub.
       else {
-        $pub = tripal_get_publication(array('uniquename' => 'null'));
+        $pub = chado_get_publication(array('uniquename' => 'null'));
         $form_state['values'][$field_name][$langcode][$delta]['chado-' . $field_table . '__pub_id'] = $pub->pub_id;
       }
     }

+ 1 - 1
tripal_chado/includes/TripalFields/sio__references/sio__references.inc

@@ -129,7 +129,7 @@ class sio__references extends ChadoField {
               ->execute()
               ->fetchObject();
             if ($mapping) {
-              $cvterm = tripal_get_cvterm(array('cvterm_id' => $mapping->cvterm_id));
+              $cvterm = chado_get_cvterm(array('cvterm_id' => $mapping->cvterm_id));
               $entity->{$field_name}['und'][$delta]['value']['rdfs:type'] = $cvterm->name;
             }
           }

+ 1 - 1
tripal_chado/includes/TripalFields/sio__vocabulary/sio__vocabulary_widget.inc

@@ -30,7 +30,7 @@ class sio__vocabulary_widget extends ChadoFieldWidget {
       // Use the bundle to get the cv_id choosen for this cvterm-based entity.
       // ASSUMPTION: the cv_id is saved as the "type_value" of the bundle.
       $bundle = tripal_load_bundle_entity(array('name' => $widget['#bundle']));
-      $cv = tripal_get_cv(array('cv_id' => $bundle->type_value));
+      $cv = chado_get_cv(array('cv_id' => $bundle->type_value));
 
       // Now populate the items array with defaults based on the cv.
       if ($cv) {

+ 2 - 2
tripal_chado/includes/TripalFields/so__cds/so__cds.inc

@@ -81,7 +81,7 @@ class so__cds extends ChadoField {
 
     foreach($featurelocs as $featureloc){
       // Generate a CDS sequence if one exsits for this feature alignment.
-      $cds_sequence = tripal_get_feature_sequences(
+      $cds_sequence = chado_get_feature_sequences(
         array(
           'feature_id' => $feature->feature_id,
           'parent_id' => $featureloc->srcfeature_id->feature_id,
@@ -101,7 +101,7 @@ class so__cds extends ChadoField {
       );
 
       if (count($cds_sequence) > 0) {
-        // the tripal_get_feature_sequences() function can return multiple sequences
+        // the chado_get_feature_sequences() function can return multiple sequences
         // if a feature is aligned to multiple places. In the case of CDSs we expect
         // that one mRNA is only aligned to a single location on the assembly so we
         // can access the CDS sequence with index 0.

+ 2 - 2
tripal_chado/includes/TripalFields/taxrank__infraspecific_taxon/taxrank__infraspecific_taxon_widget.inc

@@ -48,8 +48,8 @@ class taxrank__infraspecific_taxon_widget extends ChadoFieldWidget {
       '#value' =>  $infra_name,
     );
 
-    $cv = tripal_get_cv(array('name' => 'taxonomic_rank'));
-    $terms = tripal_get_cvterm_select_options($cv->cv_id);
+    $cv = chado_get_cv(array('name' => 'taxonomic_rank'));
+    $terms = chado_get_cvterm_select_options($cv->cv_id);
 
     // Unfortunately the taxonomic_rank vocabulary is not properly organized
     // such that we only include terms below 'species'. Therefore we will

+ 2 - 2
tripal_chado/includes/TripalFields/uo__unit/uo__unit_widget.inc

@@ -31,8 +31,8 @@ class uo__unit_widget extends ChadoFieldWidget {
       '#type' => 'value',
       '#value' => array_key_exists($delta, $items) ? $items[$delta]['value'] : '',
     );
-    $cv = tripal_get_cv(array('name' => 'featuremap_units'));
-    $options = tripal_get_cvterm_select_options($cv->cv_id);
+    $cv = chado_get_cv(array('name' => 'featuremap_units'));
+    $options = chado_get_cvterm_select_options($cv->cv_id);
     unset($options[0]);
     $widget['chado-' . $field_table . '__unittype_id'] = array(
       '#type' => 'select',

+ 5 - 5
tripal_chado/includes/TripalImporter/GFF3Importer.inc

@@ -902,7 +902,7 @@ class GFF3Importer extends TripalImporter {
             TGPT.feature_id, TGPT.fmin, TGPT.fmax, TGCT.strand, FLM.uniquename
         ";
         $results = chado_query($sql);
-        $protein_cvterm = tripal_get_cvterm(array(
+        $protein_cvterm = chado_get_cvterm(array(
           'name' => 'polypeptide',
           'cv_id' => array(
             'name' => 'sequence'
@@ -947,7 +947,7 @@ class GFF3Importer extends TripalImporter {
             $feature = $this->loadFeature($organism, $analysis_id,
                 $protein_cvterm, $uname, $name, '', 'f', 'f', 1, 0);
             // Add the derives_from relationship.
-            $cvterm = tripal_get_cvterm(array('cvterm_id' => $result->cvterm_id));
+            $cvterm = chado_get_cvterm(array('cvterm_id' => $result->cvterm_id));
             $this->loadDerivesFrom($feature, $cvterm,
                 $result->uniquename, $organism, $pfmin, $pfmax);
             // Add the featureloc record. Set the start of the protein to
@@ -1055,7 +1055,7 @@ class GFF3Importer extends TripalImporter {
     $result = chado_select_record('tripal_gff_temp', array('type_name'), $values);
     $type_id = NULL;
     if (count($result) > 0) {
-      $otype = tripal_get_cvterm(array(
+      $otype = chado_get_cvterm(array(
         'name' => $result[0]->type_name,
         'cv_id' => array(
           'name' => 'sequence'
@@ -1472,7 +1472,7 @@ class GFF3Importer extends TripalImporter {
         'cv_name' => $syncv->name,
         'is_relationship' => FALSE
       );
-      $syntype = tripal_insert_cvterm($term, array('update_existing' => TRUE));
+      $syntype = chado_insert_cvterm($term, array('update_existing' => TRUE));
       if (!$syntype) {
         $this->logMessage("Cannot add synonym type: internal:$type.", array(), TRIPAL_WARNING);
         return 0;
@@ -1912,7 +1912,7 @@ class GFF3Importer extends TripalImporter {
         'cv_name' => 'feature_property',
         'is_relationship' => FALSE
       );
-      $cvterm = (object) tripal_insert_cvterm($term, array('update_existing' => FALSE));
+      $cvterm = (object)chado_insert_cvterm($term, array('update_existing' => FALSE));
       if (!$cvterm) {
         $this->logMessage("Cannot add cvterm, $property.", array(), TRIPAL_WARNING);
         return 0;

+ 3 - 3
tripal_chado/includes/TripalImporter/NewickImporter.inc

@@ -109,7 +109,7 @@ class NewickImporter extends TripalImporter {
     ];
 
     $type_cv = tripal_get_default_cv('phylotree', 'type_id');
-    $so_cv = tripal_get_cv(['name' => 'sequence']);
+    $so_cv = chado_get_cv(['name' => 'sequence']);
     $cv_id = $so_cv->cv_id;
     if (!$so_cv) {
       drupal_set_message('The Sequence Ontolgoy does not appear to be imported.
@@ -190,7 +190,7 @@ class NewickImporter extends TripalImporter {
     $errors = [];
     $warnings = [];
 
-    tripal_validate_phylotree('insert', $options, $errors, $warnings);
+    chado_validate_phylotree('insert', $options, $errors, $warnings);
 
     // Now set form errors if any errors were detected.
     if (count($errors) > 0) {
@@ -229,6 +229,6 @@ class NewickImporter extends TripalImporter {
     );
     $errors = array();
     $warnings = array();
-    tripal_insert_phylotree($options, $errors, $warnings);
+    chado_insert_phylotree($options, $errors, $warnings);
   }
 }

+ 16 - 16
tripal_chado/includes/TripalImporter/OBOImporter.inc

@@ -420,7 +420,7 @@ class OBOImporter extends TripalImporter {
     $this->logMessage("Updating cvtermpath table.  This may take a while...");
     foreach ($this->newcvs as $namespace => $cvid) {
       $this->logMessage("- Loading paths for @vocab", array('@vocab' => $namespace));
-      tripal_update_cvtermpath($cvid);
+      chado_update_cvtermpath($cvid);
     }
   }
   /**
@@ -486,7 +486,7 @@ class OBOImporter extends TripalImporter {
    */
   private function loadOBO_v1_2_file($obo_name, $file, $is_new = TRUE) {
     if ($is_new) {
-      tripal_insert_obo($obo_name, $file);
+      chado_insert_obo($obo_name, $file);
     }
 
     $success = $this->loadOBO_v1_2($file, $obo_name);
@@ -528,7 +528,7 @@ class OBOImporter extends TripalImporter {
     fclose($obo_fh);
 
     if ($is_new) {
-      tripal_insert_obo($obo_name, $url);
+      chado_insert_obo($obo_name, $url);
     }
 
     // second, parse the OBO
@@ -568,7 +568,7 @@ class OBOImporter extends TripalImporter {
     // present for each stanza.  Some ontologies have adopted the v1.4 method
     // in their v1.2 files and not including it.
     if (array_key_exists('default-namespace', $header)) {
-      $defaultcv = tripal_insert_cv($header['default-namespace'][0], '');
+      $defaultcv = chado_insert_cv($header['default-namespace'][0], '');
       if (!$defaultcv) {
         throw new Exception('Cannot add namespace ' . $header['default-namespace'][0]);
       }
@@ -607,7 +607,7 @@ class OBOImporter extends TripalImporter {
         else {
           $results = $short_name;
         }
-        $defaultcv = tripal_insert_cv(strtoupper($results), '');
+        $defaultcv = chado_insert_cv(strtoupper($results), '');
         $this->newcvs[$defaultcv->name] = $defaultcv->cv_id;
       }
       catch (Exception $e) {
@@ -776,7 +776,7 @@ class OBOImporter extends TripalImporter {
         elseif (array_key_exists('namespace', $ontology_info['config'])) {
           $results = $ontology_info['config']['namespace'];
         }
-        $cv_returned = tripal_insert_cv($results[0], '');
+        $cv_returned = chado_insert_cv($results[0], '');
         // If name && definition are both empty then look up the term from the ontology you just loaded.
         if($cv_returned) {
           $defaultcv = $cv_returned;
@@ -790,7 +790,7 @@ class OBOImporter extends TripalImporter {
     $t['db_name'] = $default_db;
 
     // add the cvterm
-    $cvterm = tripal_insert_cvterm($t, array('update_existing' => TRUE));
+    $cvterm = chado_insert_cvterm($t, array('update_existing' => TRUE));
     if (!$cvterm) {
       throw new Exception("Cannot add the term " . $term['id'][0]);
     }
@@ -1001,7 +1001,7 @@ class OBOImporter extends TripalImporter {
       'is_relationship' => TRUE,
       'db_name' => $default_db
     );
-    $relcvterm = tripal_insert_cvterm($term, array('update_existing' => FALSE));
+    $relcvterm = chado_insert_cvterm($term, array('update_existing' => FALSE));
 
     if (!$relcvterm) {
       // If the relationship term couldn't be found in the default_db provided
@@ -1015,7 +1015,7 @@ class OBOImporter extends TripalImporter {
         'is_relationship' => TRUE,
         'db_name' => 'OBO_REL'
       );
-      $relcvterm = tripal_insert_cvterm($term, array('update_existing' => FALSE));
+      $relcvterm = chado_insert_cvterm($term, array('update_existing' => FALSE));
       if (!$relcvterm) {
         throw new Exception("Cannot find the relationship term in the current ontology or in the relationship ontology: $rel\n");
       }
@@ -1047,7 +1047,7 @@ class OBOImporter extends TripalImporter {
     $objterm['is_relationship'] = $object_is_relationship;
     $objterm['db_name'] = $default_db;
 
-    $objcvterm = tripal_insert_cvterm($objterm, array('update_existing' => TRUE));
+    $objcvterm = chado_insert_cvterm($objterm, array('update_existing' => TRUE));
     if (!$objcvterm) {
       throw new Exception("Cannot add cvterm " . $oterm['name'][0]);
     }
@@ -1100,7 +1100,7 @@ class OBOImporter extends TripalImporter {
   private function addSynonym($term, $cvterm) {
 
     // make sure we have a 'synonym_type' vocabulary
-    $syncv = tripal_insert_cv(
+    $syncv = chado_insert_cv(
         'synonym_type',
         'A local vocabulary added for synonym types.'
     );
@@ -1124,7 +1124,7 @@ class OBOImporter extends TripalImporter {
             'name' => 'synonym_type',
           ),
         );
-        $syntype = tripal_get_cvterm($values);
+        $syntype = chado_get_cvterm($values);
 
         // if it doesn't exist then add it
         if (!$syntype) {
@@ -1137,7 +1137,7 @@ class OBOImporter extends TripalImporter {
             'cv_name' => $syncv->name,
             'is_relationship' => FALSE
           );
-          $syntype = tripal_insert_cvterm($term, array('update_existing' => TRUE));
+          $syntype = chado_insert_cvterm($term, array('update_existing' => TRUE));
           if (!$syntype) {
             throw new Exception("Cannot add synonym type: internal:$scope");
           }
@@ -1324,7 +1324,7 @@ class OBOImporter extends TripalImporter {
     }
 
     // add the database
-    $db = tripal_insert_db(array('name' => $dbname));
+    $db = chado_insert_db(array('name' => $dbname));
     if (!$db) {
       throw new Exception("Cannot find database '$dbname' in Chado.");
     }
@@ -1369,7 +1369,7 @@ class OBOImporter extends TripalImporter {
   private function addCvtermProp($cvterm, $property, $value, $rank) {
 
     // make sure the 'cvterm_property_type' CV exists
-    $cv = tripal_insert_cv('cvterm_property_type', '');
+    $cv = chado_insert_cv('cvterm_property_type', '');
     if (!$cv) {
       throw new Exception("Cannot add/find cvterm_property_type cvterm");
     }
@@ -1389,7 +1389,7 @@ class OBOImporter extends TripalImporter {
         'cv_name' => $cv->name,
         'is_relationship' => FALSE,
       );
-      $cvproptype = tripal_insert_cvterm($term, array('update_existing' => FALSE));
+      $cvproptype = chado_insert_cvterm($term, array('update_existing' => FALSE));
       if (!$cvproptype) {
         throw new Exception("Cannot add cvterm property: internal:$property");
       }

+ 13 - 13
tripal_chado/includes/TripalImporter/TaxonomyImporter.inc

@@ -256,7 +256,7 @@ class TaxonomyImporter extends TripalImporter {
 
     // Now import the tree.
     $options = array('taxonomy' => 1);
-    tripal_phylogeny_import_tree($this->tree, $this->phylotree, $options);
+    chado_phylogeny_import_tree($this->tree, $this->phylotree, $options);
   }
 
 
@@ -312,7 +312,7 @@ class TaxonomyImporter extends TripalImporter {
     $lineage_nodes[] = array();
 
     // Get the "rank" cvterm. It requires that the TAXRANK vocabulary is loaded.
-    $rank_cvterm = tripal_get_cvterm(array(
+    $rank_cvterm = tripal_chado_get_cvtermget_cvterm(array(
       'name' => 'rank',
       'cv_id' => array('name' => 'local')
     ));
@@ -332,7 +332,7 @@ class TaxonomyImporter extends TripalImporter {
     $total = count($this->all_orgs);
     $j = 1;
     foreach ($this->all_orgs as $organism) {
-      $sci_name =  tripal_get_organism_scientific_name($organism);
+      $sci_name = chado_get_organism_scientific_name($organism);
       //$this->logMessage("- " . ($j++) . " of $total. Adding @organism", array('@organism' => $sci_name));
 
       // First get the phylonode record for this organism.
@@ -433,7 +433,7 @@ class TaxonomyImporter extends TripalImporter {
       }
 
       // Now add in the leaf node
-      $sci_name = tripal_get_organism_scientific_name($organism);
+      $sci_name = chado_get_organism_scientific_name($organism);
       $node = array(
         'name' => $sci_name,
         'depth' => $i,
@@ -451,7 +451,7 @@ class TaxonomyImporter extends TripalImporter {
       $this->addTaxonomyNode($tree, $node, $lineage_depth);
 
       // Set the indecies for the tree.
-      tripal_assign_phylogeny_tree_indices($tree);
+      chado_assign_phylogeny_tree_indices($tree);
     }
 
     return $tree;
@@ -473,7 +473,7 @@ class TaxonomyImporter extends TripalImporter {
       // if so we should use that instead of the scientific name.
 
       // Build the query string to get the information about this species.
-      $sci_name = tripal_get_organism_scientific_name($organism);
+      $sci_name = chado_get_organism_scientific_name($organism);
       $sci_name = urlencode($sci_name);
       $search_url = "http://www.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?".
           "db=taxonomy" .
@@ -561,7 +561,7 @@ class TaxonomyImporter extends TripalImporter {
     // Second, check if the full name includes the infraspecific name.
     if (!$organism) {
       foreach ($this->all_orgs as $item) {
-        $internal_sci_name = tripal_get_organism_scientific_name($item);
+        $internal_sci_name = chado_get_organism_scientific_name($item);
         if ($sci_name == $internal_sci_name) {
           $organism = $item;
         }
@@ -594,13 +594,13 @@ class TaxonomyImporter extends TripalImporter {
       $infra = $matches[3];
 
       // Get the CV term for the rank.
-      $type = tripal_get_cvterm(array(
+      $type = chado_get_cvterm(array(
         'name' => preg_replace('/ /','_', $rank),
         'cv_id' => array('name' => 'taxonomic_rank')
       ));
 
       // Remove the rank from the infraspecific name.
-      $abbrev = tripal_abbreviate_infraspecific_rank($rank);
+      $abbrev = chado_abbreviate_infraspecific_rank($rank);
       $infra = preg_replace("/$abbrev/", "", $infra);
       $infra = trim($infra);
 
@@ -648,7 +648,7 @@ class TaxonomyImporter extends TripalImporter {
     $adds_organism = $organism ? FALSE : TRUE;
 
     // Get the "rank" cvterm. It requires that the TAXRANK vocabulary is loaded.
-    $rank_cvterm = tripal_get_cvterm(array(
+    $rank_cvterm = chado_get_cvterm(array(
       'name' => 'rank',
       'cv_id' => array('name' => 'local')
     ));
@@ -795,7 +795,7 @@ class TaxonomyImporter extends TripalImporter {
       $this->addTaxonomyNode($this->tree, $node, $lineage_depth);
 
       // Set the indecies for the tree.
-      tripal_assign_phylogeny_tree_indices($this->tree);
+      chado_assign_phylogeny_tree_indices($this->tree);
     }
   }
   /**
@@ -901,12 +901,12 @@ class TaxonomyImporter extends TripalImporter {
    * @param unknown $taxId
    */
   private function addDbxref($organism_id, $taxId) {
-    $db = tripal_get_db(array('name' => 'NCBITaxon'));
+    $db = chado_get_db(array('name' => 'NCBITaxon'));
     $values = array(
       'db_id' => $db->db_id,
       'accession' => $taxId
     );
-    $dbxref = tripal_insert_dbxref($values);
+    $dbxref = chado_insert_dbxref($values);
 
     $values = array(
       'dbxref_id' => $dbxref->dbxref_id,

+ 1 - 1
tripal_chado/includes/exporters/tripal_chado.seq_extract.inc

@@ -34,7 +34,7 @@ function tripal_chado_seq_extract_page() {
       drupal_add_http_header('Content-Disposition: attachment; filename="sequences.fasta.txt"');
     }
 
-    tripal_get_bulk_feature_sequences(array(
+    chado_get_bulk_feature_sequences(array(
       'genus' => $genus,
       'species' => $species,
       'analysis_name' => $analysis,

+ 1 - 1
tripal_chado/includes/loaders/tripal_chado.pub_importer_AGL.inc

@@ -927,7 +927,7 @@ function tripal_pub_AGL_parse_pubxml($pub_xml) {
   $pub['Author List'] = $newauths;
 
   // build the citation
-  $pub['Citation'] = tripal_pub_create_citation($pub);
+  $pub['Citation'] = chado_pub_create_citation($pub);
 
   $pub['raw'] = $pub_xml;
 

+ 3 - 3
tripal_chado/includes/loaders/tripal_chado.pub_importer_PMID.inc

@@ -436,7 +436,7 @@ function tripal_pub_PMID_parse_pubxml($pub_xml) {
       }
     }
   }
-  $pub['Citation'] = tripal_pub_create_citation($pub);
+  $pub['Citation'] = chado_pub_create_citation($pub);
 
   $pub['raw'] = $pub_xml;
   return $pub;
@@ -619,7 +619,7 @@ function tripal_pub_PMID_parse_publication_type($xml, &$pub) {
             )
           );
           $options = array('case_insensitive_columns' => array('name'));
-          $pub_cvterm = tripal_get_cvterm($identifiers, $options);
+          $pub_cvterm = chado_get_cvterm($identifiers, $options);
           if (!$pub_cvterm) {
             // see if this we can find the name using a synonym
             $identifiers = array(
@@ -628,7 +628,7 @@ function tripal_pub_PMID_parse_publication_type($xml, &$pub) {
                 'cv_name' => 'tripal_pub'
               )
             );
-            $pub_cvterm = tripal_get_cvterm($identifiers, $options);
+            $pub_cvterm = chado_get_cvterm($identifiers, $options);
             if (!$pub_cvterm) {
               tripal_report_error('tripal_pubmed', TRIPAL_ERROR,
                 'Cannot find a valid vocabulary term for the publication type: "%term".',

+ 7 - 7
tripal_chado/includes/loaders/tripal_chado.pub_importers.inc

@@ -979,7 +979,7 @@ function tripal_pub_add_publication($pub_details, &$action, $do_contact = FALSE,
 
   // before proceeding check to see if the publication already exists. If there is only one match
   // and the $update_if_exists is NOT set then return FALSE
-  $pub_ids = tripal_publication_exists($pub_details);
+  $pub_ids = chado_publication_exists($pub_details);
 
   if(count($pub_ids) == 1 and !$update_if_exists) {
     tripal_report_error('tripal_pub', TRIPAL_NOTICE,
@@ -1031,7 +1031,7 @@ function tripal_pub_add_publication($pub_details, &$action, $do_contact = FALSE,
         'name' => 'tripal_pub'
       ),
     );
-    $pub_type = tripal_get_cvterm($identifiers);
+    $pub_type = chado_get_cvterm($identifiers);
   }
   else {
     tripal_report_error('tripal_pub', TRIPAL_ERROR,
@@ -1125,10 +1125,10 @@ function tripal_pub_add_publication($pub_details, &$action, $do_contact = FALSE,
         'name' => 'tripal_pub'
       ),
     );
-    $cvterm = tripal_get_cvterm($identifiers);
+    $cvterm = chado_get_cvterm($identifiers);
 
     // if we could not find the cvterm by name then try by synonym
-    //$cvterm = tripal_get_cvterm(array('name' => $key, 'cv_id' => array('name' => 'tripal_pub')));
+    //$cvterm = chado_get_cvterm(array('name' => $key, 'cv_id' => array('name' => 'tripal_pub')));
     if (!$cvterm) {
       $identifiers = array(
         'synonym' => array(
@@ -1136,7 +1136,7 @@ function tripal_pub_add_publication($pub_details, &$action, $do_contact = FALSE,
           'cv_name' => 'tripal_pub'
         )
       );
-      $cvterm = tripal_get_cvterm($identifiers);
+      $cvterm = chado_get_cvterm($identifiers);
     }
     if (!$cvterm) {
       tripal_report_error('tripal_pub', TRIPAL_ERROR, "Cannot find term: '%prop'. Skipping.", array('%prop' => $key));
@@ -1257,7 +1257,7 @@ function tripal_pub_add_authors($pub_id, $authors, $do_contact) {
     // if the user wants us to create a contact for each author then do it.
     if ($do_contact) {
       // Add the contact
-      $contact = tripal_insert_contact(array(
+      $contact = chado_insert_contact(array(
         'name' => $name,
         'description' => '',
         'type_name' => $type,
@@ -1695,5 +1695,5 @@ function tripal_pub_citation_form($form, &$form_state) {
  */
 function tripal_pub_citation_form_submit(&$form_state) {
   $options [0] = $form_state['options']['#value'];
-  tripal_add_job("Create citations ($options[0])", 'tripal_pub', 'tripal_pub_create_citations', $options, $user->uid);
+  tripal_add_job("Create citations ($options[0])", 'tripal_pub', 'chado_pub_create_citations', $options, $user->uid);
 }

+ 8 - 8
tripal_chado/includes/loaders/tripal_cv.owl_loader.php

@@ -132,7 +132,7 @@ function tripal_cv_parse_owl($filename) {
   );
 
   // Using the Tripal API function to insert the term into the Chado database.
-  $db = tripal_insert_db($db);
+  $db = chado_insert_db($db);
 
   // Get the description for this vocabulary. This should be in the
   // dc:description element. If that element is missing then the
@@ -156,7 +156,7 @@ function tripal_cv_parse_owl($filename) {
   }
 
   // Insert the CV record into Chado.
-  $cv = tripal_insert_cv($cv_name, $cv_description);
+  $cv = chado_insert_cv($cv_name, $cv_description);
 
   // Add this CV and DB to our vocabs array so we can reuse it later.
   $vocabs[$db_name]['cv'] = $namespace_cv;
@@ -343,13 +343,13 @@ function tripal_owl_handle_annotation_property($stanza, $vocabs) {
 //     $values = array(
 //       'name' => $db_name
 //     );
-//     $db = tripal_insert_db($values);
+//     $db = chado_insert_db($values);
 // // Insert a dbxref record.
 //   $values = array(
 //     'db_id' => $db->db_id,
 //     'accession' => $accession
 //   );
-//   $dbxref = tripal_insert_dbxref($values);
+//   $dbxref = chado_insert_dbxref($values);
 
 //   $imported_from = $stanza->getChild('obo:IAO_0000114');
 //     if ($imported_from == NULL) {
@@ -385,7 +385,7 @@ function tripal_owl_handle_annotation_property($stanza, $vocabs) {
 //   if ($vocabs['this'] != $db->name){
 //   	$option['update_existing'] = FALSE;
 //   }
-//   $cvterm = tripal_insert_cvterm($term, $option);
+//   $cvterm = chado_insert_cvterm($term, $option);
 // }
 }
 /**
@@ -453,7 +453,7 @@ function tripal_owl_handle_class(OWLStanza $stanza, $vocabs) {
     'db_id' => $db->db_id,
     'accession' => $accession
   );
-  $dbxref = tripal_insert_dbxref($values);
+  $dbxref = chado_insert_dbxref($values);
 
   $cvterm_name = $stanza->getChild('rdfs:label');
   if ($cvterm_name) {
@@ -476,7 +476,7 @@ function tripal_owl_handle_class(OWLStanza $stanza, $vocabs) {
   if ($vocabs['this'] != $db->name) {
   $options['update_existing'] = FALSE;
   }
-  $cvterm = tripal_insert_cvterm($term, $options);
+  $cvterm = chado_insert_cvterm($term, $options);
 
   // // Add a record to the chado relationship table if an ‘rdfs:subClassOf’ child exists.
 
@@ -506,5 +506,5 @@ function tripal_owl_handle_class(OWLStanza $stanza, $vocabs) {
   // if ($vocabs['this'] != $db->name) {
   // $option['update_existing'] = FALSE;
   // }
-  // $cvterm = tripal_insert_cvterm($term, $option);
+  // $cvterm = chado_insert_cvterm($term, $option);
   }

+ 6 - 6
tripal_chado/includes/setup/tripal_chado.setup.inc

@@ -133,11 +133,11 @@ function tripal_chado_load_ontologies() {
 
   module_load_include('inc', 'tripal_chado', 'includes/TripalImporter/OBOImporter');
   for ($i = 0; $i < count($ontologies); $i++) {
-    $obo_id = tripal_insert_obo($ontologies[$i]['name'], $ontologies[$i]['path']);
+    $obo_id = chado_insert_obo($ontologies[$i]['name'], $ontologies[$i]['path']);
     if ($ontologies[$i]['auto_load'] == TRUE) {
       // Only load ontologies that are not already in the cv table.
-      $cv = tripal_get_cv(array('name' => $ontologies[$i]['cv_name']));
-      $db = tripal_get_db(array('name' => $ontologies[$i]['db_name']));
+      $cv = chado_get_cv(array('name' => $ontologies[$i]['cv_name']));
+      $db = chado_get_db(array('name' => $ontologies[$i]['db_name']));
       if (!$cv or !$db) {
         print "Loading ontology: " . $ontologies[$i]['name'] . " ($obo_id)...\n";
         $obo_importer = new OBOImporter();
@@ -335,7 +335,7 @@ function tripal_chado_prepare_chado($job = NULL) {
       'cv_id' => array('name' => 'EDAM'),
       'name' => 'Map'
     );
-    $cvterm = tripal_get_cvterm($identifier);
+    $cvterm = chado_get_cvterm($identifier);
     tripal_chado_add_cvterm_mapping($cvterm->cvterm_id, 'featuremap', NULL);
     if ($report_progress) {
       $job->setProgress(86);
@@ -343,7 +343,7 @@ function tripal_chado_prepare_chado($job = NULL) {
 
     // Import a publication so we get all of the properties before
     // creating the content type.
-    tripal_import_pub_by_dbxref('PMID:24163125');
+    chado_import_pub_by_dbxref('PMID:24163125');
 
     // Create the 'Publication' entity type.
     $error = '';
@@ -370,7 +370,7 @@ function tripal_chado_prepare_chado($job = NULL) {
       'cv_id' => array('name' => 'tripal_pub'),
       'name' => 'Publication'
     );
-    $cvterm = tripal_get_cvterm($identifier);
+    $cvterm = chado_get_cvterm($identifier);
     tripal_chado_add_cvterm_mapping($cvterm->cvterm_id, 'pub', NULL);
 
     // Now remove the publication that was added above.

+ 4 - 4
tripal_chado/includes/tripal_chado.cv.inc

@@ -663,7 +663,7 @@ function tripal_cv_cvterm_edit_form_submit($form, &$form_state) {
       'db_name' => $db->name
     );
 
-    $cvterm = tripal_insert_cvterm($term, array('update_existing' => TRUE));
+    $cvterm = chado_insert_cvterm($term, array('update_existing' => TRUE));
     if ($cvterm) {
       drupal_set_message('Term updated successfully.');
       drupal_goto('admin/tripal/loaders/chado_vocabs/chado_cvterms');
@@ -721,7 +721,7 @@ function tripal_cv_cvterm_add_form_submit($form, &$form_state) {
     'db_name' => $db->name
   );
 
-  $cvterm = tripal_insert_cvterm($term, array('update_existing' => TRUE));
+  $cvterm = chado_insert_cvterm($term, array('update_existing' => TRUE));
   if ($cvterm) {
     drupal_set_message('Term added successfully.');
   }
@@ -809,7 +809,7 @@ function tripal_cv_cvtermpath_form_submit($form, &$form_state) {
   $job_args = array($cvid);
   if ($form_state['values']['op'] == t('Update cvtermpath')) {
     tripal_add_job("Update cvtermpath: $cv->name", 'tripal_cv',
-        'tripal_update_cvtermpath', $job_args, $user->uid, 10);
+        'chado_update_cvtermpath', $job_args, $user->uid, 10);
   }
 }
 
@@ -818,7 +818,7 @@ function tripal_cv_cvtermpath_form_submit($form, &$form_state) {
  */
 function tripal_cv_cv_delete_form($form, &$form_state, $cv_id) {
 
-  $cv = tripal_get_cv(array('cv_id' => $cv_id));
+  $cv = chado_get_cv(array('cv_id' => $cv_id));
 
   $form['cv_id'] = array(
     '#type' => 'value',

+ 3 - 3
tripal_chado/includes/tripal_chado.field_storage.inc

@@ -29,8 +29,8 @@ function tripal_chado_field_storage_write($entity_type, $entity, $op, $fields) {
   $term = reset($term);
 
   // Convert the Tripal term entity into the appropriate record in Chado.
-  $dbxref = tripal_get_dbxref(array('accession' => $term->accession, 'db_id' => array('name' => $term->vocab->vocabulary)));
-  $cvterm = tripal_get_cvterm(array('dbxref_id' => $dbxref->dbxref_id));
+  $dbxref = chado_get_dbxref(array('accession' => $term->accession, 'db_id' => array('name' => $term->vocab->vocabulary)));
+  $cvterm = chado_get_cvterm(array('dbxref_id' => $dbxref->dbxref_id));
 
   // Get the base table, type field and record_id from the entity.
   $base_table = $entity->chado_table;
@@ -1179,7 +1179,7 @@ function tripal_chado_field_storage_bundle_mapping_form_add_cvterm(&$form,
     ),
   );
   if ($default['use_cvterm'] == 'cv') {
-    $cvs = tripal_get_cv_select_options();
+    $cvs = chado_get_cv_select_options();
     $form['chado_type_cv_id'] = array(
       '#type' => select,
       '#options' => $cvs,

文件差异内容过多而无法显示
+ 131 - 131
tripal_chado/includes/tripal_chado.semweb.inc


+ 1 - 1
tripal_chado/includes/tripal_chado.seq_extract.inc

@@ -43,7 +43,7 @@ function tripal_chado_feature_seq_extract_download() {
     header('Content-Disposition: attachment; filename="sequences.fnn"');
   }
 
-  $seqs = tripal_get_bulk_feature_sequences(array(
+  $seqs = chado_get_bulk_feature_sequences(array(
     'genus' => $genus,
     'species' => $species,
     'analysis_name' => $analysis,

+ 3 - 3
tripal_chado/includes/tripal_chado.vocab_storage.inc

@@ -298,7 +298,7 @@ function _tripal_chado_format_term_description($cvterm) {
     'vocabulary' => $vocabulary,
     'accession'  => $cvterm->dbxref_id->accession,
     'name'       => $cvterm->name,
-    'url'        => tripal_get_dbxref_url($cvterm->dbxref_id),
+    'url'        => chado_get_dbxref_url($cvterm->dbxref_id),
     'definition' => (isset($cvterm->definition)) ? $cvterm->definition : '',
   );
   return $term;
@@ -327,11 +327,11 @@ function tripal_chado_vocab_add_term($details) {
     // TODO: deal with the URL prefix
   );
   $options = array('update_existing' => TRUE);
-  tripal_insert_db($values, $options);
+  chado_insert_db($values, $options);
 
 
   // Second make sure the term is added.
-  $term = tripal_insert_cvterm(array(
+  $term = chado_insert_cvterm(array(
     'id' => $vocabulary . ':' . $accession,
     'name' => $details['name'],
     'definition' => $details['definition'],

+ 3 - 3
tripal_chado/tripal_chado.drush.inc

@@ -143,10 +143,10 @@ function drush_tripal_chado_trp_import_pubs() {
 
   module_load_include('inc', 'tripal_chado', 'includes/loaders/tripal_chado.pub_importers');
   if ($dbxref) {
-    tripal_import_pub_by_dbxref($dbxref, $create_contacts, $update);
+    chado_import_pub_by_dbxref($dbxref, $create_contacts, $update);
   }
   else {
-    tripal_execute_active_pub_importers($do_report, $update);
+    chado_execute_active_pub_importers($do_report, $update);
   }
 }
 
@@ -161,7 +161,7 @@ function drush_tripal_chado_trp_update_pubs() {
   $db = drush_get_option('db');
 
   module_load_include('inc', 'tripal_chado', 'includes/loaders/tripal_chado.pub_importers');
-  tripal_reimport_publications($create_contacts, $dbxref, $db);
+  chado_reimport_publications($create_contacts, $dbxref, $db);
 }
 
 /**

+ 75 - 75
tripal_chado/tripal_chado.install

@@ -13,7 +13,7 @@ function tripal_chado_install() {
   if (chado_is_installed()) {
     // For an upgraded site we need to move some vocabulary terms over
     // to the new 'local' vocabulary:
-    tripal_insert_db(array(
+    chado_insert_db(array(
       'name' => 'local',
       'description' => variable_get('site_name', 'This site.'),
     ));
@@ -697,7 +697,7 @@ function tripal_chado_update_7300() {
       chado_query("ALTER TABLE {tripal_gffcds_temp} ALTER COLUMN phase DROP NOT NULL;");
     }
 
-    $term = tripal_insert_cvterm(array(
+    $term = chado_insert_cvterm(array(
       'id' => 'data:1048',
       'name' => 'Database ID',
       'cv_name' => 'EDAM',
@@ -762,25 +762,25 @@ function tripal_chado_update_7301() {
 function tripal_chado_update_7302(){
   try {
     // Add the term for the field.
-    tripal_insert_db(array(
+    chado_insert_db(array(
       'name' => 'format',
       'description' => 'A defined way or layout of representing and structuring data in a computer file, blob, string, message, or elsewhere. The main focus in EDAM lies on formats as means of structuring data exchanged between different tools or resources. ',
       'url' => 'http://edamontology.org/page',
       'urlprefix' => 'http://edamontology.org/{db}_{accession}',
     ));
-    tripal_insert_db(array(
+    chado_insert_db(array(
       'name' => 'operation',
       'description' => 'A function that processes a set of inputs and results in a set of outputs, or associates arguments (inputs) with values (outputs). Special cases are: a) An operation that consumes no input (has no input arguments).',
       'url' => 'http://edamontology.org/page',
       'urlprefix' => 'http://edamontology.org/{db}_{accession}',
     ));
-    tripal_insert_db(array(
+    chado_insert_db(array(
       'name' => 'topic',
       'description' => 'A category denoting a rather broad domain or field of interest, of study, application, work, data, or technology. Topics have no clearly defined borders between each other.',
       'url' => 'http://edamontology.org/page',
       'urlprefix' => 'http://edamontology.org/{db}_{accession}',
     ));
-    tripal_insert_cv(
+    chado_insert_cv(
       'EDAM',
       'EDAM is an ontology of well established, familiar concepts that are prevalent within bioinformatics, including types of data and data identifiers, data formats, operations and topics. EDAM is a simple ontology - essentially a set of terms with synonyms and definitions - organised into an intuitive hierarchy for convenient use by curators, software developers and end-users. EDAM is suitable for large-scale semantic annotations and categorization of diverse bioinformatics resources. EDAM is also suitable for diverse application including for example within workbenches and workflow-management systems, software distributions, and resource registries.'
     );
@@ -815,20 +815,20 @@ function tripal_chado_update_7303() {
  */
 function tripal_chado_update_7304() {
   try {
-    $term = tripal_insert_cvterm(array(
+    $term = chado_insert_cvterm(array(
       'id' => 'SIO:001080',
       'name' => 'vocabulary',
       'cv_name' => 'SIO',
       'definition' => 'A vocabulary is a collection of terms.',
     ));
     tripal_associate_chado_semweb_term('cvterm', 'cv_id', $term);
-    $term = tripal_insert_cvterm(array(
+    $term = chado_insert_cvterm(array(
       'id' => 'data:2976',
       'name' => 'Protein sequence',
       'cv_name' => 'EDAM',
       'definition' => 'One or more protein sequences, possibly with associated annotation.',
     ));
-    $term = tripal_insert_cvterm(array(
+    $term = chado_insert_cvterm(array(
       'id' => 'local:fmin',
       'name' => 'minimal boundary',
       'definition' => 'The leftmost, minimal boundary in the linear range ' .
@@ -838,7 +838,7 @@ function tripal_chado_update_7304() {
       'cv_name' => 'local',
     ));
     tripal_associate_chado_semweb_term('featureloc', 'fmin', $term);
-    $term = tripal_insert_cvterm(array(
+    $term = chado_insert_cvterm(array(
       'id' => 'local:fmax',
       'name' => 'maximal boundary',
       'definition' => 'The rightmost, maximal boundary in the linear range ' .
@@ -848,14 +848,14 @@ function tripal_chado_update_7304() {
       'cv_name' => 'local',
     ));
     tripal_associate_chado_semweb_term('featureloc', 'fmax', $term);
-    $term = tripal_insert_cvterm(array(
+    $term = chado_insert_cvterm(array(
       'id' => 'data:2336',
       'name' => 'Translation phase specification',
       'cv_name' => 'EDAM',
       'definition' => 'Phase for translation of DNA (0, 1 or 2) relative to a fragment of the coding sequence.',
     ));
     tripal_associate_chado_semweb_term('featureloc', 'phase', $term);
-    $term = tripal_insert_cvterm(array(
+    $term = chado_insert_cvterm(array(
       'id' => 'data:3002',
       'name' => 'Annotation track',
       'cv_name' => 'EDAM',
@@ -876,90 +876,90 @@ function tripal_chado_update_7304() {
  */
 function tripal_chado_update_7305() {
   try {
-    tripal_insert_db(array(
+    chado_insert_db(array(
       'name' => 'rdfs',
       'description' => 'Resource Description Framework Schema',
       'url' => 'https://www.w3.org/TR/rdf-schema/',
       'urlprefix' => 'https://www.w3.org/TR/rdf-schema/#ch_{accession}',
     ));
-    tripal_insert_cv('rdfs', 'Resource Description Framework Schema');
-    tripal_insert_db(array(
+    chado_insert_cv('rdfs', 'Resource Description Framework Schema');
+    chado_insert_db(array(
       'name' => 'SO',
       'description' => 'The sequence ontology.',
       'url' => 'http://www.sequenceontology.org/',
       'urlprefix' => 'http://www.sequenceontology.org/browser/current_svn/term/{db}:{accession}',
     ));
-    tripal_insert_cv('sequence', 'The sequence ontology.');
-    tripal_insert_db(array(
+    chado_insert_cv('sequence', 'The sequence ontology.');
+    chado_insert_db(array(
       'name' => 'TAXRANK',
       'description' => 'A vocabulary of taxonomic ranks (species, family, phylum, etc)',
       'url' => 'http://www.obofoundry.org/ontology/taxrank.html',
       'urlprefix' => 'http://purl.obolibrary.org/obo/{db}_{accession}',
     ));
-    tripal_insert_cv('taxonomic_rank', 'A vocabulary of taxonomic ranks (species, family, phylum, etc)');
-    tripal_insert_db(array(
+    chado_insert_cv('taxonomic_rank', 'A vocabulary of taxonomic ranks (species, family, phylum, etc)');
+    chado_insert_db(array(
       'name' => 'hydra',
       'description' => 'A Vocabulary for Hypermedia-Driven Web APIs',
       'url' => 'http://www.w3.org/ns/hydra/core',
       'urlprefix' => 'http://www.w3.org/ns/hydra/core#{accession}',
     ));
-    tripal_insert_cv(
+    chado_insert_cv(
       'hydra',
       'A Vocabulary for Hypermedia-Driven Web APIs.'
     );
-    tripal_insert_db(array(
+    chado_insert_db(array(
       'name' => 'dc',
       'description' => 'DCMI Metadata Terms.',
       'url' => 'http://purl.org/dc/dcmitype/',
       'urlprefix' => 'http://purl.org/dc/terms/{accession}',
     ));
-    tripal_insert_cv(
+    chado_insert_cv(
       'dc',
       'DCMI Metadata Terms.'
     );
-    $term = tripal_insert_cvterm(array(
+    $term = chado_insert_cvterm(array(
       'id' => 'dc:Service',
       'name' => 'Service',
       'cv_name' => 'dc',
       'definition' => 'A system that provides one or more functions.',
     ));
-    $name = tripal_insert_cvterm(array(
+    $name = chado_insert_cvterm(array(
       'id' => 'hydra:Collection',
       'name' => 'Collection',
       'cv_name' => 'hydra',
       'definition' => 'A collection holding references to a number of related resources.',
     ));
-    $name = tripal_insert_cvterm(array(
+    $name = chado_insert_cvterm(array(
       'id' => 'hydra:member',
       'name' => 'member',
       'cv_name' => 'hydra',
       'definition' => 'A member of the collection',
     ));
-    $name = tripal_insert_cvterm(array(
+    $name = chado_insert_cvterm(array(
       'id' => 'hydra:description',
       'name' => 'description',
       'cv_name' => 'hydra',
       'definition' => 'A description.',
     ));
-    $name = tripal_insert_cvterm(array(
+    $name = chado_insert_cvterm(array(
       'id' => 'hydra:totalItems',
       'name' => 'totalItems',
       'cv_name' => 'hydra',
       'definition' => 'The total number of items referenced by a collection.',
     ));
-    $name = tripal_insert_cvterm(array(
+    $name = chado_insert_cvterm(array(
       'id' => 'hydra:title',
       'name' => 'title',
       'cv_name' => 'hydra',
       'definition' => 'A title, often used along with a description.',
     ));
-    $name = tripal_insert_cvterm(array(
+    $name = chado_insert_cvterm(array(
       'id' => 'hydra:PartialCollectionView',
       'name' => 'PartialCollectionView',
       'cv_name' => 'hydra',
       'definition' => 'A PartialCollectionView describes a partial view of a Collection. Multiple PartialCollectionViews can be connected with the the next/previous properties to allow a client to retrieve all members of the collection.',
     ));
-    $term = tripal_insert_cvterm(array(
+    $term = chado_insert_cvterm(array(
       'id' => 'schema:ItemPage',
       'name' => 'ItemPage',
       'cv_name' => 'schema',
@@ -967,19 +967,19 @@ function tripal_chado_update_7305() {
     ));
     global $base_path;
 
-    tripal_insert_db(array(
+    chado_insert_db(array(
       'name' => 'null',
       'description' => 'No online database.',
       'url' => $base_path . 'cv/lookup/null',
       'urlprefix' => $base_path. 'cv/lookup/{db}/{accession}',
     ));
-    tripal_insert_db(array(
+    chado_insert_db(array(
       'name' => 'local',
       'description' => 'Terms created for this site.',
       'url' => $base_path . 'cv/lookup/local',
       'urlprefix' => $base_path . 'cv/lookup/{db}/{accession}',
     ));
-    $term = tripal_insert_cvterm(array(
+    $term = chado_insert_cvterm(array(
       'id' => 'local:rank',
       'name' => 'rank',
       'definition' => 'A taxonmic rank',
@@ -1003,7 +1003,7 @@ function tripal_chado_update_7306() {
       'cv_id' => array('name' => 'EDAM'),
       'name' => 'Map'
     );
-    $cvterm = tripal_get_cvterm($identifier);
+    $cvterm = chado_get_cvterm($identifier);
     tripal_chado_add_cvterm_mapping($cvterm->cvterm_id, 'featuremap', NULL);
   }
   catch (\PDOException $e) {
@@ -1021,7 +1021,7 @@ function tripal_chado_update_7307() {
       'cv_id' => array('name' => 'tripal_pub'),
       'name' => 'Publication'
     );
-    $cvterm = tripal_get_cvterm($identifier);
+    $cvterm = chado_get_cvterm($identifier);
     tripal_chado_add_cvterm_mapping($cvterm->cvterm_id, 'pub', NULL);
   }
   catch (\PDOException $e) {
@@ -1035,7 +1035,7 @@ function tripal_chado_update_7307() {
  */
 function tripal_chado_update_7308() {
   try {
-    $term = tripal_insert_cvterm(array(
+    $term = chado_insert_cvterm(array(
       'id' => 'IAO:0000129',
       'name' => 'version number',
       'cv_name' => 'IAO',
@@ -1048,7 +1048,7 @@ function tripal_chado_update_7308() {
     tripal_associate_chado_semweb_term('analysis', 'sourceversion', $term);
     tripal_associate_chado_semweb_term(NULL, 'version', $term);
 
-    $term = tripal_insert_cvterm(array(
+    $term = chado_insert_cvterm(array(
       'id' => 'schema:name',
       'name' => 'name',
       'cv_name' => 'schema',
@@ -1056,7 +1056,7 @@ function tripal_chado_update_7308() {
     ));
     tripal_associate_chado_semweb_term('analysis', 'sourcename', $term);
 
-    $term = tripal_insert_cvterm(array(
+    $term = chado_insert_cvterm(array(
       'id' => 'data:2091',
       'name' => 'Accession',
       'cv_name' => 'EDAM',
@@ -1076,7 +1076,7 @@ function tripal_chado_update_7308() {
  */
 function tripal_chado_update_7309() {
   try {
-    $term = tripal_insert_cvterm(array(
+    $term = chado_insert_cvterm(array(
       'id' => 'SIO:001166',
       'name' => 'annotation',
       'cv_name' => 'SIO',
@@ -1094,7 +1094,7 @@ function tripal_chado_update_7309() {
     tripal_associate_chado_semweb_term('stock_relationship_cvterm', 'cvterm_id', $term);
 
 
-    $term = tripal_insert_cvterm(array(
+    $term = chado_insert_cvterm(array(
       'id' => 'SIO:000281',
       'name' => 'negation',
       'cv_name' => 'SIO',
@@ -1115,18 +1115,18 @@ function tripal_chado_update_7309() {
  */
 function tripal_chado_update_7310() {
   try {
-    tripal_insert_db(array(
+    chado_insert_db(array(
       'name' => 'OBCS',
       'description' => 'Ontology of Biological and Clinical Statistics.',
       'url' => 'https://github.com/obcs/obcs',
       'urlprefix' => 'http://purl.obolibrary.org/obo/{db}_{accession}',
     ));
-    tripal_insert_cv(
+    chado_insert_cv(
         'OBCS',
         'Ontology of Biological and Clinical Statistics.'
     );
 
-    $term = tripal_insert_cvterm(array(
+    $term = chado_insert_cvterm(array(
       'id' => 'OBCS:0000117',
       'name' => 'rank order',
       'cv_name' => 'OBCS',
@@ -1144,7 +1144,7 @@ function tripal_chado_update_7310() {
  */
 function tripal_chado_update_7311() {
   try {
-    $term = tripal_insert_cvterm(array(
+    $term = chado_insert_cvterm(array(
       'id' => 'local:fmin',
       'name' => 'minimal boundary',
       'definition' => 'The leftmost, minimal boundary in the linear range ' .
@@ -1166,14 +1166,14 @@ function tripal_chado_update_7311() {
 function tripal_chado_update_7312() {
   try {
 
-    $term = tripal_insert_cvterm(array(
+    $term = chado_insert_cvterm(array(
       'id' => 'local:miniref',
       'name' => 'Mini-ref',
       'definition' => 'A small in-house unique identifier for a publication.',
       'cv_name' => 'local',
     ));
     tripal_associate_chado_semweb_term('pub', 'miniref', $term);
-    $term = tripal_insert_cvterm(array(
+    $term = chado_insert_cvterm(array(
       'id' => 'schema:url',
       'name' => 'url',
       'cv_name' => 'schema',
@@ -1192,10 +1192,10 @@ function tripal_chado_update_7312() {
  */
 function tripal_chado_update_7313() {
   try {
-    $cv = tripal_get_cv(array('name' => 'tripal_pub'));
-    tripal_update_cvtermpath($cv->cv_id);
-    $cv = tripal_get_cv(array('name' => 'tripal_contact'));
-    tripal_update_cvtermpath($cv->cv_id);
+    $cv = chado_get_cv(array('name' => 'tripal_pub'));
+    chado_update_cvtermpath($cv->cv_id);
+    $cv = chado_get_cv(array('name' => 'tripal_contact'));
+    chado_update_cvtermpath($cv->cv_id);
   }
   catch (\PDOException $e) {
     $error = $e->getMessage();
@@ -1208,7 +1208,7 @@ function tripal_chado_update_7313() {
  */
 function tripal_chado_update_7314() {
   try {
-    $term = tripal_insert_cvterm(array(
+    $term = chado_insert_cvterm(array(
       'name' => 'Reference Feature',
       'definition' => 'A genomic or genetic feature on which other features are mapped.',
       'cv_name' => 'local',
@@ -1227,7 +1227,7 @@ function tripal_chado_update_7314() {
  */
 function tripal_chado_update_7315() {
   try {
-    $term = tripal_insert_cvterm(array(
+    $term = chado_insert_cvterm(array(
       'id' => 'schema:additionalType',
       'name' => 'additionalType',
       'cv_name' => 'schema',
@@ -1246,7 +1246,7 @@ function tripal_chado_update_7315() {
  */
 function tripal_chado_update_7316() {
   try {
-    $term = tripal_insert_cvterm(array(
+    $term = chado_insert_cvterm(array(
       'id' => 'SIO:001323',
       'name' => 'email address',
       'cv_name' => 'SIO',
@@ -1264,14 +1264,14 @@ function tripal_chado_update_7316() {
  */
 function tripal_chado_update_7317() {
   try {
-    $term = tripal_insert_cvterm(array(
+    $term = chado_insert_cvterm(array(
       'id' => 'OBI:0100026',
       'name' => 'organism',
       'cv_name' => 'obi',
       'definition' => 'A material entity that is an individual living system, such as animal, plant, bacteria or virus, that is capable of replicating or reproducing, growth and maintenance in the right environment. An organism may be unicellular or made up, like humans, of many billions of cells divided into specialized tissues and organs.',
     ));
     tripal_associate_chado_semweb_term('biomaterial', 'taxon_id', $term);
-    $term = tripal_insert_cvterm(array(
+    $term = chado_insert_cvterm(array(
       'id' => 'local:contact',
       'name' => 'contact',
       'definition' => 'An entity (e.g. individual or organization) through ' .
@@ -1292,14 +1292,14 @@ function tripal_chado_update_7317() {
  */
 function tripal_chado_update_7318() {
   try {
-    tripal_insert_db(array(
+    chado_insert_db(array(
       'name' => 'sep',
       'description' => 'Sample processing and separation techniques.',
       'url' => 'http://psidev.info/index.php?q=node/312',
       'urlprefix' => 'http://purl.obolibrary.org/obo/{db}_{accession}',
     ));
-    tripal_insert_cv('sep','A structured controlled vocabulary for the annotation of sample processing and separation techniques in scientific experiments.');
-    $term = tripal_insert_cvterm(array(
+    chado_insert_cv('sep','A structured controlled vocabulary for the annotation of sample processing and separation techniques in scientific experiments.');
+    $term = chado_insert_cvterm(array(
       'id' => 'sep:00195',
       'name' => 'biological sample',
       'cv_name' => 'sep',
@@ -1318,7 +1318,7 @@ function tripal_chado_update_7318() {
  */
 function tripal_chado_update_7319() {
   try {
-    $term = tripal_insert_cvterm(array(
+    $term = chado_insert_cvterm(array(
       'id' => 'operation:2945',
       'name' => 'Analysis',
       'cv_name' => 'EDAM',
@@ -1337,28 +1337,28 @@ function tripal_chado_update_7319() {
 function tripal_chado_update_7320() {
     try {
     // Associate the Analysis term with the analysis_id of the phylotree table.
-    $term = tripal_get_cvterm(array('id' => 'operation:2945'));
+    $term = chado_get_cvterm(array('id' => 'operation:2945'));
     tripal_associate_chado_semweb_term('phylotree', 'analysis_id', $term);
 
-    $term = tripal_insert_cvterm(array(
+    $term = chado_insert_cvterm(array(
       'id' => 'data:0872',
       'name' => 'Phylogenetic tree',
       'cv_name' => 'EDAM',
       'definition' => 'The raw data (not just an image) from which a phylogenetic tree is directly generated or plotted, such as topology, lengths (in time or in expected amounts of variance) and a confidence interval for each length.',
     ));
-    $term = tripal_insert_cvterm(array(
+    $term = chado_insert_cvterm(array(
       'id' => 'data:3272',
       'name' => 'Species tree',
       'cv_name' => 'EDAM',
       'definition' => 'A phylogenetic tree that reflects phylogeny of the taxa from which the characters (used in calculating the tree) were sampled.',
     ));
-    $term = tripal_insert_cvterm(array(
+    $term = chado_insert_cvterm(array(
       'id' => 'data:3271',
       'name' => 'Gene tree',
       'cv_name' => 'EDAM',
       'definition' => 'A phylogenetic tree that is an estimate of the character\'s phylogeny.',
     ));
-    $term = tripal_insert_cvterm(array(
+    $term = chado_insert_cvterm(array(
       'id' => 'operation:0567',
       'name' => 'Phylogenetic tree visualisation',
       'cv_name' => 'EDAM',
@@ -1396,37 +1396,37 @@ function tripal_chado_update_7320() {
  */
 function tripal_chado_update_7321() {
   try {
-    tripal_insert_db(array(
+    chado_insert_db(array(
       'name' => 'TPUB',
       'description' => 'Tripal Publiation Ontology. A temporary ontology until a more formal appropriate ontology an be identified.',
       'url' => '/cv/lookup/TPUB',
       'urlprefix' => '/cv/lookup/TPUB/{accession}',
     ));
-    tripal_insert_cv('tripal_pub', 'Tripal Publiation Ontology. A temporary ontology until a more formal appropriate ontology an be identified.');
+    chado_insert_cv('tripal_pub', 'Tripal Publiation Ontology. A temporary ontology until a more formal appropriate ontology an be identified.');
 
-    tripal_insert_db(array(
+    chado_insert_db(array(
       'name' => 'rdf',
       'description' => 'Resource Description Framework',
       'url' => 'http://www.w3.org/1999/02/22-rdf-syntax-ns',
       'urlprefix' => 'http://www.w3.org/1999/02/22-rdf-syntax-ns#',
     ));
-    tripal_insert_cv(
+    chado_insert_cv(
       'rdf',
       'Resource Description Framework'
     );
-    tripal_insert_db(array(
+    chado_insert_db(array(
       'name' => 'rdfs',
       'description' => 'Resource Description Framework Schema',
       'url' => 'https://www.w3.org/TR/rdf-schema/',
       'urlprefix' => 'http://www.w3.org/2000/01/rdf-schema#{accession}',
     ));
-    tripal_insert_db(array(
+    chado_insert_db(array(
       'name' => 'hydra',
       'description' => 'A Vocabulary for Hypermedia-Driven Web APIs',
       'url' => 'http://www.w3.org/ns/hydra/core',
       'urlprefix' => 'http://www.w3.org/ns/hydra/core#{accession}',
     ));
-    tripal_insert_cv(
+    chado_insert_cv(
       'hydra',
       'A Vocabulary for Hypermedia-Driven Web APIs.'
     );
@@ -1441,21 +1441,21 @@ function tripal_chado_update_7321() {
  */
 function tripal_chado_update_7322() {
   try {
-    tripal_insert_db(array(
+    chado_insert_db(array(
       'name' => 'TPUB',
       'description' => 'Tripal Publiation Ontology. A temporary ontology until a more formal appropriate ontology an be identified.',
       'url' => 'cv/lookup/TPUB',
       'urlprefix' => 'cv/lookup/TPUB/{accession}',
     ));
-    tripal_insert_db(array(
+    chado_insert_db(array(
       'name' => 'TContact',
       'description' => 'Tripal Contact Ontology. A temporary ontology until a more formal appropriate ontology an be identified.',
       'url' => 'cv/lookup/TContact',
       'urlprefix' => 'cv/lookup/TContact/{accession}',
     ));
-    tripal_insert_cv('tripal_contact', 'Tripal Contact Ontology. A temporary ontology until a more formal appropriate ontology an be identified.');
+    chado_insert_cv('tripal_contact', 'Tripal Contact Ontology. A temporary ontology until a more formal appropriate ontology an be identified.');
 
-    tripal_insert_db(array(
+    chado_insert_db(array(
       'name' => 'SWO',
       'description' => 'Software Ontology',
       'url' => 'http://purl.obolibrary.org/obo/swo',

+ 8 - 6
tripal_chado/tripal_chado.module

@@ -35,6 +35,7 @@ require_once 'api/tripal_chado.schema_v1.2.api.inc';
 require_once 'api/tripal_chado.schema_v1.11.api.inc';
 require_once 'api/tripal_chado.semweb.api.inc';
 require_once 'api/tripal_chado.migrate.api.inc';
+require_once 'api/tripal_chado.DEPRECATED.api.inc';
 
 // Chado module specific API functions
 require_once 'api/modules/tripal_chado.analysis.api.inc';
@@ -46,6 +47,7 @@ require_once 'api/modules/tripal_chado.organism.api.inc';
 require_once 'api/modules/tripal_chado.pub.api.inc';
 require_once 'api/modules/tripal_chado.stock.api.inc';
 require_once 'api/modules/tripal_chado.phylotree.api.inc';
+require_once 'api/modules/tripal_chado.module.DEPRECATED.api.inc';
 
 //
 // REQUIRED INCLUDE FILES
@@ -519,7 +521,7 @@ function tripal_chado_menu() {
   //                           Auto Completes
   //////////////////////////////////////////////////////////////////////////////
   $items['admin/tripal/storage/chado/auto_name/dbxref/%/%'] = array(
-    'page callback' => 'tripal_autocomplete_dbxref',
+    'page callback' => 'chado_autocomplete_dbxref',
     'page arguments' => array(6, 7),
     'access arguments' => array('access content'),
     'file' => 'api/modules/tripal_chado.db.api.inc',
@@ -527,7 +529,7 @@ function tripal_chado_menu() {
     'type' => MENU_CALLBACK,
   );
   $items['admin/tripal/storage/chado/auto_name/cv/%'] = array(
-    'page callback' => 'tripal_autocomplete_cv',
+    'page callback' => 'chado_autocomplete_cv',
     'page arguments' => array(6),
     'access arguments' => array('access content'),
     'file' => 'api/modules/tripal_chado.cv.api.inc',
@@ -535,7 +537,7 @@ function tripal_chado_menu() {
     'type' => MENU_CALLBACK,
   );
   $items['admin/tripal/storage/chado/auto_name/cvterm/%/%'] = array(
-    'page callback' => 'tripal_autocomplete_cvterm',
+    'page callback' => 'chado_autocomplete_cvterm',
     'page arguments' => array(6, 7),
     'access arguments' => array('access content'),
     'file' => 'api/modules/tripal_chado.cv.api.inc',
@@ -544,7 +546,7 @@ function tripal_chado_menu() {
   );
 
   $items['admin/tripal/storage/chado/auto_name/pub/%'] = array(
-    'page callback' => 'tripal_autocomplete_pub',
+    'page callback' => 'chado_autocomplete_pub',
     'page arguments' => array(6),
     'access arguments' => array('access content'),
     'file' => 'api/modules/tripal_chado.pub.api.inc',
@@ -560,7 +562,7 @@ function tripal_chado_menu() {
     'type' => MENU_CALLBACK,
   );
   $items['admin/tripal/storage/chado/auto_name/feature/%'] = array(
-    'page callback' => 'tripal_autocomplete_feature',
+    'page callback' => 'chado_autocomplete_feature',
     'page arguments' => array(6),
     'access arguments' => array('access content'),
     'file' => 'api/modules/tripal_chado.feature.api.inc',
@@ -568,7 +570,7 @@ function tripal_chado_menu() {
     'type' => MENU_CALLBACK,
   );
   $items['admin/tripal/storage/chado/auto_name/organism/%'] = array(
-    'page callback' => 'tripal_autocomplete_organism',
+    'page callback' => 'chado_autocomplete_organism',
     'page arguments' => array(6),
     'access arguments' => array('access content'),
     'file' => 'api/modules/tripal_chado.organism.api.inc',

部分文件因为文件数量过多而无法显示