Class 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
    • 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
      • 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)
      • compareTo

        public int compareTo​(Interval i2)
        Compare by start and end
        Specified by:
        compareTo in interface java.lang.Comparable<Interval>
        Overrides:
        compareTo in class Marker
      • 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()
      • 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 class Marker
      • 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)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class Marker
      • 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