Skip to content

Commit

Permalink
MM-120 fix Bonferroni correction
Browse files Browse the repository at this point in the history
  • Loading branch information
jdstamp committed Oct 16, 2023
1 parent 77b3908 commit 330288b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion data-raw/mvmapit_on_simulated_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ mvmapit_hybrid <- mvmapit(
fisher <- fishers_combined(mvmapit_hybrid$pvalues)

# exhaustive search for p-values
thresh <- 0.05 / nrow(X) # Set a significance threshold
thresh <- 0.05 / nrow(t(X)) # Set a significance threshold

significant_snps <- fisher %>%
filter(p < thresh) # Call only marginally significant SNPs
Expand Down
Binary file modified data/mvmapit_data.rda
Binary file not shown.
8 changes: 4 additions & 4 deletions vignettes/mvMAPIT.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ fisher <- fishers_combined(mvmapit_hybrid$pvalues)
```{r assign_data, include = FALSE}
fisher <- mvmapit_data$fisher
pairs <- mvmapit_data$exhaustive_search
thresh <- 0.05 / (nrow(fisher) / 2)
thresh <- 0.05 / nrow(fisher)
```


Expand All @@ -96,7 +96,7 @@ To control the type I error despite multiple testing, we recommend the conservat
The significant SNPs returned by the `mvMAPIT` analysis are shown in the output below. There are in total 6 significant SNPs after multiple test correction. Of the significant SNPs, 4 are true positives.

```{r significant_snps}
thresh <- 0.05 / (nrow(fisher) / 2)
thresh <- 0.05 / nrow(fisher)
significant_snps <- fisher %>%
filter(p < thresh) # Call only marginally significant SNPs
Expand Down Expand Up @@ -179,11 +179,11 @@ plot(tiles)
```

The only significant interactions after multiple testing correction are the interaction
between `snp00068` and `snp_00665` as well as `snp_00465` and `snp_00917`.
between `snp00068` and `snp_00665` as well as `snp_00469` and `snp_00917`.

```{r significant_exhaustive}
pairs %>%
filter(p_01 < 0.05/15 | p_02 < 0.05/15) %>%
filter(p_01 < 0.05/nrow(pairs) | p_02 < 0.05/nrow(pairs)) %>%
kable(., linesep = "", digits = 14) %>%
kable_material(c("striped"))
```
Expand Down

0 comments on commit 330288b

Please sign in to comment.