Sfoglia il codice sorgente

Fixed bug in OBO loader when https:// is used for the remote file

Stephen Ficklin 9 anni fa
parent
commit
f5d965b420

+ 4 - 2
tripal_cv/includes/tripal_cv.obo_loader.inc

@@ -358,7 +358,9 @@ function tripal_cv_load_obo_v1_2_id($obo_id, $jobid = NULL) {
   }
 
   // if the reference is for a remote URL then run the URL processing function
-  if (preg_match("/^http:\/\//", $obo->path) or preg_match("/^ftp:\/\//", $obo->path)) {
+  if (preg_match("/^http:\/\//", $obo->path) or
+      preg_match("/^https:\/\//", $obo->path) or
+      preg_match("/^ftp:\/\//", $obo->path)) {
     tripal_cv_load_obo_v1_2_url($obo->name, $obo->path, $jobid, 0);
   }
   // if the reference is for a local file then run the file processing function
@@ -375,7 +377,7 @@ function tripal_cv_load_obo_v1_2_id($obo_id, $jobid = NULL) {
         tripal_cv_load_obo_v1_2_file($obo->name, $obo->path, $jobid, 0);
       }
       else {
-        print "ERROR: counld not find OBO file: '$obo->path'\n";
+        print "ERROR: could not find OBO file: '$obo->path'\n";
       }
     }
   }

+ 1 - 1
tripal_cv/tripal_cv.install

@@ -246,7 +246,7 @@ function tripal_cv_add_obo_defaults() {
   $ontologies = array(
     array('Relationship Ontology', 'http://purl.obolibrary.org/obo/ro.obo'),
 //    array('Relationship Ontology (older deprecated version)', 'http://www.obofoundry.org/ro/ro.obo'),
-    array('Sequence Ontology', 'https://github.com/The-Sequence-Ontology/SO-Ontologies/blob/master/so-xp-simple.obo'),
+    array('Sequence Ontology', 'https://raw.githubusercontent.com/The-Sequence-Ontology/SO-Ontologies/master/so-xp-simple.obo'),
     array('Gene Ontology', 'http://www.geneontology.org/ontology/gene_ontology.obo'),
 //    array('Cell Ontology', 'https://raw.githubusercontent.com/obophenotype/cell-ontology/master/cl.obo'),
 //    array('Plant Structure Ontology', 'http://palea.cgrb.oregonstate.edu/viewsvn/Poc/trunk/ontology/OBO_format/po_anatomy.obo?view=co'),

+ 1 - 1
tripal_feature/includes/tripal_feature.gff_loader.inc

@@ -1493,7 +1493,7 @@ function tripal_feature_load_gff3_alias($feature, $aliases) {
   if (count($result) == 0) {
     $term = array(
       'name' => 'exact',
-      'id' => "internal:exact",
+      'id' => "local:exact",
       'definition' => '',
       'is_obsolete' => 0,
       'cv_name' => $syncv->name,

+ 11 - 11
tripal_feature/theme/templates/tripal_feature_terms.tpl.php

@@ -10,42 +10,42 @@ $terms = $feature->feature_cvterm;
 $s_terms = array();
 if ($terms) {
   foreach ($terms as $term) {
-    $s_terms[$term->cvterm_id->cv_id->name][] = $term;  
+    $s_terms[$term->cvterm_id->cv_id->name][] = $term;
   }
 }
 
 if (count($s_terms) > 0) { ?>
   <div class="tripal_feature-data-block-desc tripal-data-block-desc">The following terms have been associated with this <?php print $node->feature->type_id->name ?>:</div>  <?php
-  
+
   // iterate through each term
   $i = 0;
-  foreach ($s_terms as $cv => $terms) {  
+  foreach ($s_terms as $cv => $terms) {
     // the $headers array is an array of fields to use as the colum headers.
     // additional documentation can be found here
     // https://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_table/7
     $headers = array('Term', 'Definition');
-    
+
     // the $rows array contains an array of rows where each row is an array
     // of values for each column of the table in that row.  Additional documentation
     // can be found here:
     // https://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_table/7
     $rows = array();
 
-    foreach ($terms as $term) { 
+    foreach ($terms as $term) {
       $accession = $term->cvterm_id->dbxref_id->accession;
       if (is_numeric($term->cvterm_id->dbxref_id->accession)) {
         $accession = $term->cvterm_id->dbxref_id->db_id->name . ":" . $term->cvterm_id->dbxref_id->accession;
       }
       if ($term->cvterm_id->dbxref_id->db_id->urlprefix) {
         $accession = l($accession, $term->cvterm_id->dbxref_id->db_id->urlprefix . $accession, array('attributes' => array("target" => '_blank')));
-      } 
-      
+      }
+
       $rows[] = array(
         array('data' => $accession, 'width' => '15%'),
         $term->cvterm_id->name
       );
-    } 
-    
+    }
+
     // generate the link to configure a database, b ut only if the user is
     // a tripal administrator
     $configure_link = '';
@@ -53,7 +53,7 @@ if (count($s_terms) > 0) { ?>
       $db_id = $term->cvterm_id->dbxref_id->db_id->db_id;
       $configure_link = l('[configure term links]', "admin/tripal/chado/tripal_db/edit/$db_id", array('attributes' => array("target" => '_blank')));
     }
-    
+
     // the $table array contains the headers and rows array as well as other
     // options for controlling the display of the table.  Additional
     // documentation can be found here:
@@ -70,7 +70,7 @@ if (count($s_terms) > 0) { ?>
       'colgroups' => array(),
       'empty' => '',
     );
-    
+
     // once we have our table array structure defined, we call Drupal's theme_table()
     // function to generate the table.
     print theme_table($table);