list2matrix: Convert list of sequences to matrix

Description Usage Arguments Value Note Examples

View source: R/seq2matrix.R

Description

Converts list of sequences to matrix.

Usage

1
list2matrix(seq_list)

Arguments

seq_list

list of sequences (e.g. as returned by the read.fasta function).

Value

A matrix with the number of rows equal to the number of sequences and the number of columns equal to the length of the longest sequence.

Note

Since matrix must have specified number of columns, ends of shorter sequences are completed with NAs.

Examples

1
2
3
list2matrix(list(s1 = c("c", "g", "g", "t"),
                 s2 = c("g", "t", "c", "t", "t", "g"),
                 s3 = c("a", "a", "t")))

biogram documentation built on March 31, 2020, 5:14 p.m.