| Title: | Fast Rust-Based SplitsTree NeighbourNet Algorithm |
|---|---|
| Description: | A fast Rust implementation of the NeighbourNet algorithm (Bryant & Moulton, 2004) for phylogenetic analysis. It constructs an implicit split network from a distance matrix and returns it in a 'networx'-compatible structure for exploratory visualisation with 'tanggle', 'ggplot2', or 'phangorn'. |
| Authors: | Rhys Newell [aut, cre] |
| Maintainer: | Rhys Newell <[email protected]> |
| License: | GPL (>= 3) |
| Version: | 0.3.0 |
| Built: | 2026-06-16 06:39:57 UTC |
| Source: | https://github.com/rhysnewell/fast-nnt |
Runs the NeighbourNet algorithm (Bryant & Moulton, 2004) on a distance
matrix and returns the resulting split network in a networx-compatible
list, ready to plot with tanggle/ggplot2 or base phangorn.
run_neighbornet_networkx( x, flip_y = TRUE, labels = NULL, max_iterations = 5000, ordering_method = NULL, inference_method = NULL ) run_neighbournet_networkx( x, flip_y = TRUE, labels = NULL, max_iterations = 5000, ordering_method = NULL, inference_method = NULL )run_neighbornet_networkx( x, flip_y = TRUE, labels = NULL, max_iterations = 5000, ordering_method = NULL, inference_method = NULL ) run_neighbournet_networkx( x, flip_y = TRUE, labels = NULL, max_iterations = 5000, ordering_method = NULL, inference_method = NULL )
x |
A distance matrix. May be a |
flip_y |
Logical; if |
labels |
Optional character vector of taxon labels. If |
max_iterations |
Integer; maximum NNLS iterations for split-weight
estimation (default |
ordering_method |
Split ordering algorithm: |
inference_method |
Split-weight solver: |
NeighbourNet produces an implicit (split) network: a planar diagram that summarises conflicting signal in the data for exploratory analysis. Unlike explicit networks, the boxes do not represent specific reticulation events such as hybridisation or introgression.
run_neighbournet_networkx() is an identical spelling alias of
run_neighbornet_networkx().
A list of class c("networx", "phylo") containing edge,
tip.label, edge.length, Nnode, splitIndex, splits, translate,
and a .plot sublist whose vertices matrix holds 2-D node coordinates
from the equal-angle layout. The structure is compatible with
phangorn's networx objects and tanggle's ggplot2 layers.
tanggle and phangorn for plotting networx objects;
stats::dist() and phangorn::dist.ml() for computing distances.
# A minimal workflow from raw distances to a plotted network. d <- dist(matrix(rnorm(50), nrow = 5, dimnames = list(LETTERS[1:5], NULL))) net <- run_neighbornet_networkx(d) str(net$tip.label) # Plot with tanggle/ggplot2 (if installed): if (requireNamespace("tanggle", quietly = TRUE)) { library(tanggle) ggplot2::ggplot(net) + geom_splitnet() + geom_tiplab2() }# A minimal workflow from raw distances to a plotted network. d <- dist(matrix(rnorm(50), nrow = 5, dimnames = list(LETTERS[1:5], NULL))) net <- run_neighbornet_networkx(d) str(net$tip.label) # Plot with tanggle/ggplot2 (if installed): if (requireNamespace("tanggle", quietly = TRUE)) { library(tanggle) ggplot2::ggplot(net) + geom_splitnet() + geom_tiplab2() }
Configures the size of the internal Rayon thread pool used for split-weight estimation. The pool can only be initialised once per R session; subsequent calls emit a warning and leave the existing pool unchanged.
set_fastnnt_threads(threads)set_fastnnt_threads(threads)
threads |
Integer (>= 1); number of worker threads to use. |
Invisibly NULL; called for its side effect.
set_fastnnt_threads(4)set_fastnnt_threads(4)