Description Usage Arguments Value Note Author(s) Examples
Simulates a multiple sequence alignment of specified length. Deals with base-substitution only, not indels. If one tree model is given, simply simulates a sequence from this model. If an HMM is provided, then the mod parameter should be a list of tree models with the same length as the number of states in the HMM.
1 2 3 |
object |
An object of type |
nsim |
The number of columns in the simulated alignment. |
seed |
A random number seed. Either |
hmm |
an object of type HMM describing transitions between the tree models across the columns of the alignment. |
get.features |
(For use with hmm). If |
pointer.only |
(Advanced use only). If TRUE, return only a pointer to the simulated alignment. Possibly useful for very (very) large alignments. |
... |
Currently not used (for S3 compatibility) |
An object of type MSA containing the simulated alignment.
Currently only supports HMMs in which the models for each state have the same topologies.
Melissa J. Hubisz and Adam Siepel
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | filename <- "rev.mod"
exampleArchive <- system.file("extdata", "examples.zip", package="rphast")
unzip(exampleArchive, filename)
m <- matrix(nrow=3, ncol=3)
m[1,] <- c(1,2,3)
m[2,] <- c(1,5,10)
m[3,] <- c(10,4,2)
eq.freq <- c(1,2,3)
h <- hmm(m, eq.freq)
mod <- read.tm(filename)
mod2 <- mod
mod2$backgd <- rep(0.25, 4)
mod3 <- mod
mod3$backgd <- c(0.6, 0.1, 0.2, 0.1)
m <- simulate.msa(mod, 20)
m <- simulate.msa(list(mod, mod2, mod3), 20, hmm=h)
m <- matrix(1, nrow=3, ncol=3)
h <- hmm(m)
l <- simulate.msa(list(mod, mod2, mod3), 100, get.features=TRUE, hmm=h)
names(l)
l$msa
l$feats
coverage.feat(l$feats[l$feats$feature=="state1",])
unlink(filename)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.