public class ComputeCount extends Object implements ComputeCountInterface
| Modifier and Type | Field and Description |
|---|---|
protected it.unimi.dsi.fastutil.ints.IntList |
countKeys
Sorted keys of countPerBase.
|
protected it.unimi.dsi.fastutil.ints.Int2IntMap |
countPerBase
Used to store bases count in memory.
|
protected it.unimi.dsi.fastutil.ints.IntList |
endKeys |
protected it.unimi.dsi.fastutil.ints.Int2IntMap |
ends
Number of reads that end BEFORE position.
|
protected it.unimi.dsi.fastutil.ints.IntList |
startKeys |
protected boolean |
startPopulateInitialized |
protected it.unimi.dsi.fastutil.ints.Int2IntMap |
starts
Number of reads that start ON or BEFORE this position.
|
| Constructor and Description |
|---|
ComputeCount() |
| Modifier and Type | Method and Description |
|---|---|
void |
accumulate()
Accumulate start and end counts to produce cumulative start and end count.
|
void |
accumulateOneMap(it.unimi.dsi.fastutil.ints.Int2IntMap map,
it.unimi.dsi.fastutil.ints.IntList mapKeys)
Calculate the cumulative start or end counts.
|
void |
baseCount()
Calculate base counts.
|
void |
baseCount(CountsWriterI writerI)
Calculate base counts and write the result to the specified CountsWriter.
|
it.unimi.dsi.fastutil.ints.IntList |
getCountKeys()
Return a list of positions on the reference sequence that have non-zero counts.
|
Map |
getCountPerBase()
Returns a map from position on the reference sequence to count per base.
|
protected int |
getNumberOfReadsWithEndAt(int position)
Returns the cumulative end count at position.
|
protected int |
getNumberOfReadsWithStartAt(int position)
Returns the cumulative start count at position.
|
int |
populate(int startIndex,
int endIndex)
Populate the data structures with a read.
|
void |
populate(int startPosition,
int endPosition,
boolean forwardStrand)
This implementation ignores strand, but some sub-classes need this information.
|
void |
populate(int startPosition,
int endPosition,
boolean forwardStrand,
int queryIndex)
This implementation ignores strand and queryIndex, but some sub-classes need this information.
|
void |
populate(it.unimi.dsi.fastutil.objects.ObjectList<Read> reads)
Convenience method to populate with a set of reads.
|
void |
startPopulating()
This method must be called before calling the populate method.
|
int |
totalCountOnReference()
Returns the total number of counts on the reference sequence.
|
protected final it.unimi.dsi.fastutil.ints.Int2IntMap starts
protected final it.unimi.dsi.fastutil.ints.Int2IntMap ends
protected final it.unimi.dsi.fastutil.ints.IntList startKeys
protected final it.unimi.dsi.fastutil.ints.IntList endKeys
protected final it.unimi.dsi.fastutil.ints.Int2IntMap countPerBase
protected final it.unimi.dsi.fastutil.ints.IntList countKeys
protected boolean startPopulateInitialized
public void startPopulating()
startPopulating in interface ComputeCountInterfacepublic final void populate(it.unimi.dsi.fastutil.objects.ObjectList<Read> reads)
reads - public int populate(int startIndex,
int endIndex)
startIndex - Start position of the read ON or BEFORE the startIndex on the reference sequence.endIndex - End position of the read BEFORE the endIndex on the reference sequence.protected final int getNumberOfReadsWithStartAt(int position)
position - position along the reference sequence.protected final int getNumberOfReadsWithEndAt(int position)
position - position along the reference sequence.public void accumulate()
accumulate in interface ComputeCountInterfacepublic final void accumulateOneMap(it.unimi.dsi.fastutil.ints.Int2IntMap map,
it.unimi.dsi.fastutil.ints.IntList mapKeys)
map - mapKeys - public void baseCount()
baseCount in interface ComputeCountInterfacepublic Map getCountPerBase()
ComputeCountInterfacegetCountPerBase in interface ComputeCountInterfacepublic it.unimi.dsi.fastutil.ints.IntList getCountKeys()
ComputeCountInterfacegetCountKeys in interface ComputeCountInterfacepublic void baseCount(CountsWriterI writerI) throws IOException
baseCount in interface ComputeCountInterfacewriterI - A CountsWriter to write the counts to.IOExceptionpublic int totalCountOnReference()
public void populate(int startPosition,
int endPosition,
boolean forwardStrand)
populate in interface ComputeCountInterfacestartPosition - Start position of a read.endPosition - End position of a read.forwardStrand - True when the read matches the forward strand, false otherwise.public void populate(int startPosition,
int endPosition,
boolean forwardStrand,
int queryIndex)
populate in interface ComputeCountInterfacestartPosition - Start position of a read.endPosition - End position of a read.forwardStrand - True when the read matches the forward strand, false otherwise.queryIndex - Index of the read/query.Copyright © 2018 Campagne Laboratory. All rights reserved.