-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
93 lines (68 loc) · 3.72 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# dar <a href="https://microbialgenomics-irsicaixaorg.github.io/dar/"><img src="man/figures/logo.png" align="right" height="138" /></a>
<!-- badges: start -->
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)
[![R-CMD-check](https://github.com/MicrobialGenomics-IrsicaixaOrg/dar/workflows/R-CMD-check-bioc/badge.svg)](https://github.com/MicrobialGenomics-IrsicaixaOrg/dar/actions)
[![Codecov test coverage](https://codecov.io/gh/MicrobialGenomics-IrsicaixaOrg/dar/branch/devel/graph/badge.svg)](https://app.codecov.io/gh/MicrobialGenomics-IrsicaixaOrg/dar?branch=devel)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://makeapullrequest.com)
[![GitHub issues](https://img.shields.io/github/issues/MicrobialGenomics-IrsicaixaOrg/dar)](https://github.com/MicrobialGenomics-IrsicaixaOrg/dar/issues)
[![GitHub pulls](https://img.shields.io/github/issues-pr/MicrobialGenomics-IrsicaixaOrg/dar)](https://github.com/MicrobialGenomics-IrsicaixaOrg/dar/pulls)
<!-- badges: end -->
## Introduction
Differential abundance testing in microbiome data challenges both parametric
and non-parametric statistical methods, due to its sparsity, high variability
and compositional nature. Microbiome-specific statistical methods often assume
classical distribution models or take into account compositional specifics.
These produce results that range within the specificity vs sensitivity space
in such a way that type I and type II error are difficult to ascertain in real
microbiome data when a single method is used. Recently, a consensus approach
based on multiple differential abundance (DA) methods was recently suggested
in order to increase robustness.
With dar, you can use dplyr-like pipeable sequences of DA methods and then
apply different consensus strategies. In this way we can obtain more reliable
results in a fast, consistent and reproducible way.
## Installation
You can install the development version of dar from [GitHub](https://github.com/) with:
```{r eval=FALSE}
# install.packages("devtools")
devtools::install_github("MicrobialGenomics-IrsicaixaOrg/dar")
```
## Usage
```{r}
library(dar)
data("metaHIV_phy")
## Define recipe
rec <-
recipe(metaHIV_phy, var_info = "RiskGroup2", tax_info = "Species") %>%
step_subset_taxa(expr = 'Kingdom %in% c("Bacteria", "Archaea")') %>%
step_filter_taxa(.f = "function(x) sum(x > 0) >= (0.03 * length(x))") %>%
step_metagenomeseq(rm_zeros = 0.01) %>%
step_maaslin()
rec
## Prep recipe
da_results <- prep(rec, parallel = TRUE)
da_results
## Consensus strategy
n_methods <- 2
da_results <- bake(da_results, count_cutoff = n_methods)
da_results
## Results
cool(da_results)
```
## Contributing
- If you think you have encountered a bug, please [submit an issue](https://github.com/MicrobialGenomics-IrsicaixaOrg/dar/issues).
- Either way, learn how to create and share a [reprex](https://reprex.tidyverse.org/articles/articles/learn-reprex.html) (a minimal, reproducible example), to clearly communicate about your code.
- Working on your first Pull Request? You can learn how from this *free* series [How to Contribute to an Open Source Project on GitHub](https://kcd.im/pull-request)
## Code of Conduct
Please note that the dar project is released with a [Contributor Code of Conduct](https://contributor-covenant.org/version/2/0/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms.