Copyright | (c) Dominik Schrempf 2017 |
---|---|

License | GPLv3 |

Maintainer | dominik.schrempf@gmail.com |

Stability | unstable |

Portability | non-portable (not tested) |

Safe Haskell | None |

Language | Haskell2010 |

Calculate transition probability matrices, map rate matrices on trees, populate a tree with states according to a stationary distribution, etc.

The implementation of the Markov process is more than basic and can be improved in a lot of ways.

## Synopsis

- simulateNSitesAlongTree :: (PrimMonad m, Measurable a) => Int -> StationaryDistribution -> ExchangeabilityMatrix -> Tree a -> Gen (PrimState m) -> m (Tree [State])
- simulateAndFlattenNSitesAlongTree :: (PrimMonad m, Measurable a) => Int -> StationaryDistribution -> ExchangeabilityMatrix -> Tree a -> Gen (PrimState m) -> m [[State]]
- simulateNSitesAlongTreeMixtureModel :: (PrimMonad m, Measurable a) => Int -> Vector R -> [StationaryDistribution] -> [ExchangeabilityMatrix] -> Tree a -> Gen (PrimState m) -> m (Tree [State])
- simulateAndFlattenNSitesAlongTreeMixtureModel :: (PrimMonad m, Measurable a) => Int -> Vector R -> [StationaryDistribution] -> [ExchangeabilityMatrix] -> Tree a -> Gen (PrimState m) -> m [[State]]

# Single rate matrix.

simulateNSitesAlongTree :: (PrimMonad m, Measurable a) => Int -> StationaryDistribution -> ExchangeabilityMatrix -> Tree a -> Gen (PrimState m) -> m (Tree [State]) Source #

Simulate a number of sites for a given substitution model. Keep states at internal nodes. The result is a tree with the list of simulated states as node labels.

simulateAndFlattenNSitesAlongTree :: (PrimMonad m, Measurable a) => Int -> StationaryDistribution -> ExchangeabilityMatrix -> Tree a -> Gen (PrimState m) -> m [[State]] Source #

Simulate a number of sites for a given substitution model. Only the states at the leafs are retained. The states at internal nodes are removed. This has a lower memory footprint.

# Mixture models.

simulateNSitesAlongTreeMixtureModel :: (PrimMonad m, Measurable a) => Int -> Vector R -> [StationaryDistribution] -> [ExchangeabilityMatrix] -> Tree a -> Gen (PrimState m) -> m (Tree [State]) Source #

Simulate a number of sites for a given set of substitution models with
corresponding weights. Keep states at internal nodes. See also
`simulateNSitesAlongTree`

.

simulateAndFlattenNSitesAlongTreeMixtureModel :: (PrimMonad m, Measurable a) => Int -> Vector R -> [StationaryDistribution] -> [ExchangeabilityMatrix] -> Tree a -> Gen (PrimState m) -> m [[State]] Source #

Simulate a number of sites for a given set of substitution models with
corresponding weights. Forget states at internal nodes. See also
`simulateAndFlattenNSitesAlongTree`

.