Documentation

PhylogeneticNode

FinalYes

A leaf is a node with no children and must carry a name (the taxon it represents) ; an internal node commonly has no name, since Newick and neighbor-joining rarely name ancestral nodes. Branch length is the distance to this node's OWN parent, so it is meaningless - and left null - on the root of a tree. Negative branch lengths are accepted without validation : neighbor-joining can legitimately produce one when the input distances are slightly non-additive (measurement noise), a well documented property of the algorithm, not an error this value object should reject.

Class PhylogeneticNode

Tags
author

Amélie DUVERNET aka Amelaye amelieonline@gmail.com

Table of Contents

Properties

$branchLength  : float|null
$children  : array<string|int, PhylogeneticNode>
$name  : string|null

Methods

__construct()  : mixed
PhylogeneticNode constructor.
getBranchLength()  : float|null
getChildren()  : array<string|int, PhylogeneticNode>
getLeafNames()  : array<string|int, string>
getName()  : string|null
isLeaf()  : bool
toNewick()  : string
Serializes this node and its whole subtree as a Newick string, semicolon included.
newickLabel()  : string
A name holding a blank, a quote or a character Newick uses for its structure is quoted, its quotes doubled : written bare, it would not read back as the same name. So is a name holding an underscore, which a reader following the specification turns into a blank.
toNewickFragment()  : string

Properties

$branchLength

private float|null $branchLength = null

Distance to this node's own parent ; null when not specified (e.g. the root)

Methods

getBranchLength()

public getBranchLength() : float|null
Return values
float|null

getLeafNames()

public getLeafNames() : array<string|int, string>
Return values
array<string|int, string> —

The name of every leaf under this node, depth-first, left to right

toNewick()

Serializes this node and its whole subtree as a Newick string, semicolon included.

public toNewick() : string
Return values
string

newickLabel()

A name holding a blank, a quote or a character Newick uses for its structure is quoted, its quotes doubled : written bare, it would not read back as the same name. So is a name holding an underscore, which a reader following the specification turns into a blank.

private static newickLabel(string $sName) : string
Parameters
$sName : string
Return values
string

toNewickFragment()

private toNewickFragment() : string
Return values
string —

This node's subtree, without the terminating ";"

On this page

Search results