5 #ifndef BALL_DOCKING_POSECLUSTERING_H
6 #define BALL_DOCKING_POSECLUSTERING_H
8 #ifndef BALL_DATATYPE_OPTIONS_H
12 #ifndef BALL_DOCKING_COMMON_CONFORMATIONSET_H
16 #ifndef BALL_MOLMEC_COMMON_SNAPSHOT_H
20 #ifndef BALL_STRUCTURE_ATOMBIJECTION_H
24 #ifndef BALL_KERNEL_SYSTEM_H
28 #ifndef BALL_DATATYPE_STRING_H
32 #ifndef BALL_MATHS_VECTOR3_H
36 #ifndef BALL_MATHS_MATRIX44_H
42 #include <boost/shared_ptr.hpp>
43 #include <boost/variant.hpp>
44 #include <boost/graph/adjacency_list.hpp>
50 #undef POSECLUSTERING_DEBUG
153 CENTER_OF_MASS_DISTANCE
162 PROPERTY_BASED_ATOM_BIJECTION
170 NEAREST_NEIGHBOR_CHAIN_WARD
179 : translation(new_trans),
227 boost::variant<Eigen::VectorXf, RigidTransformation>
center;
232 #ifdef POSECLUSTERING_DEBUG
235 float current_cluster_id;
239 typedef boost::adjacency_list<boost::vecS,
286 void setBaseSystemAndPoses(
System const& base_system, std::vector<PosePointer>
const& poses);
291 void setBaseSystemAndTransformations(
System const& base_system,
String transformation_file_name);
300 const System& getSystem()
const;
313 const std::set<Index>& getCluster(
Index i)
const;
317 std::set<Index>& getCluster(
Index i);
323 float getClusterScore(
Index i)
const;
329 boost::shared_ptr<System> getPose(
Index i)
const;
332 boost::shared_ptr<System> getClusterRepresentative(
Index i)
const;
335 boost::shared_ptr<ConformationSet> getClusterConformationSet(
Index i);
338 boost::shared_ptr<ConformationSet> getReducedConformationSet();
353 bool refineClustering(
Options const& refined_options);
365 void setDefaultOptions();
377 static float getRigidRMSD(Eigen::Vector3f
const& t_ab, Eigen::Matrix3f
const& M_ab, Eigen::Matrix3f
const& covariance_matrix);
384 static float getSquaredRigidRMSD(Eigen::Vector3f
const& t_ab, Eigen::Matrix3f
const& M_ab, Eigen::Matrix3f
const& covariance_matrix);
388 static Eigen::Matrix3f computeCovarianceMatrix(
System const& system,
Index rmsd_level_of_detail =
C_ALPHA);
400 std::vector<std::set<Index> > extractClustersForThreshold(
float threshold);
405 std::vector<std::set<Index> > extractNBestClusters(
Size n);
409 void exportWardClusterTree(std::ostream& out);
416 void printClusters(std::ostream& out = std::cout)
const;
420 void printClusterRMSDs(std::ostream& out = std::cout);
431 : cluster_tree_(cluster_tree)
434 void operator() (std::ostream& out,
const ClusterTreeNode& v)
const;
446 : cluster_tree_(&cluster_tree)
449 bool operator() (ClusterTreeNode
const first, ClusterTreeNode
const second)
const
451 float first_value = (*cluster_tree_)[ first].merged_at;
452 float second_value = (*cluster_tree_)[second].merged_at;
454 return first_value < second_value;
463 bool trivialCompute_();
466 bool linearSpaceCompute_();
471 void slinkInner_(
int current_level);
476 void clinkInner_(
int current_level);
482 bool nearestNeighborChainCompute_();
484 void initWardDistance_(
Index rmsd_type);
486 void updateWardDistance_(ClusterTreeNode parent, ClusterTreeNode i, ClusterTreeNode j,
Index rmsd_type);
488 float computeWardDistance_(ClusterTreeNode i, ClusterTreeNode j,
Index rmsd_type);
490 std::set<Index> collectClusterBelow_(ClusterTreeNode
const& v);
493 void computeCenterOfMasses_();
496 void precomputeAtomBijection_();
499 bool static isExcludedByLevelOfDetail_(
Atom const* atom,
Index rmsd_level_of_detail);
508 bool readTransformationsFromFile_(
String filename);
514 void storeSnapShotReferences_();
517 void convertTransformations2Snaphots_();
520 void convertSnaphots2Transformations_();
523 void printCluster_(
Index i, std::ostream& out = std::cout)
const;
526 void printVariables_(
int a,
int b,
double c,
int d,
double e,
int current_level);
608 #endif // BALL_DOCKING_POSECLUSTERING_H
#define BALL_CREATE(name)
std::vector< double > mu_
std::vector< double > lambda_
static const String RMSD_TYPE
static const Index RMSD_TYPE
ClusterTree * cluster_tree_
bool delete_conformation_set_
std::vector< std::set< Index > > clusters_
the clusters: sets of pose indices
std::vector< Vector3 > com_
static const String CLUSTER_METHOD
Eigen::Matrix3f covariance_matrix_
static const float DISTANCE_THRESHOLD
bool has_rigid_transformations_
const ConformationSet * getConformationSet() const
returns the poses to be clustered as ConformationSet
ClusterTreeWriter_(ClusterTree const *cluster_tree)
ClusterTreeNodeComparator(ClusterTree &cluster_tree)
Index rmsd_level_of_detail_
the RMSD definition used for clustering
RigidTransformation const * trafo
PosePointer(RigidTransformation const *new_trafo, SnapShot const *new_snap=0)
ClusterTreeNode cluster_tree_root_
BALL_EXTERN_VARIABLE const double c
static const Index CLUSTER_METHOD
boost::variant< Eigen::VectorXf, RigidTransformation > center
Eigen::MatrixXd pairwise_scores_
Computation of clusters of docking poses.
ClusterTree const * cluster_tree_
ConformationSet * current_set_
the ConformationSet we wish to cluster
static const String DISTANCE_THRESHOLD
Size getNumberOfClusters() const
returns the number of clusters found
Size getNumberOfPoses() const
returns the number of poses
static const String RMSD_LEVEL_OF_DETAIL
PosePointer(SnapShot const *new_snap)
ConformationSet * getConformationSet()
returns the poses to be clustered as ConformationSet
boost::adjacency_list< boost::vecS, boost::vecS, boost::directedS, ClusterProperties > ClusterTree
std::vector< float > cluster_scores_
the scores of the clusters
-*- Mode: C++; tab-width: 2; -*-
std::vector< PosePointer > poses_
Size number_of_selected_atoms_
static const Index RMSD_LEVEL_OF_DETAIL
static const bool USE_CENTER_OF_MASS_PRECLINK
ClusterTree cluster_tree_
The tree built during hierarchical clustering.
std::vector< RigidTransformation > transformations_
SnapShot base_conformation_
Default values for options.
ClusterTree::vertex_descriptor ClusterTreeNode
AtomBijection atom_bijection_