https://github.com/fxia22/radafdr
R port of adafdr
https://github.com/fxia22/radafdr
Last synced: 3 months ago
JSON representation
R port of adafdr
- Host: GitHub
- URL: https://github.com/fxia22/radafdr
- Owner: fxia22
- Created: 2019-04-05T22:48:23.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-05-15T07:11:58.000Z (about 6 years ago)
- Last Synced: 2025-01-13T00:28:57.151Z (5 months ago)
- Language: R
- Size: 114 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# R API of adaFDR
[](https://badge.fury.io/gh/martinjzhang%2Fadafdr) [](https://badge.fury.io/py/adafdr)
## InstallationFirst, install [adafdr](https://github.com/martinjzhang/adafdr) and put it in a virtual environment or anaconda environment(recommended). In the installation script, it assumes you use an anaconda environment called `py36`. You can change it to your virtual environment name in `install.R`.
Then install the R package for wrapper functions.
Dependency: `reticulate`
```
git clone https://github.com/fxia22/RadaFDR.git
Rscript ./RadaFDR/install.R
```Or install from github:
```
install.packages("devtools")
library(devtools)
install_github("fxia22/RadaFDR")
```## Functions
The R API contains 3 functions and some data loaders. They produce the same results as their python counterparts.```
adafdr_test: function(p_input, x_input, K=5, alpha=0.1, n_itr=1500, qt_norm=TRUE, verbose=FALSE,
output_folder=NULL, random_state=0L, single_core=TRUE, fast_mode=TRUE,
n_full=NULL, covariate_type=NULL, h=NULL)
adafdr_retest: function(res_adafdr, alpha=0.1, n_full=NULL, output_folder=NULL)
adafdr_explore: function(p_input, x_input, alpha=0.1, output_folder=NULL, n_full=NULL,
covariate_type=NULL, h=NULL, vis_dim=NULL)
````adafdr_test` runs AdaFDR as described in the paper, `adafdr_retest` retest a set of hypothesis with a different threshold.
`adafdr_explore` visualize the features and save it to a folder.For input format:
- `p_input` is (n,) matrix.
- `x_input` is (n, d) matrix.
- `res_adafdr` is the output of 'adafdr_test'.## Running
See `vignettes/scripts/adafdr_example_airway.R` for an example.