IMP  2.0.0
The Integrative Modeling Platform
proteomics_em_alignment_atomic.h
Go to the documentation of this file.
1 /**
2  * \file proteomics_em_alignment_atomic.h
3  * \brief align proteomics graph to em density map
4  *
5  * Copyright 2007-2013 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef IMPMULTIFIT_PROTEOMICS_EM_ALIGNMENT_ATOMIC_H
10 #define IMPMULTIFIT_PROTEOMICS_EM_ALIGNMENT_ATOMIC_H
11 
15 #include "AlignmentParams.h"
16 #include <IMP/core/LeavesRefiner.h>
21 #include <IMP/em/DensityMap.h>
22 #include <IMP/multifit/multifit_config.h>
23 #include <algorithm>
24 #include <boost/scoped_ptr.hpp>
25 
26 IMPMULTIFIT_BEGIN_NAMESPACE
27 
28 //the alignment is from the em anchors to the proteomics graph
29 // Alignments get_alignments(const AnchorData &anchor_graph,
30 // const ProteomicsData &prot_graph) {
31 class IMPMULTIFITEXPORT ProteomicsEMAlignmentAtomic : public base::Object {
32 public:
33  ProteomicsEMAlignmentAtomic(
34  const ProteinsAnchorsSamplingSpace &mapping_data,
35  multifit::SettingsData *asmb_data,
36  const AlignmentParams &align_param);
37  void align();
38  void add_all_restraints();
39  void add_states_and_filters();
40  void show_domino_merge_tree() const;
41  domino::Assignments get_combinations(bool uniques=false) const;
42  void set_density_map(em::DensityMap *dmap,float threshold) {
43  dmap_=dmap;threshold_=threshold;
44  }
45  atom::Hierarchies get_molecules() const {return mhs_;}
46  core::RigidBodies get_rigid_bodies() const {return rbs_;}
47  /* float load_configuration(int i) {
48  cg_->load_configuration(cg_sorted_[i].first);
49  return cg_sorted_[i].second;
50  }*/
51  //! load combination of states
52  //!The order of the states should be the order
53  void load_combination_of_states(const Ints &state4particles);
54  void show_scores_header(std::ostream& ous=std::cout) const;
55  /* void show_scores(const domino::Assignment &a,
56  std::ostream& out=std::cout) const;
57  */
58  Model * get_model() {return mdl_;}
59  //! If set to fast EV is calculated as penetration score and Fit
60  //! restraint is decomposed
61  void set_fast_scoring(bool state) {
62  fast_scoring_=state;
63  }
64 
65  IMP_OBJECT_INLINE(ProteomicsEMAlignmentAtomic, {IMP_UNUSED(out);}, {});
66 
67 protected:
68  RestraintsTemp get_alignment_restraints() const;
69  Pointer<domino::RestraintCache> rc_;
70  bool fast_scoring_;
71  domino::ParticleStatesTable*
72  set_particle_states_table(domino::SubsetFilterTables &filters);
73  void load_atomic_molecules();
74  // void sort_configurations();
75  ProteinsAnchorsSamplingSpace mapping_data_;
76  OwnerPointer<multifit::ProteomicsData> prot_data_;
77  Pointer<em::DensityMap> dmap_;
78  double threshold_;
79  atom::Hierarchies mhs_;
80  core::RigidBodies rbs_;
81  Pointer<Model> mdl_;
82  AlignmentParams params_;
83  IntsLists sampled_solutions_;//instead of cg
84  domino::Assignments sampled_assignments_;//instead of sampled_solutions
85  //configurations sorted by score
86  std::vector<std::pair<int,float> >cg_sorted_;
87  Pointer<RestraintSet> conn_rs_;
88  Pointer<RestraintSet> conn_rs_with_filter_;
89  Pointer<RestraintSet> xlink_rs_;
90  Pointer<RestraintSet> xlink_rs_with_filter_;
91  Pointer<RestraintSet> dummy_rs_;
92  Pointer<RestraintSet> em_rs_;
93  Pointer<RestraintSet> ev_rs_;
94  RestraintsTemp jt_rs_;
95  // Pointer<RestraintSet> ev_pruned_rs_;
96  // Pointer<RestraintSet> rog_rs_;
97  //Pointer<RestraintSet> other_rs_;//the other restraints
98  //Pointer<RestraintSet> fit_rs_;//the other restraints
99  OwnerPointer<domino::RestraintScoreSubsetFilterTable> all_rs_filt_;
100  IntKey fit_state_key_,order_key_;
101  bool restraints_set_,states_set_,filters_set_;
102  OwnerPointer<domino::ParticleStatesTable> pst_;
104  multifit::SettingsData *asmb_data_;
105  IntPairs post_sampling_ev_pairs_;
106  float ev_thr_;
107 };
108 IMP_OBJECTS(ProteomicsEMAlignmentAtomic, ProteomicsEMAlignmentAtomics);
109 
110 IMPMULTIFIT_END_NAMESPACE
111 
112 #endif /* IMPMULTIFIT_PROTEOMICS_EM_ALIGNMENT_ATOMIC_H */