kMerIndex:
kMerIndex function: Returns array index for given DNA k-mers.
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
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.