Skip to contents

Set ref_seq on a microbiome_dataset and optionally align it with the current dataset.

Usage

replace_ref_seq(object, value = NULL, align = TRUE)

Arguments

object

A microbiome_dataset object.

value

A Biostrings::XStringSet object or NULL.

align

Should the sequences be aligned after replacement? Defaults to TRUE.

Value

A microbiome_dataset object.

Examples

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

x0 <- prune_taxa(global_patterns, variable_id = global_patterns@variable_info$variable_id[1:80])
x <- microbiomedataset::convert2microbiome_dataset(
  microbiomedataset::convert2phyloseq(x0)
)
#> 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’
ref_seq <- Biostrings::DNAStringSet(rep("ACGT", nrow(x@variable_info)))
x <- replace_ref_seq(x, value = ref_seq)
length(x@ref_seq)
#> [1] 80