transform_sample_counts: Transform abundance data in an 'otu_table', sample-by-sample

View source: R/transform-filter.R

transform_sample_countsR Documentation

Transform abundance data in an otu_table, sample-by-sample

Description

Version of phyloseq::transform_sample_counts() that allows a purrr-style anonymous function.

Usage

transform_sample_counts(physeq, fun, ...)

Arguments

physeq

phyloseq-class() or ape::phylo().

fun

A function or formula that can be converted to a function by purrr::as_mapper()

...

Additional arguments passed on to fun

Details

This function simply calls purrr::as_mapper() on fun and passes the resulting function on to phyloseq::transform_sample_counts().

See Also

phyloseq::transform_sample_counts() purrr::as_mapper()

Examples

data(GlobalPatterns)
# Filter low prevalence taxa, then convert to proportions
gp.prop <- GlobalPatterns %>%
  filter_taxa2(~ sum(. > 0) > 5) %>%
  transform_sample_counts(~ . / sum(.))

mikemc/speedyseq documentation built on April 22, 2024, 6:40 p.m.