View source: R/process_filter_abundance.R
filter_abundance | R Documentation |
whether to filter the low relative abundance or unclassified feature by the threshold. Here, we choose the following criterion:
Feature more than Mean absolute or relative abundance across all samples;
Feature more than Minimum absolute or relative abundance at least one sample.
filter_abundance(
object,
level = c(NULL, "Kingdom", "Phylum", "Class",
"Order", "Family", "Genus",
"Species", "Strain", "unique"),
cutoff_mean = c(100, 1e-04, 2),
cutoff_one = c(1000, 1e-03, 3),
unclass = TRUE)
object |
(Required). a |
level |
(Optional). character. taxonomic level to summarize,
default the top level rank of the |
cutoff_mean |
(Optional). numeric. Threshold for Mean
absolute (integer) or relative (float) abundance all samples (default, |
cutoff_one |
(Optional). numeric. Threshold for Minimum
absolute (integer) or relative (float) abundance at least one sample (default, |
unclass |
(Optional). logical. whether to filter the unclassified taxa (default |
a phyloseq::phyloseq
or
SummarizedExperiment::SummarizedExperiment
object,
where each row represents a feature and each col represents the
feature abundance of each sample.
Created by Hua Zou (11/30/2021 Shenzhen China)
Thingholm, Louise B., et al. "Obese individuals with and without type 2 diabetes show different gut microbial functional capacity and composition." Cell host & microbe 26.2 (2019): 252-264.
## Not run:
# phyloseq object
data("Zeybel_2022_gut")
Zeybel_2022_gut_counts <- phyloseq::transform_sample_counts(
Zeybel_2022_gut, function(x) {round(x * 10^7)})
# absolute abundance
ps <- filter_abundance(
object = Zeybel_2022_gut_counts,
level = NULL,
cutoff_mean = 100,
cutoff_one = 1000,
unclass = FALSE)
# relative abundance
ps <- filter_abundance(
object = Zeybel_2022_gut,
level = "Phylum",
cutoff_mean = 1e-04,
cutoff_one = 1e-03,
unclass = TRUE)
# SummarizedExperiment object
data("Zeybel_2022_protein")
filter_abundance(
object = Zeybel_2022_protein,
cutoff_mean = 5,
cutoff_one = 8)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.