#include <genesis/tree/mass_tree/squash_clustering.hpp>
Perform Squash Clustering.
The class performs squash clustering and stores the results.
Definition at line 54 of file squash_clustering.hpp.
Public Member Functions | |
SquashClustering ()=default | |
SquashClustering (SquashClustering &&)=default | |
SquashClustering (SquashClustering const &)=default | |
~SquashClustering ()=default | |
void | clear () |
Clear the clusters() and mergers() data. More... | |
std::vector< Cluster > const & | clusters () const |
std::vector< Merger > const & | mergers () const |
SquashClustering & | operator= (SquashClustering &&)=default |
SquashClustering & | operator= (SquashClustering const &)=default |
double | p () const |
SquashClustering & | p (double value) |
void | run (std::vector< MassTree > &&trees) |
Perfom Squash Clustering. More... | |
std::string | tree_string (std::vector< std::string > const &labels) const |
Build a Newick-format tree for visualizing the result of a squash_clustering(). More... | |
Public Attributes | |
std::function< void(void)> | report_initialization |
std::function< void(size_t i, size_t total)> | report_step |
std::function< void(MassTree const &cluster_tree, size_t index)> | write_cluster_tree |
Classes | |
struct | Cluster |
struct | Merger |
|
default |
|
default |
|
default |
|
default |
void clear | ( | ) |
Clear the clusters() and mergers() data.
Definition at line 276 of file squash_clustering.cpp.
|
inline |
Definition at line 169 of file squash_clustering.hpp.
|
inline |
Definition at line 174 of file squash_clustering.hpp.
|
default |
|
default |
|
inline |
Definition at line 164 of file squash_clustering.hpp.
|
inline |
Definition at line 158 of file squash_clustering.hpp.
void run | ( | std::vector< MassTree > && | trees | ) |
Perfom Squash Clustering.
See the guppy documentation and the corresponding paper for details on this algorithm.
The funciton takes MassTrees as input, which are consumed. The optional parameter p
is used as exponent to calculate the earth_movers_distance(). See there for details.
Definition at line 212 of file squash_clustering.cpp.
std::string tree_string | ( | std::vector< std::string > const & | labels | ) | const |
Build a Newick-format tree for visualizing the result of a squash_clustering().
The resulting Tree is a tree of samples, i.e., each leaf node represents one MassTree that was used as input for the Squash Clustering. The labels
vector needs to contain the labels for those tips, in the order of elements that was used for running squash_clustering().
Definition at line 252 of file squash_clustering.cpp.
std::function<void( void )> report_initialization |
Definition at line 188 of file squash_clustering.hpp.
std::function<void( size_t i, size_t total )> report_step |
Definition at line 189 of file squash_clustering.hpp.
std::function<void( MassTree const& cluster_tree, size_t index )> write_cluster_tree |
Definition at line 191 of file squash_clustering.hpp.