Network manipulation
The package contains a good number of utilities to manipulate phylogenetic networks. Functions that are not exported are more likely to experience breaking changes in future versions, but can be used by prefixing their name with PhyloNetworks.
.
Here is a list of the most useful functions that can handle networks of any level. They typically assume a bicombining network, that is, a network in which each hybrid node has exactly 2 parents (never more).
To traverse or learn something about a network, node or edge, see for example:
tipLabels
,PhyloNetworks.descendants
for the clade ("hardwired cluster") below an edge,PhyloNetworks.isdescendant
,PhyloNetworks.isconnected
displayedTrees
,majorTree
,biconnectedComponents
,PhyloNetworks.blobInfo
hardwiredCluster
,hardwiredClusters
getroot
,isrootof
,isleaf
,isexternal
,isparentof
,ischildof
,hassinglechild
,getchild
,getchildren
,getchildedge
getparent
,getparents
,getparentminor
,getparentedge
,getparentedgeminor
,getpartneredge
To modify a network, for example:
rootonedge!
,rootatnode!
: very useful to root with an outgroup, androtate!
to improve plotsdeleteleaf!
,deleteaboveLSA!
(the "least stable ancestor" may be different from the root)deleteHybridThreshold!
to simplify a network by deleting edges with small γ'sremovedegree2nodes!
,shrink3cycles!
,shrink2cycles!
,PhyloNetworks.shrinkedge!
PhyloNetworks.addleaf!
,PhyloNetworks.deletehybridedge!
,PhyloNetworks.addhybridedge!
nni!
(nearest neighbor interchange),PhyloNetworks.fliphybrid!
to flip the direction of a hybrid edgePhyloNetworks.unzip_canonical!
to "unzip" (or zip down) all reticulations, orPhyloNetworks.rezip_canonical!
to undo.
To compare networks or compare nodes in a network, for example:
hardwiredClusterDistance
: extends the Robinson-Foulds distance, it's a dissimilarity measure on networkspairwiseTaxonDistanceMatrix
for average distances,getNodeAges
if ultrametric network,PhyloNetworks.getHeights
,vcv