readFasta {bbl}R Documentation

Read FASTA File

Description

Read nucleotide sequence files in FASTA format

Usage

readFasta(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.

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.

Value

Data frame of each sequence in rows.

Examples

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 <- readFasta(file)
x

[Package bbl version 1.0.0 Index]