package phylogenetics

  1. Overview
  2. Docs

Module for phylogenetic trees.

Types
type t =
  1. | Node of {
    1. meta : metadata;
    2. left : branch;
    3. right : branch;
    }
  2. | Leaf of {
    1. meta : metadata;
    2. index : Sigs.index;
    }

Type for evolutionary trees: binary trees whose edges are labelled with lengths (floats) and whose leaves are labelled with sequence indexes (strings)

and branch = float * t
and metadata = {
  1. id : int;
  2. routing_no : int;
}
Creation/Conversion
val of_preorder : string -> t
val of_newick : string -> t
val of_newick_file : string -> t
val make_random : int -> t
val to_newick : t -> string
val to_newick_file : t -> string -> unit
val to_dot : t -> string
val to_tree : t -> (metadata, metadata * string, float) Tree.t
Parameters and transformations
val nb_branches : t -> int
val get_branch_lengths : t -> float list
val set_branch_lengths : t -> float list -> t
Constructors
val build_leaf : ?routing_no:int -> Sigs.index -> t
val build_node : ?routing_no:int -> (float * t) -> (float * t) -> t
val index_of_int : int -> Sigs.index
val index_of_string : string -> Sigs.index
Getters and setters
val get_id : t -> int
val get_meta : t -> metadata
val set_meta : t -> metadata -> t
val get_routing_no : t -> int
val set_routing_no : t -> int -> t
Comparison
val equal : t -> t -> bool
Pretty printers
val pp : Format.formatter -> t -> unit
val pp_fancy : Format.formatter -> t -> unit
val print : t -> unit
val print_fancy : t -> unit