Simulate a single sequence based from a Markov Model. These are referred to as simulated sequences and used compute the background rates and False Discovery Rates.
1 2 
object 
Markov Model 
nsim 
Length of the sequence to simulate. Can be a vector, in which case multiple sequences of the specified length will be simulated. 
seed 
A random number seed. Either 
pointer.only 
If 
... 
Not used; for S3 compatibility 
MS object containing a single sequence with nsim bases.
build.mm
for details on Markov models,
ms
for details on MS objects
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);
# Generate a sequence 1000 bases long using the supplied
# Markov Model and random numbers
v < simulate.ms(mm, 1000);

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.
All documentation is copyright its authors; we didn't write any of that.