View source: R/phyloseq_mult_raref.R
phyloseq_mult_raref | R Documentation |
This function will resample an OTU table such that all samples have the same library size. Resampling will be performed multiple times.
phyloseq_mult_raref(
x,
SampSize = NULL,
MinSizeThreshold = NULL,
iter = 1000,
replace = F,
multithread = F,
seeds = NULL,
...
)
x |
A phyloseq-class object |
SampSize |
Rarefaction depth (number of reads to sample) |
MinSizeThreshold |
Remove samples with number of reads less than this threshold |
iter |
Number of rarefication iterations |
replace |
Logical, whether to sample with replacement (TRUE) or without replacement (FALSE, default) |
multithread |
Logical or integer; if TRUE, attempts to run the function on multiple cores; integer defines the number of cores to use (if it is set to TRUE, all cores will be used) |
seeds |
Integer vector used for the reproducible random subsampling (should be of the same length as the number of iterations) |
... |
Additional arguments will be passed to |
If the sample size ('SampSize') is not specified, rarefaction will be made for the depth equeal to 0.9 * minimal observed sample size.
By default, sampling is performed without replacement ('replace = FALSE'), which differs from the default behaviour of rarefy_even_depth
.
List of rarefied phyloseq-objects.
rarefy_even_depth
data("esophagus")
eso_raref <- phyloseq_mult_raref(esophagus, iter = 10)
# Discard samples with number of reads < 210 and perform resampling with replacement
eso_raref_t <- phyloseq_mult_raref(esophagus, replace = T, MinSizeThreshold = 210, SampSize = 210, iter = 10)
sample_sums(esophagus)
sample_sums(eso_raref_t[[1]])
# Do not remove OTUs from the dataset that are no longer observed in any sample (have a count of zero in every sample)
phyloseq_mult_raref(esophagus, trimOTUs = F, replace = T, MinSizeThreshold = 210, SampSize = 210, iter = 10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.