get_counts_metadata | R Documentation |
Check whether the input object is a phyloseq or a TreeSummarizedExperiment, then extract the requested data slots.
get_counts_metadata(
object,
assay_name = "counts",
min_counts = 0,
min_samples = 0
)
object |
a phyloseq or TreeSummarizedExperiment object. |
assay_name |
the name of the assay to extract from the
TreeSummarizedExperiment object (default |
min_counts |
Parameter to filter taxa. Set this number to keep features
with more than |
min_samples |
Parameter to filter taxa. Set this number to keep
features with a |
a list
of results:
counts
the otu_table
slot or assayName
assay
of the phyloseq or TreeSummarizedExperiment object;
metadata
the sample_data
or colData
slot of
the phyloseq or TreeSummarizedExperiment object;
is_phyloseq
a boolean equal to TRUE
if the input is
a phyloseq object.
set.seed(1)
# Create a very simple phyloseq object
counts <- matrix(rnbinom(n = 60, size = 3, prob = 0.5), nrow = 10, ncol = 6)
metadata <- data.frame("Sample" = c("S1", "S2", "S3", "S4", "S5", "S6"),
"group" = as.factor(c("A", "A", "A", "B", "B", "B")))
ps <- phyloseq::phyloseq(phyloseq::otu_table(counts, taxa_are_rows = TRUE),
phyloseq::sample_data(metadata))
get_counts_metadata(ps)
# Or with a TreeSummarizedExperiment
tse <- TreeSummarizedExperiment::TreeSummarizedExperiment(
assays = list("counts" = counts), colData = metadata)
get_counts_metadata(tse)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.