build.mm: Build Markov Model to represent sequences in an MS object

Description Usage Arguments Value See Also Examples

View source: R/tfbs.R

Description

Build a Markov Model of user specified order to represent sequences in an MS object.

Usage

1
build.mm(ms, order, pseudoCount = 0, considerReverse = FALSE)

Arguments

ms

Sequence used to build Markov Model

order

Order of Markov model to build; ie, the number of preceding bases to consider when calculating the probability of a given base.

pseudoCount

(Optional) Integer added to the number of observed cases of each possible sequence pattern.

considerReverse

(Optional) Logical value. If TRUE, considers reverse complement frequencies in addition to forward strand frequencies when building model.

Value

A list of matrices, each representing a markov model from order 0, 1, ..., order. Each matrix gives the probability of observing a particular base (column) given the preceding bases (row).

See Also

read.ms split.ms groupByGC.ms

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
require("rtfbs")
exampleArchive <- system.file("extdata", "NRSF.zip", package="rtfbs")
seqFile <- "input.fas"
unzip(exampleArchive, seqFile)
# Read in FASTA file "input.fas" from the examples into an 
#   MS (multiple sequences) object
ms <- read.ms(seqFile)
# Build a 3rd order Markov Model to represent the sequences
#   in the MS object "ms".  The Model will be a list of
#   matrices  corrisponding in size to the order of the 
#   Markov Model
mm <- build.mm(ms, 3);
# Print the list of 4 Markov Matrices that make up the 
#   Markov Model 
print(mm)

rtfbs documentation built on May 19, 2017, 1:53 p.m.

Search within the rtfbs package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs in the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.