Loading...
Searching...
No Matches
poseClustering.h
Go to the documentation of this file.
// -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//
#ifndef BALL_DOCKING_POSECLUSTERING_H
#define BALL_DOCKING_POSECLUSTERING_H
#ifndef BALL_DATATYPE_OPTIONS_H
# include <BALL/DATATYPE/options.h>
#endif
#ifndef BALL_DOCKING_COMMON_CONFORMATIONSET_H
# include <BALL/DOCKING/COMMON/conformationSet.h>
#endif
#ifndef BALL_MOLMEC_COMMON_SNAPSHOT_H
# include <BALL/MOLMEC/COMMON/snapShot.h>
#endif
#ifndef BALL_STRUCTURE_ATOMBIJECTION_H
# include <BALL/STRUCTURE/atomBijection.h>
#endif
#ifndef BALL_KERNEL_SYSTEM_H
# include <BALL/KERNEL/system.h>
#endif
#ifndef BALL_DATATYPE_STRING_H
# include <BALL/DATATYPE/string.h>
#endif
#ifndef BALL_MATHS_VECTOR3_H
# include <BALL/MATHS/vector3.h>
#endif
#ifndef BALL_MATHS_MATRIX44_H
# include <BALL/MATHS/matrix44.h>
#endif
#include <Eigen/Core>
#include <boost/shared_ptr.hpp>
#include <boost/variant.hpp>
// Boost 1.56+ implicitly deletes the copy constructors of stored_edge_properties. In order
// to automatically use the respective move constructor instead, ClusterProperties has to
// be _nothrow_ move constructible!
#ifndef BALL_HAS_NOEXCEPT
# define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
# include <boost/graph/adjacency_list.hpp>
# undef BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
#else
# include <boost/graph/adjacency_list.hpp>
#endif
#include <set>
#include <iostream>
#ifdef BALL_HAS_TBB
# include <tbb/parallel_reduce.h>
# include <tbb/blocked_range.h>
#endif
//#define POSECLUSTERING_DEBUG 1
#undef POSECLUSTERING_DEBUG
namespace BALL
{
class BALL_EXPORT PoseClustering
{
public:
struct BALL_EXPORT Option
{
static const String CLUSTER_METHOD;
static const String DISTANCE_THRESHOLD;
static const String RMSD_LEVEL_OF_DETAIL;
static const String RMSD_TYPE;
static const String RUN_PARALLEL;
};
struct BALL_EXPORT Default
{
static const Index CLUSTER_METHOD;
static const float DISTANCE_THRESHOLD;
static const Index RMSD_LEVEL_OF_DETAIL;
static const Index RMSD_TYPE;
static const bool RUN_PARALLEL;
static const bool USE_CENTER_OF_MASS_PRECLINK;
};
enum BALL_EXPORT RMSDType
{
SNAPSHOT_RMSD,
RIGID_RMSD,
CENTER_OF_MASS_DISTANCE
};
enum BALL_EXPORT RMSDLevelOfDetail
{
C_ALPHA, //=0
HEAVY_ATOMS,
BACKBONE,
ALL_ATOMS,
PROPERTY_BASED_ATOM_BIJECTION
};
enum BALL_EXPORT ClusterMethod
{
TRIVIAL_COMPLETE_LINKAGE,
SLINK_SIBSON,
CLINK_DEFAYS,
NEAREST_NEIGHBOR_CHAIN_WARD,
CLINK_ALTHAUS
};
class BALL_EXPORT RigidTransformation
{
public:
RigidTransformation() {};
RigidTransformation(Eigen::Vector3f const& new_trans, Eigen::Matrix3f const& new_rot)
: translation(new_trans),
rotation(new_rot)
{}
Eigen::Vector3f translation;
Eigen::Matrix3f rotation;
};
class BALL_EXPORT PosePointer
{
public:
PosePointer(RigidTransformation const* new_trafo, SnapShot const* new_snap = 0)
: trafo(new_trafo),
snap(new_snap)
{ }
PosePointer(SnapShot const* new_snap)
: trafo(0),
snap(new_snap)
{ }
RigidTransformation const* trafo;
SnapShot const* snap;
};
class BALL_EXPORT ClusterProperties
{
public:
ClusterProperties();
ClusterProperties(const ClusterProperties&);
ClusterProperties& operator=(const ClusterProperties&);
ClusterProperties(ClusterProperties&&) BALL_NOEXCEPT;
ClusterProperties& operator=(ClusterProperties&&) BALL_NOEXCEPT;
template <class Archive>
void serialize(Archive& ar, const unsigned int version);
std::set<Index> poses;
Size size;
boost::variant<Eigen::VectorXf, RigidTransformation> center;
float merged_at;
#ifdef POSECLUSTERING_DEBUG
float current_cluster_id;
#endif
};
typedef boost::adjacency_list<boost::vecS,
boost::vecS,
boost::directedS,
ClusterProperties,
boost::no_property,
unsigned int> ClusterTree;
typedef ClusterTree::vertex_descriptor ClusterTreeNode;
BALL_CREATE(PoseClustering);
PoseClustering();
PoseClustering(ConformationSet* poses, float rmsd);
PoseClustering(System const& base_system, String transformation_file_name);
virtual ~PoseClustering();
bool compute();
void setConformationSet(ConformationSet* new_set, bool precompute_atombijection = false);
void setBaseSystemAndPoses(System const& base_system, std::vector<PosePointer> const& poses);
// will be applied upon the current conformation
void setBaseSystemAndTransformations(System const& base_system, String transformation_file_name);
const ConformationSet* getConformationSet() const {return current_set_;}
ConformationSet* getConformationSet() {return current_set_;}
const std::vector<RigidTransformation> & getRigidTransformations() const {return transformations_;}
std::vector<Vector3> & getCentersOfMass() {return com_;}
std::vector<Vector3> const & getCentersOfMass() const {return com_;}
const System& getSystem() const;
System& getSystem();
Size getNumberOfPoses() const {return poses_.size();}
Size getNumberOfClusters() const {return clusters_.size();}
const std::set<Index>& getCluster(Index i) const;
std::set<Index>& getCluster(Index i);
Size getClusterSize(Index i) const;
float getClusterScore(Index i) const;
float getScore(const System sys_a, const System sys_b, Options options) const;
AtomBijection& getAtomBijection() {return atom_bijection_;}
AtomBijection const& getAtomBijection() const {return atom_bijection_;}
void applyTransformation2System(Index i, System& target_system);
void convertTransformations2Snaphots();
void convertSnaphots2Transformations();
float computeCompleteLinkageRMSD(Index i, Options options, bool initialize = true);
//float computeCompleteLinkageRMSD(boost::shared_ptr<ConformationSet> cluster, Option options) const;
boost::shared_ptr<System> getPose(Index i) const;
std::vector<PosePointer> const& getPoses() const {return poses_;}
boost::shared_ptr<System> getClusterRepresentative(Index i);
Index findClusterRepresentative(Index i);
boost::shared_ptr<ConformationSet> getClusterConformationSet(Index i);
boost::shared_ptr<ConformationSet> getReducedConformationSet();
bool refineClustering(Options const& refined_options);
Options options;
void setDefaultOptions();
static float getRigidRMSD(Eigen::Vector3f const& t_ab, Eigen::Matrix3f const& M_ab, Eigen::Matrix3f const& covariance_matrix);
static float getSquaredRigidRMSD(Eigen::Vector3f const& t_ab, Eigen::Matrix3f const& M_ab, Eigen::Matrix3f const& covariance_matrix);
static Eigen::Matrix3f computeCovarianceMatrix(System const& system, Index rmsd_level_of_detail = C_ALPHA);
std::vector<std::set<Index> > extractClustersForThreshold(float threshold, Size min_size = 0);
std::vector<std::set<Index> > extractNBestClusters(Size n);
std::vector<std::set<Index> > filterClusters(Size min_size = 1);
void serializeWardClusterTree(std::ostream& out, bool binary = false);
void deserializeWardClusterTree(std::istream& in, bool binary = false);
void exportWardClusterTreeToGraphViz(std::ostream& out);
void exportClusterTreeToJSON(std::ostream& out);
void printClusters(std::ostream& out = std::cout) const;
void printClusterScores(std::ostream& out = std::cout);
protected:
#ifdef BALL_HAS_TBB
class ComputeNearestClusterTask_
{
public:
ComputeNearestClusterTask_(PoseClustering* parent,
const std::vector<ClusterTreeNode>& active_clusters,
Position current_cluster,
Index rmsd_type);
ComputeNearestClusterTask_(ComputeNearestClusterTask_& cnct, tbb::split);
void join(ComputeNearestClusterTask_ const& cnct);
void operator() (const tbb::blocked_range<size_t>& r);
Position getMinIndex() {return my_min_index_;}
float getMinValue() {return my_min_value_;}
protected:
// the PoseClustering instance that called us
PoseClustering* parent_;
// the array we work on
const std::vector<ClusterTreeNode>& active_clusters_;
// the cluster to compare to everything else
Position current_cluster_;
// the kind of rmsd computation desired
Index rmsd_type_;
// the minimum index in our own block
Position my_min_index_;
// the minimum value in our own block
float my_min_value_;
};
#endif
class ClusterTreeWriter_
{
public:
ClusterTreeWriter_(ClusterTree const* cluster_tree)
: cluster_tree_(cluster_tree)
{ }
void operator() (std::ostream& out, const ClusterTreeNode& v) const;
protected:
ClusterTree const* cluster_tree_;
};
class ClusterTreeNodeComparator
{
public:
ClusterTreeNodeComparator(ClusterTree& cluster_tree)
: cluster_tree_(&cluster_tree)
{}
bool operator() (ClusterTreeNode const first, ClusterTreeNode const second) const
{
float first_value = (*cluster_tree_)[ first].merged_at;
float second_value = (*cluster_tree_)[second].merged_at;
return first_value < second_value;
}
protected:
ClusterTree* cluster_tree_;
};
// trivial complete linkage implementation
// with O(n^2) space request
bool trivialCompute_();
// space efficient (SLINK or CLINK) clustering
bool linearSpaceCompute_();
//
bool althausCompute_();
// implementation of a single linkage clustering as described in
// R. Sibson: SLINK: an optimally efficient algorithm for the single-link cluster method.
// The Computer Journal. 16, 1, British Computer Society, 1973, p. 30-34
void slinkInner_(int current_level);
// implementation of a complete linkage clustering as described in
// D. Defays: An efficient algorithm for a complete link method.
// The Computer Journal. 20, 4, British Computer Society, 1977, p. 364-366.
void clinkInner_(int current_level);
// implememtation of the nearest neighbor chain clustering algorithm
// as described in:
// Murtagh, Fionn (1983): "A survey of recent advances in hierarchical clustering algorithms",
// The Computer Journal 26 (4): 354–359
bool nearestNeighborChainCompute_();
void initWardDistance_(Index rmsd_type);
void updateWardDistance_(ClusterTreeNode parent, ClusterTreeNode i, ClusterTreeNode j, Index rmsd_type);
float computeWardDistance_(ClusterTreeNode i, ClusterTreeNode j, Index rmsd_type);
std::set<Index> collectClusterBelow_(ClusterTreeNode const& v);
// compute the center of masses
void computeCenterOfMasses_();
// precompute an atom bijection for faster access
void precomputeAtomBijection_();
// check the given atom wrt choice of option RMSD_LEVEL_OF_DETAIL
bool static isExcludedByLevelOfDetail_(Atom const* atom, Index rmsd_level_of_detail);
// distance between cluster i and cluster j
float getClusterRMSD_(Index i, Index j, Index rmsd_type);
// reads the poses given as transformations from a file
// Note: the previously given system will be taken
// as untransformed reference, e.g. all transformations
// will be applied upon the current conformation
bool readTransformationsFromFile_(String filename);
// compute the RMSD between two "poses"
float getRMSD_(Index i, Index j, Index rmsd_type);
// store pointers to the snapshots in the poses vector
void storeSnapShotReferences_();
//
void printCluster_(Size i, std::ostream& out = std::cout) const;
//
void printVariables_(int a, int b, double c, int d, double e, int current_level);
//
void clear_();
// Used by exportClusterTreeToJSON
void exportToJSONDFS_(ClusterTreeNode const& current, String& result);
// only used by trivial clustering
Eigen::MatrixXd pairwise_scores_;
ConformationSet* current_set_;
std::vector< std::set<Index> > clusters_;
std::vector< Index > cluster_representatives_;
std::vector< float > cluster_scores_;
Index rmsd_level_of_detail_;
// ----- unified access to the poses, independent of their type
// (the poses are either stored in transformations_, or in current_set_)
std::vector<PosePointer> poses_;
// ----- data structure for transformation input (instead of snapshots)
std::vector<RigidTransformation> transformations_;
Eigen::Matrix3f covariance_matrix_;
// TODO: maybe use a const - ptr instead?
System base_system_;
// the reference state
SnapShot base_conformation_;
// flag indicating the use of transformation as input
bool has_rigid_transformations_;
// do we need to delete the conformation set, that was
// created by converting transformations to snapshots
bool delete_conformation_set_;
// ------ data structures for slink and clink
// stores the distance at which this indexed element has longer
// the largest index of its cluster
std::vector<double> lambda_;
// the index of the cluster representative at merge-time
// (element with largest index)
std::vector<int> pi_;
std::vector<double> mu_;
// ----- data structures for nearest neighbor chain ward
Size number_of_selected_atoms_;
// ----- data structure for CENTER_OF_GRAVITY_CLINK
// the geometric center of mass
std::vector<Vector3> com_;
// ----- general data structures
// We cache the atom bijection for faster
// RMSD computation; this is possible, since the system topology does
// not change
AtomBijection atom_bijection_;
// helper dummies to speed up snapshot application
System system_i_;
System system_j_;
ClusterTree cluster_tree_;
}; //class PoseClustering
} //namesspace BALL
#endif // BALL_DOCKING_POSECLUSTERING_H
BALL_EXPORT
#define BALL_EXPORT
Definition COMMON/global.h:50
system.h
atomBijection.h
BALL::AtomBijection
Definition atomBijection.h:47
BALL::Atom
Definition atom.h:90
BALL::ConformationSet
Definition conformationSet.h:33
BALL::Options
Definition options.h:48
BALL::PoseClustering::ClusterProperties
Definition poseClustering.h:229
BALL::PoseClustering::ClusterProperties::ClusterProperties
ClusterProperties()
BALL::PoseClustering::ClusterProperties::serialize
void serialize(Archive &ar, const unsigned int version)
BALL::PoseClustering::ClusterProperties::size
Size size
Definition poseClustering.h:250
BALL::PoseClustering::ClusterProperties::operator=
ClusterProperties & operator=(const ClusterProperties &)
BALL::PoseClustering::ClusterProperties::ClusterProperties
ClusterProperties(ClusterProperties &&) BALL_NOEXCEPT
BALL::PoseClustering::ClusterProperties::poses
std::set< Index > poses
Definition poseClustering.h:246
BALL::PoseClustering::ClusterProperties::merged_at
float merged_at
Definition poseClustering.h:264
BALL::PoseClustering::ClusterProperties::ClusterProperties
ClusterProperties(const ClusterProperties &)
BALL::PoseClustering::ClusterProperties::center
boost::variant< Eigen::VectorXf, RigidTransformation > center
Definition poseClustering.h:260
BALL::PoseClustering::ClusterTreeNodeComparator::cluster_tree_
ClusterTree * cluster_tree_
Definition poseClustering.h:594
BALL::PoseClustering::ClusterTreeNodeComparator::ClusterTreeNodeComparator
ClusterTreeNodeComparator(ClusterTree &cluster_tree)
Definition poseClustering.h:581
BALL::PoseClustering::ClusterTreeWriter_::ClusterTreeWriter_
ClusterTreeWriter_(ClusterTree const *cluster_tree)
Definition poseClustering.h:566
BALL::PoseClustering::ClusterTreeWriter_::cluster_tree_
ClusterTree const * cluster_tree_
Definition poseClustering.h:573
BALL::PoseClustering::PosePointer::snap
SnapShot const * snap
Definition poseClustering.h:225
BALL::PoseClustering::PosePointer::PosePointer
PosePointer(RigidTransformation const *new_trafo, SnapShot const *new_snap=0)
Definition poseClustering.h:214
BALL::PoseClustering::PosePointer::trafo
RigidTransformation const * trafo
Definition poseClustering.h:224
BALL::PoseClustering::PosePointer::PosePointer
PosePointer(SnapShot const *new_snap)
Definition poseClustering.h:219
BALL::PoseClustering::RigidTransformation
Definition poseClustering.h:194
BALL::PoseClustering::RigidTransformation::translation
Eigen::Vector3f translation
Definition poseClustering.h:203
BALL::PoseClustering::RigidTransformation::RigidTransformation
RigidTransformation(Eigen::Vector3f const &new_trans, Eigen::Matrix3f const &new_rot)
Definition poseClustering.h:198
BALL::PoseClustering::RigidTransformation::RigidTransformation
RigidTransformation()
Definition poseClustering.h:196
BALL::PoseClustering::RigidTransformation::rotation
Eigen::Matrix3f rotation
Definition poseClustering.h:204
BALL::PoseClustering::deserializeWardClusterTree
void deserializeWardClusterTree(std::istream &in, bool binary=false)
BALL::PoseClustering::has_rigid_transformations_
bool has_rigid_transformations_
Definition poseClustering.h:701
BALL::PoseClustering::computeWardDistance_
float computeWardDistance_(ClusterTreeNode i, ClusterTreeNode j, Index rmsd_type)
BALL::PoseClustering::system_j_
System system_j_
Definition poseClustering.h:737
BALL::PoseClustering::getClusterRepresentative
boost::shared_ptr< System > getClusterRepresentative(Index i)
returns the "central cluster" conformation of cluster i as system
BALL::PoseClustering::getAtomBijection
AtomBijection const & getAtomBijection() const
returns a const reference to the cached AtomBijection
Definition poseClustering.h:376
BALL::PoseClustering::getClusterScore
float getClusterScore(Index i) const
returns the score of cluster i
BALL::PoseClustering::clear_
void clear_()
BALL::PoseClustering::poses_
std::vector< PosePointer > poses_
Definition poseClustering.h:687
BALL::PoseClustering::options
Options options
options
Definition poseClustering.h:432
BALL::PoseClustering::clinkInner_
void clinkInner_(int current_level)
BALL::PoseClustering::setConformationSet
void setConformationSet(ConformationSet *new_set, bool precompute_atombijection=false)
sets the poses to be clustered, the conformation set's reference system will the base system
BALL::PoseClustering::base_system_
System base_system_
Definition poseClustering.h:695
BALL::PoseClustering::system_i_
System system_i_
Definition poseClustering.h:736
BALL::PoseClustering::nearestNeighborChainCompute_
bool nearestNeighborChainCompute_()
BALL::PoseClustering::covariance_matrix_
Eigen::Matrix3f covariance_matrix_
Definition poseClustering.h:692
BALL::PoseClustering::getConformationSet
ConformationSet * getConformationSet()
returns the poses to be clustered as ConformationSet
Definition poseClustering.h:332
BALL::PoseClustering::exportToJSONDFS_
void exportToJSONDFS_(ClusterTreeNode const &current, String &result)
BALL::PoseClustering::precomputeAtomBijection_
void precomputeAtomBijection_()
BALL::PoseClustering::pi_
std::vector< int > pi_
Definition poseClustering.h:715
BALL::PoseClustering::atom_bijection_
AtomBijection atom_bijection_
Definition poseClustering.h:733
BALL::PoseClustering::readTransformationsFromFile_
bool readTransformationsFromFile_(String filename)
BALL::PoseClustering::getRigidTransformations
const std::vector< RigidTransformation > & getRigidTransformations() const
returns the poses as rigid transformations
Definition poseClustering.h:335
BALL::PoseClustering::getConformationSet
const ConformationSet * getConformationSet() const
returns the poses to be clustered as ConformationSet
Definition poseClustering.h:329
BALL::PoseClustering::getReducedConformationSet
boost::shared_ptr< ConformationSet > getReducedConformationSet()
returns a ConformationSet containing one structure per cluster
BALL::PoseClustering::althausCompute_
bool althausCompute_()
BALL::PoseClustering::getScore
float getScore(const System sys_a, const System sys_b, Options options) const
returns the score between two poses given as systems
BALL::PoseClustering::linearSpaceCompute_
bool linearSpaceCompute_()
BALL::PoseClustering::setBaseSystemAndTransformations
void setBaseSystemAndTransformations(System const &base_system, String transformation_file_name)
BALL::PoseClustering::delete_conformation_set_
bool delete_conformation_set_
Definition poseClustering.h:705
BALL::PoseClustering::exportWardClusterTreeToGraphViz
void exportWardClusterTreeToGraphViz(std::ostream &out)
BALL::PoseClustering::getRMSD_
float getRMSD_(Index i, Index j, Index rmsd_type)
BALL::PoseClustering::~PoseClustering
virtual ~PoseClustering()
BALL::PoseClustering::findClusterRepresentative
Index findClusterRepresentative(Index i)
returns the index of the cluster representative
BALL::PoseClustering::cluster_scores_
std::vector< float > cluster_scores_
the scores of the clusters
Definition poseClustering.h:679
BALL::PoseClustering::updateWardDistance_
void updateWardDistance_(ClusterTreeNode parent, ClusterTreeNode i, ClusterTreeNode j, Index rmsd_type)
BALL::PoseClustering::base_conformation_
SnapShot base_conformation_
Definition poseClustering.h:698
BALL::PoseClustering::getRigidRMSD
static float getRigidRMSD(Eigen::Vector3f const &t_ab, Eigen::Matrix3f const &M_ab, Eigen::Matrix3f const &covariance_matrix)
BALL::PoseClustering::collectClusterBelow_
std::set< Index > collectClusterBelow_(ClusterTreeNode const &v)
BALL::PoseClustering::applyTransformation2System
void applyTransformation2System(Index i, System &target_system)
apply a transformation to a given system
BALL::PoseClustering::extractClustersForThreshold
std::vector< std::set< Index > > extractClustersForThreshold(float threshold, Size min_size=0)
BALL::PoseClustering::getSystem
System & getSystem()
returns the reference pose
BALL::PoseClustering::getClusterConformationSet
boost::shared_ptr< ConformationSet > getClusterConformationSet(Index i)
returns cluster i as ConformationSet
BALL::PoseClustering::exportClusterTreeToJSON
void exportClusterTreeToJSON(std::ostream &out)
BALL::PoseClustering::serializeWardClusterTree
void serializeWardClusterTree(std::ostream &out, bool binary=false)
BALL::PoseClustering::initWardDistance_
void initWardDistance_(Index rmsd_type)
BALL::PoseClustering::getCentersOfMass
std::vector< Vector3 > const & getCentersOfMass() const
returns the centers of mass-vector, const version (non-empty only for CENTER_OF_MASS_DISTANCE)
Definition poseClustering.h:341
BALL::PoseClustering::number_of_selected_atoms_
Size number_of_selected_atoms_
Definition poseClustering.h:721
BALL::PoseClustering::filterClusters
std::vector< std::set< Index > > filterClusters(Size min_size=1)
BALL::PoseClustering::getPoses
std::vector< PosePointer > const & getPoses() const
returns poses as PosePointer
Definition poseClustering.h:397
BALL::PoseClustering::PoseClustering
PoseClustering()
Default constructor.
BALL::PoseClustering::ClusterTree
boost::adjacency_list< boost::vecS, boost::vecS, boost::directedS, ClusterProperties, boost::no_property, unsigned int > ClusterTree
Definition poseClustering.h:277
BALL::PoseClustering::compute
bool compute()
BALL::PoseClustering::pairwise_scores_
Eigen::MatrixXd pairwise_scores_
Definition poseClustering.h:668
BALL::PoseClustering::getPose
boost::shared_ptr< System > getPose(Index i) const
returns the complete linkage RMSD of a pose set
BALL::PoseClustering::PoseClustering
PoseClustering(ConformationSet *poses, float rmsd)
BALL::PoseClustering::setBaseSystemAndPoses
void setBaseSystemAndPoses(System const &base_system, std::vector< PosePointer > const &poses)
BALL::PoseClustering::getCluster
const std::set< Index > & getCluster(Index i) const
BALL::PoseClustering::lambda_
std::vector< double > lambda_
Definition poseClustering.h:711
BALL::PoseClustering::transformations_
std::vector< RigidTransformation > transformations_
Definition poseClustering.h:690
BALL::PoseClustering::current_set_
ConformationSet * current_set_
the ConformationSet we wish to cluster
Definition poseClustering.h:671
BALL::PoseClustering::PoseClustering
PoseClustering(System const &base_system, String transformation_file_name)
PoseClustering for a given set of rigid transformations of a base structure.
BALL::PoseClustering::rmsd_level_of_detail_
Index rmsd_level_of_detail_
the RMSD definition used for clustering
Definition poseClustering.h:682
BALL::PoseClustering::storeSnapShotReferences_
void storeSnapShotReferences_()
BALL::PoseClustering::BALL_CREATE
BALL_CREATE(PoseClustering)
BALL::PoseClustering::getClusterRMSD_
float getClusterRMSD_(Index i, Index j, Index rmsd_type)
BALL::PoseClustering::ClusterTreeNode
ClusterTree::vertex_descriptor ClusterTreeNode
Definition poseClustering.h:279
BALL::PoseClustering::getNumberOfPoses
Size getNumberOfPoses() const
returns the number of poses
Definition poseClustering.h:350
BALL::PoseClustering::printClusterScores
void printClusterScores(std::ostream &out=std::cout)
BALL::PoseClustering::refineClustering
bool refineClustering(Options const &refined_options)
BALL::PoseClustering::convertTransformations2Snaphots
void convertTransformations2Snaphots()
convert the poses to SnapShots
BALL::PoseClustering::getCluster
std::set< Index > & getCluster(Index i)
BALL::PoseClustering::mu_
std::vector< double > mu_
Definition poseClustering.h:717
BALL::PoseClustering::slinkInner_
void slinkInner_(int current_level)
BALL::PoseClustering::computeCenterOfMasses_
void computeCenterOfMasses_()
BALL::PoseClustering::getNumberOfClusters
Size getNumberOfClusters() const
returns the number of clusters found
Definition poseClustering.h:353
BALL::PoseClustering::cluster_representatives_
std::vector< Index > cluster_representatives_
Definition poseClustering.h:676
BALL::PoseClustering::getSystem
const System & getSystem() const
returns the reference pose
BALL::PoseClustering::getCentersOfMass
std::vector< Vector3 > & getCentersOfMass()
returns the centers of mass-vector (non-empty only for CENTER_OF_MASS_DISTANCE)
Definition poseClustering.h:338
BALL::PoseClustering::extractNBestClusters
std::vector< std::set< Index > > extractNBestClusters(Size n)
BALL::PoseClustering::getSquaredRigidRMSD
static float getSquaredRigidRMSD(Eigen::Vector3f const &t_ab, Eigen::Matrix3f const &M_ab, Eigen::Matrix3f const &covariance_matrix)
BALL::PoseClustering::convertSnaphots2Transformations
void convertSnaphots2Transformations()
convert the poses to rigid transformations
BALL::PoseClustering::getClusterSize
Size getClusterSize(Index i) const
returns the size of cluster i
BALL::PoseClustering::clusters_
std::vector< std::set< Index > > clusters_
the clusters: sets of pose indices
Definition poseClustering.h:674
BALL::PoseClustering::com_
std::vector< Vector3 > com_
Definition poseClustering.h:726
BALL::PoseClustering::setDefaultOptions
void setDefaultOptions()
BALL::PoseClustering::getAtomBijection
AtomBijection & getAtomBijection()
returns a reference to the cached AtomBijection
Definition poseClustering.h:373
BALL::PoseClustering::cluster_tree_
ClusterTree cluster_tree_
The tree built during hierarchical clustering.
Definition poseClustering.h:740
BALL::PoseClustering::computeCompleteLinkageRMSD
float computeCompleteLinkageRMSD(Index i, Options options, bool initialize=true)
returns the complete linkage RMSD of cluster i
BALL::PoseClustering::printClusters
void printClusters(std::ostream &out=std::cout) const
BALL::PoseClustering::computeCovarianceMatrix
static Eigen::Matrix3f computeCovarianceMatrix(System const &system, Index rmsd_level_of_detail=C_ALPHA)
BALL::PoseClustering::isExcludedByLevelOfDetail_
static bool isExcludedByLevelOfDetail_(Atom const *atom, Index rmsd_level_of_detail)
BALL::PoseClustering::printVariables_
void printVariables_(int a, int b, double c, int d, double e, int current_level)
BALL::PoseClustering::printCluster_
void printCluster_(Size i, std::ostream &out=std::cout) const
BALL::PoseClustering::trivialCompute_
bool trivialCompute_()
BALL::SnapShot
Definition snapShot.h:30
BALL::String
Definition string.h:57
BALL::System
Definition KERNEL/system.h:40
conformationSet.h
matrix44.h
BALL
Definition constants.h:13
BALL::Size
BALL_SIZE_TYPE Size
Definition COMMON/global.h:114
BALL::Position
BALL_SIZE_TYPE Position
Definition COMMON/global.h:140
BALL::Index
BALL_INDEX_TYPE Index
Definition COMMON/global.h:105
boost
Definition graphAlgorithms.h:27
std
STL namespace.
options.h
SNAPSHOT_RMSD
SNAPSHOT_RMSD
Definition poseClustering.h:170
C_ALPHA
C_ALPHA
Definition poseClustering.h:177
RIGID_RMSD
RIGID_RMSD
Definition poseClustering.h:171
ALL_ATOMS
ALL_ATOMS
Definition poseClustering.h:180
BACKBONE
BACKBONE
Definition poseClustering.h:179
TRIVIAL_COMPLETE_LINKAGE
TRIVIAL_COMPLETE_LINKAGE
Definition poseClustering.h:186
NEAREST_NEIGHBOR_CHAIN_WARD
NEAREST_NEIGHBOR_CHAIN_WARD
Definition poseClustering.h:189
SLINK_SIBSON
SLINK_SIBSON
Definition poseClustering.h:187
HEAVY_ATOMS
HEAVY_ATOMS
Definition poseClustering.h:178
CLINK_DEFAYS
CLINK_DEFAYS
Definition poseClustering.h:188
snapShot.h
string.h
BALL::PoseClustering::Default
Default values for options.
Definition poseClustering.h:159
BALL::PoseClustering::Default::DISTANCE_THRESHOLD
static const float DISTANCE_THRESHOLD
Definition poseClustering.h:161
BALL::PoseClustering::Default::USE_CENTER_OF_MASS_PRECLINK
static const bool USE_CENTER_OF_MASS_PRECLINK
Definition poseClustering.h:165
BALL::PoseClustering::Default::RUN_PARALLEL
static const bool RUN_PARALLEL
Definition poseClustering.h:164
BALL::PoseClustering::Default::RMSD_TYPE
static const Index RMSD_TYPE
Definition poseClustering.h:163
BALL::PoseClustering::Default::RMSD_LEVEL_OF_DETAIL
static const Index RMSD_LEVEL_OF_DETAIL
Definition poseClustering.h:162
BALL::PoseClustering::Default::CLUSTER_METHOD
static const Index CLUSTER_METHOD
Definition poseClustering.h:160
BALL::PoseClustering::Option
Option names.
Definition poseClustering.h:134
BALL::PoseClustering::Option::RUN_PARALLEL
static const String RUN_PARALLEL
Definition poseClustering.h:153
BALL::PoseClustering::Option::DISTANCE_THRESHOLD
static const String DISTANCE_THRESHOLD
Definition poseClustering.h:141
BALL::PoseClustering::Option::RMSD_TYPE
static const String RMSD_TYPE
Definition poseClustering.h:149
BALL::PoseClustering::Option::CLUSTER_METHOD
static const String CLUSTER_METHOD
Definition poseClustering.h:137
BALL::PoseClustering::Option::RMSD_LEVEL_OF_DETAIL
static const String RMSD_LEVEL_OF_DETAIL
Definition poseClustering.h:145
vector3.h