write.fasta {LocaTT}R Documentation

Write FASTA Files

Description

Writes FASTA files.

Usage

write.fasta(names, sequences, file)

Arguments

names

A character vector of sequence names.

sequences

A character vector of sequences.

file

A string specifying the path to a FASTA file to write.

Value

No return value. Writes a FASTA file.

See Also

read.fasta for reading FASTA files.
write.fastq for writing FASTQ files.
read.fastq for reading FASTQ files.

Examples

# Get path to example sequences CSV file.
path_to_CSV_file<-system.file("extdata",
                              "example_query_sequences.csv",
                              package="LocaTT",
                              mustWork=TRUE)

# Read the example sequences CSV file.
df<-read.csv(file=path_to_CSV_file,stringsAsFactors=FALSE)

# Create a temporary file path for the FASTA file to write.
path_to_FASTA_file<-tempfile(fileext=".fasta")

# Write the example sequences as a FASTA file.
write.fasta(names=df$Name,
            sequences=df$Sequence,
            file=path_to_FASTA_file)

[Package LocaTT version 1.1.1 Index]