TbyLocibyRef previously didn't seem to support traversals with no interval specified. Put in a temporary fix until the threaded approach is in place.

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@363 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
hanna 2009-04-10 22:14:06 +00:00
parent c2669021b8
commit 608a66e6ab
1 changed files with 15 additions and 5 deletions

View File

@ -35,8 +35,8 @@ public class TraverseByLociByReference extends TraverseByLoci {
}
public <M,T> T traverse(Walker<M,T> walker, ArrayList<GenomeLoc> locations) {
if ( locations.isEmpty() )
Utils.scareUser("Requested all locations be processed without providing locations to be processed!");
//if ( locations.isEmpty() )
// Utils.scareUser("Requested all locations be processed without providing locations to be processed!");
return super.traverse(walker, locations);
}
@ -54,11 +54,21 @@ public class TraverseByLociByReference extends TraverseByLoci {
FilteringIterator filterIter = new FilteringIterator(readIter, new locusStreamFilterFunc());
LocusIterator locusIter = new LocusIteratorByHanger(filterIter); // prepare the iterator by loci from reads
ReferenceIterator refSite = refIter.seekForward(interval); // jump to the first reference site
LocusContext locusFromReads = advanceReadsToLoc(locusIter, interval); // load up the next locus by reads
ReferenceIterator refSite = null;
LocusContext locusFromReads = null;
if( interval != null ) {
refSite = refIter.seekForward(interval); // jump to the first reference site
locusFromReads = advanceReadsToLoc(locusIter, interval); // load up the next locus by reads
}
else {
refSite = refIter.next();
locusFromReads = locusIter.next();
}
// We keep processing while the next reference location is within the interval
while ( interval.containsP(refSite.getLocation()) && ! done ) {
while ( (interval == null || interval.containsP(refSite.getLocation())) && ! done ) {
logger.debug(String.format(" LocusFromReads is %s", locusFromReads == null ? null : locusFromReads.getLocation()));
TraversalStatistics.nRecords++;