Write ref_seq from a microbiome_dataset to a FASTA file for use in
external tools.
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)
fasta_file <- tempfile(fileext = ".fasta")
export_ref_seq(x, fasta_file)
file.exists(fasta_file)
#> [1] TRUE
