write_fasta {phylotypr} | R Documentation |
Write to a FASTA-formatted file
Description
Writes a data frame containing id, sequence, and comment columns,
write_fasta
will write the data frame out to a
standard FASTA-formatted file.
The header will have a tab character between the sequence id and any
comments. There won't be a tab if there's no comment for the sequence. All
sequence data will be on a single line
Usage
write_fasta(data_frame, file = NULL)
Arguments
data_frame |
A data frame object with three columns. The |
file |
Either a path to a file, a connection, or literal data (either a single string or a raw vector) to write to a standard FASTA formatted file. There are no checks to determine whether the data are DNA or amino acid sequences. Files ending in .gz, .bz2, .xz, or .zip will be automatically compressed.
Files starting with If the value of |
Value
Sequence data is either written out to the screen (file = NULL
) or to a
file.
Examples
df_d <- data.frame(
id = c("seqA", "seqB", "seqC"),
sequence = c("ATGCATGC", "ATGCATGA", "ATGCATGT"),
comment = c("comment 1", "", "comment 3")
)
string_d <- write_fasta(df_d)