Package org.snpeff.probablility
Class RankSumPdf
- java.lang.Object
-
- org.snpeff.probablility.RankSumPdf
-
public class RankSumPdf extends java.lang.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 org.apfloat.Apfloat
BAD
static int
CACHE_MAX_N
Cache size roughly (N * NT)^2static int
CACHE_MAX_NT
static double
SMALL
A small number
-
Constructor Summary
Constructors Constructor Description RankSumPdf()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
canBeCached(int n, int nt)
Is the number in the cachestatic 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 CDFstatic boolean
isOk(org.apfloat.Apfloat p)
Is the value OK? (i.e.static void
main(java.lang.String[] args)
static long
maxRankSum(int n, int nt)
Maximum possible rank sumstatic double
mean(int n, int nt)
Mean value for a given N and N_Tstatic long
minRankSum(int n, int nt)
Minimum possible rank sumstatic 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 statisticstatic 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
-
-
-
Field Detail
-
CACHE_MAX_N
public static final int CACHE_MAX_N
Cache size roughly (N * NT)^2- See Also:
- Constant Field Values
-
CACHE_MAX_NT
public static final int CACHE_MAX_NT
- See Also:
- Constant Field Values
-
BAD
public static final org.apfloat.Apfloat BAD
-
SMALL
public static double SMALL
A small number
-
-
Method Detail
-
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 numbernt
- : Number of elements in the sumr
- : 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 numbernt
- : Number of elements in the sumr
- : rank sum value- Returns:
- The probability that selecting 'nt' elements out of 'n' ranked elements, the rank sum is less or equal to 'r'
-
main
public static void main(java.lang.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 numbernt
- : Number of elements in the sumr
- : 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 numbernt
- : Number of elements in the sumr
- : 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:
-
isOk
public static boolean isOk(org.apfloat.Apfloat p)
Is the value OK? (i.e. not 'BAD')- Parameters:
p
-- Returns:
-
-