diff --git a/core/src/main/java/org/mskcc/cbio/portal/servlet/CalcFisherExactTest.java b/core/src/main/java/org/mskcc/cbio/portal/servlet/CalcFisherExactTest.java index 346c4ecc0ff..16073e48ff0 100644 --- a/core/src/main/java/org/mskcc/cbio/portal/servlet/CalcFisherExactTest.java +++ b/core/src/main/java/org/mskcc/cbio/portal/servlet/CalcFisherExactTest.java @@ -44,13 +44,13 @@ import org.mskcc.cbio.portal.stats.FisherExact; /** - * Calculate the cumulative (one-tail) p-value out of fisher exact test + * Calculate the cumulative (two-tail) p-value out of fisher exact test * * @param a a, b, c, d are the four cells in a 2x2 matrix * @param b * @param c * @param d - * @return one-tailed P-value (right or left, whichever is smallest) + * @return two-tailed P-value (right or left, whichever is smallest) * */ public class CalcFisherExactTest extends HttpServlet { @@ -86,7 +86,7 @@ protected void doPost(HttpServletRequest httpServletRequest, int c = Integer.parseInt(dataSet.split(" ")[2]); int d = Integer.parseInt(dataSet.split(" ")[3]); FisherExact fisher = new FisherExact(a + b + c + d); - double pValue = fisher.getCumlativeP(a, b, c, d); + double pValue = fisher.getTwoTailedP(a, b, c, d); result = result.concat(String.valueOf(pValue) + " "); } } diff --git a/core/src/main/java/org/mskcc/cbio/portal/stats/OddsRatio.java b/core/src/main/java/org/mskcc/cbio/portal/stats/OddsRatio.java index c66b49426a8..92f8f839559 100644 --- a/core/src/main/java/org/mskcc/cbio/portal/stats/OddsRatio.java +++ b/core/src/main/java/org/mskcc/cbio/portal/stats/OddsRatio.java @@ -87,7 +87,7 @@ public OddsRatio(ProfileDataSummary pDataSummary, String geneA, String geneB) { oddsRatio = ((double) (a * d)) / ((double) (b * c)); FisherExact fisher = new FisherExact(a + b + c + d); - pValue = fisher.getCumlativeP(a, b, c, d); + pValue = fisher.getTwoTailedP(a, b, c, d); lowerConfidenceInterval = Math.exp(Math.log(oddsRatio) - 1.96 * (Math.sqrt(1 / (double) a + 1 / (double) b + 1 / (double) c + 1 / (double) d))); upperConfidenceInterval = Math.exp(Math.log(oddsRatio) + 1.96 * (Math.sqrt(1 / (double) a @@ -103,7 +103,7 @@ public double getOddsRatio() { return oddsRatio; } - public double getCumulativeP() { + public double getTwoTailedP() { return pValue; } diff --git a/core/src/main/java/org/mskcc/cbio/portal/util/EnrichmentsAnalysisUtil.java b/core/src/main/java/org/mskcc/cbio/portal/util/EnrichmentsAnalysisUtil.java index d1bf2df5851..c1c4adac537 100644 --- a/core/src/main/java/org/mskcc/cbio/portal/util/EnrichmentsAnalysisUtil.java +++ b/core/src/main/java/org/mskcc/cbio/portal/util/EnrichmentsAnalysisUtil.java @@ -652,7 +652,7 @@ private double runFisherExactTest(HashMap singleGeneCaseValueMa } } FisherExact fisher = new FisherExact(a + b + c + d); - return fisher.getCumlativeP(a, b, c, d); + return fisher.getTwoTailedP(a, b, c, d); } private String getCytoband(int geneticEntityId, String geneticProfileStableId) { diff --git a/core/src/test/java/org/mskcc/cbio/portal/stats/TestFisherExact.java b/core/src/test/java/org/mskcc/cbio/portal/stats/TestFisherExact.java index 6139a270c18..06377765dfe 100644 --- a/core/src/test/java/org/mskcc/cbio/portal/stats/TestFisherExact.java +++ b/core/src/test/java/org/mskcc/cbio/portal/stats/TestFisherExact.java @@ -39,7 +39,7 @@ public class TestFisherExact extends TestCase { public void testFisherExact() { FisherExact fisher = new FisherExact(43 + 2 + 17 + 7); - double p = fisher.getCumlativeP(43, 2, 17, 7); + double p = fisher.getTwoTailedP(43, 2, 17, 7); assertEquals(0.006653, p, 0.00001); } } diff --git a/core/src/test/java/org/mskcc/cbio/portal/stats/TestOddsRatio.java b/core/src/test/java/org/mskcc/cbio/portal/stats/TestOddsRatio.java index 3c5b1e73772..108fdb5785e 100644 --- a/core/src/test/java/org/mskcc/cbio/portal/stats/TestOddsRatio.java +++ b/core/src/test/java/org/mskcc/cbio/portal/stats/TestOddsRatio.java @@ -70,9 +70,9 @@ public void testFisherExact() throws IOException { OddsRatio oddsRatio = new OddsRatio(pDataSummary, "BRCA1", "BRCA2"); double oddsRatioValue = oddsRatio.getOddsRatio(); - double p = oddsRatio.getCumulativeP(); + double p = oddsRatio.getTwoTailedP(); assertEquals(0.16666, oddsRatioValue, 0.0001); - assertEquals(0.0849, p, 0.0001); + assertEquals(0.1698, p, 0.0001); //System.out.println (oddsRatio.getRCommand()); } } diff --git a/docs/user-guide/faq.md b/docs/user-guide/faq.md index 1e554373167..ea7d3d653e0 100644 --- a/docs/user-guide/faq.md +++ b/docs/user-guide/faq.md @@ -146,7 +146,7 @@ Group Comparison is a suite of analysis features which allows a user to compare - Other tabs - 2 groups - Continuous data: one-sided t-test - - Categorical data: one-sided Fisher's exact test + - Categorical data: two-sided Fisher's exact test - 3 or more groups - Continuous data: one-way ANOVA - Categorical data: Chi-squared test diff --git a/persistence/persistence-mybatis/src/test/java/org/cbioportal/persistence/mybatis/AlterationMyBatisRepositoryTest.java b/persistence/persistence-mybatis/src/test/java/org/cbioportal/persistence/mybatis/AlterationMyBatisRepositoryTest.java index 7330e13633a..3ea53acf77e 100644 --- a/persistence/persistence-mybatis/src/test/java/org/cbioportal/persistence/mybatis/AlterationMyBatisRepositoryTest.java +++ b/persistence/persistence-mybatis/src/test/java/org/cbioportal/persistence/mybatis/AlterationMyBatisRepositoryTest.java @@ -1034,7 +1034,7 @@ public void getPatientStructuralVariantCountIncludeCustomDriverAnnotationsInclud alterationFilter.setStructuralVariants(true); alterationFilter.setMutationTypeSelect(Select.none()); alterationFilter.setCnaTypeSelect(Select.none()); - alterationFilter.setSelectedTiers(Select.byValues(List.of("Class 2"))); + alterationFilter.setSelectedTiers(Select.byValues(Arrays.asList("Class 2"))); alterationFilter.setIncludeUnknownTier(true); List result = alterationMyBatisRepository.getPatientAlterationGeneCounts( svPatientIdToProfileId, @@ -1049,7 +1049,7 @@ public void getPatientStructuralVariantCountIncludeCustomDriverAnnotationsExclud alterationFilter.setStructuralVariants(true); alterationFilter.setMutationTypeSelect(Select.none()); alterationFilter.setCnaTypeSelect(Select.none()); - alterationFilter.setSelectedTiers(Select.byValues(List.of("Class 2"))); + alterationFilter.setSelectedTiers(Select.byValues(Arrays.asList("Class 2"))); alterationFilter.setIncludeUnknownTier(false); List result = alterationMyBatisRepository.getPatientAlterationGeneCounts( svPatientIdToProfileId, diff --git a/service/src/main/java/org/cbioportal/service/util/AlterationEnrichmentUtil.java b/service/src/main/java/org/cbioportal/service/util/AlterationEnrichmentUtil.java index 0b2b0183c81..8113cc63f73 100644 --- a/service/src/main/java/org/cbioportal/service/util/AlterationEnrichmentUtil.java +++ b/service/src/main/java/org/cbioportal/service/util/AlterationEnrichmentUtil.java @@ -132,7 +132,7 @@ public List createAlterationEnrichments(Map result = alterationEnrichmentUtil.createAlterationEnrichments( mutationCountsbyEntrezGeneIdAndGroup);