# Class VariantStats

java.lang.Object
org.snpeff.stats.VariantStats

All Implemented Interfaces:
  `SamplingStats<Variant>`

public class VariantStats extends Object implements SamplingStats<Variant>
Variants statistics: These are statisticas at Variant level. For example in a VCF file, there can be more than one variant per VCF entry (i.e. VCF line)

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`CHANGE_SEPARATOR`

## Constructor Summary

Constructors
Constructor
Description
`VariantStats(Genome genome)`

## Method Summary

Modifier and Type
Method
Description
`char[]`
`getBases()`
`String`
`getBasesChangesColor(String oldBase, String newBase)`
Background color used for base change table
`long`
`getBasesChangesCount(String oldBase, String newBase)`
`Variant.VariantType[]`
`getChangeType()`
`int`
`getChangeTypeLength()`
`int`
`getChromosomeLength(String chromoName)`
Choromosome length
`List<String>`
`getChromosomeNamesEffective()`
A list of chromosomes that had at least one change Note: Chromosome names are sorted.
`ChrPosStats`
`getChrPosStats(String chrName)`
`String`
`getChrPosStatsChartUrl(String chrName)`
`long`
`getCount()`
Total number of variants
`CountByType`
`getCountByChangeType()`
Number of variants by type
`int`
`getCountByChromosome(String chromoName)`
Number of changes by chromosome
`long`
`getCountNonEmptyId()`
`long`
`getCountNonVariants()`
`long`
`getGenomeLen()`
Genome length
`long`
`getGenomeLenEffective()`
Genome effective length: The sum of length of every chromosome that had a change (e.g.
`IntStats`
`getIndelLen()`
`String`
`getIndelLenHistoUrl()`
`double`
`getKnownRatio()`
Ratio of known variants (the one with a non-empty ID) and total variants
`long`
`getRateOfChange()`
Rate of change
`int`
`getRateOfChangeByChromosome(String chromoName)`
Rate of change by chromosome
`boolean`
`hasData()`
Does this statistic have any data?
`void`
`sample(Variant variant)`
Use this sample to perform statistics

### Methods inherited from class Object

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

## Field Details

### CHANGE_SEPARATOR

public static final String CHANGE_SEPARATOR

See Also:
  - Constant Field Values

## Constructor Details

### VariantStats

public VariantStats(Genome genome)

## Method Details

### getBases

public char[] getBases()

### getBasesChangesColor

public String getBasesChangesColor(String oldBase, String newBase)
Background color used for base change table

### getBasesChangesCount

public long getBasesChangesCount(String oldBase, String newBase)

### getChangeType

public Variant.VariantType[] getChangeType()

### getChangeTypeLength

public int getChangeTypeLength()

### getChromosomeLength

public int getChromosomeLength(String chromoName)
Choromosome length

Parameters:
  `chromoName` -
Returns:

### getChromosomeNamesEffective

public List<String> getChromosomeNamesEffective()
A list of chromosomes that had at least one change Note: Chromosome names are sorted.

Returns:

### getChrPosStats

public ChrPosStats getChrPosStats(String chrName)

### getChrPosStatsChartUrl

public String getChrPosStatsChartUrl(String chrName)

### getCount

public long getCount()
Total number of variants

Returns:

### getCountByChangeType

public CountByType getCountByChangeType()
Number of variants by type

Returns:

### getCountByChromosome

public int getCountByChromosome(String chromoName)
Number of changes by chromosome

Parameters:
  `chromoName` -
Returns:

### getCountNonEmptyId

public long getCountNonEmptyId()

### getCountNonVariants

public long getCountNonVariants()

### getGenomeLen

public long getGenomeLen()
Genome length

Returns:

### getGenomeLenEffective

public long getGenomeLenEffective()
Genome effective length: The sum of length of every chromosome that had a change (e.g. If there was no SNP in chromosome Y, then it doesn't count in the effective length)

Returns:

### getIndelLen

public IntStats getIndelLen()

### getIndelLenHistoUrl

public String getIndelLenHistoUrl()

### getKnownRatio

public double getKnownRatio()
Ratio of known variants (the one with a non-empty ID) and total variants

### getRateOfChange

public long getRateOfChange()
Rate of change

Returns:

### getRateOfChangeByChromosome

public int getRateOfChangeByChromosome(String chromoName)
Rate of change by chromosome

Parameters:
  `chromoName` -
Returns:

### hasData

public boolean hasData()
Description copied from interface: `SamplingStats`
Does this statistic have any data?

Specified by:
  `hasData` in interface `SamplingStats<Variant>`
Returns:

### sample

public void sample(Variant variant)
Use this sample to perform statistics

Specified by:
  `sample` in interface `SamplingStats<Variant>`
Parameters:
  `variant` -