Package htsjdk.samtools.cram.structure
Class AlignmentContext
java.lang.Object
htsjdk.samtools.cram.structure.AlignmentContext
An AlignmentContext represents mapping information related to a collection of reads, or a single
CRAMCompressionRecord
, Slice
, or Container
.
It contains a ReferenceContext
, and if that context is of type SINGLE_REFERENCE_TYPE
then it also contains Alignment Start and Alignment Span values.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final AlignmentContext
static final AlignmentContext
static final int
static final int
static final int
static final AlignmentContext
-
Constructor Summary
ConstructorsConstructorDescriptionAlignmentContext
(ReferenceContext referenceContext, int alignmentStart, int alignmentSpan) Create an AlignmentContext from a reference context, start, and span. -
Method Summary
Modifier and TypeMethodDescriptionboolean
int
int
int
hashCode()
toString()
static void
validateAlignmentContext
(boolean isStrict, ReferenceContext referenceContext, int alignmentStart, int alignmentSpan) Determine if the provided values would result in a valid alignment context.
-
Field Details
-
NO_ALIGNMENT_START
public static final int NO_ALIGNMENT_START- See Also:
-
NO_ALIGNMENT_SPAN
public static final int NO_ALIGNMENT_SPAN- See Also:
-
NO_ALIGNMENT_END
public static final int NO_ALIGNMENT_END- See Also:
-
MULTIPLE_REFERENCE_CONTEXT
-
UNMAPPED_UNPLACED_CONTEXT
-
EOF_CONTAINER_CONTEXT
-
-
Constructor Details
-
AlignmentContext
Create an AlignmentContext from a reference context, start, and span. Unfortunately, this can't enforce that the values are valid alignment values, or even warn about such values here, because there are too many cases where the spec doesn't or didn't originally prescribe valid values for cases like MULTIPLE_REF containers/slices, or unmapped slices, or SAMFileHeader containers. As a result, there are many files floating around that use various out-of-spec values that were created with old htsjdk or other implementations that were based based on older spec versions.- Parameters:
referenceContext
- the reference context for this alignment contextalignmentStart
- the 1-based alignment startalignmentSpan
- the alignment span
-
-
Method Details
-
getReferenceContext
-
getAlignmentStart
public int getAlignmentStart() -
getAlignmentSpan
public int getAlignmentSpan() -
validateAlignmentContext
public static void validateAlignmentContext(boolean isStrict, ReferenceContext referenceContext, int alignmentStart, int alignmentSpan) Determine if the provided values would result in a valid alignment context. Note: The spec does not prescribe what the alignment start/span for a SAMFileHeader container should be, and only recently prescribed what they should be for multi-ref slices, so there are many files out their with various out-of-band values in those cases, so we can't validate or throw in the general case.- Parameters:
isStrict
- throw if the values do not represent a valid alignmentContextreferenceContext
- reference context to validatealignmentStart
- alignment start to validatealignmentSpan
- alignment span to validate
-
toString
-
equals
-
hashCode
public int hashCode()
-