elynx-tree-0.7.2.0: Handle phylogenetic trees
Copyright2021 Dominik Schrempf
LicenseGPL-3.0-or-later
Maintainerdominik.schrempf@gmail.com
Stabilityunstable
Portabilityportable
Safe HaskellSafe-Inferred
LanguageHaskell2010

ELynx.Tree.Simulate.PointProcess

Description

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

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.

Constructors

PointProcess 

Fields

Instances

Instances details
(Read a, Read b) => Read (PointProcess a b) Source # 
Instance details

Defined in ELynx.Tree.Simulate.PointProcess

(Show a, Show b) => Show (PointProcess a b) Source # 
Instance details

Defined in ELynx.Tree.Simulate.PointProcess

(Eq a, Eq b) => Eq (PointProcess a b) Source # 
Instance details

Defined in ELynx.Tree.Simulate.PointProcess

Methods

(==) :: PointProcess a b -> PointProcess a b -> Bool #

(/=) :: PointProcess a b -> PointProcess a b -> Bool #

data TimeSpec Source #

Tree height specification.

Constructors

Random

Sample time of origin from respective distribution.

Origin Time

Condition on time of origin.

Mrca Time

Condition on time of most recent common ancestor (MRCA).

simulate Source #

Arguments

:: StatefulGen g m 
=> Int

Number of points (samples).

-> TimeSpec

Time of origin or MRCA.

-> Rate

Birth rate.

-> Rate

Death rate.

-> g 
-> m (PointProcess Int Double) 

Sample a point process using the BirthDeathDistribution. The names of the points will be integers.

toReconstructedTree :: a -> PointProcess a Length -> Tree Length a Source #

Convert a point process to a reconstructed tree. See Lemma 2.2.

simulateReconstructedTree Source #

Arguments

:: StatefulGen g m 
=> Int

Number of points (samples)

-> TimeSpec

Time of origin or MRCA

-> Rate

Birth rate

-> Rate

Death rate

-> g 
-> m (Tree Length Int) 

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 #

Arguments

:: StatefulGen g m 
=> Int

Number of trees

-> Int

Number of points (samples)

-> TimeSpec

Time of origin or MRCA

-> Rate

Birth rate

-> Rate

Death rate

-> g 
-> m (Forest Length Int) 

See simulateReconstructedTree, but n times.