Browse Source

Nightly check-in

Stephen Ficklin 9 years ago
parent
commit
4934be25a3

+ 2 - 2
tripal/includes/TripalBundleUIController.inc

@@ -29,7 +29,7 @@ class TripalBundleUIController extends EntityDefaultUIController {
     // Add an action link to Admin > Structure > Tripal Content Types for adding types.
     $items[$this->path . '/add'] = array(
       'title' => 'Add Tripal Content Type',
-      'description' => 'Add new biological content',
+      'description' => 'Add data type content',
       'page callback' => 'drupal_get_form',
       'page arguments' => array('tripal_admin_add_type_form'),
       'access arguments' => array('administer tripal data types'),
@@ -438,7 +438,7 @@ function tripal_admin_add_type_form_submit($form, &$form_state) {
         $form_state['redirect'] = "admin/structure/bio-data";
       }
       else {
-        drupal_set_message('New biological data type created.  Fields are added automatically to this type.');
+        drupal_set_message('New data type created.');
         $form_state['redirect'] = "admin/structure/bio-data";
       }
     }

+ 3 - 3
tripal/includes/TripalEntityController.inc

@@ -139,7 +139,7 @@ class TripalEntityController extends EntityAPIController {
     if (!$alias) {
 
       // Load the TripalBundle entity for this TripalEntity.
-      $bundle_entity = tripal_bundle_load($entity->bundle);
+      $bundle_entity = tripal_load_bundle_entity(array('name' => $entity->bundle));
 
       // First get the format for the url alias based on the bundle of the entity.
       $alias = tripal_get_bundle_variable('url_format', $bundle_entity->id);
@@ -190,7 +190,7 @@ class TripalEntityController extends EntityAPIController {
       // assigned this alias to this entity in a previous save.
       elseif ($num_aliases == 1) {
 
-        $bundle_entity = tripal_bundle_load($entity->bundle);
+        $bundle_entity = tripal_load_bundle_entity(array('name' => $entity->bundle));
 
         // Checking to see if the single alias is for the same entity and if not
         // warning the admin that the alias is already used (ie: not unique?)
@@ -218,7 +218,7 @@ class TripalEntityController extends EntityAPIController {
       // If there are more then one alias' matching what we generated then there's
       // a real problem and we need to warn the administrator.
       else {
-        $bundle_entity = tripal_bundle_load($entity->bundle);
+        $bundle_entity = tripal_load_bundle_entity(array('name' => $entity->bundle));
 
         $aliases = db_query('SELECT source FROM {url_alias} WHERE alias=:alias',
           array(':alias' => $alias))->fetchAll();

+ 1 - 1
tripal/includes/TripalEntityUIController.inc

@@ -377,7 +377,7 @@ function tripal_view_entity($entity, $view_mode = 'full') {
      );
      $output .= '<p>' . t('You have not created any biological data types yet. ' .
          'Go to the <a href="@create-content">data type creation page</a> to ' .
-         'add a new biological data type.',
+         'add a new data type.',
          array('@create-content' => url('admin/structure/bio-data/add'))) . '</p>';
    }
    return $output;

+ 0 - 0
tripal/theme/js/tripal.js


+ 7 - 11
tripal/tripal.module

@@ -75,6 +75,7 @@ function tripal_init() {
 function tripal_menu() {
   $items = array();
 
+
   // Tripal setting groups
   $items['admin/tripal'] = array(
     'title' => 'Tripal',
@@ -179,12 +180,7 @@ function tripal_menu() {
     'type' => MENU_CALLBACK,
   );
 
-  $items['admin/structure/bio-data/term/%'] = array(
-    'page callback' => 'tripal_autocomplete_term',
-    'page arguments' => array(6, 7),
-    'access arguments' => array('administer content'),
-    'type' => MENU_CALLBACK,
-  );
+
 
   return $items;
 }
@@ -654,13 +650,13 @@ function tripal_entity_info_alter(&$entity_info){
  *   A tripal data type array or FALSE if $type does not exist.
  */
 
-function TripalBundleload($bundle_type, $reset = FALSE) {
+function TripalBundle_load($bundle_type, $reset = FALSE) {
   // Get the type of entity by the ID.
   $bundle = db_select('tripal_bundle', 'tdt')
-  ->fields('tdt')
-  ->condition('name', $bundle_type)
-  ->execute()
-  ->fetchObject();
+    ->fields('tdt')
+    ->condition('name', $bundle_type)
+    ->execute()
+    ->fetchObject();
   if ($bundle) {
     $entity = entity_load('TripalBundle', array($bundle->id), array(), $reset);
     return reset($entity);

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

@@ -795,7 +795,7 @@ function tripal_submit_obo_job($obo) {
   $obo['file']   = (isset($obo['file']))   ? $obo['file']   : NULL;
 
   if ($obo['obo_id']) {
-    $sql = "SELECT * FROM {tripal_chado_obo} WHERE obo_id = :obo_id";
+    $sql = "SELECT * FROM {tripal_cv_obo} WHERE obo_id = :obo_id";
     $result = db_query($sql, array(':obo_id' => $obo['obo_id']))->fetchObject();
 
     $args = array($result->obo_id);
@@ -818,7 +818,7 @@ function tripal_submit_obo_job($obo) {
 }
 
 /**
- * Add the OBO to the tripal_chado_obo table in the Drupal database.
+ * 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.
  *
@@ -834,14 +834,14 @@ function tripal_submit_obo_job($obo) {
  */
 function tripal_insert_obo($name, $path) {
   // make sure an OBO with the same name doesn't already exist
-  $obo_id = db_select('tripal_chado_obo', 'tco')
+  $obo_id = db_select('tripal_cv_obo', 'tco')
     ->fields('tco', array('obo_id'))
     ->condition('name', $name)
     ->execute()
     ->fetchField();
 
   if ($obo_id) {
-    db_update('tripal_chado_obo')
+    db_update('tripal_cv_obo')
       ->fields(array(
         'path' => $path,
       ))
@@ -853,7 +853,7 @@ function tripal_insert_obo($name, $path) {
     $record = new stdClass;
     $record->name = $name;
     $record->path = $path;
-    drupal_write_record('tripal_chado_obo', $record);
+    drupal_write_record('tripal_cv_obo', $record);
     return $record->obo_id;
   }
 }

+ 0 - 0
legacy/tripal_contact/files/tcontact.obo → tripal_chado/files/tcontact.obo


+ 0 - 0
legacy/tripal_pub/files/tpub.obo → tripal_chado/files/tpub.obo


+ 1 - 1
tripal_chado/includes/fields/kvproperty_adder.inc

@@ -44,7 +44,7 @@ function tripal_chado_kvproperty_adder_widget(&$widget, $form, $form_state,
     '#type' => 'textfield',
     '#description' => t("Please enter the type of property that you want to
         add.  As you type, suggestions will be provided."),
-    '#autocomplete_path' => "admin/tripal/vocab/cvterm/auto_name//",
+    '#autocomplete_path' => "admin/tripal/storage/term/",
   );
   $widget['kvproperty_adder_link'] = array(
     '#type' => 'item',

+ 6 - 6
tripal_chado/includes/loaders/tripal_chado.fasta_loader.inc

@@ -20,7 +20,7 @@
  *
  * @ingroup fasta_loader
  */
-function tripal_chado_fasta_load_form() {
+function tripal_feature_fasta_load_form() {
   $form['fasta_file'] = array('#type' => 'textfield','#title' => t('FASTA File'),
     '#description' => t('Please enter the full system path for the FASTA file, or a path within the Drupal
                            installation (e.g. /sites/default/files/xyz.obo).  The path must be accessible to the
@@ -201,7 +201,7 @@ function tripal_chado_fasta_load_form() {
  *
  * @ingroup fasta_loader
  */
-function tripal_chado_fasta_load_form_validate($form, &$form_state) {
+function tripal_feature_fasta_load_form_validate($form, &$form_state) {
   $fasta_file = trim($form_state['values']['fasta_file']);
   $organism_id = $form_state['values']['organism_id'];
   $type = trim($form_state['values']['seqtype']);
@@ -302,7 +302,7 @@ function tripal_chado_fasta_load_form_validate($form, &$form_state) {
  *
  * @ingroup fasta_loader
  */
-function tripal_chado_fasta_load_form_submit($form, &$form_state) {
+function tripal_feature_fasta_load_form_submit($form, &$form_state) {
   global $user;
 
   $dfile = $form_state['storage']['dfile'];
@@ -385,7 +385,7 @@ function tripal_chado_fasta_load_form_submit($form, &$form_state) {
  *
  *          @ingroup fasta_loader
  */
-function tripal_chado_load_fasta($dfile, $organism_id, $type, $re_name, $re_uname, $re_accession,
+function tripal_feature_load_fasta($dfile, $organism_id, $type, $re_name, $re_uname, $re_accession,
   $db_id, $rel_type, $re_subject, $parent_type, $method, $uid, $analysis_id, $match_type,
   $job = NULL) {
   $transaction = db_transaction();
@@ -617,7 +617,7 @@ function tripal_chado_load_fasta($dfile, $organism_id, $type, $re_name, $re_unam
  *
  * @ingroup fasta_loader
  */
-function tripal_chado_load_fasta_feature($fh, $name, $uname, $db_id, $accession, $parent,
+function tripal_feature_load_fasta_feature($fh, $name, $uname, $db_id, $accession, $parent,
   $rel_type, $parent_type, $analysis_id, $organism_id, $cvterm, $source, $method, $re_name,
   $match_type, $parentcvterm, $relcvterm, $seq_start, $seq_end) {
 
@@ -906,7 +906,7 @@ function tripal_chado_load_fasta_feature($fh, $name, $uname, $db_id, $accession,
  * @param unknown $seq_start
  * @param unknown $seq_end
  */
-function tripal_chado_load_fasta_residues($fh, $feature_id, $seq_start, $seq_end) {
+function tripal_feature_load_fasta_residues($fh, $feature_id, $seq_start, $seq_end) {
 
   // First position the file at the beginning of the sequence
   fseek($fh, $seq_start, SEEK_SET);

+ 14 - 14
tripal_chado/includes/loaders/tripal_chado.gff_loader.inc

@@ -18,7 +18,7 @@
  *
  * @ingroup gff3_loader
  */
-function tripal_chado_gff3_load_form() {
+function tripal_feature_gff3_load_form() {
 
   $form['gff_file']= array(
     '#type'          => 'textfield',
@@ -214,7 +214,7 @@ function tripal_chado_gff3_load_form() {
  *
  * @ingroup gff3_loader
  */
-function tripal_chado_gff3_load_form_validate($form, &$form_state) {
+function tripal_feature_gff3_load_form_validate($form, &$form_state) {
 
   $gff_file = trim($form_state['values']['gff_file']);
   $organism_id = $form_state['values']['organism_id'];
@@ -263,7 +263,7 @@ function tripal_chado_gff3_load_form_validate($form, &$form_state) {
  *
  * @ingroup gff3_loader
  */
-function tripal_chado_gff3_load_form_submit($form, &$form_state) {
+function tripal_feature_gff3_load_form_submit($form, &$form_state) {
   global $user;
 
   $gff_file = trim($form_state['values']['gff_file']);
@@ -380,7 +380,7 @@ function tripal_chado_gff3_load_form_submit($form, &$form_state) {
  *
  * @ingroup gff3_loader
  */
-function tripal_chado_load_gff3($gff_file, $organism_id, $analysis_id,
+function tripal_feature_load_gff3($gff_file, $organism_id, $analysis_id,
   $add_only = 0, $update = 1, $refresh = 0, $remove = 0, $use_transaction = 1,
   $target_organism_id = NULL, $target_type = NULL,  $create_target = 0,
   $start_line = 1, $landmark_type = '', $alt_id_attr = '', $create_organism = FALSE,
@@ -1071,7 +1071,7 @@ function tripal_chado_load_gff3($gff_file, $organism_id, $analysis_id,
  *
  * @ingroup gff3_loader
  */
-function tripal_chado_load_gff3_derives_from($feature, $cvterm, $object,
+function tripal_feature_load_gff3_derives_from($feature, $cvterm, $object,
   $organism, $fmin, $fmax) {
 
   $type = $cvterm->name;
@@ -1180,7 +1180,7 @@ function tripal_chado_load_gff3_derives_from($feature, $cvterm, $object,
  *
  * @ingroup gff3_loader
  */
-function tripal_chado_load_gff3_parents($feature, $cvterm, $parents,
+function tripal_feature_load_gff3_parents($feature, $cvterm, $parents,
   $organism_id, $strand, $phase, $fmin, $fmax) {
 
   $uname = $feature->uniquename;
@@ -1281,7 +1281,7 @@ function tripal_chado_load_gff3_parents($feature, $cvterm, $parents,
  *
  * @ingroup gff3_loader
  */
-function tripal_chado_load_gff3_dbxref($feature, $dbxrefs) {
+function tripal_feature_load_gff3_dbxref($feature, $dbxrefs) {
 
   // iterate through each of the dbxrefs
   foreach ($dbxrefs as $dbxref) {
@@ -1373,7 +1373,7 @@ function tripal_chado_load_gff3_dbxref($feature, $dbxrefs) {
  *
  * @ingroup gff3_loader
  */
-function tripal_chado_load_gff3_ontology($feature, $dbxrefs) {
+function tripal_feature_load_gff3_ontology($feature, $dbxrefs) {
 
    // iterate through each of the dbxrefs
   foreach ($dbxrefs as $dbxref) {
@@ -1451,7 +1451,7 @@ function tripal_chado_load_gff3_ontology($feature, $dbxrefs) {
  *
  * @ingroup gff3_loader
  */
-function tripal_chado_load_gff3_alias($feature, $aliases) {
+function tripal_feature_load_gff3_alias($feature, $aliases) {
 
   // make sure we have a 'synonym_type' vocabulary
   $select = array('name' => 'synonym_type');
@@ -1608,7 +1608,7 @@ function tripal_chado_load_gff3_alias($feature, $aliases) {
  *
  * @ingroup gff3_loader
  */
-function tripal_chado_load_gff3_feature($organism, $analysis_id, $cvterm, $uniquename,
+function tripal_feature_load_gff3_feature($organism, $analysis_id, $cvterm, $uniquename,
   $name, $residues, $is_analysis = 'f', $is_obsolete = 'f', $add_only, $score) {
 
   // Check to see if the feature already exists.
@@ -1735,7 +1735,7 @@ function tripal_chado_load_gff3_feature($organism, $analysis_id, $cvterm, $uniqu
  *
  * @ingroup gff3_loader
  */
-function tripal_chado_load_gff3_featureloc($feature, $organism, $landmark, $fmin,
+function tripal_feature_load_gff3_featureloc($feature, $organism, $landmark, $fmin,
   $fmax, $strand, $phase, $is_fmin_partial, $is_fmax_partial, $residue_info, $locgroup,
   $landmark_type_id = '', $landmark_organism_id = '', $create_landmark = 0,
   $landmark_is_target = 0) {
@@ -1916,7 +1916,7 @@ function tripal_chado_load_gff3_featureloc($feature, $organism, $landmark, $fmin
  *
  * @ingroup gff3_loader
  */
-function tripal_chado_load_gff3_property($feature, $property, $value) {
+function tripal_feature_load_gff3_property($feature, $property, $value) {
 
   // first make sure the cvterm exists.  if not, then add it
   $select = array(
@@ -1998,7 +1998,7 @@ function tripal_chado_load_gff3_property($feature, $property, $value) {
  *
  * @ingroup gff3_loader
  */
-function tripal_chado_load_gff3_fasta($fh, $interval, &$num_read, &$intv_read, &$line_num, $filesize, $job) {
+function tripal_feature_load_gff3_fasta($fh, $interval, &$num_read, &$intv_read, &$line_num, $filesize, $job) {
   print "\nLoading FASTA sequences\n";
   $residues = '';
   $id = NULL;
@@ -2089,7 +2089,7 @@ function tripal_chado_load_gff3_fasta($fh, $interval, &$num_read, &$intv_read, &
  *
  * @ingroup gff3_loader
  */
-function tripal_chado_load_gff3_target($feature, $tags, $target_organism_id, $target_type, $create_target, $attr_locgroup) {
+function tripal_feature_load_gff3_target($feature, $tags, $target_organism_id, $target_type, $create_target, $attr_locgroup) {
   // format is: "target_id start end [strand]", where strand is optional and may be "+" or "-"
   $matched = preg_match('/^(.*?)\s+(\d+)\s+(\d+)(\s+[\+|\-])*$/', trim($tags['Target'][0]), $matches);
 

+ 76 - 76
tripal_chado/includes/loaders/tripal_chado.obo_loader.inc

@@ -26,10 +26,10 @@
  *
  * @ingroup tripal_obo_loader
  */
-function tripal_chado_obo_form($form, &$form_state) {
+function tripal_cv_obo_form($form, &$form_state) {
 
   // get a list of db from chado for user to choose
-  $sql = "SELECT * FROM {tripal_chado_obo} ORDER BY name";
+  $sql = "SELECT * FROM {tripal_cv_obo} ORDER BY name";
   $results = db_query($sql);
 
   $obos = array();
@@ -79,7 +79,7 @@ function tripal_chado_obo_form($form, &$form_state) {
     '#type' => 'select',
     '#options' => $obos,
     '#ajax' => array(
-      'callback' => 'tripal_chado_obo_form_ajax_callback',
+      'callback' => 'tripal_cv_obo_form_ajax_callback',
       'wrapper' => 'obo-existing-fieldset',
     ),
   );
@@ -91,7 +91,7 @@ function tripal_chado_obo_form($form, &$form_state) {
     $uobo_url = '';
     $uobo_file = '';
 
-    $vocab = db_select('tripal_chado_obo', 't')
+    $vocab = db_select('tripal_cv_obo', 't')
       ->fields('t', array('name', 'path'))
       ->condition('obo_id', $obo_id)
       ->execute()
@@ -209,7 +209,7 @@ function tripal_chado_obo_form($form, &$form_state) {
  * @param $form
  * @param $form_state
  */
-function tripal_chado_obo_form_validate($form, &$form_state) {
+function tripal_cv_obo_form_validate($form, &$form_state) {
   $obo_id    = $form_state['values']['obo_id'];
   $obo_name  = trim($form_state['values']['obo_name']);
   $obo_url   = trim($form_state['values']['obo_url']);
@@ -222,7 +222,7 @@ function tripal_chado_obo_form_validate($form, &$form_state) {
   if ($form_state['clicked_button']['#name'] == 'update_obo_details' or
       $form_state['clicked_button']['#name'] == 'update_load_obo') {
     // Get the current record
-    $vocab = db_select('tripal_chado_obo', 't')
+    $vocab = db_select('tripal_cv_obo', 't')
       ->fields('t', array('obo_id', 'name', 'path'))
       ->condition('name', $uobo_name)
       ->execute()
@@ -246,7 +246,7 @@ function tripal_chado_obo_form_validate($form, &$form_state) {
   }
   if ($form_state['clicked_button']['#name'] == 'add_new_obo') {
     // Get the current record
-    $vocab = db_select('tripal_chado_obo', 't')
+    $vocab = db_select('tripal_cv_obo', 't')
       ->fields('t', array('obo_id', 'name', 'path'))
       ->condition('name', $obo_name)
       ->execute()
@@ -282,7 +282,7 @@ function tripal_chado_obo_form_validate($form, &$form_state) {
  *
  * @ingroup tripal_obo_loader
  */
-function tripal_chado_obo_form_submit($form, &$form_state) {
+function tripal_cv_obo_form_submit($form, &$form_state) {
 
   $obo_id    = $form_state['values']['obo_id'];
   $obo_name  = trim($form_state['values']['obo_name']);
@@ -295,7 +295,7 @@ function tripal_chado_obo_form_submit($form, &$form_state) {
   // If the user requested to alter the details then do that.
   if ($form_state['clicked_button']['#name'] == 'update_obo_details' or
       $form_state['clicked_button']['#name'] == 'update_load_obo') {
-    $success = db_update('tripal_chado_obo')
+    $success = db_update('tripal_cv_obo')
       ->fields(array(
         'name' => $uobo_name,
         'path' => $uobo_url ? $uobo_url : $uobo_file,
@@ -316,7 +316,7 @@ function tripal_chado_obo_form_submit($form, &$form_state) {
     tripal_submit_obo_job(array('obo_id' => $obo_id));
   }
   if ($form_state['clicked_button']['#name'] == 'add_new_obo') {
-    $success = db_insert('tripal_chado_obo')
+    $success = db_insert('tripal_cv_obo')
     ->fields(array(
       'name' => $obo_name,
       'path' => $obo_url ? $obo_url : $obo_file,
@@ -338,7 +338,7 @@ function tripal_chado_obo_form_submit($form, &$form_state) {
  * management after a user submits a job via the Load Onotloies form.
  *
  * @param $obo_id
- *   An obo_id from the tripal_chado_obo file that specifies which OBO file to import
+ *   An obo_id from the tripal_cv_obo file that specifies which OBO file to import
  * @param $job_id
  *   The job_id of the job from the Tripal jobs management system.
  *
@@ -347,7 +347,7 @@ function tripal_chado_obo_form_submit($form, &$form_state) {
 function tripal_chado_load_obo_v1_2_id($obo_id, $jobid = NULL) {
 
   // Get the OBO reference.
-  $sql = "SELECT * FROM {tripal_chado_obo} WHERE obo_id = :obo_id";
+  $sql = "SELECT * FROM {tripal_cv_obo} WHERE obo_id = :obo_id";
   $obo = db_query($sql, array(':obo_id' => $obo_id))->fetchObject();
 
   // Convert the module name to the real path if present
@@ -395,7 +395,7 @@ function tripal_chado_load_obo_v1_2_id($obo_id, $jobid = NULL) {
  *   The job_id of the job from the Tripal jobs management system.
  * @param $is_new
  *   Set to TRUE if this is a new ontology that does not yet exist in the
- *   tripal_chado_obo table.  If TRUE the OBO will be added to the table.
+ *   tripal_cv_obo table.  If TRUE the OBO will be added to the table.
  *
  * @ingroup tripal_obo_loader
  */
@@ -428,7 +428,7 @@ function tripal_chado_load_obo_v1_2_file($obo_name, $file, $jobid = NULL, $is_ne
  *   The job_id of the job from the Tripal jobs management system.
  * @param $is_new
  *   Set to TRUE if this is a new ontology that does not yet exist in the
- *   tripal_chado_obo table.  If TRUE the OBO will be added to the table.
+ *   tripal_cv_obo table.  If TRUE the OBO will be added to the table.
  *
  * @ingroup tripal_obo_loader
  */
@@ -442,7 +442,7 @@ function tripal_chado_load_obo_v1_2_url($obo_name, $url, $jobid = NULL, $is_new
   $url_fh = fopen($url, "r");
   $obo_fh = fopen($temp, "w");
   if (!$url_fh) {
-    tripal_chado_obo_quiterror("Unable to download the remote OBO file at $url. Could a firewall be blocking outgoing connections? " .
+    tripal_cv_obo_quiterror("Unable to download the remote OBO file at $url. Could a firewall be blocking outgoing connections? " .
       " if you are unable to download the file you may manually downlod the OBO file and use the web interface to " .
       " specify the location of the file on your server.");
 
@@ -529,14 +529,14 @@ function tripal_chado_load_obo_v1_2($file, $jobid = NULL, &$newcvs) {
 
     // make sure we have an 'internal' and a '_global' database
     if (!tripal_insert_db(array('name' => 'internal'))) {
-      tripal_chado_obo_quiterror("Cannot add 'internal' database");
+      tripal_cv_obo_quiterror("Cannot add 'internal' database");
     }
     if (!tripal_insert_db(array('name' => '_global'))) {
-      tripal_chado_obo_quiterror("Cannot add '_global' database");
+      tripal_cv_obo_quiterror("Cannot add '_global' database");
     }
 
     // parse the obo file
-    $default_db = tripal_chado_obo_parse($file, $header, $jobid);
+    $default_db = tripal_cv_obo_parse($file, $header, $jobid);
 
     // add the CV for this ontology to the database.  The v1.2 definition
     // specifies a 'default-namespace' to be used if a 'namespace' is not
@@ -545,7 +545,7 @@ function tripal_chado_load_obo_v1_2($file, $jobid = NULL, &$newcvs) {
     if (array_key_exists('default-namespace', $header)) {
       $defaultcv = tripal_insert_cv($header['default-namespace'][0], '');
       if (!$defaultcv) {
-        tripal_chado_obo_quiterror('Cannot add namespace ' . $header['default-namespace'][0]);
+        tripal_cv_obo_quiterror('Cannot add namespace ' . $header['default-namespace'][0]);
       }
       $newcvs[$header['default-namespace'][0]] = $defaultcv->cv_id;
     }
@@ -557,7 +557,7 @@ function tripal_chado_load_obo_v1_2($file, $jobid = NULL, &$newcvs) {
       if (array_key_exists('ontology', $header)) {
         $defaultcv = tripal_insert_cv(strtoupper($header['ontology'][0]), '');
         if (!$defaultcv) {
-          tripal_chado_obo_quiterror('Cannot add namespace ' . strtoupper($header['ontology'][0]));
+          tripal_cv_obo_quiterror('Cannot add namespace ' . strtoupper($header['ontology'][0]));
         }
         $newcvs[strtoupper(strtoupper($header['ontology'][0]))] = $defaultcv->cv_id;
       }
@@ -571,12 +571,12 @@ function tripal_chado_load_obo_v1_2($file, $jobid = NULL, &$newcvs) {
 
     // add any typedefs to the vocabulary first
     print "\nStep 2: Loading type defs...\n";
-    tripal_chado_obo_load_typedefs($defaultcv, $newcvs, $default_db, $jobid);
+    tripal_cv_obo_load_typedefs($defaultcv, $newcvs, $default_db, $jobid);
 
     // next add terms to the vocabulary
     print "\nStep 3: Loading terms...\n";
-    if (!tripal_chado_obo_process_terms($defaultcv, $jobid, $newcvs, $default_db)) {
-      tripal_chado_obo_quiterror('Cannot add terms from this ontology');
+    if (!tripal_cv_obo_process_terms($defaultcv, $jobid, $newcvs, $default_db)) {
+      tripal_cv_obo_quiterror('Cannot add terms from this ontology');
     }
   }
   catch (Exception $e) {
@@ -598,7 +598,7 @@ function tripal_chado_load_obo_v1_2($file, $jobid = NULL, &$newcvs) {
  *
  * @ingroup tripal_obo_loader
  */
-function tripal_chado_obo_quiterror($message) {
+function tripal_cv_obo_quiterror($message) {
 
   tripal_report_error("T_obo_loader", TRIPAL_ERROR, $message, array());
   exit;
@@ -622,7 +622,7 @@ function tripal_chado_obo_quiterror($message) {
  *
  * @ingroup tripal_obo_loader
  */
-function tripal_chado_obo_load_typedefs($defaultcv, $newcvs, $default_db, $jobid) {
+function tripal_cv_obo_load_typedefs($defaultcv, $newcvs, $default_db, $jobid) {
   $sql = "SELECT * FROM {tripal_obo_temp} WHERE type = 'Typedef' ";
   $typedefs = chado_query($sql);
 
@@ -650,7 +650,7 @@ function tripal_chado_obo_load_typedefs($defaultcv, $newcvs, $default_db, $jobid
       printf("%d of %d records. (%0.2f%%) Memory: %s bytes\r", $i, $count, $complete * 3, number_format(memory_get_usage()));
     }
 
-    tripal_chado_obo_process_term($term, $defaultcv->name, 1, $newcvs, $default_db);
+    tripal_cv_obo_process_term($term, $defaultcv->name, 1, $newcvs, $default_db);
 
     $i++;
   }
@@ -684,7 +684,7 @@ function tripal_chado_obo_load_typedefs($defaultcv, $newcvs, $default_db, $jobid
  *   The name of the default database.
  * @ingroup tripal_obo_loader
  */
-function tripal_chado_obo_process_terms($defaultcv, $jobid = NULL, &$newcvs, $default_db) {
+function tripal_cv_obo_process_terms($defaultcv, $jobid = NULL, &$newcvs, $default_db) {
 
   $i = 0;
 
@@ -720,8 +720,8 @@ function tripal_chado_obo_process_terms($defaultcv, $jobid = NULL, &$newcvs, $de
     }
 
     // add/update this term
-    if (!tripal_chado_obo_process_term($term, $defaultcv->name, 0, $newcvs, $default_db)) {
-      tripal_chado_obo_quiterror("Failed to process terms from the ontology");
+    if (!tripal_cv_obo_process_term($term, $defaultcv->name, 0, $newcvs, $default_db)) {
+      tripal_cv_obo_quiterror("Failed to process terms from the ontology");
     }
 
     $i++;
@@ -757,11 +757,11 @@ function tripal_chado_obo_process_terms($defaultcv, $jobid = NULL, &$newcvs, $de
  *
  * @ingroup tripal_obo_loader
  */
-function tripal_chado_obo_process_term($term, $defaultcv, $is_relationship = 0, &$newcvs, $default_db) {
+function tripal_cv_obo_process_term($term, $defaultcv, $is_relationship = 0, &$newcvs, $default_db) {
 
   // make sure we have a namespace for this term
   if (!array_key_exists('namespace', $term) and !($defaultcv or $defaultcv == '')) {
-    tripal_chado_obo_quiterror("Cannot add the term: no namespace defined. " . $term['id'][0]);
+    tripal_cv_obo_quiterror("Cannot add the term: no namespace defined. " . $term['id'][0]);
   }
 
   // construct the term array for sending to the tripal_chado_add_cvterm function
@@ -789,7 +789,7 @@ function tripal_chado_obo_process_term($term, $defaultcv, $is_relationship = 0,
   // add the cvterm
   $cvterm = tripal_insert_cvterm($t, array('update_existing' => TRUE));
   if (!$cvterm) {
-    tripal_chado_obo_quiterror("Cannot add the term " . $term['id'][0]);
+    tripal_cv_obo_quiterror("Cannot add the term " . $term['id'][0]);
   }
 
   if (array_key_exists('namespace', $term)) {
@@ -802,8 +802,8 @@ function tripal_chado_obo_process_term($term, $defaultcv, $is_relationship = 0,
   }
   if (array_key_exists('alt_id', $term)) {
     foreach ($term['alt_id'] as $alt_id) {
-      if (!tripal_chado_obo_add_cvterm_dbxref($cvterm, $alt_id)) {
-        tripal_chado_obo_quiterror("Cannot add alternate id $alt_id");
+      if (!tripal_cv_obo_add_cvterm_dbxref($cvterm, $alt_id)) {
+        tripal_cv_obo_quiterror("Cannot add alternate id $alt_id");
       }
     }
   }
@@ -813,8 +813,8 @@ function tripal_chado_obo_process_term($term, $defaultcv, $is_relationship = 0,
   }
   // add synonyms for this cvterm
   if (array_key_exists('synonym', $term)) {
-    if (!tripal_chado_obo_add_synonyms($term, $cvterm)) {
-      tripal_chado_obo_quiterror("Cannot add synonyms");
+    if (!tripal_cv_obo_add_synonyms($term, $cvterm)) {
+      tripal_cv_obo_quiterror("Cannot add synonyms");
     }
   }
 
@@ -840,8 +840,8 @@ function tripal_chado_obo_process_term($term, $defaultcv, $is_relationship = 0,
       }
     }
 
-    if (!tripal_chado_obo_add_synonyms($term, $cvterm)) {
-      tripal_chado_obo_quiterror("Cannot add/update synonyms");
+    if (!tripal_cv_obo_add_synonyms($term, $cvterm)) {
+      tripal_cv_obo_quiterror("Cannot add/update synonyms");
     }
   }
 
@@ -850,8 +850,8 @@ function tripal_chado_obo_process_term($term, $defaultcv, $is_relationship = 0,
     $comments = $term['comment'];
     $j = 0;
     foreach ($comments as $comment) {
-      if (!tripal_chado_obo_add_cvterm_prop($cvterm, 'comment', $comment, $j)) {
-        tripal_chado_obo_quiterror("Cannot add/update cvterm property");
+      if (!tripal_cv_obo_add_cvterm_prop($cvterm, 'comment', $comment, $j)) {
+        tripal_cv_obo_quiterror("Cannot add/update cvterm property");
       }
       $j++;
     }
@@ -860,23 +860,23 @@ function tripal_chado_obo_process_term($term, $defaultcv, $is_relationship = 0,
   // add any other external dbxrefs
   if (array_key_exists('xref', $term)) {
     foreach ($term['xref'] as $xref) {
-      if (!tripal_chado_obo_add_cvterm_dbxref($cvterm, $xref)) {
-        tripal_chado_obo_quiterror("Cannot add/update cvterm database reference (dbxref).");
+      if (!tripal_cv_obo_add_cvterm_dbxref($cvterm, $xref)) {
+        tripal_cv_obo_quiterror("Cannot add/update cvterm database reference (dbxref).");
       }
     }
   }
 
   if (array_key_exists('xref_analog', $term)) {
     foreach ($term['xref_analog'] as $xref) {
-      if (!tripal_chado_obo_add_cvterm_dbxref($cvterm, $xref)) {
-        tripal_chado_obo_quiterror("Cannot add/update cvterm database reference (dbxref).");
+      if (!tripal_cv_obo_add_cvterm_dbxref($cvterm, $xref)) {
+        tripal_cv_obo_quiterror("Cannot add/update cvterm database reference (dbxref).");
       }
     }
   }
   if (array_key_exists('xref_unk', $term)) {
     foreach ($term['xref_unk'] as $xref) {
-      if (!tripal_chado_obo_add_cvterm_dbxref($cvterm, $xref)) {
-        tripal_chado_obo_quiterror("Cannot add/update cvterm database reference (dbxref).");
+      if (!tripal_cv_obo_add_cvterm_dbxref($cvterm, $xref)) {
+        tripal_cv_obo_quiterror("Cannot add/update cvterm database reference (dbxref).");
       }
     }
   }
@@ -884,8 +884,8 @@ function tripal_chado_obo_process_term($term, $defaultcv, $is_relationship = 0,
   // add is_a relationships for this cvterm
   if (array_key_exists('is_a', $term)) {
     foreach ($term['is_a'] as $is_a) {
-      if (!tripal_chado_obo_add_relationship($cvterm, $defaultcv, 'is_a', $is_a, $is_relationship, $default_db)) {
-        tripal_chado_obo_quiterror("Cannot add relationship is_a: $is_a");
+      if (!tripal_cv_obo_add_relationship($cvterm, $defaultcv, 'is_a', $is_a, $is_relationship, $default_db)) {
+        tripal_cv_obo_quiterror("Cannot add relationship is_a: $is_a");
       }
     }
   }
@@ -903,8 +903,8 @@ function tripal_chado_obo_process_term($term, $defaultcv, $is_relationship = 0,
     foreach ($term['relationship'] as $value) {
       $rel = preg_replace('/^(.+?)\s.+?$/', '\1', $value);
       $object = preg_replace('/^.+?\s(.+?)$/', '\1', $value);
-      if (!tripal_chado_obo_add_relationship($cvterm, $defaultcv, $rel, $object, $is_relationship, $default_db)) {
-        tripal_chado_obo_quiterror("Cannot add relationship $rel: $object");
+      if (!tripal_cv_obo_add_relationship($cvterm, $defaultcv, $rel, $object, $is_relationship, $default_db)) {
+        tripal_cv_obo_quiterror("Cannot add relationship $rel: $object");
       }
     }
   }
@@ -942,7 +942,7 @@ function tripal_chado_obo_process_term($term, $defaultcv, $is_relationship = 0,
  *
  * @ingroup tripal_obo_loader
  */
-function tripal_chado_obo_add_relationship($cvterm, $defaultcv, $rel,
+function tripal_cv_obo_add_relationship($cvterm, $defaultcv, $rel,
   $objname, $object_is_relationship = 0, $default_db = 'OBO_REL') {
 
   // make sure the relationship cvterm exists
@@ -971,14 +971,14 @@ function tripal_chado_obo_add_relationship($cvterm, $defaultcv, $rel,
     );
     $relcvterm = tripal_insert_cvterm($term, array('update_existing' => FALSE));
     if (!$relcvterm) {
-      tripal_chado_obo_quiterror("Cannot find the relationship term in the current ontology or in the relationship ontology: $rel\n");
+      tripal_cv_obo_quiterror("Cannot find the relationship term in the current ontology or in the relationship ontology: $rel\n");
     }
   }
 
   // get the object term
-  $oterm = tripal_chado_obo_get_term($objname);
+  $oterm = tripal_cv_obo_get_term($objname);
   if (!$oterm) {
-    tripal_chado_obo_quiterror("Could not find object term $objname\n");
+    tripal_cv_obo_quiterror("Could not find object term $objname\n");
   }
 
   $objterm = array();
@@ -1003,7 +1003,7 @@ function tripal_chado_obo_add_relationship($cvterm, $defaultcv, $rel,
 
   $objcvterm = tripal_insert_cvterm($objterm, array('update_existing' => TRUE));
   if (!$objcvterm) {
-    tripal_chado_obo_quiterror("Cannot add cvterm " . $oterm['name'][0]);
+    tripal_cv_obo_quiterror("Cannot add cvterm " . $oterm['name'][0]);
   }
 
   // check to see if the cvterm_relationship already exists, if not add it
@@ -1017,7 +1017,7 @@ function tripal_chado_obo_add_relationship($cvterm, $defaultcv, $rel,
     $options = array('return_record' => FALSE);
     $success = chado_insert_record('cvterm_relationship', $values, $options);
     if (!$success) {
-      tripal_chado_obo_quiterror("Cannot add term relationship: '$cvterm->name' $rel '$objcvterm->name'");
+      tripal_cv_obo_quiterror("Cannot add term relationship: '$cvterm->name' $rel '$objcvterm->name'");
     }
   }
 
@@ -1032,7 +1032,7 @@ function tripal_chado_obo_add_relationship($cvterm, $defaultcv, $rel,
  *
  * @ingroup tripal_obo_loader
  */
-function tripal_chado_obo_get_term($id) {
+function tripal_cv_obo_get_term($id) {
   $values = array('id' => $id);
   $result = chado_select_record('tripal_obo_temp', array('stanza'), $values);
   if (count($result) == 0) {
@@ -1051,7 +1051,7 @@ function tripal_chado_obo_get_term($id) {
  *
  * @ingroup tripal_obo_loader
  */
-function tripal_chado_obo_add_synonyms($term, $cvterm) {
+function tripal_cv_obo_add_synonyms($term, $cvterm) {
 
   // make sure we have a 'synonym_type' vocabulary
   $syncv = tripal_insert_cv('synonym_type', 'A vocabulary added by the Tripal CV module OBO loader for storing synonym types.');
@@ -1090,7 +1090,7 @@ function tripal_chado_obo_add_synonyms($term, $cvterm) {
         );
         $syntype = tripal_insert_cvterm($term, array('update_existing' => TRUE));
         if (!$syntype) {
-          tripal_chado_obo_quiterror("Cannot add synonym type: internal:$scope");
+          tripal_cv_obo_quiterror("Cannot add synonym type: internal:$scope");
         }
       }
 
@@ -1109,7 +1109,7 @@ function tripal_chado_obo_add_synonyms($term, $cvterm) {
         $options = array('return_record' => FALSE);
         $success = chado_insert_record('cvtermsynonym', $values, $options);
         if (!$success) {
-          tripal_chado_obo_quiterror("Failed to insert the synonym for term: $name ($def)");
+          tripal_cv_obo_quiterror("Failed to insert the synonym for term: $name ($def)");
         }
       }
 
@@ -1123,7 +1123,7 @@ function tripal_chado_obo_add_synonyms($term, $cvterm) {
       foreach ($dbxrefs as $dbxref) {
        $dbxref = preg_replace('/,_/',", ",$dbxref);
         if ($dbxref) {
-          tripal_chado_obo_add_cvterm_dbxref($syn,$dbxref);
+          tripal_cv_obo_add_cvterm_dbxref($syn,$dbxref);
         }
       }
       */
@@ -1146,7 +1146,7 @@ function tripal_chado_obo_add_synonyms($term, $cvterm) {
  *
  * @ingroup tripal_obo_loader
  */
-function tripal_chado_obo_parse($obo_file, &$header, $jobid) {
+function tripal_cv_obo_parse($obo_file, &$header, $jobid) {
   $in_header = 1;
   $stanza = array();
   $default_db = '_global';
@@ -1274,7 +1274,7 @@ function tripal_chado_obo_parse($obo_file, &$header, $jobid) {
  *
  * @ingroup tripal_obo_loader
  */
-function tripal_chado_obo_add_cvterm_dbxref($cvterm, $xref) {
+function tripal_cv_obo_add_cvterm_dbxref($cvterm, $xref) {
 
   $dbname = preg_replace('/^(.+?):.*$/', '$1', $xref);
   $accession = preg_replace('/^.+?:\s*(.*?)(\{.+$|\[.+$|\s.+$|\".+$|$)/', '$1', $xref);
@@ -1282,7 +1282,7 @@ function tripal_chado_obo_add_cvterm_dbxref($cvterm, $xref) {
   $dbxrefs = preg_replace('/^.+?\[(.+?)\].*?$/', '$1', $xref);
 
   if (!$accession) {
-    tripal_chado_obo_quiterror();
+    tripal_cv_obo_quiterror();
     tripal_report_error("T_obo_loader", TRIPAL_WARNING, "Cannot add a dbxref without an accession: '$xref'", NULL);
     return FALSE;
   }
@@ -1296,13 +1296,13 @@ function tripal_chado_obo_add_cvterm_dbxref($cvterm, $xref) {
   // add the database
   $db = tripal_insert_db(array('name' => $dbname));
   if (!$db) {
-    tripal_chado_obo_quiterror("Cannot find database '$dbname' in Chado.");
+    tripal_cv_obo_quiterror("Cannot find database '$dbname' in Chado.");
   }
 
   // now add the dbxref
-  $dbxref = tripal_chado_obo_add_dbxref($db->db_id, $accession, '', $description);
+  $dbxref = tripal_cv_obo_add_dbxref($db->db_id, $accession, '', $description);
   if (!$dbxref) {
-    tripal_chado_obo_quiterror("Cannot find or add the database reference (dbxref)");
+    tripal_cv_obo_quiterror("Cannot find or add the database reference (dbxref)");
   }
 
   // finally add the cvterm_dbxref but first check to make sure it exists
@@ -1315,7 +1315,7 @@ function tripal_chado_obo_add_cvterm_dbxref($cvterm, $xref) {
     $ins_options = array('return_record' => FALSE);
     $result = chado_insert_record('cvterm_dbxref', $values, $ins_options);
     if (!$result) {
-      tripal_chado_obo_quiterror("Cannot add cvterm_dbxref: $xref");
+      tripal_cv_obo_quiterror("Cannot add cvterm_dbxref: $xref");
       return FALSE;
     }
   }
@@ -1337,12 +1337,12 @@ function tripal_chado_obo_add_cvterm_dbxref($cvterm, $xref) {
  *
  * @ingroup tripal_obo_loader
  */
-function tripal_chado_obo_add_cvterm_prop($cvterm, $property, $value, $rank) {
+function tripal_cv_obo_add_cvterm_prop($cvterm, $property, $value, $rank) {
 
   // make sure the 'cvterm_property_type' CV exists
   $cv = tripal_insert_cv('cvterm_property_type', '');
   if (!$cv) {
-    tripal_chado_obo_quiterror("Cannot add/find cvterm_property_type cvterm");
+    tripal_cv_obo_quiterror("Cannot add/find cvterm_property_type cvterm");
   }
 
   // get the property type cvterm.  If it doesn't exist then we want to add it
@@ -1362,7 +1362,7 @@ function tripal_chado_obo_add_cvterm_prop($cvterm, $property, $value, $rank) {
     );
     $cvproptype = tripal_insert_cvterm($term, array('update_existing' => FALSE));
     if (!$cvproptype) {
-      tripal_chado_obo_quiterror("Cannot add cvterm property: internal:$property");
+      tripal_cv_obo_quiterror("Cannot add cvterm property: internal:$property");
       return FALSE;
     }
   }
@@ -1375,7 +1375,7 @@ function tripal_chado_obo_add_cvterm_prop($cvterm, $property, $value, $rank) {
     $values = array('cvterm_id' => $cvterm->cvterm_id);
     $success = chado_delete_record('cvtermprop', $values);
     if (!$success) {
-       tripal_chado_obo_quiterror("Could not remove existing properties to update property $property for term\n");
+       tripal_cv_obo_quiterror("Could not remove existing properties to update property $property for term\n");
        return FALSE;
     }
   }
@@ -1390,7 +1390,7 @@ function tripal_chado_obo_add_cvterm_prop($cvterm, $property, $value, $rank) {
   $options = array('return_record' => FALSE);
   $result = chado_insert_record('cvtermprop', $values, $options);
   if (!$result) {
-    tripal_chado_obo_quiterror("Could not add property $property for term\n");
+    tripal_cv_obo_quiterror("Could not add property $property for term\n");
     return FALSE;
   }
   return TRUE;
@@ -1410,7 +1410,7 @@ function tripal_chado_obo_add_cvterm_prop($cvterm, $property, $value, $rank) {
  *
  * @ingroup tripal_obo_loader
  */
-function tripal_chado_obo_add_dbxref($db_id, $accession, $version='', $description='') {
+function tripal_cv_obo_add_dbxref($db_id, $accession, $version='', $description='') {
 
   // check to see if the dbxref exists if not, add it
   $values = array(
@@ -1428,7 +1428,7 @@ function tripal_chado_obo_add_dbxref($db_id, $accession, $version='', $descripti
     $ins_options = array('return_record' => FALSE);
     $result = chado_insert_record('dbxref', $ins_values, $ins_options);
     if (!$result) {
-      tripal_chado_obo_quiterror("Failed to insert the dbxref record $accession");
+      tripal_cv_obo_quiterror("Failed to insert the dbxref record $accession");
       return FALSE;
     }
     $result = chado_select_record('dbxref', array('dbxref_id'), $values, $options);
@@ -1437,6 +1437,6 @@ function tripal_chado_obo_add_dbxref($db_id, $accession, $version='', $descripti
 }
 
 
-function tripal_chado_obo_form_ajax_callback($form, $form_state) {
+function tripal_cv_obo_form_ajax_callback($form, $form_state) {
   return $form['obo_existing'];
 }

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

@@ -71,7 +71,7 @@ function tripal_chado_vocab_select_term_form($form, &$form_state) {
           Sequence Ontology (SO)."),
       '#required'    => TRUE,
       '#default_value' => $term_name,
-      '#autocomplete_path' => "admin/tripal/vocab/cvterm/auto_name/$cv_id/",
+      '#autocomplete_path' => "admin/tripal/storage/term/$cv_id",
     );
   }
 

File diff suppressed because it is too large
+ 1481 - 61
tripal_chado/tripal_chado.install


+ 76 - 13
tripal_chado/tripal_chado.module

@@ -87,18 +87,21 @@ function tripal_chado_init() {
 function tripal_chado_menu() {
   $items = array();
 
-  $items['admin/tripal/loaders'] = array(
-    'title' => 'Data Loaders',
-    'description' => t('Tools facilitating data import.'),
-    'access arguments' => array('administer tripal'),
-    'type' => MENU_NORMAL_ITEM,
-    'weight' => 6
+  $items['admin/tripal/storage/term/%/%'] = array(
+    'page callback' => 'tripal_autocomplete_cvterm',
+    'page arguments' => array(4, 5),
+    'access arguments' => array('administer content'),
+    'type' => MENU_CALLBACK,
   );
 
-  // Chado Storage Backend
+  //////////////////////////////////////////////////////////////////////////////
+  //                            Chado Storage Backend
+  //////////////////////////////////////////////////////////////////////////////
   $items['admin/tripal/storage/chado'] = array(
-    'title' => 'Chado Schema',
-    'description' => t("Tools to extend the chado schema through custom tables & materialized views."),
+    'title' => 'Chado Relational Database',
+    'description' => t("Integrates Chado with Tripal and includes tools to
+        load data, and extend the chado schema through custom tables &
+        materialized views."),
     'weight' => -100,
     'access arguments' => array('administer tripal'),
   );
@@ -112,7 +115,9 @@ function tripal_chado_menu() {
     'weight' => -100
   );
 
-  // Materialized Views
+  //////////////////////////////////////////////////////////////////////////////
+  //                       Materialized Views
+  //////////////////////////////////////////////////////////////////////////////
   $items['admin/tripal/storage/chado/mviews'] = array(
     'title' => 'Materialized Views',
     'description' => t('Materialized views are used to improve speed of large or complex queries.'),
@@ -188,7 +193,9 @@ function tripal_chado_menu() {
     'type' => MENU_CALLBACK,
   );
 
-  // Custom Tables
+  //////////////////////////////////////////////////////////////////////////////
+  //                           Custom Tables
+  //////////////////////////////////////////////////////////////////////////////
   $items['admin/tripal/storage/chado/custom_tables'] = array(
     'title' => 'Custom Tables',
     'description' => t('Creation of custom tables that are added to Chado database.'),
@@ -244,6 +251,47 @@ function tripal_chado_menu() {
     'type' => MENU_CALLBACK,
   );
 
+
+  //////////////////////////////////////////////////////////////////////////////
+  //                           Data Loaders
+  //////////////////////////////////////////////////////////////////////////////
+  $items['admin/tripal/storage/chado/loaders'] = array(
+    'title' => 'Data Loaders',
+    'description' => t('Tools facilitating data import.'),
+    'access arguments' => array('administer tripal'),
+    'type' => MENU_NORMAL_ITEM,
+    'weight' => 6
+  );
+  $items['admin/tripal/storage/chado/loaders/obo_loader'] = array(
+    'title' => 'OBO File Loader',
+    'description' => 'Load an ontology in OBO format into chado as a controlled vocabulary.',
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('tripal_cv_obo_form'),
+    'access arguments' => array('administer controlled vocabularies'),
+    'file' => 'includes/loaders/tripal_chado.obo_loader.inc',
+    'file path' => drupal_get_path('module', 'tripal_chado'),
+    'type' => MENU_NORMAL_ITEM,
+  );
+  $items['admin/tripal/storage/chado/loaders/fasta_loader'] = array(
+    'title' => 'FASTA file Loader',
+    'description' => 'Load sequences from a multi-FASTA file into Chado',
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('tripal_feature_fasta_load_form'),
+    'access arguments' => array('administer tripal feature'),
+    'file' => 'includes/loaders/tripal_chado.fasta_loader.inc',
+    'file path' => drupal_get_path('module', 'tripal_chado'),
+    'type' => MENU_NORMAL_ITEM,
+  );
+  $items['admin/tripal/storage/chado/loaders/gff3_load'] = array(
+    'title' => 'GFF3 file Loader',
+    'description' => 'Import a GFF3 file into Chado',
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('tripal_feature_gff3_load_form'),
+    'access arguments' => array('administer tripal feature'),
+    'file' => 'includes/loaders/tripal_chado.gff_loader.inc',
+    'file path' => drupal_get_path('module', 'tripal_chado'),
+    'type' => MENU_NORMAL_ITEM,
+  );
   return $items;
 
 }
@@ -827,8 +875,10 @@ function tripal_chado_add_bundle_fields($entity_type, $bundle, $term) {
 
   // Check to see if there are any kv-property tables associated to this
   // base table. If so, add the fields for that type of table.
-  // TODO: the 'featurprop' table should not be hardcoded.
-  tripal_chado_add_bundle_kvproperty_adder_field($entity_type, $bundle_name, 'featureprop');
+  $proptable = $bundle_data['data_table'] . 'prop';
+  if (chado_table_exists($proptable)) {
+    tripal_chado_add_bundle_kvproperty_adder_field($entity_type, $bundle_name, $proptable);
+  }
 }
 
 /**
@@ -1082,6 +1132,19 @@ function tripal_chado_get_table_column_field_default($table_name, $schema, $colu
     $field['label'] = 'Residues';
     $field['description'] = 'Please provide an IUPAC compatible residues for this feature. Spaces and new lines are allowed.';
   }
+  //
+  // ANALYSIS TABLE
+  //
+  elseif ($field['field_settings']['chado_table'] == 'analysis' and $field['field_settings']['chado_column'] == 'program') {
+    $field['field_settings']['semantic_web']['type'] = 'SoftwareApplication';
+    $field['field_settings']['semantic_web']['ns'] = 'schema';
+    $field['field_settings']['semantic_web']['nsurl'] = 'https://schema.org/';
+  }
+  elseif ($field['field_settings']['chado_table'] == 'analysis' and $field['field_settings']['chado_column'] == 'sourceuri') {
+    $field['field_type'] = 'text';
+    $field['widget_type'] = 'text_textfield';
+    $field['field_settings']['text_processing'] = 0;
+  }
 
   return $field;
 }

Some files were not shown because too many files changed in this diff