Quellcode durchsuchen

Fixing mistake in subtracting 1 from fmax in featureloc entries

spficklin vor 13 Jahren
Ursprung
Commit
41ca848a92

+ 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 + 1) . ".." . ($featureloc->fmax + 1);
+         $location = $featureloc->srcfeature_id->name .":". ($featureloc->fmin + 1) . ".." . $featureloc->fmax;
          if($location->srcfeature_id->nid){
-           $location = "<a href=\"" . url("node/".$location->srcfeature_id->nid) . "\">".$featureloc->srcfeature_id->name .":".($featureloc->fmin + 1) . ".." . ($featureloc->fmax + 1) ."</a> ";
+           $location = "<a href=\"" . url("node/".$location->srcfeature_id->nid) . "\">".$featureloc->srcfeature_id->name .":".($featureloc->fmin + 1) . ".." . $featureloc->fmax ."</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 + 1) . ".." . ($featureloc->fmax + 1);
+         $location = $featureloc->srcfeature_id->name .":". ($featureloc->fmin + 1) . ".." . $featureloc->fmax;
          if($location->srcfeature_id->nid){
-           $location = "<a href=\"" . url("node/$location->srcfeature_id->nid") . "\">".$featureloc->srcfeature_id->name .":".($featureloc->fmin + 1) . ".." . ($featureloc->fmax + 1) ."</a> ";
+           $location = "<a href=\"" . url("node/$location->srcfeature_id->nid") . "\">".$featureloc->srcfeature_id->name .":".($featureloc->fmin + 1) . ".." . $featureloc->fmax ."</a> ";
          }
          ?>
          <tr class="<?php print $class ?>">

+ 5 - 5
tripal_feature/gff_loader.php

@@ -291,12 +291,12 @@ function tripal_core_load_gff3($gff_file, $organism_id,$analysis_id,$add_only =0
       $attrs = explode(";",$cols[8]);  // split by a semi-colon
 
       // 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);
+      // to be zero-based, so we substract 1 from the fmin
+      $fmin = $start - 1;
+      $fmax = $end;
       if($end < $start){
-         $fmin = ($end - 1);
-         $fmax = ($start - 1);
+         $fmin = $end - 1;
+         $fmax = $start;
       }
       // format the strand for chado
       if(strcmp($strand,'.')==0){