Package org.snpeff.interval
Class Variant
- java.lang.Object
-
- org.snpeff.interval.Interval
-
- org.snpeff.interval.Marker
-
- org.snpeff.interval.Variant
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,java.lang.Comparable<Interval>
,TxtSerializable
- Direct Known Subclasses:
VariantBnd
,VariantNonRef
,VariantVcfEntry
,VariantWithScore
public class Variant extends Marker
A variant represents a change in a reference sequence Notes: This class was previously known as Variant. As of version 4.0, variants in the negative strand are NOT allowed any more (they just complicate the code and bring no real benefit). We are also storing much less information fields like quality, score, coverage, etc. have been removed.- Author:
- pcingola
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Variant.VariantType
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
alt
protected java.lang.String
genotype
static double
HUGE_DELETION_RATIO_THRESHOLD
static int
HUGE_DELETION_SIZE_THRESHOLD
protected boolean
imprecise
static Variant
NO_VARIANT
protected java.lang.String
ref
protected Variant.VariantType
variantType
-
Fields inherited from class org.snpeff.interval.Interval
chromosomeNameOri, end, id, parent, start, strandMinus
-
-
Constructor Summary
Constructors Constructor Description Variant()
Variant(Marker parent, int start, int end, java.lang.String id)
This constructor is used when we only have interval data (e.g.Variant(Marker parent, int position, java.lang.String referenceStr, java.lang.String altStr)
Variant(Marker parent, int position, java.lang.String referenceStr, java.lang.String altStr, java.lang.String id)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Variant
clone()
Variant
cloneShallow()
Perform a shallow cloneint
compareTo(Interval i2)
Compare by start and endVariant[]
decompose()
Decompose a variant into basic constituents At the moment this only makes sense for MIXED variants which are decomposed into two variants: MNP + InDelstatic java.util.List<Variant>
factory(Chromosome chromo, int start, java.lang.String ref, java.lang.String altStr, java.lang.String id, boolean expand)
Create variants from ALT (which can be multiple values)java.lang.String
getAlt()
java.lang.String
getGenotype()
java.lang.String
getReference()
Variant.VariantType
getVariantType()
int
hashCode()
boolean
isBnd()
boolean
isDel()
boolean
isDup()
boolean
isElongation()
boolean
isImprecise()
boolean
isInDel()
boolean
isIns()
boolean
isInterval()
boolean
isInv()
boolean
isMixed()
boolean
isMnp()
boolean
isNonRef()
protected boolean
isShowWarningIfParentDoesNotInclude()
Show an error if parent does not include child?boolean
isSnp()
boolean
isStructural()
boolean
isStructuralHuge()
Is this a huge structural variant?boolean
isTruncation()
boolean
isVariant()
Is this a change or is ALT actually the same as the referenceint
lengthChange()
Calculate the number of bases of change in lengthjava.lang.String
netChange(boolean reverseStrand)
Return the change (always compared to 'referenceStrand')java.lang.String
netChange(Marker marker)
Only the part of the change that overlaps with a marker Return the change (always in positive strand)Variant
realignLeft()
Create a new variant realigning it towards the leftmost positionvoid
setGenotype(java.lang.String genotype)
void
setImprecise(boolean imprecise)
void
setVariantType(Variant.VariantType variantType)
java.lang.String
toString()
java.lang.String
toStringEnsembl()
Show variant in ENSEMBL's VEP formatjava.lang.String
toStringOld()
Old format, used for some test cases-
Methods inherited from class org.snpeff.interval.Marker
adjust, apply, applyDel, applyDup, applyIns, applyMixed, codonTable, compareToPos, distance, distanceBases, getParent, getType, idChain, idChain, idChain, includes, intersect, isAdjustIfParentDoesNotInclude, minus, query, query, readTxt, serializeParse, serializeSave, shouldApply, union, variantEffect, variantEffectNonRef
-
Methods inherited from class org.snpeff.interval.Interval
equals, findParent, getChromosome, getChromosomeName, getChromosomeNameOri, getChromosomeNum, getEnd, getGenome, getGenomeName, getId, getStart, getStrand, intersects, intersects, intersects, intersects, intersectSize, isCircular, isSameChromo, isStrandMinus, isStrandPlus, isValid, setChromosomeNameOri, setEnd, setId, setParent, setStart, setStrandMinus, shiftCoordinates, size, toStr, toStringAsciiArt
-
-
-
-
Field Detail
-
HUGE_DELETION_SIZE_THRESHOLD
public static final int HUGE_DELETION_SIZE_THRESHOLD
- See Also:
- Constant Field Values
-
HUGE_DELETION_RATIO_THRESHOLD
public static final double HUGE_DELETION_RATIO_THRESHOLD
- See Also:
- Constant Field Values
-
NO_VARIANT
public static final Variant NO_VARIANT
-
variantType
protected Variant.VariantType variantType
-
ref
protected java.lang.String ref
-
alt
protected java.lang.String alt
-
genotype
protected java.lang.String genotype
-
imprecise
protected boolean imprecise
-
-
Constructor Detail
-
Variant
public Variant()
-
Variant
public Variant(Marker parent, int start, int end, java.lang.String id)
This constructor is used when we only have interval data (e.g. when reading a BED file)
-
Variant
public Variant(Marker parent, int position, java.lang.String referenceStr, java.lang.String altStr)
-
Variant
public Variant(Marker parent, int position, java.lang.String referenceStr, java.lang.String altStr, java.lang.String id)
-
-
Method Detail
-
factory
public static java.util.List<Variant> factory(Chromosome chromo, int start, java.lang.String ref, java.lang.String altStr, java.lang.String id, boolean expand)
Create variants from ALT (which can be multiple values)
-
cloneShallow
public Variant cloneShallow()
Description copied from class:Marker
Perform a shallow clone- Overrides:
cloneShallow
in classMarker
-
compareTo
public int compareTo(Interval i2)
Compare by start and end
-
decompose
public Variant[] decompose()
Decompose a variant into basic constituents At the moment this only makes sense for MIXED variants which are decomposed into two variants: MNP + InDel
-
getAlt
public java.lang.String getAlt()
-
getGenotype
public java.lang.String getGenotype()
-
getReference
public java.lang.String getReference()
-
getVariantType
public Variant.VariantType getVariantType()
-
isBnd
public boolean isBnd()
-
isDel
public boolean isDel()
-
isDup
public boolean isDup()
-
isElongation
public boolean isElongation()
-
isImprecise
public boolean isImprecise()
-
isInDel
public boolean isInDel()
-
isIns
public boolean isIns()
-
isInterval
public boolean isInterval()
-
isInv
public boolean isInv()
-
isMixed
public boolean isMixed()
-
isMnp
public boolean isMnp()
-
isNonRef
public boolean isNonRef()
-
isShowWarningIfParentDoesNotInclude
protected boolean isShowWarningIfParentDoesNotInclude()
Description copied from class:Marker
Show an error if parent does not include child?- Overrides:
isShowWarningIfParentDoesNotInclude
in classMarker
-
isSnp
public boolean isSnp()
-
isStructural
public boolean isStructural()
-
isStructuralHuge
public boolean isStructuralHuge()
Is this a huge structural variant?
-
isTruncation
public boolean isTruncation()
-
isVariant
public boolean isVariant()
Is this a change or is ALT actually the same as the reference
-
lengthChange
public int lengthChange()
Calculate the number of bases of change in length
-
netChange
public java.lang.String netChange(boolean reverseStrand)
Return the change (always compared to 'referenceStrand')
-
netChange
public java.lang.String netChange(Marker marker)
Only the part of the change that overlaps with a marker Return the change (always in positive strand)
-
realignLeft
public Variant realignLeft()
Create a new variant realigning it towards the leftmost position
-
setGenotype
public void setGenotype(java.lang.String genotype)
-
setImprecise
public void setImprecise(boolean imprecise)
-
setVariantType
public void setVariantType(Variant.VariantType variantType)
-
toStringEnsembl
public java.lang.String toStringEnsembl()
Show variant in ENSEMBL's VEP format
-
toStringOld
public java.lang.String toStringOld()
Old format, used for some test cases
-
-