Skip to contents

Remove taxa from a microbiome_dataset while keeping expression_data, variable_info, otu_tree, taxa_tree, and ref_seq synchronized.

Usage

prune_taxa(object, variable_id, variable_index, keep = TRUE)

Arguments

object

A microbiome_dataset object.

variable_id

Variable identifiers to keep or remove.

variable_index

Variable indices to keep or remove.

keep

Should the provided taxa be kept? Defaults to TRUE.

Value

A microbiome_dataset object.

Examples

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

keep_taxa <- global_patterns@variable_info$variable_id[1:5]
x <- prune_taxa(global_patterns, variable_id = keep_taxa)
dim(x@expression_data)
#> [1]  5 26