cleanup of the pile-up limit exceeded warning, and a little code cleanup
git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@2657 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
de21943acd
commit
cc3b818268
|
|
@ -448,7 +448,7 @@ public class LocusIteratorByState extends LocusIterator {
|
||||||
// logger.debug(String.format("entering collectPendingReads..., hasNext=%b", it.hasNext()));
|
// logger.debug(String.format("entering collectPendingReads..., hasNext=%b", it.hasNext()));
|
||||||
// printState();
|
// printState();
|
||||||
//}
|
//}
|
||||||
|
GenomeLoc location = null;
|
||||||
int curSize = readStates.size(); // simple performance improvement -- avoids unnecessary size() operation
|
int curSize = readStates.size(); // simple performance improvement -- avoids unnecessary size() operation
|
||||||
while (it.hasNext()) {
|
while (it.hasNext()) {
|
||||||
SAMRecord read = it.next();
|
SAMRecord read = it.next();
|
||||||
|
|
@ -464,10 +464,13 @@ public class LocusIteratorByState extends LocusIterator {
|
||||||
curSize++;
|
curSize++;
|
||||||
if (state.hadIndel()) hasExtendedEvents = true;
|
if (state.hadIndel()) hasExtendedEvents = true;
|
||||||
//if (DEBUG) logger.debug(String.format(" ... added read %s", read.getReadName()));
|
//if (DEBUG) logger.debug(String.format(" ... added read %s", read.getReadName()));
|
||||||
|
} else if (location == null) {
|
||||||
|
location = GenomeLocParser.createGenomeLoc(read);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
overflowTracker.exceeded(read, curSize);
|
if (location != null) overflowTracker.exceeded(location, curSize);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// fast testing of position
|
// fast testing of position
|
||||||
|
|
@ -560,16 +563,15 @@ class LocusOverflowTracker {
|
||||||
/**
|
/**
|
||||||
* have we exceeded the maximum pile-up size?
|
* have we exceeded the maximum pile-up size?
|
||||||
*
|
*
|
||||||
* @param read the current read, we use this to get the GenomeLoc only if needed (for efficiency)
|
* @param loc the current location
|
||||||
* @param pileupSize the pile-up size
|
* @param pileupSize the pile-up size
|
||||||
*
|
*
|
||||||
* @return return true if we're greater, false if we're not
|
* @return return true if we're greater, false if we're not
|
||||||
*/
|
*/
|
||||||
public boolean exceeded(SAMRecord read, int pileupSize) {
|
public boolean exceeded(GenomeLoc loc, int pileupSize) {
|
||||||
boolean exceeded = pileupSize >= maxPileupSize;
|
boolean exceeded = pileupSize >= maxPileupSize;
|
||||||
if (exceeded) {
|
if (exceeded && warningsEmitted <= MAX_WARNINGS) {
|
||||||
warningInQueue = true;
|
warningInQueue = true;
|
||||||
GenomeLoc loc = GenomeLocParser.createGenomeLoc(read);
|
|
||||||
if (lastLocation == null) lastLocation = loc;
|
if (lastLocation == null) lastLocation = loc;
|
||||||
else if (lastLocation.contiguousP(loc))
|
else if (lastLocation.contiguousP(loc))
|
||||||
lastLocation = lastLocation.merge(loc);
|
lastLocation = lastLocation.merge(loc);
|
||||||
|
|
@ -598,10 +600,10 @@ class LocusOverflowTracker {
|
||||||
warningInQueue = false;
|
warningInQueue = false;
|
||||||
if (warningsEmitted < MAX_WARNINGS) {
|
if (warningsEmitted < MAX_WARNINGS) {
|
||||||
warningsEmitted++;
|
warningsEmitted++;
|
||||||
Utils.warnUser("Unable to add a read, we're over the hanger limit of " + maxPileupSize + " at location " + lastLocation);
|
Utils.warnUser("Unable to add a reads to the pile-up, we're over the hanger limit of " + maxPileupSize + " at location: " + lastLocation);
|
||||||
} else if (warningsEmitted == MAX_WARNINGS) {
|
} else if (warningsEmitted == MAX_WARNINGS) {
|
||||||
warningsEmitted++;
|
warningsEmitted++;
|
||||||
Utils.warnUser("Unable to add a read, we're over the hanger limit of " + maxPileupSize + " at location " + lastLocation +
|
Utils.warnUser("Unable to add a reads to the pile-up, we're over the hanger limit of " + maxPileupSize + " at location: " + lastLocation +
|
||||||
"; the maximum warning count has been reached, we will no longer emit warnings of this nature!!");
|
"; the maximum warning count has been reached, we will no longer emit warnings of this nature!!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue