Skip to contents

Keep or remove selected sequences from ref_seq without changing the abundance matrix.

Usage

prune_ref_seq(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 sequences be kept? Defaults to TRUE.

Value

A microbiome_dataset object.

Examples

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

x <- prune_taxa(global_patterns, variable_id = global_patterns@variable_info$variable_id[1:120])
x <- microbiomedataset::convert2microbiome_dataset(
  microbiomedataset::convert2phyloseq(x)
)
#> Found more than one class "phylo" in cache; using the first, from namespace 'phyloseq'
#> Also defined by ‘tidytree’
#> Found more than one class "phylo" in cache; using the first, from namespace 'phyloseq'
#> Also defined by ‘tidytree’
#> Found more than one class "phylo" in cache; using the first, from namespace 'phyloseq'
#> Also defined by ‘tidytree’
#> Found more than one class "phylo" in cache; using the first, from namespace 'phyloseq'
#> Also defined by ‘tidytree’
x@ref_seq <- Biostrings::DNAStringSet(rep("ACGT", nrow(x@variable_info)))
names(x@ref_seq) <- x@variable_info$variable_id
x <- prune_ref_seq(x, variable_id = x@variable_info$variable_id[1:5])
length(x@ref_seq)
#> [1] 5