public final class FisherExact extends Object
This requires native R libraries and rJava to be installed. From the R console enter:
install.packages('rJava')
When running the Java code, you need to add the R and rJava libraries to the library path. For example on windows, add -Djava.library.path="C:\Program Files (x86)\R\R-2.10.1\library\rJava\jri". On Unix, add the R and JRI paths to the LD_LIBRARY_PATH environment variable.
| Modifier and Type | Class and Description |
|---|---|
static class |
FisherExact.AlternativeHypothesis
Indicates the alternative hypothesis used in the 2x2 case.
|
static class |
FisherExact.Result
Result from the fisher exact test.
|
| Modifier and Type | Method and Description |
|---|---|
static FisherExact.Result |
fexact(int[] factor1,
int[] factor2,
FisherExact.AlternativeHypothesis alternativeHypothesis,
boolean hybrid)
Performs Fisher's exact test using two input vectors.
|
static FisherExact.Result |
fexact(int[] vector,
int nrows,
int ncols)
Performs Fisher's exact test for testing the null of independence of rows and columns
in a contingency table with fixed marginals.
|
static FisherExact.Result |
fexact(int[] vector,
int nrows,
int ncols,
FisherExact.AlternativeHypothesis alternativeHypothesis)
Performs Fisher's exact test for testing the null of independence of rows and columns
in a contingency table with fixed marginals.
|
static FisherExact.Result |
fexact(int[] vector,
int nrows,
int ncols,
FisherExact.AlternativeHypothesis alternativeHypothesis,
boolean hybrid)
Performs Fisher's exact test for testing the null of independence of rows and columns
in a contingency table with fixed marginals.
|
static FisherExact.Result |
fexact(int r1c1,
int r2c1,
int r1c2,
int r2c2)
Performs Fisher's exact test for testing the null of independence of rows and columns
in a contingency table with fixed marginals.
|
static FisherExact.Result |
fexactLesser(int r1c1,
int r2c1,
int r1c2,
int r2c2) |
static double |
greater(int totalChanged,
int changedInNode,
int total,
int inNode)
Calculates the 1-tailed greater p-value, using the the same input data parameters as
Fisher.fisher(int, int, int, int). |
static double |
lesser(int totalChanged,
int changedInNode,
int total,
int inNode)
Calculates the 1-tailed lesser p-value, using the the same input data parameters as
Fisher.fisher(int, int, int, int). |
static double |
twoTailed(int totalChanged,
int changedInNode,
int total,
int inNode)
Calculates the 2-tailed p-value, using the the same input data parameters as
Fisher.fisher(int, int, int, int). |
public static FisherExact.Result fexact(int[] vector, int nrows, int ncols, FisherExact.AlternativeHypothesis alternativeHypothesis, boolean hybrid)
C1 C2
R1 1 11
R2 2 12
R3 3 13
vector - An array of integer values used to populate the matrtix to be evaluated.nrows - The number of rows in the resulting martrixncols - The number of columns in the resulting matrixalternativeHypothesis - The alternative hypothesis to use for the calculationhybrid - Whether exact probabilities are computed (false) or a hybrid approximation
(true) is made (only used if the data is larger than a 2 by 2 table)public static FisherExact.Result fexact(int[] vector, int nrows, int ncols, FisherExact.AlternativeHypothesis alternativeHypothesis)
C1 C2
R1 1 11
R2 2 12
R3 3 13
vector - An array of integer values used to populate the matrtix to be evaluated.nrows - The number of rows in the resulting martrixncols - The number of columns in the resulting matrixalternativeHypothesis - The alternative hypothesis to use for the calculationpublic static FisherExact.Result fexact(int[] factor1, int[] factor2, FisherExact.AlternativeHypothesis alternativeHypothesis, boolean hybrid)
factor1 - factor2 - alternativeHypothesis - The alternative hypothesis to use for the calculationhybrid - Wheter exact probabilities are computed (false) or a hybrid approximation
(true) is madepublic static FisherExact.Result fexact(int[] vector, int nrows, int ncols)
C1 C2 C3
R1 1 2 3
R2 11 12 13
vector - An array of integer values used to populate the matrtix to be evaluated.nrows - The number of rows in the resulting matrixncols - The number of columns in the resulting matrixpublic static FisherExact.Result fexact(int r1c1, int r2c1, int r1c2, int r2c2)
C1 C2
R1 r1c1 r1c2
R2 r2c1 r2c2
r1c1 - Value for row1/column1 of the contingency matrixr2c1 - Value for row1/column1 of the contingency matrixr1c2 - Value for row1/column2 of the contingency matrixr2c2 - Value for row2/column2 of the contingency matrixpublic static FisherExact.Result fexactLesser(int r1c1, int r2c1, int r1c2, int r2c2)
public static double twoTailed(int totalChanged,
int changedInNode,
int total,
int inNode)
Fisher.fisher(int, int, int, int).totalChanged - The number of genes changed in the experiment N1changedInNode - The number of genes changed in a particular node xtotal - The total number of genes in the experiment (changed and unchanged) N1+N2inNode - The number of genes in the node (changed and unchanged) x+ypublic static double greater(int totalChanged,
int changedInNode,
int total,
int inNode)
Fisher.fisher(int, int, int, int).totalChanged - The number of genes changed in the experiment N1changedInNode - The number of genes changed in a particular node xtotal - The total number of genes in the experiment (changed and unchanged) N1+N2inNode - The number of genes in the node (changed and unchanged) x+ypublic static double lesser(int totalChanged,
int changedInNode,
int total,
int inNode)
Fisher.fisher(int, int, int, int).totalChanged - The number of genes changed in the experiment N1changedInNode - The number of genes changed in a particular node xtotal - The total number of genes in the experiment (changed and unchanged) N1+N2inNode - The number of genes in the node (changed and unchanged) x+yCopyright © 2018 Campagne Laboratory. All rights reserved.