Package org.snpeff.stats
Class TsTvStats
- java.lang.Object
-
- org.snpeff.stats.TsTvStats
-
- All Implemented Interfaces:
SamplingStats<VcfEntry>
public class TsTvStats extends java.lang.Object implements SamplingStats<VcfEntry>
Calculate Ts/Tv rations per sample (transitions vs transversions)- Author:
- pablocingolani
-
-
Constructor Summary
Constructors Constructor Description TsTvStats()
-
Method Summary
All Methods Instance Methods Concrete Methods 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 databoolean
isTransition(java.lang.String ref, java.lang.String alt)
Is this a transition?boolean
isTranversion(java.lang.String ref, java.lang.String alt)
Is this a transversion?void
sample(VcfEntry vcfEntry)
Update Ts and Tv counters Only for SNPsjava.lang.String
toString()
Show results to stdout
-
-
-
Method Detail
-
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 interfaceSamplingStats<VcfEntry>
- Returns:
-
isTransition
public boolean isTransition(java.lang.String ref, java.lang.String alt)
Is this a transition?- Parameters:
ref
- : Reference base (upper case)alt
- : Alternative base (upper case)- Returns:
-
isTranversion
public boolean isTranversion(java.lang.String ref, java.lang.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 interfaceSamplingStats<VcfEntry>
-
toString
public java.lang.String toString()
Show results to stdout- Overrides:
toString
in classjava.lang.Object
-
-