@groovy.transform.CompileStatic class OrderedPairReader extends java.lang.Object implements java.io.Closeable
A utility class for efficiently iterating all the read pairs in a BAM file.
NOTE: unpaired and chimeric reads are omitted
Performance depends on buffering a window of reads so that the mates for each read are
encountered within the buffer and thus random lookup of mates is not needed. The right size
for it depends on the coverage depth and the separation between
paired reads. It should be able to hold enough reads that most of the time
a read's pair is encountered before the buffer overflows. When it overflows
the loop below starts doing random queries (slow) to resolve the mates for reads
so that the pair can be output together. See the spoolSize
option
which can be passed to the constructor.
Type | Name and description |
---|---|
java.util.concurrent.atomic.AtomicInteger |
asyncRequests |
java.util.concurrent.atomic.AtomicInteger |
asyncResolves |
SAM |
bam |
java.util.Set<java.lang.String> |
chimericPreprocessedReads To contain memory consumption, preprocessed reads are cleared every chromosome. |
java.lang.String |
currentChr |
gngs.Region |
currentRegion |
java.lang.String |
debugRead |
int |
forcedQueries |
gngs.ReadMateLookupActor |
forcedQueryLookupActor |
boolean |
includeChimeric |
boolean |
includeUnmapped |
java.util.logging.Logger |
log |
java.util.List<gngs.ReadMateLookupActor> |
lookupActors |
int |
lookupConcurrency |
int |
lookupReaderIndex |
int |
maxSpoolSize |
gngs.MissingMateIndex |
missingMates |
int |
pairs |
java.util.Set<java.lang.String> |
preprocessedReads |
ProgressCounter |
progress |
htsjdk.samtools.SamReader |
randomLookupReader |
java.util.List<AsyncMateResolveWorker> |
resolvers |
java.lang.String |
sample |
int |
unpairedReads |
boolean |
verbose |
java.util.List<gngs.SAMRecordPair> |
writeSpool List of reads in order that need to be written out |
Constructor and description |
---|
OrderedPairReader
(java.util.Map options, SAM sam) |
Type Params | Return Type | Name and description |
---|---|---|
|
void |
addPreprocessedRead(gngs.SAMRecordPair pair) |
|
void |
close() |
|
void |
eachPair(groovy.lang.Closure c) |
|
void |
eachPair(htsjdk.samtools.SAMRecordIterator iter, groovy.lang.Closure c) |
|
void |
eachPair(Regions regions, groovy.lang.Closure c) |
|
void |
eachPairImpl(htsjdk.samtools.SAMRecordIterator iter, groovy.lang.Closure c) |
|
void |
flushSpooledReads(groovy.lang.Closure c) |
|
void |
forceQueryOverflowRead(int position) |
|
boolean |
isNewChromosome(htsjdk.samtools.SAMRecord record) |
|
boolean |
isProcessableRead(htsjdk.samtools.SAMRecord record) |
|
void |
processPartneredReads(groovy.lang.Closure c) |
|
htsjdk.samtools.SAMRecord |
queryMateByDirectLookup(htsjdk.samtools.SAMRecord record) |
|
boolean |
resolveAsynchronously(gngs.SAMRecordPair pair) |
|
void |
scheduleAsyncResolves() |
|
java.util.Map |
spoolStats() |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
To contain memory consumption, preprocessed reads are cleared every chromosome. We can't, however, do that for chimeric reads since they span chromosomes
List of reads in order that need to be written out
Groovy Documentation