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

Diff of /Sprout/SimBlocks.pm

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

revision 1.4, Wed Jan 11 19:39:20 2006 UTC revision 1.5, Fri Jan 13 07:00:28 2006 UTC
# Line 825  Line 825 
825      return @retVal;      return @retVal;
826  }  }
827    
   
   
828  =head3 MergeDNA  =head3 MergeDNA
829    
830  C<< my ($groupSequence, $variance) = SimBlocks::MergeDNA($groupSequence, $newSequence); >>  C<< my ($groupSequence, $variance) = SimBlocks::MergeDNA($groupSequence, $newSequence); >>
# Line 1182  Line 1180 
1180      my $loc = BasicLocation->new($location);      my $loc = BasicLocation->new($location);
1181      # Determine the parameters needed to get the desired list of regions.      # Determine the parameters needed to get the desired list of regions.
1182      my ($left, $right, $contigID) = ($loc->Left, $loc->Right, $loc->Contig);      my ($left, $right, $contigID) = ($loc->Left, $loc->Right, $loc->Contig);
1183        Trace("Searching for regions near " . $loc->String) if T(4);
1184      # Ask for the regions in the section we want.      # Ask for the regions in the section we want.
1185      my @regions = $self->GetAll(['Region', 'IncludesRegion', 'GroupBlock'],      my @regions = $self->GetAll(['Region', 'IncludesRegion', 'GroupBlock'],
1186                                  'Region(end) >= ? AND Region(position) <= ? AND Region(contigID) = ?',                                  'Region(end) >= ? AND Region(position) <= ? AND Region(contigID) = ?',
# Line 1299  Line 1298 
1298              # Get the length of the contig in question.              # Get the length of the contig in question.
1299              my $len = $fig->contig_ln($genomeID, $locObject->Contig);              my $len = $fig->contig_ln($genomeID, $locObject->Contig);
1300              # Expand the location.              # Expand the location.
1301              $locObject->Widen($distance);              $locObject->Widen($distance, $len);
1302                # Insure the location is Sprout-style;
1303                $locObject->FixContig($genomeID);
1304              # Get the desired block pieces.              # Get the desired block pieces.
1305              my @pieces = $self->GetBlockPieces($locObject);              my @pieces = $self->GetBlockPieces($locObject);
1306                Trace(scalar(@pieces) . " pieces found for location $loc.") if T(4);
1307              # Put them in the hash.              # Put them in the hash.
1308              for my $piece (@pieces) {              for my $piece (@pieces) {
1309                  $retHash{$piece} = 1;                  $retHash{$piece} = 1;
# Line 1314  Line 1316 
1316      my @retVal = ();      my @retVal = ();
1317      for my $piece (keys %retHash) {      for my $piece (keys %retHash) {
1318          my $loc = BasicLocation->new($piece);          my $loc = BasicLocation->new($piece);
1319          push @retVal, $piece;          push @retVal, $loc;
1320      }      }
1321        Trace("Beginning sort.") if T(3);
1322      @retVal = sort { BasicLocation::Cmp($a,$b) } @retVal;      @retVal = sort { BasicLocation::Cmp($a,$b) } @retVal;
1323        Trace(scalar(@retVal) . " pieces found before overlap check.") if T(3);
1324      # Now the locations are sorted by block ID, start position, and descending      # Now the locations are sorted by block ID, start position, and descending
1325      # length. This means that if there's an overlap, the two overlapping      # length. This means that if there's an overlap, the two overlapping
1326      # pieces will be next to each other.      # pieces will be next to each other.

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3