public class CRAMCompressionRecord
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
CF_DETACHED |
static int |
CF_HAS_MATE_DOWNSTREAM |
static int |
CF_QS_PRESERVED_AS_ARRAY |
static int |
CF_UNKNOWN_BASES |
static int |
MF_MATE_NEG_STRAND |
static int |
MF_MATE_UNMAPPED |
static byte |
MISSING_QUALITY_SCORE |
static int |
NO_READGROUP_ID |
Constructor and Description |
---|
CRAMCompressionRecord(CRAMVersion cramVersion,
CRAMEncodingStrategy encodingStrategy,
SAMRecord samRecord,
byte[] referenceBases,
long sequentialIndex,
java.util.Map<java.lang.String,java.lang.Integer> readGroupMap)
Create a CRAMRecord from a SAMRecord.
|
CRAMCompressionRecord(long sequentialIndex,
int bamFlags,
int cramFlags,
java.lang.String readName,
int readLength,
int referenceIndex,
int alignmentStart,
int templateSize,
int mappingQuality,
byte[] qualityScores,
byte[] readBases,
java.util.List<ReadTag> readTags,
java.util.List<ReadFeature> readFeaturesList,
int readGroupID,
int mateFlags,
int mateReferenceIndex,
int mateAlignmentStart,
int recordsToNextFragment)
Create a CRAMRecord from a set of values retrieved from a serialized Slice's data series streams.
|
Modifier and Type | Method and Description |
---|---|
void |
assignReadName() |
boolean |
equals(java.lang.Object o) |
int |
getAlignmentEnd() |
int |
getAlignmentStart() |
int |
getBAMFlags() |
int |
getCRAMFlags() |
int |
getMappingQuality() |
int |
getMateAlignmentStart() |
int |
getMateFlags() |
int |
getMateReferenceIndex() |
CRAMCompressionRecord |
getNextSegment() |
CRAMCompressionRecord |
getPreviousSegment() |
byte[] |
getQualityScores() |
byte[] |
getReadBases() |
java.util.List<ReadFeature> |
getReadFeatures() |
int |
getReadGroupID() |
int |
getReadLength() |
java.lang.String |
getReadName() |
int |
getRecordsToNextFragment() |
int |
getReferenceIndex() |
long |
getSequentialIndex() |
MutableInt |
getTagIdsIndex() |
java.util.List<ReadTag> |
getTags() |
int |
getTemplateSize() |
int |
hashCode() |
boolean |
isDetached() |
static boolean |
isDetached(int cramFlags) |
boolean |
isFirstSegment() |
boolean |
isForcePreserveQualityScores() |
static boolean |
isForcePreserveQualityScores(int cramFlags) |
boolean |
isHasMateDownStream() |
static boolean |
isHasMateDownStream(int cramFlags) |
boolean |
isLastSegment() |
boolean |
isNormalized()
When a CRAM record is read from a CRAM stream, it is "raw" in that the record's read bases, quality
scores, and mate graph are not stored directly as part of the record.
|
boolean |
isPlaced()
Determine is read is "placed".
|
boolean |
isReadPaired() |
boolean |
isSecondaryAlignment() |
boolean |
isSegmentUnmapped()
Does this record have the mapped flag set? This is independent of placement/alignment status.
|
static boolean |
isSegmentUnmapped(int bamFlags) |
boolean |
isUnknownBases() |
static boolean |
isUnknownBases(int cramFlags) |
void |
resolveQualityScores()
Resolve the quality scores for this CRAM record based on preserved scores, read features and flags.
|
void |
restoreMateInfo() |
void |
restoreReadBases(CRAMReferenceRegion cramReferenceRegion,
SubstitutionMatrix substitutionMatrix)
Restore the actual read bases for this record.
|
void |
setDetached(boolean detached) |
void |
setNextSegment(CRAMCompressionRecord nextSegment) |
void |
setPreviousSegment(CRAMCompressionRecord previousSegment) |
void |
setTagIdsIndex(MutableInt tagIdsIndex) |
void |
setToDetachedState() |
SAMRecord |
toSAMRecord(SAMFileHeader samFileHeader)
Create a SAMRecord from the CRAMRecord.
|
public static final int CF_QS_PRESERVED_AS_ARRAY
public static final int CF_DETACHED
public static final int CF_HAS_MATE_DOWNSTREAM
public static final int CF_UNKNOWN_BASES
public static final int NO_READGROUP_ID
public static final byte MISSING_QUALITY_SCORE
public static final int MF_MATE_NEG_STRAND
public static final int MF_MATE_UNMAPPED
public CRAMCompressionRecord(CRAMVersion cramVersion, CRAMEncodingStrategy encodingStrategy, SAMRecord samRecord, byte[] referenceBases, long sequentialIndex, java.util.Map<java.lang.String,java.lang.Integer> readGroupMap)
cramVersion
- encodingStrategy
- samRecord
- referenceBases
- sequentialIndex
- readGroupMap
- public CRAMCompressionRecord(long sequentialIndex, int bamFlags, int cramFlags, java.lang.String readName, int readLength, int referenceIndex, int alignmentStart, int templateSize, int mappingQuality, byte[] qualityScores, byte[] readBases, java.util.List<ReadTag> readTags, java.util.List<ReadFeature> readFeaturesList, int readGroupID, int mateFlags, int mateReferenceIndex, int mateAlignmentStart, int recordsToNextFragment)
sequentialIndex
- bamFlags
- cramFlags
- readName
- readLength
- referenceIndex
- alignmentStart
- templateSize
- mappingQuality
- qualityScores
- readBases
- readTags
- readFeaturesList
- readGroupID
- mateFlags
- mateReferenceIndex
- mateAlignmentStart
- recordsToNextFragment
- public SAMRecord toSAMRecord(SAMFileHeader samFileHeader)
samFileHeader
- SAMFileHeaderpublic void assignReadName()
public boolean isNormalized()
Slice.normalizeCRAMRecords(List, CRAMReferenceRegion)
).public void resolveQualityScores()
public void restoreReadBases(CRAMReferenceRegion cramReferenceRegion, SubstitutionMatrix substitutionMatrix)
cramReferenceRegion
- CRAMReferenceRegion spanning the reference bases for this record, if reference
bases are required (may be null for records with RR=false in the compression header)substitutionMatrix
- substitution matrix to use for this recordpublic void restoreMateInfo()
public void setToDetachedState()
public boolean isPlaced()
isSegmentUnmapped()
public java.lang.String getReadName()
public int getAlignmentStart()
public int getReadLength()
public byte[] getReadBases()
public byte[] getQualityScores()
public int getMappingQuality()
public int getReferenceIndex()
public int getTemplateSize()
public java.util.List<ReadTag> getTags()
public int getRecordsToNextFragment()
public java.util.List<ReadFeature> getReadFeatures()
public int getReadGroupID()
NO_READGROUP_ID
if no read group assignedpublic int getBAMFlags()
public int getMateReferenceIndex()
public int getMateAlignmentStart()
public void setTagIdsIndex(MutableInt tagIdsIndex)
public MutableInt getTagIdsIndex()
public int getMateFlags()
public int getCRAMFlags()
public int getAlignmentEnd()
public long getSequentialIndex()
public CRAMCompressionRecord getNextSegment()
public void setNextSegment(CRAMCompressionRecord nextSegment)
public CRAMCompressionRecord getPreviousSegment()
public void setPreviousSegment(CRAMCompressionRecord previousSegment)
public boolean isSecondaryAlignment()
public boolean isHasMateDownStream()
public static boolean isHasMateDownStream(int cramFlags)
public boolean isDetached()
public static boolean isDetached(int cramFlags)
public boolean isForcePreserveQualityScores()
public static boolean isForcePreserveQualityScores(int cramFlags)
public boolean isUnknownBases()
public static boolean isUnknownBases(int cramFlags)
public boolean isReadPaired()
public boolean isSegmentUnmapped()
Slice
s and Container
s as mapped
records if they are placed.isPlaced()
public static boolean isSegmentUnmapped(int bamFlags)
public boolean isFirstSegment()
public boolean isLastSegment()
public void setDetached(boolean detached)
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object