build_coal_tree.structured: Generate a Newick string representation of a tree...

View source: R/tree_utils.R

build_coal_tree.structuredR Documentation

Generate a Newick string representation of a tree corresponding to a realisation of a structured,linage-based coalescent process. Note: the topology is RANDOM, If you wish for the topology to be consistent, use set.seed before calling this function.

Description

Generate a Newick string representation of a tree corresponding to a realisation of a structured,linage-based coalescent process. Note: the topology is RANDOM, If you wish for the topology to be consistent, use set.seed before calling this function.

Usage

build_coal_tree.structured(
  sampling_times,
  coalescent_times,
  leaf_colours,
  coalescent_colours,
  div_times,
  div_events,
  div_from
)

Arguments

sampling_times

times of leaves.

coalescent_times

times of coalescent events / internal nodes.

leaf_colours

leaf colouring

coalescent_colours

a numeric vector where number at j-th position indicates that the j-th coalescent event corresponds to j-th lineage.

div_times

times of lineage divergence events.

div_events

a numeric vector where number at j-th position indicates that the j-th divergence time corresponds to j-th lineage

div_from

numeric vector identifying the parent of the j-th diverging lineage

Value

a list with the Newick string corresponding to the tree, and a list of leaf colouring assignments


dhelekal/CaveDive documentation built on June 11, 2024, 4:32 p.m.