# Class CodonChange

java.lang.Object
org.snpeff.interval.codonChange.CodonChange

Direct Known Subclasses:
  `CodonChangeIns, CodonChangeInterval, CodonChangeInv, CodonChangeMnp, CodonChangeSnp, CodonChangeStructural`

public class CodonChange extends Object
Analyze codon changes based on a variant and a Transcript

Author:
  pcingola

## Field Summary

Fields
Modifier and Type
Field
Description
`static final int`
`CODON_SIZE`
`static boolean`
`showCodonChange`

## Constructor Summary

Constructors
Modifier
Constructor
Description
`protected`
`CodonChange(Variant variant, Transcript transcript, VariantEffects variantEffects)`

## Method Summary

Modifier and Type
Method
Description
`protected EffectType`
`additionalEffect(String codonsOld, String codonsNew, int codonNum, int codonIndex, String aaOld, String aaNew)`
Calculate additional effect due to codon changes E.g.
`protected int`
`cdsBaseNumber(int pos)`
Calculate base number in a cds where 'pos' is
`void`
`codonChange()`
Calculate a list of codon changes
`protected boolean`
`codonChange(Exon exon)`
Calculate the effect on an exon
`protected String`
`codonsAlt()`
Calculate new codons
`protected String`
`codonsRef()`
Calculate 'reference' codons
`protected String`
`codonsRef(int numCodons)`
Calculate 'reference' codons
`protected VariantEffect`
`effect(Marker marker, EffectType effectType, boolean allowReplace)`
Calculate variant effect
`protected VariantEffect`
`effectNoCodon(Marker marker, EffectType effectType)`
`protected VariantEffect`
`effectNoCodon(Marker marker, EffectType effectType, VariantEffect.EffectImpact effectImpact)`
`static CodonChange`
`factory(Variant variant, Transcript transcript, VariantEffects variantEffects)`
Create a specific codon change for a variant
`protected boolean`
`intersectsExons()`
Does the variant intersect any exons?
`protected String`
`netCdsChange()`
We may have to calculate 'netCdsChange', which is the effect on the CDS Note: A deletion or a MNP might affect several exons
`String`
`toString()`

### Methods inherited from class Object

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

## Field Details

### CODON_SIZE

public static final int CODON_SIZE

See Also:
  - Constant Field Values

### showCodonChange

public static boolean showCodonChange

## Constructor Details

### CodonChange

protected CodonChange(Variant variant, Transcript transcript, VariantEffects variantEffects)

## Method Details

### factory

public static CodonChange factory(Variant variant, Transcript transcript, VariantEffects variantEffects)
Create a specific codon change for a variant

### additionalEffect

protected EffectType additionalEffect(String codonsOld, String codonsNew, int codonNum, int codonIndex, String aaOld, String aaNew)
Calculate additional effect due to codon changes E.g. A frame-shift that also affects a stop codon

### cdsBaseNumber

protected int cdsBaseNumber(int pos)
Calculate base number in a cds where 'pos' is

### codonChange

public void codonChange()
Calculate a list of codon changes

### codonChange

protected boolean codonChange(Exon exon)
Calculate the effect on an exon

### codonsAlt

protected String codonsAlt()
Calculate new codons

### codonsRef

protected String codonsRef()
Calculate 'reference' codons

### codonsRef

protected String codonsRef(int numCodons)
Calculate 'reference' codons

### effect

protected VariantEffect effect(Marker marker, EffectType effectType, boolean allowReplace)
Calculate variant effect

Parameters:
  `marker` - : Genomic marker affected by this variant (e.g. exon, transcript, etc)
  `effectType` - : Effect type
  `allowReplace` - : Can another variant effect replace this one?
Returns:
  A new VariantEffect object

### effectNoCodon

protected VariantEffect effectNoCodon(Marker marker, EffectType effectType)

### effectNoCodon

protected VariantEffect effectNoCodon(Marker marker, EffectType effectType, VariantEffect.EffectImpact effectImpact)

### intersectsExons

protected boolean intersectsExons()
Does the variant intersect any exons?

### netCdsChange

protected String netCdsChange()
We may have to calculate 'netCdsChange', which is the effect on the CDS Note: A deletion or a MNP might affect several exons

### toString

public String toString()

Overrides:
  `toString` in class `Object`