Class CounterManager


  • public class CounterManager
    extends Object
    Class for managing a list of Counters of integer, provides methods to access data from Counters with respect to an offset. Each Counter represents a certain region of a processed sequence starting from offset and can accumulate some value for each locus of this sequence, for instance, read coverage.
    • Constructor Detail

      • CounterManager

        public CounterManager​(int arrayLength,
                              int readLength)
        Constructor creates new CounterManager without any Counters, counters are added to CounterManager via newCounter() method
        Parameters:
        arrayLength - length of inner Counter arrays
        readLength - proposed length of processed reads
    • Method Detail

      • checkOutOfBounds

        public void checkOutOfBounds​(int locusPosition)
        Method checks that new locus position is not out of bounds of Counter arrays and there is enough space in them to hold information on at least one more read of length readLength. If there is no free space, but there is accumulated information in Counter arrays after new locus position that we may need, the arrays are rebased, so that 0 index of arrays represents new locus position. In other case, we just clear the arrays.
        Parameters:
        locusPosition - position in the reference sequence, that will be represented by index 0 of CounterManager.Counter arrays.
      • clear

        public void clear()
        Clears all inner Counter arrays