[Bio] / FigKernelPackages / FullLocation.pm Repository:
ViewVC logotype

Diff of /FigKernelPackages/FullLocation.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.7, Mon Aug 8 03:59:19 2005 UTC revision 1.8, Mon Aug 8 17:24:27 2005 UTC
# Line 598  Line 598 
598      my $parity = ($dir eq 'first' ? '-' : '+');      my $parity = ($dir eq 'first' ? '-' : '+');
599      # Get the contig length.      # Get the contig length.
600      my $contig_len = $fig->contig_ln($self->{genomeID}, $self->Contig);      my $contig_len = $fig->contig_ln($self->{genomeID}, $self->Contig);
601      # If we're moving in the opposite direction as the location, we're going to      # If we're moving in the opposite direction from the location, we're going to
602      # go toward the beginning of the contig; otherwise, we're going toward the      # go toward the beginning of the contig; otherwise, we're going toward the
603      # end.      # end.
604      my ($multiplier, $endPoint);      my ($multiplier, $endPoint);
# Line 612  Line 612 
612      # Compute the number of positions to move and add it to the begin point.      # Compute the number of positions to move and add it to the begin point.
613      my $retVal = int(($endPoint - $beginPoint) / $multiplier) * $multiplier +      my $retVal = int(($endPoint - $beginPoint) / $multiplier) * $multiplier +
614                   $beginPoint;                   $beginPoint;
615      # If we're going toward the end, adjust by 2 to get the end of the codon. This      # If this is a "last" situation, adjust by 2 to get the end of the codon. This
616      # may push us past the edge, in which case we need to back up by one codon.      # may push us past the edge, in which case we need to back up by one codon.
617      if ($multiplier > 0) {      if ($parity eq '+') {
618          $retVal += 2;          my $adjustment = ($multiplier > 0 ? 2 : -2);
619          if ($retVal > $contig_len) {          $retVal += $adjustment;
620              $retVal -= 3;          if (! FIG::between(1, $retVal,$contig_len)) {
621                $retVal -= $multiplier;
622          }          }
623      }      }
624      # Return the codon found.      # Return the codon found.

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3