Copyright | (c) Dominik Schrempf 2018 |
---|---|
License | GPL-3 |
Maintainer | dominik.schrempf@gmail.com |
Stability | unstable |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Creation date: Tue Feb 13 13:16:18 2018.
See Gernhard, T. (2008). The conditioned reconstructed process. Journal of Theoretical Biology, 253(4), 769–778. http://doi.org/10.1016/j.jtbi.2008.04.005.
The point process can be used to simulate reconstructed trees under the birth and death process.
Synopsis
- data PointProcess a b = PointProcess {}
- type TimeSpec = Maybe (Time, Bool)
- simulate :: PrimMonad m => Int -> TimeSpec -> Rate -> Rate -> Gen (PrimState m) -> m (PointProcess Int Double)
- toReconstructedTree :: PointProcess Int Double -> Tree PhyloIntLabel
- simulateReconstructedTree :: PrimMonad m => Int -> TimeSpec -> Rate -> Rate -> Gen (PrimState m) -> m (Tree PhyloIntLabel)
- simulateNReconstructedTrees :: PrimMonad m => Int -> Int -> TimeSpec -> Rate -> Rate -> Gen (PrimState m) -> m [Tree PhyloIntLabel]
Documentation
data PointProcess a b Source #
A point process for \(n\) points and of age \(t_{or}\) is defined as
follows. Draw $n$ points on the horizontal axis at \(1,2,\ldots,n\). Pick
\(n-1\) points at locations \((i+1/2, s_i)\), \(i=1,2,\ldots,n-1\);
\(0 < s_i < t_{or}\). There is a bijection between (ranked) oriented trees
and the point process. Usually, a will be String
(or Int
) and b will be
Double
.
Instances
(Eq a, Eq b) => Eq (PointProcess a b) Source # | |
Defined in ELynx.Simulate.PointProcess (==) :: PointProcess a b -> PointProcess a b -> Bool # (/=) :: PointProcess a b -> PointProcess a b -> Bool # | |
(Read a, Read b) => Read (PointProcess a b) Source # | |
Defined in ELynx.Simulate.PointProcess readsPrec :: Int -> ReadS (PointProcess a b) # readList :: ReadS [PointProcess a b] # readPrec :: ReadPrec (PointProcess a b) # readListPrec :: ReadPrec [PointProcess a b] # | |
(Show a, Show b) => Show (PointProcess a b) Source # | |
Defined in ELynx.Simulate.PointProcess showsPrec :: Int -> PointProcess a b -> ShowS # show :: PointProcess a b -> String # showList :: [PointProcess a b] -> ShowS # |
type TimeSpec = Maybe (Time, Bool) Source #
If nothing, sample time of origin from respective distribution. If time is given, we need to know if we condition on the time of origin, or the time of the most recent common ancestor (MRCA).
:: PrimMonad m | |
=> Int | Number of points (samples) |
-> TimeSpec | Time of origin or MRCA |
-> Rate | Birth rate |
-> Rate | Death rate |
-> Gen (PrimState m) | Generator (see |
-> m (PointProcess Int Double) |
Sample a point process using the BirthDeathDistribution
. The names of the
points will be integers.
toReconstructedTree :: PointProcess Int Double -> Tree PhyloIntLabel Source #
Convert a point process to a reconstructed tree. See Lemma 2.2.
simulateReconstructedTree Source #
:: PrimMonad m | |
=> Int | Number of points (samples) |
-> TimeSpec | Time of origin or MRCA |
-> Rate | Birth rate |
-> Rate | Death rate |
-> Gen (PrimState m) | Generator (see |
-> m (Tree PhyloIntLabel) |
Use the point process to simulate a reconstructed tree (see
toReconstructedTree
) possibly with specific height and a fixed number of
leaves according to the birth and death process.
simulateNReconstructedTrees Source #
:: PrimMonad m | |
=> Int | Number of trees |
-> Int | Number of points (samples) |
-> TimeSpec | Time of origin or MRCA |
-> Rate | Birth rate |
-> Rate | Death rate |
-> Gen (PrimState m) | Generator (see |
-> m [Tree PhyloIntLabel] |
See simulateReconstructedTree
, but n times.