Expand description

light structures and functions for phylogeny

light_phylogeny is a set of structures and functions dedicated to reading, building, manipulating and displaying phylogenic trees, especially reconciled trees with speciation, duplication, loss and horizontal transfer events. Read newick, phyloXML and recPhyloXML files. For more information, visit https://github.com/simonpenel/light_phylogeny/wiki

Structs

ArenaTree Structure. It describes a binary phylogenetic tree.

Structure Config: drawing config.

Noeud Structure. It describes a node of a tree stored in a Arena structure. Concerning recPhyloXML file, we assume in the documentation that it describes a gene/species reconciliation.

Structure Options: these are the drawing options for the svg. Concerning recPhyloXML file, we assume in the documentation that it describes a gene/species reconciliation.

Enums

Enum of the possible events in a gene tree.

Functions

Add a node to another node in a tree.

Shift the gene nodes in a given species node to avoid superposition.

Center the gene nodes into a species node.

Solve the conflicts between the left subtree and the right subtree.

Solve the conflicts between the left subtree and the right subtree.

Processing potential obsolete tags from the old recPhyloXML format.

Check if tree in newick format is rooted.

Solve the conflicts between a parent and its children in a tree (species pipe tree only).

Transforms the tree into cladogram.

Finish the drawing of species tree at the leaves level.

Copy a node of the free-living part of a gene tree into a another tree under some conditions.

Get the minimal distance between 2 contours in “tidy” context.

Draw a svg pipe species tree and several gene trees inside it.

Draw the svg of a simple tree.

Split a parenthesed tree into left and right parenthesed trees and trailing string.

Get the list of ids of all the “regGeneTree” tag in a xml document.

Get the list of ids of all the “spTree” tag in a xml document.

Draw a frame.

Draw a square of size s at x,y.

Draw a square path between x1,y1 and x2,y2.

Draw a square pipe path between x1,y1 ad x2,y2

Draw a transfer path between x1,y1 and x2,y2.

Draw a circle of size s at x,y.

Get the left ‘contour’ of a sub tree.

Get the right ‘contour’ of a sub tree.

Get the left ‘contour’ of a sub tree in the “tidy” context.

Get the right ‘contour’ of a sub tree in the “tidy” context.

Draw a cross of size s at x,y.

Get the transfers in a gene tree.

Get the longest node name in a tree.

Get the longest node name in a set of trees.

Get the largest x in set of trees.

Get the depth of a tree.

Draw a triangle of size s at x,y.

Initial set x and y of nodes in a tree: left son x is 0; right son x is 1; y is depth.

Send the index of the last common ancestor of 2 nodes.

Map gene trees to a host tree.

Set the coordinates of the gene tree according to the associated species tree coordinates.

Map a reconciled species tree to a pipe species tree.

Map a pipe species tree to a reconciled species tree.

Determine and set the number of gene nodes associated to a species node.

Map a transfer in gene tree to the species tree.

Map a transfer from a gene tree to the species trees.

Move a node from a parent node to another node in a tree.

Shift again previously shifted gene nodes in a species node in case of a duplication node or a leaf.

Move species father when the father and children of a gene speciation are in the same node tree (Only occurs for 3-level gene/symbiot/host reconciliation).

Fill an ArenaTree structure with the contents of a parentheses tree.

Get the leftest or rightest x value of a node.

Get the upper or lower y value of a node

Create a svg of the tree in phyloxml context.

Specific processing of free living gene trees.

Check for conficts between parents and children and shift down nodes in order to solve detected conflicts (species pipe tree only).

Check for conficts between subtrees and shift conflicting right-hand subtrees to the right in order to solve detected conflicts.

Check for conficts between subtrees and shift conflicting right-hand subtrees to the right in order to solve detected conflicts in the “tidy” context.

Read a newick file and store the tree into ArenaTree structure.

Read a phyloxml file and store the tree into a ArenaTree structure.

Read a recphyloxml file and store the species and gene trees into several ArenaTree structures.

Use real branch lengths to build the tree.

Create a svg of the tree in recphyloxml context.

Replace the free-living part of a gene tree by a free living tree calculated independantly.

Reset all positions x y xmod ymod of a tree.

Scaling tree height.

Scaling tree width.

Get the transfers in a gene tree.

Set the y values of the leaves of a tree to the same value in a cladogram.

Set the y values of the leaves of a tree to the same value in a real length branch tree.

Set the x of the father between its children.

Set the node widths of the species tree pipe.

Shift the x y values of a node and its children according to the cumulated xmod ymod values.

Shift the y values of the nodes of a tree.

Uniformise the size of the pipe tree nodes (by uniformising nbg).

Display a short summary of each node of a tree.

Fill an ArenaTree structure with the contents of a roxmltree::Node structure.