aldex | R Documentation |
aldex
ObjectWelcome to the ALDEx2
package!
The aldex
function is a wrapper that performs log-ratio transformation
and statistical testing in a single line of code. Specifically, this function:
(a) generates Monte Carlo samples of the Dirichlet distribution for each sample,
(b) converts each instance using a log-ratio transform, then (c) returns test
results for two sample (Welch's t, Wilcoxon) or multi-sample (glm, Kruskal-Wallace)
tests. This function also estimates effect size for two sample analyses.
aldex(
reads,
conditions,
mc.samples = 128,
test = "t",
effect = TRUE,
CI = FALSE,
include.sample.summary = FALSE,
verbose = FALSE,
paired.test = FALSE,
denom = "all",
iterate = FALSE,
gamma = NULL,
...
)
reads |
A non-negative, integer-only |
conditions |
A character vector. A description of the data structure used
for testing. Typically, a vector of group labels. For |
mc.samples |
An integer. The number of Monte Carlo samples to use when estimating the underlying distributions. Since we are estimating central tendencies, 128 is usually sufficient. |
test |
A character string. Indicates which tests to perform. "t" runs
Welch's t and Wilcoxon tests. "kw" runs Kruskal-Wallace and glm tests.
"glm" runs a generalized linear model using a |
effect |
A boolean. Toggles whether to calculate abundances and effect sizes. |
CI |
A boolean. Toggles whether to calculate effect size confidence intervals
Applies to |
include.sample.summary |
A boolean. Toggles whether to include median clr
values for each sample. Applies to |
verbose |
A boolean. Toggles whether to print diagnostic information while
running. Useful for debugging errors on large datasets. Applies to
|
paired.test |
A boolean. Toggles whether to do paired-sample tests.
Applies to |
denom |
A character string. Indicates which features to retain as the denominator for the Geometric Mean calculation. Using "iqlr" accounts for data with systematic variation and centers the features on the set features that have variance that is between the lower and upper quartile of variance. Using "zero" is a more extreme case where there are many non-zero features in one condition but many zeros in another. In this case the geometric mean of each group is calculated using the set of per-group non-zero features. |
iterate |
A boolean. Toggles whether to iteratively perform a test. For example, this will use the results from an initial "t" routine to seed the reference (i.e., denominator of Geometric Mean calculation) for a second "t" routine. |
gamma |
A numeric. The standard deviation on the within sample variation. |
... |
Arguments to embedded method (e.g., |
See "Examples" below for a description of the sample input.
Returns a number of values that depends on the set of options. See the return values of aldex.ttest, aldex.kw, aldex.glm, and aldex.effect for explanations and examples.
Greg Gloor, Andrew Fernandes, and Matt Links contributed to the original package. Thom Quinn added the "glm" test method, the "corr" test method, and the "iterate" procedure. Michelle Pistner Nixon and Justin Silverman contributed the scale and PPP routines
Please use the citation given by
citation(package="ALDEx2")
.
aldex
,
aldex.clr
,
aldex.ttest
,
aldex.kw
,
aldex.glm
,
aldex.effect
,
aldex.corr
,
selex
# The 'reads' data.frame should have row
# and column names that are unique, and
# looks like the following:
#
# T1a T1b T2 T3 N1 N2 Nx
# Gene_00001 0 0 2 0 0 1 0
# Gene_00002 20 8 12 5 19 26 14
# Gene_00003 3 0 2 0 0 0 1
# Gene_00004 75 84 241 149 271 257 188
# Gene_00005 10 16 4 0 4 10 10
# Gene_00006 129 126 451 223 243 149 209
# ... many more rows ...
data(selex)
selex <- selex[1201:1600,] # subset for efficiency
conds <- c(rep("NS", 7), rep("S", 7))
x <- aldex(selex, conds, mc.samples=2, denom="all",
test="t", effect=TRUE, paired.test=FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.