Optimization: don't keep scoring an alternate consensus if it's already worse than the best alt seen so far.
git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@2806 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
ca1917507f
commit
4fe851a83d
|
|
@ -498,15 +498,23 @@ public class IndelRealigner extends ReadWalker<Integer, Integer> {
|
||||||
//logger.debug(consensus.str + " vs. " + toTest.getRead().getReadString() + " => " + myScore + " - " + altAlignment.first);
|
//logger.debug(consensus.str + " vs. " + toTest.getRead().getReadString() + " => " + myScore + " - " + altAlignment.first);
|
||||||
if ( !toTest.getRead().getDuplicateReadFlag() )
|
if ( !toTest.getRead().getDuplicateReadFlag() )
|
||||||
consensus.mismatchSum += myScore;
|
consensus.mismatchSum += myScore;
|
||||||
|
|
||||||
|
// optimization: once the mismatch sum is higher than the best consensus, quit since this one can't win
|
||||||
|
// THIS MUST BE DISABLED IF WE DECIDE TO ALLOW MORE THAN ONE ALTERNATE CONSENSUS!
|
||||||
|
if ( bestConsensus != null && consensus.mismatchSum > bestConsensus.mismatchSum )
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//logger.debug(consensus.str + " " + consensus.mismatchSum);
|
//logger.debug(consensus.str + " " + consensus.mismatchSum);
|
||||||
if ( bestConsensus == null || bestConsensus.mismatchSum > consensus.mismatchSum) {
|
if ( bestConsensus == null || bestConsensus.mismatchSum > consensus.mismatchSum) {
|
||||||
if ( bestConsensus != null ) bestConsensus.readIndexes.clear();
|
// we do not need this alt consensus, release memory right away!!
|
||||||
|
if ( bestConsensus != null )
|
||||||
|
bestConsensus.readIndexes.clear();
|
||||||
bestConsensus = consensus;
|
bestConsensus = consensus;
|
||||||
//logger.debug(consensus.str + " " + consensus.mismatchSum);
|
//logger.debug(consensus.str + " " + consensus.mismatchSum);
|
||||||
} else {
|
} else {
|
||||||
consensus.readIndexes.clear(); // we do not need this alt consensus, release memory right away!!
|
// we do not need this alt consensus, release memory right away!!
|
||||||
|
consensus.readIndexes.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -361,6 +361,11 @@ public class IntervalCleanerWalker extends LocusWindowWalker<Integer, Integer>
|
||||||
//logger.debug(consensus.str + " vs. " + toTest.getRead().getReadString() + " => " + myScore + " - " + altAlignment.first);
|
//logger.debug(consensus.str + " vs. " + toTest.getRead().getReadString() + " => " + myScore + " - " + altAlignment.first);
|
||||||
if ( !toTest.getRead().getDuplicateReadFlag() )
|
if ( !toTest.getRead().getDuplicateReadFlag() )
|
||||||
consensus.mismatchSum += myScore;
|
consensus.mismatchSum += myScore;
|
||||||
|
|
||||||
|
// optimization: once the mismatch sum is higher than the best consensus, quit since this one can't win
|
||||||
|
// THIS MUST BE DISABLED IF WE DECIDE TO ALLOW MORE THAN ONE ALTERNATE CONSENSUS!
|
||||||
|
if ( bestConsensus != null && consensus.mismatchSum > bestConsensus.mismatchSum )
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//logger.debug(consensus.str + " " + consensus.mismatchSum);
|
//logger.debug(consensus.str + " " + consensus.mismatchSum);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue