IMP  2.3.1
The Integrative Modeling Platform
IMP::em2d::ClusterSet Class Reference

A class to store the clusters generated during hierarchical clustering. More...

#include <IMP/em2d/hierarchical_clustering.h>

Detailed Description

A class to store the clusters generated during hierarchical clustering.

Definition at line 38 of file hierarchical_clustering.h.

Public Member Functions

 ClusterSet (unsigned int N)
 
void do_join_clusters (unsigned int cluster_id1, unsigned int cluster_id2, double distance_between_clusters)
 join operation More...
 
Ints get_cluster_elements (unsigned int id) const
 Returns a vector with the ids of the elements that are in a cluster. More...
 
Ints get_cluster_formed_at_step (unsigned int step) const
 Return the elements of the cluster formed at a given step. More...
 
Ints get_clusters_below_cutoff (double cutoff) const
 Get the biggest clusters that have distances below a given cutoff. More...
 
double get_distance_at_step (unsigned int step) const
 Distance in the linkage matrix at a given step. More...
 
unsigned int get_id_for_cluster_at_step (unsigned int step) const
 
FloatsList get_linkage_matrix () const
 Returns the linkage matrix. More...
 
FloatsList get_linkage_matrix_in_matlab_format () const
 Returns the linkage matrix compatible with Matlab format. More...
 
unsigned int get_number_of_steps () const
 Returns the number of steps of clustering recorded. More...
 
void show (std::ostream &out) const
 

Constructor & Destructor Documentation

IMP::em2d::ClusterSet::ClusterSet ( unsigned int  N)
Parameters
[in]NNumber of elements to be clustered

Member Function Documentation

void IMP::em2d::ClusterSet::do_join_clusters ( unsigned int  cluster_id1,
unsigned int  cluster_id2,
double  distance_between_clusters 
)

join operation

Parameters
[in]cluster_id1id of the 1st cluster joined
[in]cluster_id2id of the 2nd cluster merged
[in]distance_between_clustersdistance between the merged clusters
Ints IMP::em2d::ClusterSet::get_cluster_elements ( unsigned int  id) const

Returns a vector with the ids of the elements that are in a cluster.

Does not contain any hierarchical information, just the members

Parameters
[in]idof the cluster
Ints IMP::em2d::ClusterSet::get_cluster_formed_at_step ( unsigned int  step) const

Return the elements of the cluster formed at a given step.

Ints IMP::em2d::ClusterSet::get_clusters_below_cutoff ( double  cutoff) const

Get the biggest clusters that have distances below a given cutoff.

Parameters
[in]cutoffdistance
Returns
A vector of Ints: Each Ints has the ids of all elements of the cluster
double IMP::em2d::ClusterSet::get_distance_at_step ( unsigned int  step) const

Distance in the linkage matrix at a given step.

FloatsList IMP::em2d::ClusterSet::get_linkage_matrix ( ) const

Returns the linkage matrix.

Note
Linkage matrix is a matrix A[N-1][3]. A[i][0] - id of the first cluster merged at step i A[i][1] - id of the second cluster merged at step i A[i][2] - distance between the clusters
FloatsList IMP::em2d::ClusterSet::get_linkage_matrix_in_matlab_format ( ) const

Returns the linkage matrix compatible with Matlab format.

Note
This function merely adds 1 to the cluster ids, for compatibility with Matlab. Matlab format: http://www.mathworks.com/help/toolbox/stats/linkage.html
unsigned int IMP::em2d::ClusterSet::get_number_of_steps ( ) const

Returns the number of steps of clustering recorded.

Definition at line 94 of file hierarchical_clustering.h.


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