Class 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 data
      boolean 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 SNPs
      java.lang.String toString()
      Show results to stdout
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • TsTvStats

        public TsTvStats()
    • 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:
      • 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:
      • toString

        public java.lang.String toString()
        Show results to stdout
        Overrides:
        toString in class java.lang.Object