Quellcode durchsuchen

Fixed indexing of featurelocs. When importing a GFF file they should be zero-based and must subtract 1. The feature theming has been updated to add 1 back.

spficklin vor 13 Jahren
Ursprung
Commit
54302f6010

+ 4 - 4
theme_tripal/tripal_feature/tripal_feature_featurelocs.tpl.php

@@ -43,9 +43,9 @@ if (!$sfeaturelocs) {
          if($i % 2 == 0 ){
             $class = 'tripal_feature-table-odd-row tripal-table-even-row';
          } 
-         $location = $featureloc->srcfeature_id->name .":".$featureloc->fmin . ".." . $featureloc->fmax;
+         $location = $featureloc->srcfeature_id->name .":". ($featureloc->fmin + 1) . ".." . ($featureloc->fmax + 1);
          if($location->srcfeature_id->nid){
-           $location = "<a href=\"" . url("node/".$location->srcfeature_id->nid) . "\">".$featureloc->srcfeature_id->name .":".$featureloc->fmin . ".." . $featureloc->fmax ."</a> ";
+           $location = "<a href=\"" . url("node/".$location->srcfeature_id->nid) . "\">".$featureloc->srcfeature_id->name .":".($featureloc->fmin + 1) . ".." . ($featureloc->fmax + 1) ."</a> ";
          }
          ?>
          <tr class="<?php print $class ?>">
@@ -95,9 +95,9 @@ if (!$sfeaturelocs) {
          if($i % 2 == 0 ){
             $class = 'tripal_feature-table-odd-row tripal-table-even-row';
          } 
-         $location = $featureloc->srcfeature_id->name .":".$featureloc->fmin . ".." . $featureloc->fmax;
+         $location = $featureloc->srcfeature_id->name .":". ($featureloc->fmin + 1) . ".." . ($featureloc->fmax + 1);
          if($location->srcfeature_id->nid){
-           $location = "<a href=\"" . url("node/$location->srcfeature_id->nid") . "\">".$featureloc->srcfeature_id->name .":".$featureloc->fmin . ".." . $featureloc->fmax ."</a> ";
+           $location = "<a href=\"" . url("node/$location->srcfeature_id->nid") . "\">".$featureloc->srcfeature_id->name .":".($featureloc->fmin + 1) . ".." . ($featureloc->fmax + 1) ."</a> ";
          }
          ?>
          <tr class="<?php print $class ?>">

+ 6 - 5
tripal_feature/gff_loader.php

@@ -290,12 +290,13 @@ function tripal_core_load_gff3($gff_file, $organism_id,$analysis_id,$add_only =0
       $phase = $cols[7];
       $attrs = explode(";",$cols[8]);  // split by a semi-colon
 
-      // ready the start and stop for chado
-      $fmin = $start;
-      $fmax = $end;
+      // ready the start and stop for chado.  Chado expects these positions
+      // to be zero-based, so we substract 1 from each of them
+      $fmin = ($start - 1);
+      $fmax = ($end - 1);
       if($end < $start){
-         $fmin = $end;
-         $fmax = $start;
+         $fmin = ($end - 1);
+         $fmax = ($start - 1);
       }
       // format the strand for chado
       if(strcmp($strand,'.')==0){