Learn R Programming

tcR (version 2.2.4)

generate.kmers: Generate k-mers.

Description

Generate all k-mers. starting with the given sequence on the given alphabet Generate k-mers with the given k and probabilities of nucleotides next to each other (markov chain).

Usage

generate.kmers(.k, .seq = '', .alphabet = c('A', 'C', 'G', 'T'))

generate.kmers.prob(.k, .probs, .count = 1, .alphabet = c('A', 'C', 'G', 'T'), .last.nucl = 'X')

Arguments

.k

Size of k-mers or either integer or vector with k-s for generate.kmers.prob.

.seq

Prefix of all generated k-mers.

.alphabet

Alphabet.

.probs

Matrix with probabilities for generating adjacent symbol with |alphabet| X |alphabet| size. Order of letters is given in the .alphabet parameter.

.count

Number of kmers to be generated.

.last.nucl

Adjacent nucleotide from which start generation. If 'X' than choose one of the nucleotides with equal probabilities.

Value

Vector of all possible k-mers for generate.kmers or a vector of generated kmers for generate.kmers.prob.