IMP  2.0.0
The Integrative Modeling Platform
AlignSymmetric.h
Go to the documentation of this file.
1 /**
2  * \file AlignSymmetric.h
3  * \brief Fast alignment of a cyclic model to its density.
4  *
5  * Copyright 2007-2013 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,
41  float max_allowed_diff);
42  //! Return the two alignments that match the model symmetry axis on
43  //! the density symmetry axis
44  algebra::Transformation3Ds get_symm_axis_alignments_from_model_to_density(
45  atom::Hierarchies mhs,bool sample_translation,
46  bool fine_rotation_sampling=true) const;
47 
48  void show(std::ostream& out=std::cout) const {
49  out << "AlignSymmetric with cn_symm_deg " << cn_symm_deg_ << std::endl;
50  }
51 
52 protected:
53  algebra::Transformation3Ds generate_cn_density_rotations(
54  bool fine=false) const;
55 
56  algebra::Transformation3Ds generate_cn_density_translations()const;
57 
58  float spacing_;
59  boost::scoped_ptr<CnSymmAxisDetector> symm_map_;
60  int cn_symm_deg_,dn_symm_deg_;
61  Floats map_v_; //the principal values of non-symm axis first
62 };
64 
65 IMPCNMULTIFIT_END_NAMESPACE
66 
67 #endif /* IMPCNMULTIFIT_ALIGN_SYMMETRIC_H */