elynx-markov-0.6.0.0: Simulate molecular sequences along trees
Copyright(c) Dominik Schrempf 2021
LicenseGPLv3
Maintainerdominik.schrempf@gmail.com
Stabilityunstable
Portabilitynon-portable (not tested)
Safe HaskellNone
LanguageHaskell2010

ELynx.Simulate.MarkovProcessAlongTree

Description

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

Single rate matrix.

simulate :: PrimMonad m => Int -> StationaryDistribution -> ExchangeabilityMatrix -> Tree Double -> 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.

simulateAndFlatten :: PrimMonad m => Int -> StationaryDistribution -> ExchangeabilityMatrix -> Tree Double -> 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.

simulateMixtureModel :: PrimMonad m => Int -> Vector Double -> Vector StationaryDistribution -> Vector ExchangeabilityMatrix -> Tree Double -> 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 simulate.

simulateAndFlattenMixtureModel Source #

Arguments

:: PrimMonad m 
=> Int 
-> Vector Double 
-> Vector StationaryDistribution 
-> Vector ExchangeabilityMatrix 
-> Tree Double 
-> Gen (PrimState m) 
-> 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.