Set ref_seq on a microbiome_dataset and optionally align it with the
current dataset.
Arguments
- object
A
microbiome_datasetobject.- value
A
Biostrings::XStringSetobject orNULL.- align
Should the sequences be aligned after replacement? Defaults to
TRUE.
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
