public class CompactReadPair extends java.lang.Object implements ReadPair
Stores one read of a pair and links to the second read in a way that offers a useful amount of compression for applications that need to store many reads in memory.
By default, reads are compressed using a combination of two compression methods:
Alternative methods for compression are configurable, however for most use cases, these methods empirically outperform others in my experience. In particular, snappy compression of raw bases does not outperform simply packing them two-per-byte.
Note: 2-bit (4-per-byte) representation is not possible because we have to encode N bases. Theoretically, if alignment to byte boundaries is sacrificed then 3-bit representation could be achieved, but this has not been tested.
Modifiers | Name | Description |
---|---|---|
static interface |
CompactReadPair.ReadCompressor |
Modifiers | Name | Description |
---|---|---|
static IntegerStats |
baseCompressionStats |
|
byte |
compressedBases |
|
static org.apache.commons.math3.stat.descriptive.SummaryStatistics |
memoryStats |
|
static IntegerStats |
qualCompressionStats |
|
int |
r1AlignmentStart |
|
java.lang.String |
r1ReferenceName |
|
int |
r2AlignmentStart |
|
java.lang.String |
r2ReferenceName |
Constructor and description |
---|
CompactReadPair
(htsjdk.samtools.SAMRecord read) Create a compact read pair that encodes the default base qualities |
CompactReadPair
(htsjdk.samtools.SAMRecord read, java.lang.String baseQualityTag) Create a compact read pair that encodes base qualities extracted from the given tag. |
Type Params | Return Type | Name and description |
---|---|---|
|
public void |
appendTo(java.lang.String r1Name, java.lang.StringBuilder r1Out, java.lang.StringBuilder r2Out, Paired pairInfo, boolean addPosition) |
|
public int |
getReadLength() |
|
public boolean |
getUnmapped() |
|
public boolean |
isChimeric() |
|
public boolean |
notInRegions(Regions regions) |
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() |
Create a compact read pair that encodes the default base qualities
Note: the first read is initialised by this constructor. The second read is not stored itself, rather details are extracted from the metadata of the first read about its position. Usage of this class as a "pair" requires provision of the second read explicitly.
read
- the first read to encodeCreate a compact read pair that encodes base qualities extracted from the given tag.