Contains methods to simulate birth-death trees.
More...
|
static TreeNode | UnlabelledTree (double treeAge, double birthRate, double deathRate=0, bool keepDeadLineages=false, CancellationToken cancellationToken=default) |
| Simulate an unlabelled birth-death tree, stopping when the age of the tree reaches a certain value. More...
|
|
static TreeNode | LabelledTree (double treeAge, double birthRate, double deathRate=0, bool keepDeadLineages=false, CancellationToken cancellationToken=default) |
| Simulate a labelled birth-death tree, stopping when the age of the tree reaches a certain value. More...
|
|
static TreeNode | UnlabelledTree (int leafCount, double birthRate, double deathRate=0, bool keepDeadLineages=false, CancellationToken cancellationToken=default) |
| Simulate an unlabelled birth-death tree, stopping when the number of lineages that are alive in the tree reaches a certain value. More...
|
|
static TreeNode | LabelledTree (IReadOnlyList< string > leafNames, double birthRate, double deathRate=0, bool keepDeadLineages=false, TreeNode constraint=null, CancellationToken cancellationToken=default) |
| Simulate a labelled birth-death tree, stopping when the number of lineages that are alive in the tree reaches a certain value. More...
|
|
static TreeNode | LabelledTree (int leafCount, double birthRate, double deathRate=0, bool keepDeadLineages=false, TreeNode constraint=null, CancellationToken cancellationToken=default) |
| Simulate a labelled birth-death tree, stopping when the number of lineages that are alive in the tree reaches a certain value. More...
|
|
Contains methods to simulate birth-death trees.
Definition at line 12 of file BirthDeathTree.cs.
◆ LabelledTree() [1/3]
static TreeNode PhyloTree.TreeBuilding.BirthDeathTree.LabelledTree |
( |
double |
treeAge, |
|
|
double |
birthRate, |
|
|
double |
deathRate = 0 , |
|
|
bool |
keepDeadLineages = false , |
|
|
CancellationToken |
cancellationToken = default |
|
) |
| |
|
static |
Simulate a labelled birth-death tree, stopping when the age of the tree reaches a certain value.
- Parameters
-
treeAge | The final age of the tree. Note that the actual age of the tree may be smaller than this; this can happen either if keepDeadLineages is false and one of the two clades descending from the root node goes exinct, or if keepDeadLineages is true and all the clades go extinct. If all the clades go extinct and keepDeadLineages is false , this method will return null . |
birthRate | The birth rate of the tree. |
deathRate | The death rate of the tree. |
keepDeadLineages | If this is true , dead lineages are kept in the tree. If this is false , they are pruned from the tree. |
cancellationToken | A CancellationToken used to cancel the simulation if it takes too long. |
- Returns
- A TreeNode object containing the labelled birth-death tree, or
null
if all the lineages went extinct and keepDeadLineages is false
.
Definition at line 126 of file BirthDeathTree.cs.
◆ LabelledTree() [2/3]
static TreeNode PhyloTree.TreeBuilding.BirthDeathTree.LabelledTree |
( |
int |
leafCount, |
|
|
double |
birthRate, |
|
|
double |
deathRate = 0 , |
|
|
bool |
keepDeadLineages = false , |
|
|
TreeNode |
constraint = null , |
|
|
CancellationToken |
cancellationToken = default |
|
) |
| |
|
static |
Simulate a labelled birth-death tree, stopping when the number of lineages that are alive in the tree reaches a certain value.
- Parameters
-
leafCount | The final number of lineages that are alive in the tree (their names will be in the form t1, t2, ..., tN , where N is leafCount ). Note that, if keepDeadLineages is true , the actual number of leaves in the tree may be larger than this, because the leaves corresponding to dead lineages are kept (their names will be empty). If all the lineages go extinct before the target number of lineages is reaced, the method will return a smaller tree (without any leaf names) if keepDeadLineages is true , or null if it is false . |
birthRate | The birth rate of the tree. |
deathRate | The death rate of the tree. |
keepDeadLineages | If this is true , dead lineages are kept in the tree. If this is false , they are pruned from the tree. |
constraint | A tree to constrain the sampling. The tree produced by this method will be compatible with this tree. The constraint tree can be multifurcating. Please note that, as the constraint is applied at every step while growing the tree, this will bias the sampled topology distribution. |
cancellationToken | A CancellationToken used to cancel the simulation if it takes too long. |
- Returns
- A TreeNode object containing the unlabelled birth-death tree, or
null
if all the lineages went extinct and keepDeadLineages is false
.
Definition at line 489 of file BirthDeathTree.cs.
◆ LabelledTree() [3/3]
static TreeNode PhyloTree.TreeBuilding.BirthDeathTree.LabelledTree |
( |
IReadOnlyList< string > |
leafNames, |
|
|
double |
birthRate, |
|
|
double |
deathRate = 0 , |
|
|
bool |
keepDeadLineages = false , |
|
|
TreeNode |
constraint = null , |
|
|
CancellationToken |
cancellationToken = default |
|
) |
| |
|
static |
Simulate a labelled birth-death tree, stopping when the number of lineages that are alive in the tree reaches a certain value.
- Parameters
-
leafNames | The names for the terminal nodes of the tree. Note that, if keepDeadLineages is true , the actual number of leaves in the tree may be larger than this, because the leaves corresponding to dead lineages are kept (their names will be empty). If all the lineages go extinct before the target number of lineages is reaced, the method will return a smaller tree (without any leaf names) if keepDeadLineages is true , or null if it is false . |
birthRate | The birth rate of the tree. |
deathRate | The death rate of the tree. |
keepDeadLineages | If this is true , dead lineages are kept in the tree. If this is false , they are pruned from the tree. |
constraint | A tree to constrain the sampling. The tree produced by this method will be compatible with this tree. The constraint tree can be multifurcating. Please note that, as the constraint is applied at every step while growing the tree, this will bias the sampled topology distribution. |
cancellationToken | A CancellationToken used to cancel the simulation if it takes too long. |
- Returns
- A TreeNode object containing the unlabelled birth-death tree, or
null
if all the lineages went extinct and keepDeadLineages is false
.
Definition at line 267 of file BirthDeathTree.cs.
◆ UnlabelledTree() [1/2]
static TreeNode PhyloTree.TreeBuilding.BirthDeathTree.UnlabelledTree |
( |
double |
treeAge, |
|
|
double |
birthRate, |
|
|
double |
deathRate = 0 , |
|
|
bool |
keepDeadLineages = false , |
|
|
CancellationToken |
cancellationToken = default |
|
) |
| |
|
static |
Simulate an unlabelled birth-death tree, stopping when the age of the tree reaches a certain value.
- Parameters
-
treeAge | The final age of the tree. Note that the actual age of the tree may be smaller than this; this can happen either if keepDeadLineages is false and one of the two clades descending from the root node goes exinct, or if keepDeadLineages is true and all the clades go extinct. If all the clades go extinct and keepDeadLineages is false , this method will return null . |
birthRate | The birth rate of the tree. |
deathRate | The death rate of the tree. |
keepDeadLineages | If this is true , dead lineages are kept in the tree. If this is false , they are pruned from the tree. |
cancellationToken | A CancellationToken used to cancel the simulation if it takes too long. |
- Returns
- A TreeNode object containing the unlabelled birth-death tree, or
null
if all the lineages went extinct and keepDeadLineages is false
.
Definition at line 29 of file BirthDeathTree.cs.
◆ UnlabelledTree() [2/2]
static TreeNode PhyloTree.TreeBuilding.BirthDeathTree.UnlabelledTree |
( |
int |
leafCount, |
|
|
double |
birthRate, |
|
|
double |
deathRate = 0 , |
|
|
bool |
keepDeadLineages = false , |
|
|
CancellationToken |
cancellationToken = default |
|
) |
| |
|
static |
Simulate an unlabelled birth-death tree, stopping when the number of lineages that are alive in the tree reaches a certain value.
- Parameters
-
leafCount | The final number of lineages that are alive in the tree. Note that, if keepDeadLineages is true , the actual number of leaves in the tree may be larger than this, because the leaves corresponding to dead lineages are kept. If all the lineages go extinct before the target number of lineages is reaced, the method will return a smaller tree if keepDeadLineages is true , or null if it is false . |
birthRate | The birth rate of the tree. |
deathRate | The death rate of the tree. |
keepDeadLineages | If this is true , dead lineages are kept in the tree. If this is false , they are pruned from the tree. |
cancellationToken | A CancellationToken used to cancel the simulation if it takes too long. |
- Returns
- A TreeNode object containing the unlabelled birth-death tree, or
null
if all the lineages went extinct and keepDeadLineages is false
.
Definition at line 164 of file BirthDeathTree.cs.
The documentation for this class was generated from the following file: