IMP  2.3.1
The Integrative Modeling Platform
AlignSymmetric.h
Go to the documentation of this file.
1 /**
2  * \file IMP/cnmultifit/AlignSymmetric.h
3  * \brief Fast alignment of a cyclic model to its density.
4  *
5  * Copyright 2007-2014 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef IMPCNMULTIFIT_ALIGN_SYMMETRIC_H
10 #define IMPCNMULTIFIT_ALIGN_SYMMETRIC_H
11 
12 #include <IMP/cnmultifit/cnmultifit_config.h>
13 #include <IMP/em/DensityMap.h>
14 #include "CnSymmAxisDetector.h"
15 #include <boost/scoped_ptr.hpp>
16 
17 IMPCNMULTIFIT_BEGIN_NAMESPACE
18 
19 //! A class for fast alignment of a cyclic model to its density
20 /**
21 The class supports Cn and Dn symmetry
22  */
23 class IMPCNMULTIFITEXPORT AlignSymmetric {
24  public:
25  //! Constructor
26  /**
27 \param[in] dmap the density map
28 \param[in] threshold density threshold used for determining the map PCA
29 \param[in] cn_symm_deg the ring symmetry degree
30  */
31  AlignSymmetric(em::DensityMap* dmap, float threshold,
32  int cn_symm_deg); //,int dn_symm_deg=1);
33  Floats get_sorted_principal_values() const { return map_v_; }
34  //! Return the number of matching eigen vectors by their eigen values
35  /**
36  \param[in] mhs the model to align with the density
37  \param[in] max_allowed_diff the maximum allowed difference between matching
38  eigen values
39  */
40  int score_alignment(atom::Hierarchies mhs, float max_allowed_diff);
41  //! Return the two alignments that match the model symmetry axis on
42  //! the density symmetry axis
43  algebra::Transformation3Ds get_symm_axis_alignments_from_model_to_density(
44  atom::Hierarchies mhs, bool sample_translation,
45  bool fine_rotation_sampling = true) const;
46 
47  void show(std::ostream& out = std::cout) const {
48  out << "AlignSymmetric with cn_symm_deg " << cn_symm_deg_ << std::endl;
49  }
50 
51  protected:
52  algebra::Transformation3Ds generate_cn_density_rotations(bool fine =
53  false) const;
54 
55  algebra::Transformation3Ds generate_cn_density_translations() const;
56 
57  float spacing_;
58  boost::scoped_ptr<CnSymmAxisDetector> symm_map_;
59  int cn_symm_deg_, dn_symm_deg_;
60  Floats map_v_; // the principal values of non-symm axis first
61 };
63 
64 IMPCNMULTIFIT_END_NAMESPACE
65 
66 #endif /* IMPCNMULTIFIT_ALIGN_SYMMETRIC_H */
Detect cn symmetry in proteins and density maps.
Class for handling density maps.
Class for handling density maps.
Definition: DensityMap.h:94
#define IMP_VALUES(Name, PluralName)
Define the type for storing sets of values.
Definition: value_macros.h:23
A class for fast alignment of a cyclic model to its density.
void show(Hierarchy h, std::ostream &out=std::cout)
Print out a molecular hierarchy.