kmerFrequenciesToMarkov: Compute the parameters of a Markov model (transition matrix)...

Description Usage Arguments Details Value Author(s) Examples

Description

Compute a transition matrix from a list of k-mer occurrences.

Usage

1
kmerFrequenciesToMarkov(kmer.seq, kmer.occ, alphabet = c("A", "C", "G", "T"))

Arguments

kmer.seq

A vector of k-mer sequences.

kmer.occ

A vector of the same length as seq.

alphabet

Exhaustive list of residues to take in consideration as suffixes for the transition matrix.

Details

First version: 2003-09 Last modification: 2015-02

Value

A list with the parameters of the model (k, m) + the transition matrix.

Author(s)

Jacques van Helden (Jacques.van-Helden@univ-amu.fr)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Compute Markov model from dinucleotide occurrences measures in Escherichia coli genome
org <- "Escherichia_coli_K12"
k <- 3
freq.file.path <- file.path("markov_models", org, paste(sep="", k, "nt_genomic_",org,"-1str-ovlp.freq.gz"))
freq.file <- system.file("extdata", freq.file.path, package = "stats4bioinfo")
message("Loading k-mer frequency file", freq.file)
freq.table <- read.delim(freq.file, row.names = 1, comment.char=";")
head(freq.table)
tail(freq.table)
markov.model <- kmerFrequenciesToMarkov(
    kmer.seq = freq.table$id, 
    kmer.occ = freq.table$occ)
transitions <- markov.model[["transition"]]
heatmap.simple(round(digits=3, as.matrix(transitions)),main=org, zlim=c(0,1))

jvanheld/stats4bioinfo documentation built on May 20, 2019, 5:16 a.m.