Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FoldTreeHybridize.hh
Go to the documentation of this file.
1 // -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*-
2 // vi: set ts=2 noet:
3 //
4 // (c) Copyright Rosetta Commons Member Institutions.
5 // (c) This file is part of the Rosetta software suite and is made available under license.
6 // (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
7 // (c) For more information, see http://www.rosettacommons.org. Questions about this can be
8 // (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
9 
10 /// @file
11 /// @brief Align a random jump to template
12 /// @detailed
13 /// @author Yifan Song
14 
15 #ifndef INCLUDED_protocols_hybridization_FoldTreeHybridize_hh
16 #define INCLUDED_protocols_hybridization_FoldTreeHybridize_hh
17 
23 
24 #include <core/id/AtomID.hh>
25 #include <core/id/AtomID_Map.hh>
28 
30 
32 
33 #include <protocols/loops/Loop.hh>
34 #include <protocols/loops/Loops.hh>
35 
36 #include <protocols/moves/Mover.hh>
37 
38 #include <ObjexxFCL/format.hh>
39 #include <numeric/random/random.hh>
40 #include <numeric/xyz.functions.hh>
41 #include <numeric/model_quality/rms.hh>
42 #include <numeric/model_quality/maxsub.hh>
43 
44 #include <basic/options/option.hh>
45 #include <basic/options/keys/OptionKeys.hh>
46 #include <basic/options/keys/in.OptionKeys.gen.hh>
47 #include <basic/options/keys/constraints.OptionKeys.gen.hh>
48 #include <basic/options/keys/rigid.OptionKeys.gen.hh>
49 #include <basic/Tracer.hh>
50 
51 // pairings
56 
57 #include <set>
58 
59 namespace protocols {
60 namespace hybridization {
61 
62 using namespace core;
63 using namespace protocols::moves;
64 using namespace protocols::loops;
65 
67 
68 public:
70 
72  core::Size const initial_template_index,
73  utility::vector1 < core::pose::PoseOP > const & template_poses,
74  utility::vector1 < core::Real > const & template_weights,
75  utility::vector1 < protocols::loops::Loops > const & template_chunks,
76  utility::vector1 < protocols::loops::Loops > const & template_contigs,
77  core::fragment::FragSetOP fragments_small_in,
78  core::fragment::FragSetOP fragments_big_in );
79 
80  // initialize options to defaults
81  void init();
82 
83  void revert_loops_to_original(core::pose::Pose & pose, Loops loops);
84 
85  void set_loops_to_virt_ala(core::pose::Pose & pose, Loops loops);
86 
87  Real gap_distance(Size Seq_gap);
88 
89  void add_gap_constraints_to_pose(core::pose::Pose & pose, Loops const & chunks, int gap_edge_shift=0, Real stdev=0.1);
90 
91  void restore_original_foldtree(core::pose::Pose & pose);
92 
93  void setup_foldtree(core::pose::Pose & pose);
94 
96 
97  void translate_virt_to_CoM(core::pose::Pose & pose);
98 
99  utility::vector1< core::Real > get_residue_weights_for_1mers(core::pose::Pose & pose);
100  utility::vector1< core::Real > get_residue_weights_for_small_frags(core::pose::Pose & pose);
101  utility::vector1< core::Real > get_residue_weights_for_big_frags(core::pose::Pose & pose);
102 
103  void set_constraint_file(std::string cst_file_in) { cst_file_=cst_file_in; }
104  void set_increase_cycles(core::Real increase_cycles_in) { increase_cycles_=increase_cycles_in; }
105  void set_stage1_1_cycles(core::Size stage1_1_cycles_in) { stage1_1_cycles_=stage1_1_cycles_in; }
106  void set_stage1_2_cycles(core::Size stage1_2_cycles_in) { stage1_2_cycles_=stage1_2_cycles_in; }
107  void set_stage1_3_cycles(core::Size stage1_3_cycles_in) { stage1_3_cycles_=stage1_3_cycles_in; }
108  void set_stage1_4_cycles(core::Size stage1_4_cycles_in) { stage1_4_cycles_=stage1_4_cycles_in; }
109  void set_add_non_init_chunks(bool add_non_init_chunks_in) { add_non_init_chunks_=add_non_init_chunks_in; }
110  void set_domain_assembly(bool domain_assembly_in) { domain_assembly_=domain_assembly_in; }
111  void set_add_hetatm(bool add_hetatm_in, core::Real hetatm_cst_weight_in) { add_hetatm_=add_hetatm_in; hetatm_cst_weight_=hetatm_cst_weight_in; }
112  void set_frag_1mer_insertion_weight(core::Real frag_1mer_insertion_weight_in) { frag_1mer_insertion_weight_=frag_1mer_insertion_weight_in; }
113  void set_small_frag_insertion_weight(core::Real small_frag_insertion_weight_in) { small_frag_insertion_weight_=small_frag_insertion_weight_in; }
114  void set_big_frag_insertion_weight(core::Real big_frag_insertion_weight_in) { big_frag_insertion_weight_=big_frag_insertion_weight_in; }
115  void set_frag_weight_aligned(core::Real frag_weight_aligned_in) { frag_weight_aligned_=frag_weight_aligned_in; }
116  void set_auto_frag_insertion_weight(bool auto_frag_insertion_weight_in) { auto_frag_insertion_weight_ = auto_frag_insertion_weight_in; }
117  void set_max_registry_shift(core::Size max_registry_shift_in) { max_registry_shift_=max_registry_shift_in; }
118  void set_top_n_big_frag(core::Size top_n_big_frag_in) { top_n_big_frag_=top_n_big_frag_in; }
119  void set_top_n_small_frag(core::Size top_n_small_frag_in) { top_n_small_frag_=top_n_small_frag_in; }
120 
121  // strand pairings
122  void set_pairings_file( std::string pairings_file_in ) { pairings_file_ = pairings_file_in; }
123  void set_sheets( utility::vector1< core::Size > sheets_in ) { sheets_ = sheets_in; }
124  void set_random_sheets( utility::vector1< core::Size > random_sheets_in ) { random_sheets_ = random_sheets_in; }
125  void set_filter_templates( bool filter_templates_in ) { filter_templates_ = filter_templates_in; }
126 
127  inline void set_scorefunction(core::scoring::ScoreFunctionOP const scorefxn) { scorefxn_ = scorefxn; }
128 
129  void setup_scorefunctions(
135 
136  void apply(core::pose::Pose & pose);
137 
138  std::string get_name() const;
139 
140  // strand pairings
142  std::set< core::Size > get_pairings_residues();
143 
144 private:
145 
146  void normalize_template_wts();
147 
148  // automatically set the fragment insertion weight
149  void auto_frag_insertion_weight(
150  WeightedFragmentTrialMoverOP & frag_1mer_trial_mover,
151  WeightedFragmentTrialMoverOP & small_frag_trial_mover,
152  WeightedFragmentTrialMoverOP & big_frag_trial_mover
153  );
154 
155  utility::vector1< core::Size > get_jump_anchors();
156 
157  // strand pairings
158  void add_strand_pairings();
159  void add_strand_pairing( core::scoring::dssp::Pairing const & pairing );
160  void filter_templates( std::set< core::Size > const & templates_to_remove );
161  void superimpose_strand_pairings_to_templates(core::pose::Pose & pose);
162  core::Size map_pdb_info_number( const core::pose::Pose & pose, core::Size pdb_res );
163  protocols::simple_moves::ClassicFragmentMoverOP get_pairings_jump_mover();
164 
165 
166 private:
172 
173  // 1mer fragment insertion weight where large and small fragments are not allowed (across anchor points) vs. chunk insertion + big and small fragments
175  // small fragment insertion weight where large fragments are not allowed (across anchor points) vs. chunk insertion + big fragments
177  // fragment insertion weight, vs. chunk insertion + small gap fragments
183  core::Real frag_weight_aligned_; // fragment insertion to the aligned region, vs. unaligned region
184  bool auto_frag_insertion_weight_; // automatically set the fragment insertion weight
187 
197 
199 
202 
203  // strand pairings
210  std::set< core::Size > strand_pairings_template_indices_;
214  std::set< core::Size > floating_pairs_;
215 
217 
219 
221 
222 }; //class FoldTreeHybridize
223 
224 } // hybridization
225 } // protocols
226 
227 #endif