Package picard.analysis
Class CounterManager
java.lang.Object
picard.analysis.CounterManager
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 ClassesModifier and TypeClassDescriptionclass
Class represents an integer array with methods to increment and get the values from it with respect to offset of outerCounterManager
. -
Constructor Summary
ConstructorsConstructorDescriptionCounterManager
(int arrayLength, int readLength) Constructor creates new CounterManager without any Counters, counters are added to CounterManager via newCounter() method -
Method Summary
Modifier and TypeMethodDescriptionvoid
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 arraysCreates a new Counter object and adds it to the list of managed Counters.
-
Constructor Details
-
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 Details
-
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
Creates a new Counter object and adds it to the list of managed Counters.- Returns:
CounterManager.Counter
, that will be managed by currentCounterManager
-