Skip to contents

Summarize a microbiome_dataset at a chosen taxonomy rank and then apply a count transformation to the aggregated abundance matrix.

Usage

transform_taxa(
  object,
  taxonomic_rank = c("Kingdom", "Phylum", "Class", "Order", "Family", "Genus", "Species"),
  what = c("sum_intensity", "mean_intensity", "median_intensity"),
  method = c("relative", "log", "presence_absence", "clr"),
  pseudocount = 1,
  na_remove = TRUE,
  ...
)

Arguments

object

A microbiome_dataset object.

taxonomic_rank

Taxonomic rank used for summarization.

what

Aggregation method used before transformation.

method

Transformation method.

pseudocount

A pseudocount added before transformations that require strictly positive values.

na_remove

Should taxa with missing rank be removed before summarization?

...

Other parameters passed to transform_counts().

Value

A transformed microbiome_dataset object.

Examples

data("global_patterns", package = "microbiomedataset")

x0 <- prune_taxa(global_patterns, variable_id = global_patterns@variable_info$variable_id[1:200])
x <- transform_taxa(
  object = x0,
  taxonomic_rank = "Genus",
  what = "sum_intensity",
  method = "relative"
)
attr(x@expression_data, "transform_method")
#> [1] "relative"