kMerIndex: kMerIndex function: Returns array index for given DNA k-mers.

Description Usage Arguments Details Value Author(s) Examples

View source: R/allStatics.r

Description

For each k, there exist $4^k$ DNA k-mers. Many functions inside this package return values where DNA k-mers appear as array indices. kMerIndex can be used for extraction of count values for special k-mers by provision of index values.

Usage

1
kMerIndex(kMers, k=nchar(kMers)[1], base=1)

Arguments

kMers

character. Vector of equal sized character strings. The number of characters in each string must be =k (i.e. all(nchar(kMers)==k))

k

integer. Length of k-mer.

base

integer. Value must be 0 or 1 (i.e. length(base)==1). For base=0 the returned index is 0-based (i.e. the index of the first k-mer (AAA..)) is 0. Otherwise the index is 1-based.

Details

Maximal allowed value for k is 12.

Value

integer.

Author(s)

Wolfgang Kaisers

Examples

1
2
3
kMerIndex(c("AACC", "ATAA"))
kMerIndex(c("AA","AC"), base=1)
kMerIndex(c("AA","AC"), base=0)

wokai/seqTools documentation built on May 4, 2019, 9:46 a.m.