Package org.snpeff.stats

# Class TsTvStats

java.lang.Object
org.snpeff.stats.TsTvStats

All Implemented Interfaces:
  `SamplingStats<VcfEntry>`

public class TsTvStats extends Object implements SamplingStats<VcfEntry>
Calculate Ts/Tv rations per sample (transitions vs transversions)

Author:
  pablocingolani

## Constructor Summary

Constructors
Constructor
Description
`TsTvStats()`

## Method Summary

Modifier and Type
Method
Description
`long`
`getTransitions()`
`long`
`getTransversions()`
`double`
`getTsTvRatio()`
Transitions / transverions ratio WARNING: I removed the '2.0' factor because it mostly confused people.
`boolean`
`hasData()`
Does this stat have any data
`boolean`
`isTransition(String ref, String alt)`
Is this a transition?
`boolean`
`isTranversion(String ref, String alt)`
Is this a transversion?
`void`
`sample(VcfEntry vcfEntry)`
Update Ts and Tv counters Only for SNPs
`String`
`toString()`
Show results to stdout

### Methods inherited from class java.lang.Object

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

## Constructor Details

### TsTvStats

public TsTvStats()

## Method Details

### getTransitions

public long getTransitions()

### getTransversions

public long getTransversions()

### getTsTvRatio

public double getTsTvRatio()
Transitions / transverions ratio WARNING: I removed the '2.0' factor because it mostly confused people. I clarify that the ratio is a 'raw' ratio in the summary page ------------------------------------------------------------------------ Comments that follow are out-dated. I leave it here just for reference. Note: Why is there a '2' in the ratio and not just "number of transitions / number of transverions"? From Casey Bergman (Manchester Univ.) Ts:Tv ratio is a ratio of rates, not observed events. Imagine observing 100 sites with transitions and 100 sites with transversions. Your method would say that the Ts:Tv rate ratio is 1. But since there are 4 possible Tv mutation types and only 2 possible Ts mutation types, in this example there is actually a 2-fold higher rate of Ts mutations that Tv mutations per site. Thus, the Ts:Tv (rate) ratio is 2:1 References: http://www.mun.ca/biology/scarr/Transitions_vs_Transversions.html http://biostar.stackexchange.com/questions/4759/ti-tv-ratio-confirms-snp-discovery-is-this-a-general-rule/

Returns:

### hasData

public boolean hasData()
Does this stat have any data

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

### isTransition

public boolean isTransition(String ref, String alt)
Is this a transition?

Parameters:
  `ref` - : Reference base (upper case)
  `alt` - : Alternative base (upper case)
Returns:

### isTranversion

public boolean isTranversion(String ref, String alt)
Is this a transversion?

Parameters:
  `ref` - : Reference base (upper case)
  `alt` - : Alternative base (upper case)
Returns:

### sample

public void sample(VcfEntry vcfEntry)
Update Ts and Tv counters Only for SNPs

Specified by:
  `sample` in interface `SamplingStats<VcfEntry>`
Parameters:
  `vcfEntry` -

### toString

public String toString()
Show results to stdout

Overrides:
  `toString` in class `Object`