Class RankSumPdf

java.lang.Object
org.snpeff.probablility.RankSumPdf

public class RankSumPdf extends Object
Calculate rank sum probability distribution function (pdf) and cumulative distribution function (cdf). Note: This class assumes that ranks can be repeated (selecting with replacement)
Author:
Pablo Cingolani
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final org.apfloat.Apfloat
     
    static final int
    Cache size roughly (N * NT)^2
    static final int
     
    static double
    A small number
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    canBeCached(int n, int nt)
    Is the number in the cache
    static org.apfloat.Apfloat
    cdf(int n, int nt, int r)
    Cumulative density function (cdf)
    static org.apfloat.Apfloat
    cdfNormal(int n, int nt, int r)
    Normal approximation to rankSum CDF
    static boolean
    isOk(org.apfloat.Apfloat p)
    Is the value OK? (i.e.
    static void
    main(String[] args)
     
    static long
    maxRankSum(int n, int nt)
    Maximum possible rank sum
    static double
    mean(int n, int nt)
    Mean value for a given N and N_T
    static long
    minRankSum(int n, int nt)
    Minimum possible rank sum
    static org.apfloat.Apfloat
    pdf(int n, int nt, int r)
    Probability density function (pdf)
    static org.apfloat.Apfloat
    pdfNormal(int n, int nt, int r)
    Normal approximation to rank sum statistic
    static double
    sigma(int n, int nt)
    Wrapper to Sqrt(variance)
    static double
    variance(int n, int nt)
    Variance for a given N and N_T

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • CACHE_MAX_N

      public static final int CACHE_MAX_N
      Cache size roughly (N * NT)^2
      See Also:
    • CACHE_MAX_NT

      public static final int CACHE_MAX_NT
      See Also:
    • BAD

      public static final org.apfloat.Apfloat BAD
    • SMALL

      public static double SMALL
      A small number
  • Constructor Details

    • RankSumPdf

      public RankSumPdf()
  • Method Details

    • canBeCached

      public static boolean canBeCached(int n, int nt)
      Is the number in the cache
      Returns:
      true if it is
    • cdf

      public static org.apfloat.Apfloat cdf(int n, int nt, int r)
      Cumulative density function (cdf)
      Parameters:
      n - : Maximum rank number
      nt - : Number of elements in the sum
      r - : rank sum value
      Returns:
      The probability that selecting 'nt' elements out of 'n' ranked elements, the rank sum is less or equal to 'r'
    • cdfNormal

      public static org.apfloat.Apfloat cdfNormal(int n, int nt, int r)
      Normal approximation to rankSum CDF
      Parameters:
      n - : Maximum rank number
      nt - : Number of elements in the sum
      r - : rank sum value
      Returns:
      The probability that selecting 'nt' elements out of 'n' ranked elements, the rank sum is less or equal to 'r'
    • isOk

      public static boolean isOk(org.apfloat.Apfloat p)
      Is the value OK? (i.e. not 'BAD')
      Parameters:
      p -
      Returns:
    • main

      public static void main(String[] args)
    • maxRankSum

      public static long maxRankSum(int n, int nt)
      Maximum possible rank sum
      Parameters:
      n -
      nt -
      Returns:
    • mean

      public static double mean(int n, int nt)
      Mean value for a given N and N_T
      Parameters:
      n -
      nt -
      Returns:
    • minRankSum

      public static long minRankSum(int n, int nt)
      Minimum possible rank sum
      Parameters:
      n -
      nt -
      Returns:
    • pdf

      public static org.apfloat.Apfloat pdf(int n, int nt, int r)
      Probability density function (pdf)
      Parameters:
      n - : Maximum rank number
      nt - : Number of elements in the sum
      r - : rank sum value
      Returns:
      The probability that selecting 'nt' elements out of 'n' ranked elements, the rank sum is equal to 'r'
    • pdfNormal

      public static org.apfloat.Apfloat pdfNormal(int n, int nt, int r)
      Normal approximation to rank sum statistic
      Parameters:
      n - : Maximum rank number
      nt - : Number of elements in the sum
      r - : rank sum value
      Returns:
      The probability that selecting 'nt' elements out of 'n' ranked elements, the rank sum is equal to 'r'
    • sigma

      public static double sigma(int n, int nt)
      Wrapper to Sqrt(variance)
      Parameters:
      n -
      nt -
      Returns:
    • variance

      public static double variance(int n, int nt)
      Variance for a given N and N_T
      Parameters:
      n -
      nt -
      Returns: