Package picard.analysis
Class CounterManager
- java.lang.Object
-
- picard.analysis.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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
CounterManager.Counter
Class represents an integer array with methods to increment and get the values from it with respect to offset of outerCounterManager
.
-
Constructor Summary
Constructors Constructor Description CounterManager(int arrayLength, int readLength)
Constructor creates new CounterManager without any Counters, counters are added to CounterManager via newCounter() method
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 lengthreadLength
.void
clear()
Clears all inner Counter arraysCounterManager.Counter
newCounter()
Creates a new Counter object and adds it to the list of managed Counters.
-
-
-
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 arraysreadLength
- 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 lengthreadLength
. 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 ofCounterManager.Counter
arrays.
-
clear
public void clear()
Clears all inner Counter arrays
-
newCounter
public CounterManager.Counter newCounter()
Creates a new Counter object and adds it to the list of managed Counters.- Returns:
CounterManager.Counter
, that will be managed by currentCounterManager
-
-