IMP logo
IMP Reference Guide  2.20.0
The Integrative Modeling Platform
MolCnSymmAxisDetector.h
Go to the documentation of this file.
1 /**
2  * \file IMP/cnmultifit/MolCnSymmAxisDetector.h
3  * \brief molecule symmetry detector
4  *
5  * Copyright 2007-2022 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef IMPCNMULTIFIT_MOL_CN_SYMM_AXIS_DETECTOR_H
10 #define IMPCNMULTIFIT_MOL_CN_SYMM_AXIS_DETECTOR_H
11 
13 #include <IMP/algebra/Vector3D.h>
14 #include <IMP/em/DensityMap.h>
15 #include <IMP/core/XYZ.h>
16 #include <IMP/atom/Hierarchy.h>
17 #include <IMP/constants.h>
18 #include <vector>
19 #include <IMP/cnmultifit/cnmultifit_config.h>
20 
21 IMPCNMULTIFIT_BEGIN_NAMESPACE
22 
23 //! molecule symmetry detector
24 class IMPCNMULTIFITEXPORT MolCnSymmAxisDetector {
25  public:
26  MolCnSymmAxisDetector(int symm_deg, const atom::Hierarchies& mhs);
27  algebra::PrincipalComponentAnalysis get_pca() const { return pca_; }
28  algebra::Vector3D get_symmetry_axis() const;
29  int get_symmetry_axis_index() const;
30  void show(std::ostream& out = std::cout) const {
31  out << "symm degree:" << symm_deg_ << std::endl;
32  out << "symm axis:" << get_symmetry_axis_index() << std::endl;
33  pca_.show(out);
34  }
35  //! calculate the symmetry score around an axis
36  float calc_symm_score(int symm_axis_ind) const;
37 
38  protected:
40  algebra::PrincipalComponentAnalysis pca_;
41  int symm_deg_;
42  algebra::Transformation3D to_native_, from_native_;
43  Floats values_;
44  atom::Hierarchies mhs_;
45 };
47 
48 IMPCNMULTIFIT_END_NAMESPACE
49 
50 #endif /* IMPCNMULTIFIT_MOL_CN_SYMM_AXIS_DETECTOR_H */
Simple 3D transformation class.
Various useful constants.
Simple XYZ decorator.
Class for handling density maps.
Decorator for helping deal with a hierarchy of molecules.
#define IMP_VALUES(Name, PluralName)
Define the type for storing sets of values.
Definition: value_macros.h:23
std::ostream & show(Hierarchy h, std::ostream &out=std::cout)
Print the hierarchy using a given decorator to display each node.
VectorD< 3 > Vector3D
Definition: VectorD.h:425
Simple 3D vector class.
Principal component analysis of a set of points.