[Bio] / Sprout / Sapling.pm Repository:
ViewVC logotype

Diff of /Sprout/Sapling.pm

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

revision 1.18, Thu Aug 27 19:54:22 2009 UTC revision 1.19, Sun Aug 30 22:12:57 2009 UTC
# Line 1402  Line 1402 
1402      my $strand = $loc->Dir;      my $strand = $loc->Dir;
1403      # Get the length of the contig.      # Get the length of the contig.
1404      my $contigLen = $self->ContigLength($contigID);      my $contigLen = $self->ContigLength($contigID);
1405        Trace("Contig length is $contigLen. Starting at $currentPosition.") if T(3);
1406      # This variable keeps the rightmost end location found.      # This variable keeps the rightmost end location found.
1407      my $endPoint = $loc->Left;      my $endPoint = $loc->Left;
1408      # Loop until we find a redundancy or a gap.      # Loop until we find a redundancy or a gap.
1409      while (! $$redundancyFlag && ! $gapFound && $currentPosition <= $contigLen) {      while (! $$redundancyFlag && ! $gapFound && $currentPosition <= $contigLen) {
1410            Trace("Checking at $currentPosition.") if T(3);
1411          # Compute the limits of the search interval for this iteration.          # Compute the limits of the search interval for this iteration.
1412          my $nextPosition = $currentPosition + $interval;          my $nextPosition = $currentPosition + $interval;
1413          # Get all the locations in the interval.          # Get all the locations in the interval.
1414          my @rows = $self->GetAll("IsLocatedIn",          my @rows = $self->GetAll("IsLocatedIn",
1415                                   'IsLocatedIn(to-link) = ? AND IsLocatedIn(dir) = ? AND IsLocatedIn(begin) >= ? AND IsLocatedIn(begin) < ?',                                   'IsLocatedIn(to-link) = ? AND IsLocatedIn(dir) = ? AND IsLocatedIn(begin) >= ? AND IsLocatedIn(begin) < ?',
1416                                  [$contigID, $strand, $nextPosition, $currentPosition],                                  [$contigID, $strand, $currentPosition, $nextPosition],
1417                                  [qw(from-link begin dir len)]);                                  [qw(from-link begin dir len)]);
1418          # If nothing was found, it's a gap.          # If nothing was found, it's a gap.
1419          if (! @rows) {          if (! @rows) {
1420              $gapFound = 1;              $gapFound = 1;
1421                Trace("No result. Gap found.") if T(3);
1422          } else {          } else {
1423              # We got something, so we can loop through looking for gaps. The search              # We got something, so we can loop through looking for gaps. The search
1424              # requires we sort by left point.              # requires we sort by left point.
# Line 1438  Line 1441 
1441                  } else {                  } else {
1442                      # No, it's not close enough. We've found a gap.                      # No, it's not close enough. We've found a gap.
1443                      $gapFound = 1;                      $gapFound = 1;
1444                        Trace("Long distance. Gap found.") if T(3);
1445                  }                  }
1446              }              }
1447          }          }

Legend:
Removed from v.1.18  
changed lines
  Added in v.1.19

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3