read_fasta: Read (write) FASTA sequences into (from) named character...

View source: R/read_fasta.R

read_fastaR Documentation

Read (write) FASTA sequences into (from) named character vectors

Description

read_fasta reads sequences in FASTA format in named character vectors. write_fasta writes sequences stored as named character vectors into FASTA file.

Usage

read_fasta(file)

write_fasta(x, file)

Arguments

file

FASTA format file

x

Named characters

Details

Names of sequences to be written do not have to begin with the greater-than sign, as they are appended by the function when writing. Similarly, the read_fasta removes the leading greater-than sign of sequence names.

Value

For read_fasta, a named character vector of FASTA sequences.

For write_fasta, the side effect is used and no value is returned.

Author(s)

Jitao David Zhang <jitao_david.zhang@roche.com>

Examples


tmpfile <- tempfile()
test.seq <- c("mySeq1"="ATGCG", "mySeq2 correct"="TTGTTCGACGT")
write_fasta(test.seq, tmpfile)
read_fasta(tmpfile)


ribiosIO documentation built on Feb. 20, 2026, 5:09 p.m.