readFasta: Read FASTA File

Description Usage Arguments Details Value Examples

View source: R/utils.R

Description

Read nucleotide sequence files in FASTA format

Usage

1

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

1
2
3
4
5
6
7
8
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

bbl documentation built on Jan. 28, 2022, 1:07 a.m.