public final class SVContext
extends htsjdk.variant.variantcontext.VariantContext
Modifier and Type | Field and Description |
---|---|
static int |
NO_LENGTH
Indicates that the variant does not have a length or this could not be determined, e.g.
|
Modifier and Type | Method and Description |
---|---|
Haplotype |
composeHaplotypeBasedOnReference(int index,
int paddingSize,
ReferenceMultiSparkSource reference)
Composes the haplotype that corresponds to an allele based on the reference sequence.
|
java.util.List<SimpleInterval> |
getBreakPointIntervals(int padding,
htsjdk.samtools.SAMSequenceDictionary dictionary,
boolean padForHomology)
Returns break point intervals for this structural variant.
|
int |
getEnd()
The end position of this variant context.
|
byte[] |
getInsertedSequence()
Returns the inserted sequence.
|
PairedStrandedIntervals |
getPairedStrandedIntervals(ReadMetadata metadata,
htsjdk.samtools.SAMSequenceDictionary referenceSequenceDictionary,
int padding) |
int |
getStructuralVariantLength()
Returns the absolute structural variant length as recorded in the SVLEN annotation.
|
java.util.List<java.lang.String> |
getSupportingContigIds()
Returns the ids of the assembled contig that support this context's structural variant.
|
static SVContext |
of(htsjdk.variant.variantcontext.VariantContext vc)
Returns an instance given a plain
VariantContext instance. |
calcVCFGenotypeKeys, emptyID, extraStrictValidation, filtersWereApplied, fullyDecode, getAllele, getAllele, getAlleleIndex, getAlleleIndices, getAlleles, getAltAlleleWithHighestAlleleCount, getAlternateAllele, getAlternateAlleles, getAttribute, getAttribute, getAttributeAsBoolean, getAttributeAsDouble, getAttributeAsDoubleList, getAttributeAsInt, getAttributeAsIntList, getAttributeAsList, getAttributeAsString, getAttributeAsStringList, getAttributes, getCalledChrCount, getCalledChrCount, getCalledChrCount, getCalledChrCount, getCommonInfo, getContig, getFilters, getFiltersMaybeNull, getGenotype, getGenotype, getGenotypes, getGenotypes, getGenotypes, getGenotypes, getGenotypesOrderedBy, getGenotypesOrderedByName, getGLIndecesOfAlternateAllele, getGLIndicesOfAlternateAllele, getHetCount, getHomRefCount, getHomVarCount, getID, getIndelLengths, getLog10PError, getMaxPloidy, getMixedCount, getNAlleles, getNoCallCount, getNSamples, getPhredScaledQual, getReference, getSampleNames, getSampleNamesOrderedByName, getSource, getStart, getStructuralVariantType, getType, hasAllele, hasAllele, hasAlternateAllele, hasAlternateAllele, hasAttribute, hasGenotype, hasGenotypes, hasGenotypes, hasID, hasLog10PError, hasSameAllelesAs, hasSameAlternateAllelesAs, hasSymbolicAlleles, hasSymbolicAlleles, isBiallelic, isComplexIndel, isFiltered, isFullyDecoded, isIndel, isMixed, isMNP, isMonomorphicInSamples, isNotFiltered, isPointEvent, isPolymorphicInSamples, isReferenceBlock, isSimpleDeletion, isSimpleIndel, isSimpleInsertion, isSNP, isStructuralIndel, isSymbolic, isSymbolicOrSV, isVariant, subContextFromSample, subContextFromSamples, subContextFromSamples, toString, toStringDecodeGenotypes, toStringWithoutGenotypes, validateAlternateAlleles, validateChromosomeCounts, validateReferenceBases, validateRSIDs
public static final int NO_LENGTH
public static SVContext of(htsjdk.variant.variantcontext.VariantContext vc)
VariantContext
instance.
This method will fail with a IllegalArgumentException
if the input variant context is not
structural. A structural variant context must be biallelic and properly annotated with
with its type using the INFO field .
vc
- the input variant context.null
, potentially the same as the input if it happens to be an instance of this class.java.lang.IllegalArgumentException
- if vc
is null
or does not seem to be
a structural variant context based on its annotations.public int getEnd()
VariantContext.getEnd()
.getEnd
in interface htsjdk.samtools.util.Locatable
getEnd
in class htsjdk.variant.variantcontext.VariantContext
VariantContext.getStart()
or greater.public java.util.List<java.lang.String> getSupportingContigIds()
The list returned is an immutable list.
null
, an empty list if no structural variant is specified.java.lang.IllegalStateException
- if the GATKSVVCFConstants.CONTIG_NAMES
annotation contains
undefined contig names (.)public Haplotype composeHaplotypeBasedOnReference(int index, int paddingSize, ReferenceMultiSparkSource reference)
The resulting haplotype will be annotated with the appropriate Cigar and genome location.
index
- the index of the target allele.paddingSize
- extra bases from the reference sequence to be added on either side.reference
- the reference to use as source.null
.public byte[] getInsertedSequence()
Currently this method relies on the annotation .
null
if there is no inserted sequence.public int getStructuralVariantLength()
When SVLEN is absent this method returns NO_LENGTH
(-1).
Otherwise this method will return 0 or positive value, so for example for a deletion of 10bp
it will return 10
despite that the SVLEN annotation should be -10
.
NO_LENGTH
if there is no SVLEN annotation and the length could not be inferred, 0 or greater otherwise.public java.util.List<SimpleInterval> getBreakPointIntervals(int padding, htsjdk.samtools.SAMSequenceDictionary dictionary, boolean padForHomology)
Typically the break point interval would be located between two point locations in the reference genome.
In that case this method will return padding
bases up- and down-stream from that
inter-base position.
In case the padding is set to zero, since the 0-length interval is not valid, this method would return an interval including the base just before the break-point.
If padForHomology is set, the breakpoint interval will include the region specified as homologous sequence in the HOMOLOGY_LENGTH attribute of VariantContext, in addition to the normal padding specified in the first parameter.
padding
- the padding around the exact location of the break point to be included in the padded interval.dictionary
- reference meta-data.padForHomology
- Add homologous sequence around the breakpoint to the intervalnull
, potentially 0-length but typically at least one element.public PairedStrandedIntervals getPairedStrandedIntervals(ReadMetadata metadata, htsjdk.samtools.SAMSequenceDictionary referenceSequenceDictionary, int padding)