KmerCount: K-mer counting

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/KmerCount.R

Description

Counting overlapping words of length K in DNA/RNA sequences.

Usage

1
KmerCount(sequences, K = 1, col.names = FALSE)

Arguments

sequences

Vector of sequences (text).

K

Word length (integer).

col.names

Logical indicating if the words should be added as columns names.

Details

For each input sequence, the frequency of every word of length K is counted. Counting is done with overlap. The counting itself is done by a C++ function.

With col.names=TRUE the K-mers are added as column names, but this makes the computations slower.

Value

A matrix with one row for each sequence in sequences and one column for each possible word of lengthK.

Author(s)

Kristian Hovde Liland and Lars Snipen.

See Also

multinomTrain, multinomClassify.

Examples

1
KmerCount("ATGCCTGAACTGACCTGC",K=2)

microclass documentation built on Aug. 28, 2020, 5:08 p.m.