tab2seq: Convert a table into a vector of sequences

Description Usage Arguments Value See Also Examples

View source: R/tab2seq.r

Description

Convert a data.frame or matrix into a vector of sequences. This is done by concatenating elements either row-wise (margin 1) or column-wise (margin 2).

Usage

1
tab2seq(x, margin = 1, na = c("N", "-", "?"))

Arguments

x

data.frame or matrix, symbols must have length 1

margin

optional whether rows (1) or columns (2) should be concatenated

na

optional substitute NA for a missing/unknown symbol.

Value

a vector of sequences

See Also

seq2tab to transform sequences into a table, read_fasta to read sequences from a fasta file, write_fasta to write sequences into a fasta file

Examples

1
2
3
mat = matrix(letters[1:4],2,2)
fasta = tab2seq(mat)
identical(fasta, c("ac", "bd"))

bioDS/phyloRNA documentation built on Feb. 21, 2022, 3:28 p.m.