Copyright | 2021 Dominik Schrempf |
---|---|
License | GPLv3 |
Maintainer | dominik.schrempf@gmail.com |
Stability | unstable |
Portability | non-portable (not tested) |
Safe Haskell | Safe-Inferred |
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
- simulate :: StatefulGen g m => Int -> StationaryDistribution -> ExchangeabilityMatrix -> Tree Double -> g -> m (Tree [State])
- simulateAndFlatten :: StatefulGen g m => Int -> StationaryDistribution -> ExchangeabilityMatrix -> Tree Double -> g -> m [[State]]
- simulateAndFlattenPar :: RandomGen g => Int -> StationaryDistribution -> ExchangeabilityMatrix -> Tree Double -> IOGenM g -> IO [[State]]
- simulateMixtureModel :: StatefulGen g m => Int -> Vector Double -> Vector StationaryDistribution -> Vector ExchangeabilityMatrix -> Tree Double -> g -> m (Tree [State])
- simulateAndFlattenMixtureModel :: StatefulGen g m => Int -> Vector Double -> Vector StationaryDistribution -> Vector ExchangeabilityMatrix -> Tree Double -> g -> m ([Int], [[State]])
- simulateAndFlattenMixtureModelPar :: RandomGen g => Int -> Vector Double -> Vector StationaryDistribution -> Vector ExchangeabilityMatrix -> Tree Double -> IOGenM g -> IO ([Int], [[State]])
Single rate matrix.
simulate :: StatefulGen g m => Int -> StationaryDistribution -> ExchangeabilityMatrix -> Tree Double -> g -> 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.
simulateAndFlatten :: StatefulGen g m => Int -> StationaryDistribution -> ExchangeabilityMatrix -> Tree Double -> g -> 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.
simulateAndFlattenPar :: RandomGen g => Int -> StationaryDistribution -> ExchangeabilityMatrix -> Tree Double -> IOGenM g -> IO [[State]] Source #
See simulateAndFlatten
, parallel version.
Mixture models.
simulateMixtureModel :: StatefulGen g m => Int -> Vector Double -> Vector StationaryDistribution -> Vector ExchangeabilityMatrix -> Tree Double -> g -> 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
simulate
.
simulateAndFlattenMixtureModel Source #
:: StatefulGen g m | |
=> Int | |
-> Vector Double | |
-> Vector StationaryDistribution | |
-> Vector ExchangeabilityMatrix | |
-> Tree Double | |
-> g | |
-> m ([Int], [[State]]) | (IndicesOfComponents, [SimulatedSequenceForEachTip]) |
Simulate a number of sites for a given set of substitution models with
corresponding weights. Forget states at internal nodes. See also
simulateAndFlatten
.
simulateAndFlattenMixtureModelPar :: RandomGen g => Int -> Vector Double -> Vector StationaryDistribution -> Vector ExchangeabilityMatrix -> Tree Double -> IOGenM g -> IO ([Int], [[State]]) Source #
See simulateAndFlattenMixtureModel
, parallel version.