/** * Constructs a chained iterator that will read from the provided iterator and attempt to downsampling to the provided proportion. */ ChainedDownsamplingIterator(final Iterator<SAMRecord> iterator, final double proportion, final int seed) { super(new ConstantMemoryDownsamplingIterator(iterator, adjustProportion(proportion), seed), proportion, seed); // Deal with the fact that the iterator will advance and discard some reads at construction final long discarded = ((ConstantMemoryDownsamplingIterator) getUnderlyingIterator()).getDiscardedCount(); recordDiscardRecords(discarded); }
/** * Constructs a chained iterator that will read from the provided iterator and attempt to downsampling to the provided proportion. */ ChainedDownsamplingIterator(final Iterator<SAMRecord> iterator, final double proportion, final int seed) { super(new ConstantMemoryDownsamplingIterator(iterator, adjustProportion(proportion), seed), proportion, seed); // Deal with the fact that the iterator will advance and discard some reads at construction final long discarded = ((ConstantMemoryDownsamplingIterator) getUnderlyingIterator()).getDiscardedCount(); recordDiscardRecords(discarded); }