Learn R Programming

bbl (version 0.1.5)

read.fasta: Read FASTA file

Description

Read nucleotide sequence files in FASTA format

Usage

read.fasta(file, rownames = FALSE)

Arguments

file

File name of FASTA input.

rownames

Use the sequence annotation line in file (starts with '>') as the row names. Will fail if there are duplicate items.

Value

Data frame of each sequence in rows.

Details

Sequence data in FASTA files are converted into data frame suitable as input to bbl. If sequence lengths are different, instances longer than those already read will be truncated. Empty sequences are skipped.

Examples

Run this code
# NOT RUN {
file <- tempfile('data')
write('>seq1', file)
write('atgcc', file, append=TRUE)
write('>seq2', file, append=TRUE)
write('gccaa', file, append=TRUE)
system(paste0('cat ',file))
x <- read.fasta(file)
x
# }

Run the code above in your browser using DataLab