Class DownsamplingIteratorFactory


  • public class DownsamplingIteratorFactory
    extends Object
    A factory for creating DownsamplingIterators that uses a number of different strategies to achieve downsampling while meeting various criteria.
    • Constructor Detail

      • DownsamplingIteratorFactory

        public DownsamplingIteratorFactory()
    • Method Detail

      • make

        public static DownsamplingIterator make​(Iterator<SAMRecord> iterator,
                                                DownsamplingIteratorFactory.Strategy strategy,
                                                double proportion,
                                                double accuracy,
                                                int seed)
        Creates a new DownsamplingIterator using the supplied Strategy that attempts to read from the provided iterator and return approximately proportion of the records read.
        Parameters:
        iterator - The iterator from which to consume SAMRecords
        strategy - The downsampling strategy to use
        proportion - The proportion of records the downsampling strategy should attempt to emit
        accuracy - If supported by the downsampling strategy, the accuracy goal for the downsampler. Higher accuracy will generally require higher memory usage. An accuracy value of 0.0001 tells the strategy to try and ensure the emitted proportion is within proportion +/0 0.0001.
        seed - The seed value to use for any random process used in down-sampling.