A toolkit for working with phylogenetic data.
v0.20.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SquashClustering Class Reference

#include <genesis/tree/mass_tree/squash_clustering.hpp>

Detailed Description

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 const &)=default
 
 SquashClustering (SquashClustering &&)=default
 
 ~SquashClustering ()=default
 
void clear ()
 Clear the clusters() and mergers() data. More...
 
std::vector< Cluster > const & clusters () const
 
std::vector< Merger > const & mergers () const
 
SquashClusteringoperator= (SquashClustering const &)=default
 
SquashClusteringoperator= (SquashClustering &&)=default
 
SquashClusteringp (double value)
 
double p () const
 
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
 

Classes

struct  Cluster
 
struct  Merger
 

Constructor & Destructor Documentation

SquashClustering ( )
default
~SquashClustering ( )
default
SquashClustering ( SquashClustering const &  )
default

Member Function Documentation

void clear ( )

Clear the clusters() and mergers() data.

Definition at line 263 of file squash_clustering.cpp.

std::vector<Cluster> const& clusters ( ) const
inline

Definition at line 169 of file squash_clustering.hpp.

std::vector<Merger> const& mergers ( ) const
inline

Definition at line 174 of file squash_clustering.hpp.

SquashClustering& operator= ( SquashClustering const &  )
default
SquashClustering& operator= ( SquashClustering &&  )
default
SquashClustering& p ( double  value)
inline

Definition at line 158 of file squash_clustering.hpp.

double p ( ) const
inline

Definition at line 164 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 199 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 239 of file squash_clustering.cpp.

Member Data Documentation

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.


The documentation for this class was generated from the following files: