Package htsjdk.samtools.cram.structure
Class CRAMRecordReadFeatures
java.lang.Object
htsjdk.samtools.cram.structure.CRAMRecordReadFeatures
Class for handling the read features for a
CRAMCompressionRecord
.-
Constructor Summary
ConstructorsConstructorDescriptionCreate 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
Modifier and TypeMethodDescriptionboolean
int
getAlignmentEnd
(int alignmentStart, int readLength) getCigarForReadFeatures
(int readLength) Get a Cigar fo this set of read features.final List<ReadFeature>
int
hashCode()
static byte[]
restoreReadBases
(List<ReadFeature> readFeatures, boolean isUnknownBases, int readAlignmentStart, int readLength, CRAMReferenceRegion cramReferenceRegion, SubstitutionMatrix substitutionMatrix) Get the read bases for a CRAMRecord given a set of read feaures and a reference region.
-
Constructor Details
-
CRAMRecordReadFeatures
public CRAMRecordReadFeatures()Create a CRAMRecordReadFeatures with no actual read features (i.e. an unmapped record). -
CRAMRecordReadFeatures
Create a CRAMRecordReadFeatures from a list of read features consumed from a stream.- Parameters:
readFeatures
-
-
CRAMRecordReadFeatures
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 Details
-
getReadFeaturesList
-
getAlignmentEnd
public int getAlignmentEnd(int alignmentStart, int readLength) -
getCigarForReadFeatures
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, CRAMReferenceRegion cramReferenceRegion, SubstitutionMatrix substitutionMatrix) Get the read bases for a CRAMRecord given a set of read feaures and a reference region.- Parameters:
readFeatures
- list of ReadFeatures for this record. may be nullisUnknownBases
- true if CF_UNKNOWN_BASES CRAM flag is set for this readreadAlignmentStart
- 1-based CRAM record alignment startreadLength
- read length for this readcramReferenceRegion
- CRAMReferenceRegion spanning the reference bases required for this read, if reference-compressed. It is the caller's responsibility to have already fetched the correct bases (that is, the CRAMReferenceRegion's current bases must overlap this read's reference span. It is permissible for the region's span to be less than the entire read span in the case where the read span exceeds beyond the end of the underlying reference sequence.substitutionMatrix
- substitution matrix to use for base resolution- Returns:
- byte[] of read bases for this read
-
equals
-
hashCode
public int hashCode()
-