diff --git a/losiRF/README.Rmd b/losiRF/README.Rmd index 99584c4..d2e3cc9 100644 --- a/losiRF/README.Rmd +++ b/losiRF/README.Rmd @@ -17,6 +17,7 @@ knitr::opts_chunk$set( # losiRF +[![R-CMD-check](https://github.com/Yu-Group/epistasis-cardiac-hypertrophy/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/Yu-Group/epistasis-cardiac-hypertrophy/actions/workflows/R-CMD-check.yaml) The losiRF R package provides tools to compute the local stability importances and p-values for features and interactions from a fitted random forest, as described in "Epistasis regulates genetic control of cardiac hypertrophy" by [Wang et al. (2024)](https://www.medrxiv.org/content/10.1101/2023.11.06.23297858v2). @@ -30,6 +31,12 @@ You can install the development version of losiRF from [GitHub](https://github.c remotes::install_github("Yu-Group/epistasis-cardiac-hypertrophy", subdir = "losiRF") ``` +This package has been tested on the following operating systems: + +- MacOS (latest release: 14.7) +- Windows (latest release: 10.0.20348) +- Ubuntu (latest release: 22.04.5) + ## Examples This is a basic example which shows you how to run the lo-siRF permutation test on simulated data: @@ -38,6 +45,12 @@ This is a basic example which shows you how to run the lo-siRF permutation test library(losiRF) set.seed(331) +# uncomment and install iRF (if not already installed) +# remotes::install_github("karlkumbier/iRF2.0") + +# time code +start_time <- Sys.time() + # simulate data n <- 1000 p <- 100 @@ -82,6 +95,9 @@ results$feature_stability_pvals # lo-siRF interaction importance results results$int_stability_pvals + +end_time <- Sys.time() - start_time +print(sprintf("Time taken: %.2f %s", end_time[[1]], attr(end_time, "units"))) ``` Note that in [Wang et al. (2024)](https://www.medrxiv.org/content/10.1101/2023.11.06.23297858v2), the lo-siRF importances and permutation tests involved additional steps and preprocessing that are not included in this basic example. These additional steps include data preprocessing and dimension reduction prior to fitting the iterative random forest, a thorough prediction check to ensure that the fitted forest is indeed an appropriate fit for the given data, the grouping of SNV *features* into gene *groups* (which can be specified using the `feature_groups` argument in `local_rf_stability_importance()`), and careful screening/filtering of the features (i.e., genes) and interactions prior to conducting the permutation test. We refer interested readers to the original paper ([Wang et al. (2024)](https://www.medrxiv.org/content/10.1101/2023.11.06.23297858v2)) for more details and the [01_lo-siRF/scripts/](./01_lo-siRF/scripts) folder for scripts to reproduce our original lo-siRF analysis. @@ -92,6 +108,12 @@ We also provide an example which includes screening/filtering of features and in library(losiRF) set.seed(331) +# uncomment and install iRF (if not already installed) +# remotes::install_github("karlkumbier/iRF2.0") + +# time code +start_time <- Sys.time() + # simulate data n <- 1000 p <- 100 @@ -154,6 +176,9 @@ results$feature_stability_pvals # lo-siRF interaction importance results results$int_stability_pvals + +end_time <- Sys.time() - start_time +print(sprintf("Time taken: %.2f %s", end_time[[1]], attr(end_time, "units"))) ``` diff --git a/losiRF/README.md b/losiRF/README.md index 77b1675..a7642dc 100644 --- a/losiRF/README.md +++ b/losiRF/README.md @@ -4,6 +4,8 @@ # losiRF + +[![R-CMD-check](https://github.com/Yu-Group/epistasis-cardiac-hypertrophy/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/Yu-Group/epistasis-cardiac-hypertrophy/actions/workflows/R-CMD-check.yaml) The losiRF R package provides tools to compute the local stability @@ -22,6 +24,12 @@ You can install the development version of losiRF from remotes::install_github("Yu-Group/epistasis-cardiac-hypertrophy", subdir = "losiRF") ``` +This package has been tested on the following operating systems: + +- MacOS (latest release: 14.7) +- Windows (latest release: 10.0.20348) +- Ubuntu (latest release: 22.04.5) + ## Examples This is a basic example which shows you how to run the lo-siRF @@ -31,6 +39,12 @@ permutation test on simulated data: library(losiRF) set.seed(331) +# uncomment and install iRF (if not already installed) +# remotes::install_github("karlkumbier/iRF2.0") + +# time code +start_time <- Sys.time() + # simulate data n <- 1000 p <- 100 @@ -137,6 +151,10 @@ results$int_stability_pvals #> 15 V12-_V91- 0.518 -0.000116 #> 16 V39-_V47- 0.284 0.000875 #> 17 V30-_V47- 0.273 -0.00116 + +end_time <- Sys.time() - start_time +print(sprintf("Time taken: %.2f %s", end_time[[1]], attr(end_time, "units"))) +#> [1] "Time taken: 5.74 mins" ``` Note that in [Wang et @@ -164,6 +182,12 @@ below: library(losiRF) set.seed(331) +# uncomment and install iRF (if not already installed) +# remotes::install_github("karlkumbier/iRF2.0") + +# time code +start_time <- Sys.time() + # simulate data n <- 1000 p <- 100 @@ -266,4 +290,8 @@ results$int_stability_pvals #> 4 V3+_V4+ 0 0.298 #> 5 V1+_V3+ 0 0.186 #> 6 V1+_V2+ 0 0.197 + +end_time <- Sys.time() - start_time +print(sprintf("Time taken: %.2f %s", end_time[[1]], attr(end_time, "units"))) +#> [1] "Time taken: 3.81 mins" ```