Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Tiffany Tang committed Nov 12, 2024
1 parent 0bdb9f4 commit 2921f1a
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
25 changes: 25 additions & 0 deletions losiRF/README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ knitr::opts_chunk$set(
# losiRF

<!-- badges: start -->
[![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)
<!-- badges: end -->

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).
Expand All @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -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.
Expand All @@ -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
Expand Down Expand Up @@ -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")))
```


Expand Down
28 changes: 28 additions & 0 deletions losiRF/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
# losiRF

<!-- badges: start -->

[![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)
<!-- badges: end -->

The losiRF R package provides tools to compute the local stability
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -137,6 +151,10 @@ results$int_stability_pvals
#> 15 V12-_V91- 0.518 -0.000116 <dbl [10,000]>
#> 16 V39-_V47- 0.284 0.000875 <dbl [10,000]>
#> 17 V30-_V47- 0.273 -0.00116 <dbl [10,000]>

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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -266,4 +290,8 @@ results$int_stability_pvals
#> 4 V3+_V4+ 0 0.298 <dbl [10,000]>
#> 5 V1+_V3+ 0 0.186 <dbl [10,000]>
#> 6 V1+_V2+ 0 0.197 <dbl [10,000]>

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"
```

0 comments on commit 2921f1a

Please sign in to comment.