PerSampleDownsamplingReadsIterator: fix for incorrect use of DOWNSAMPLER_POSITIONAL_UPDATE_INTERVAL
Notify all downsamplers in our pool of the current global genomic position every DOWNSAMPLER_POSITIONAL_UPDATE_INTERVAL position changes, not every single positional change after that threshold is first reached.
This commit is contained in:
parent
133085469f
commit
34eed20aa6
|
|
@ -158,10 +158,10 @@ public class PerSampleDownsamplingReadsIterator implements StingSAMIterator {
|
|||
numPositionalChanges++;
|
||||
}
|
||||
|
||||
// If the number of times we've changed position exceeds a certain threshold, inform all
|
||||
// downsamplers of the current position in the read stream. This is to prevent downsamplers
|
||||
// for samples with sparser reads than others from getting stuck too long in a pending state.
|
||||
if ( numPositionalChanges > DOWNSAMPLER_POSITIONAL_UPDATE_INTERVAL ) {
|
||||
// Periodically inform all downsamplers of the current position in the read stream. This is
|
||||
// to prevent downsamplers for samples with sparser reads than others from getting stuck too
|
||||
// long in a pending state.
|
||||
if ( numPositionalChanges > 0 && numPositionalChanges % DOWNSAMPLER_POSITIONAL_UPDATE_INTERVAL == 0 ) {
|
||||
for ( ReadsDownsampler<SAMRecord> perSampleDownsampler : perSampleDownsamplers.values() ) {
|
||||
perSampleDownsampler.signalNoMoreReadsBefore(read);
|
||||
updateEarliestPendingRead(perSampleDownsampler);
|
||||
|
|
|
|||
Loading…
Reference in New Issue