reflect.phylo.hmm: Reflect a phylo-hmm across a strand

Description Usage Arguments Value Author(s) Examples

View source: R/hmm.R

Description

Reflect a phylo-hmm across a strand

Usage

1
reflect.phylo.hmm(x, pivot.states, mods = NULL)

Arguments

x

An object of type hmm

pivot.states

The list of states to "reflect" across; these should be the states that are not strand-specific. Can be an integer vector containing state indices, or a character vector corresponding to state names (in row.names(x$trans.mat))

mods

A list of objects of type tm representing phylogenetic models corresponding to each state in the hmm. If given, then the models will also be reflected and the return value will be a list with a new hmm and a new list of models.

Value

If mods==NULL then a new hmm will be returned. Otherwise a list containing the new hmm and the corresponding models will be returned.

Author(s)

Melissa J. Hubisz and Adam Siepel

Examples

1
2
3
4
5
6
7
8
9
#state.names <- c("neutral", "conserved", "codon1", "codon2", "codon3")
#h <- hmm(t(matrix(c(0.95, 0.04, 0.01, 0, 0, 
#                    0.04, 0.95, 0.01, 0, 0,
#                    0,    0,    0,    1, 0,
#                    0,    0,    0,    0, 1,
#                    0.005, 0.005,  0.99,   0, 0), nrow=5,
#                  dimnames=list(state.names, state.names))))
#         eq.freq=c(0.6, 0.3, 0.1/3, 0.1/3, 0.1/3))
#reflect.phylo.hmm(h, c("neutral", "conserved"))

rphast documentation built on May 1, 2019, 9:26 p.m.