Count the number of character in sequences

seq_nchar(x, gaps = TRUE)

Arguments

x

a DNA, RNA or AA vector.

gaps

if FALSE gaps are ignored.

Value

An integer vector giving the size of each sequence of x.

See also

Examples


x <- dna(c("ATGCAGA", "GGR-----","TTGCCTAGKTGAACC"))
seq_nchar(x)
#> [1]  7  8 15
seq_nchar(x, gaps = FALSE)
#> [1]  7  3 15