# Class VariantEffect

java.lang.Object
org.snpeff.snpEffect.VariantEffect

All Implemented Interfaces:
  `Cloneable, Comparable<VariantEffect>`

Direct Known Subclasses:
  `VariantEffectStructural`

public class VariantEffect extends Object implements Cloneable, Comparable<VariantEffect>
Effect of a variant.

Author:
  pcingola

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static enum`
`VariantEffect.Coding`
`static enum`
`VariantEffect.EffectImpact`
`static enum`
`VariantEffect.FunctionalClass`
This class is only getFused for SNPs

## Field Summary

Fields
Modifier and Type
Field
Description
`protected String`
`aaAlt`
`protected String`
`aaRef`
`protected String`
`aasAroundNew`
`protected String`
`aasAroundOld`
`protected int`
`cDnaPos`
`protected int`
`codonDegeneracy`
`protected int`
`codonIndex`
`protected int`
`codonNum`
`protected String`
`codonsAlt`
`protected String`
`codonsAroundNew`
`protected String`
`codonsAroundOld`
`protected String`
`codonsRef`
`protected int`
`distance`
`protected VariantEffect.EffectImpact`
`effectImpact`
`protected List<VariantEffect.EffectImpact>`
`effectImpacts`
`protected EffectType`
`effectType`
`protected List<EffectType>`
`effectTypes`
`protected String`
`error`
`protected Marker`
`marker`
`static final int`
`MAX_CODON_SEQUENCE_LEN`
`protected String`
`message`
`protected Variant`
`variant`
`protected String`
`warning`

## Constructor Summary

Constructors
Constructor
Description
`VariantEffect(Variant variant)`
`VariantEffect(Variant variant, Marker marker, EffectType effectType, VariantEffect.EffectImpact effectImpact, String codonsOld, String codonsNew, int codonNum, int codonIndex, int cDnaPos)`

## Method Summary

Modifier and Type
Method
Description
`void`
`addEffect(EffectType effectType)`
`void`
`addEffectImpact(VariantEffect.EffectImpact effectImpact)`
`void`
`addEffectType(EffectType effectType)`
`void`
`addErrorMessage(ErrorWarningType errmsg)`
`void`
`addErrorWarningInfo(ErrorWarningType errwarn)`
Add an error or warning
`void`
`addInfoMessage(ErrorWarningType infomsg)`
`void`
`addWarningMessge(ErrorWarningType warnmsg)`
`VariantEffect`
`clone()`
`int`
`compareTo(VariantEffect varEffOther)`
`String`
`effect(boolean shortFormat, boolean showAaChange, boolean showBioType, boolean useSeqOntology, boolean useFirstEffect)`
Show a string with overall effect
`String`
`getAaAlt()`
`String`
`getAaChange()`
Amino acid change string (HGVS style)
`String`
`getAaChangeOld()`
Amino acid change string (old style)
`int`
`getAaLength()`
Amino acid length (negative if there is none)
`String`
`getAaNetChange()`
Net AA change (InDels)
`String`
`getAaRef()`
`BioType`
`getBiotype()`
Get biotype
`int`
`getcDnaPos()`
`int`
`getCdsLength()`
CDS length (negative if there is none)
`String`
`getCodonChange()`
Codon change string
`String`
`getCodonChangeMax()`
Codon change string (if it's not too long)
`int`
`getCodonIndex()`
`int`
`getCodonNum()`
`String`
`getCodonsAlt()`
`String`
`getCodonsRef()`
`int`
`getDistance()`
`VariantEffect.EffectImpact`
`getEffectImpact()`
Return impact of this effect
`EffectType`
`getEffectType()`
Highest effect type
`List<EffectType>`
`getEffectTypes()`
Highest effect type
`String`
`getEffectTypeString(boolean useSeqOntology)`
`String`
`getEffectTypeString(boolean useSeqOntology, boolean useFirstEffect)`
`String`
`getEffectTypeString(boolean useSeqOntology, boolean useFirstEffect, EffFormatVersion formatVersion)`
Get Effect Type as a string
`String`
`getError()`
`Exon`
`getExon()`
Get exon (if any)
`VariantEffect.FunctionalClass`
`getFunctionalClass()`
Return functional class of this effect (i.e.
`Gene`
`getGene()`
`String`
`getGeneRegion()`
`List<Gene>`
`getGenes()`
`String`
`getGenotype()`
Get genotype string
`String`
`getHgvs()`
Change in HGVS notation
`String`
`getHgvsDna()`
Change in HGVS (Dna) notation
`String`
`getHgvsProt()`
Change in HGVS (Protein) notation
`Intron`
`getIntron()`
Get intron (if any)
`Marker`
`getMarker()`
`Transcript`
`getTranscript()`
`Variant`
`getVariant()`
`String`
`getWarning()`
`boolean`
`hasAdditionalAnnotations()`
Do we have an associated marker with additional annotations?
`boolean`
`hasEffectImpact(VariantEffect.EffectImpact effectImpact)`
`boolean`
`hasEffectType(EffectType effectType)`
`boolean`
`hasError()`
`boolean`
`hasWarning()`
`boolean`
`isCustom()`
`boolean`
`isExon()`
`boolean`
`isIntergenic()`
`boolean`
`isIntron()`
`boolean`
`isMotif()`
`boolean`
`isMultipleGenes()`
`boolean`
`isNextProt()`
`boolean`
`isRegulation()`
`boolean`
`isSpliceSite()`
`boolean`
`isSpliceSiteCore()`
`boolean`
`isSpliceSiteRegion()`
`boolean`
`isUtr3()`
`boolean`
`isUtr5()`
`void`
`set(Marker marker, EffectType effectType, VariantEffect.EffectImpact effectImpact, String message)`
`void`
`setCodons(String codonsOld, String codonsNew, int codonNum, int codonIndex)`
Set codon change.
`void`
`setCodonsAround(String codonsLeft, String codonsRight)`
Set values for codons around change.
`void`
`setDistance(int distance)`
`void`
`setEffect(EffectType effectType)`
Set effect using default impact
`void`
`setEffectImpact(VariantEffect.EffectImpact effectImpact)`
`void`
`setEffectType(EffectType effectType)`
`void`
`setMarker(Marker marker)`
Set marker.
`String`
`toStr()`
`String`
`toString()`
`String`
`toString(boolean useSeqOntology, boolean useHgvs)`
`String`
`toStringSimple(boolean shortFormat)`
Get the simplest string describing the effect (this is mostly used for testcases)

### Methods inherited from class Object

`equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Field Details

### MAX_CODON_SEQUENCE_LEN

public static final int MAX_CODON_SEQUENCE_LEN

See Also:
  - Constant Field Values

### variant

protected Variant variant

### effectTypes

protected List<EffectType> effectTypes

### effectType

protected EffectType effectType

### effectImpacts

protected List<VariantEffect.EffectImpact> effectImpacts

### effectImpact

protected VariantEffect.EffectImpact effectImpact

### marker

protected Marker marker

### error

protected String error

### warning

protected String warning

### message

protected String message

### codonsRef

protected String codonsRef

### codonsAlt

protected String codonsAlt

### codonsAroundOld

protected String codonsAroundOld

### codonsAroundNew

protected String codonsAroundNew

### distance

protected int distance

### cDnaPos

protected int cDnaPos

### codonNum

protected int codonNum

### codonIndex

protected int codonIndex

### codonDegeneracy

protected int codonDegeneracy

### aaRef

protected String aaRef

### aaAlt

protected String aaAlt

### aasAroundOld

protected String aasAroundOld

### aasAroundNew

protected String aasAroundNew

## Constructor Details

### VariantEffect

public VariantEffect(Variant variant)

### VariantEffect

public VariantEffect(Variant variant, Marker marker, EffectType effectType, VariantEffect.EffectImpact effectImpact, String codonsOld, String codonsNew, int codonNum, int codonIndex, int cDnaPos)

## Method Details

### addEffect

public void addEffect(EffectType effectType)

### addEffectImpact

public void addEffectImpact(VariantEffect.EffectImpact effectImpact)

### addEffectType

public void addEffectType(EffectType effectType)

### addErrorMessage

public void addErrorMessage(ErrorWarningType errmsg)

### addErrorWarningInfo

public void addErrorWarningInfo(ErrorWarningType errwarn)
Add an error or warning

### addInfoMessage

public void addInfoMessage(ErrorWarningType infomsg)

### addWarningMessge

public void addWarningMessge(ErrorWarningType warnmsg)

### clone

public VariantEffect clone()

Overrides:
  `clone` in class `Object`

### compareTo

public int compareTo(VariantEffect varEffOther)

Specified by:
  `compareTo` in interface `Comparable<VariantEffect>`

### effect

public String effect(boolean shortFormat, boolean showAaChange, boolean showBioType, boolean useSeqOntology, boolean useFirstEffect)
Show a string with overall effect

### getAaAlt

public String getAaAlt()

### getAaChange

public String getAaChange()
Amino acid change string (HGVS style)

### getAaChangeOld

public String getAaChangeOld()
Amino acid change string (old style)

### getAaLength

public int getAaLength()
Amino acid length (negative if there is none)

Returns:
  Amino acid length (CDS length / 3 ) or '-1' if there is no CDS length

### getAaNetChange

public String getAaNetChange()
Net AA change (InDels)

### getAaRef

public String getAaRef()

### getBiotype

public BioType getBiotype()
Get biotype

### getcDnaPos

public int getcDnaPos()

### getCdsLength

public int getCdsLength()
CDS length (negative if there is none)

### getCodonChange

public String getCodonChange()
Codon change string

### getCodonChangeMax

public String getCodonChangeMax()
Codon change string (if it's not too long)

### getCodonIndex

public int getCodonIndex()

### getCodonNum

public int getCodonNum()

### getCodonsAlt

public String getCodonsAlt()

### getCodonsRef

public String getCodonsRef()

### getDistance

public int getDistance()

### setDistance

public void setDistance(int distance)

### getEffectImpact

public VariantEffect.EffectImpact getEffectImpact()
Return impact of this effect

### setEffectImpact

public void setEffectImpact(VariantEffect.EffectImpact effectImpact)

### getEffectType

public EffectType getEffectType()
Highest effect type

### setEffectType

public void setEffectType(EffectType effectType)

### getEffectTypes

public List<EffectType> getEffectTypes()
Highest effect type

### getEffectTypeString

public String getEffectTypeString(boolean useSeqOntology)

### getEffectTypeString

public String getEffectTypeString(boolean useSeqOntology, boolean useFirstEffect)

### getEffectTypeString

public String getEffectTypeString(boolean useSeqOntology, boolean useFirstEffect, EffFormatVersion formatVersion)
Get Effect Type as a string

### getError

public String getError()

### getExon

public Exon getExon()
Get exon (if any)

### getFunctionalClass

public VariantEffect.FunctionalClass getFunctionalClass()
Return functional class of this effect (i.e. NONSENSE, MISSENSE, SILENT or NONE)

### getGene

public Gene getGene()

### getGeneRegion

public String getGeneRegion()

### getGenes

public List<Gene> getGenes()

### getGenotype

public String getGenotype()
Get genotype string

### getHgvs

public String getHgvs()
Change in HGVS notation

### getHgvsDna

public String getHgvsDna()
Change in HGVS (Dna) notation

### getHgvsProt

public String getHgvsProt()
Change in HGVS (Protein) notation

### getIntron

public Intron getIntron()
Get intron (if any)

### getMarker

public Marker getMarker()

### setMarker

public void setMarker(Marker marker)
Set marker. Add some warnings if the marker relates to incomplete transcripts

### getTranscript

public Transcript getTranscript()

### getVariant

public Variant getVariant()

### getWarning

public String getWarning()

### hasAdditionalAnnotations

public boolean hasAdditionalAnnotations()
Do we have an associated marker with additional annotations?

### hasEffectImpact

public boolean hasEffectImpact(VariantEffect.EffectImpact effectImpact)

### hasEffectType

public boolean hasEffectType(EffectType effectType)

### hasError

public boolean hasError()

### hasWarning

public boolean hasWarning()

### isCustom

public boolean isCustom()

### isExon

public boolean isExon()

### isIntergenic

public boolean isIntergenic()

### isIntron

public boolean isIntron()

### isMotif

public boolean isMotif()

### isMultipleGenes

public boolean isMultipleGenes()

### isNextProt

public boolean isNextProt()

### isRegulation

public boolean isRegulation()

### isSpliceSite

public boolean isSpliceSite()

### isSpliceSiteCore

public boolean isSpliceSiteCore()

### isSpliceSiteRegion

public boolean isSpliceSiteRegion()

### isUtr3

public boolean isUtr3()

### isUtr5

public boolean isUtr5()

### set

public void set(Marker marker, EffectType effectType, VariantEffect.EffectImpact effectImpact, String message)

### setCodons

public void setCodons(String codonsOld, String codonsNew, int codonNum, int codonIndex)
Set codon change. Calculate effect type based on codon changes (for SNPs invalid input: '&' MNPs)

### setCodonsAround

public void setCodonsAround(String codonsLeft, String codonsRight)
Set values for codons around change.

### setEffect

public void setEffect(EffectType effectType)
Set effect using default impact

### toStr

public String toStr()

### toString

public String toString()

Overrides:
  `toString` in class `Object`

### toString

public String toString(boolean useSeqOntology, boolean useHgvs)

### toStringSimple

public String toStringSimple(boolean shortFormat)
Get the simplest string describing the effect (this is mostly used for testcases)