Save Sequence

saveSequence(x, file = NULL)

Arguments

x

Either a phyloseq object with refseq information or a object of class DNAStringSet.

file

File name with extension ".fasta" or ".fa", e.g. 'myseqs.fasta' or file path where you wish to save the output fasta e.g. 'mypath/myseqs.fasta'. As a fail safe, default is NULL which returns an error.

Value

A fasta file saved in user specified location

Details

Saves sequences either from a DNAStringSet or refseq slot phyloseq object. If taxa_names is sequences, use 'add_refseq' function from microbiomeutilties before using this function.

Author

Sudarshan A. Shetty

Examples


# data("SprockettTHData")
# ps <- SprockettTHData
# seq_id <- c("ASV_30_Lachnospiraceae", "ASV_451_UC5-1-2E3", "ASV_586_CAG-56")

# saveSequence(ps,
#             file="inst/extras/sequences.fasta")