Package htsjdk.samtools.cram.structure
Class CRAMRecordReadFeatures
- java.lang.Object
-
- htsjdk.samtools.cram.structure.CRAMRecordReadFeatures
-
public class CRAMRecordReadFeatures extends Object
Class for handling the read features for aCRAMCompressionRecord
.
-
-
Constructor Summary
Constructors Constructor Description CRAMRecordReadFeatures()
Create a CRAMRecordReadFeatures with no actual read features (i.e.CRAMRecordReadFeatures(SAMRecord samRecord, byte[] bamReadBases, byte[] refBases)
Create the read features for a given SAMRecord.CRAMRecordReadFeatures(List<ReadFeature> readFeatures)
Create a CRAMRecordReadFeatures from a list of read features consumed from a stream.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
int
getAlignmentEnd(int alignmentStart, int readLength)
Cigar
getCigarForReadFeatures(int readLength)
Get a Cigar fo this set of read features.List<ReadFeature>
getReadFeaturesList()
int
hashCode()
static byte[]
restoreReadBases(List<ReadFeature> readFeatures, boolean isUnknownBases, int readAlignmentStart, int readLength, byte[] referenceBases, int zeroBasedReferenceOffset, SubstitutionMatrix substitutionMatrix)
Get the set of readBases given these read features.
-
-
-
Constructor Detail
-
CRAMRecordReadFeatures
public CRAMRecordReadFeatures()
Create a CRAMRecordReadFeatures with no actual read features (i.e. an unmapped record).
-
CRAMRecordReadFeatures
public CRAMRecordReadFeatures(List<ReadFeature> readFeatures)
Create a CRAMRecordReadFeatures from a list of read features consumed from a stream.- Parameters:
readFeatures
-
-
CRAMRecordReadFeatures
public CRAMRecordReadFeatures(SAMRecord samRecord, byte[] bamReadBases, byte[] refBases)
Create the read features for a given SAMRecord.- Parameters:
samRecord
- theSAMRecord
for which to create read featuresbamReadBases
- a modifiable copy of the readbases from the original SAM/BAM record, with the individual bases mapped to BAM bases (upper case)refBases
- the reference bases for the entire reference contig to which this record is mapped
-
-
Method Detail
-
getReadFeaturesList
public final List<ReadFeature> getReadFeaturesList()
-
getAlignmentEnd
public int getAlignmentEnd(int alignmentStart, int readLength)
-
getCigarForReadFeatures
public Cigar getCigarForReadFeatures(int readLength)
Get a Cigar fo this set of read features.- Parameters:
readLength
-- Returns:
-
restoreReadBases
public static byte[] restoreReadBases(List<ReadFeature> readFeatures, boolean isUnknownBases, int readAlignmentStart, int readLength, byte[] referenceBases, int zeroBasedReferenceOffset, SubstitutionMatrix substitutionMatrix)
Get the set of readBases given these read features.- Parameters:
isUnknownBases
-readAlignmentStart
- 1-based alignment start for this recordreadLength
-referenceBases
-zeroBasedReferenceOffset
-substitutionMatrix
-- Returns:
-
-