Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PeakAssignmentParameters.cc
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 FragmentSampler.cc
11 /// @brief ab-initio fragment assembly protocol for proteins
12 /// @detailed
13 /// Contains currently: Classic Abinitio
14 ///
15 ///
16 /// @author Oliver Lange
17 
18 // Unit Headers
19 #define DEFINE_OPTIONS_NOW
21 #undef DEFINE_OPTIONS_NOW
22 
24 
25 // Package Headers
26 //#include <devel/noesy_assign/Exceptions.hh>
27 
28 // Project Headers
29 
30 // Utility headers
31 #include <basic/Tracer.hh>
32 
33 // Utility headers
34 #include <basic/options/option_macros.hh>
35 
36 
37 //// C++ headers
38 #include <cstdlib>
39 #include <string>
40 
41 #include <utility/vector1.hh>
42 
43 
45 
47 
50  if ( instance_ ) return instance_;
53  return instance_;
54 }
55 
56 void
58  if ( instance_ ) delete instance_;
59  instance_ = NULL;
60 }
61 
64  if ( instance_ ) return instance_;
65  instance_ = new PeakAssignmentParameters;
66  instance_->set_options_from_cmdline();
67  return instance_;
68 }
69 
71  if ( instance_ ) delete instance_;
72  instance_ = new PeakAssignmentParameters;
73  instance_->set_options_from_cmdline( cycle );
74 }
75 
77  using namespace basic::options;
78  using namespace OptionKeys;
79  if ( options_registered_ ) return;
80 
81  //cycle independent
82  NEW_OPT( noesy_weights::chemshift, "contribution of chem. shift overlap to peak volume", 0.5 );
83  // NEW_OPT( noesy_weights::network_high, "contribution of network anchoring to peak volume", 10.0 );
84  NEW_OPT( noesy::ignore_resonancefile_tolerances, "ignore the tolerances in the resonance file", false );
85  NEW_OPT( noesy::ignore_resonancefile_intensities, "ignore the tolerances in the resonance file", false );
86 
87 //cycle dependent -- cycle defaults
88  NEW_OPT7( noesy_weights::defaults::Vmin, "acceptable minimial volume contribution per assignment", 0.01, 0.001, 0.005, 0.01, 0.025, 0.05, 0.501 );
89  NEW_OPT7( noesy_weights::defaults::symmetry, "contribution of symmetry compliance to peak volume", 10.0, 10.0, 10.0, 10.0, 1.0, 1.0, 1.0 );
90  NEW_OPT7( noesy_weights::defaults::covalent, "contribution of local covalent compliance to peak volume", 10.0, 10.0, 10.0, 1.0, 1.0, 1.0, 1.0 );
91  // NEW_OPT7( noesy_weights::defaults::decoys, "exponent controlling contribution of decoy compliance to peak volume", 3, 3, 6, 6, 6, 6, 6 );
92  NEW_OPT7( noesy_weights::defaults::Smax,"maximum cumulative contribution of symmetry, covalent and network to peak volume", 20, 20, 20, 20, 10, 10, 10 );
93  NEW_OPT7( noesy_weights::defaults::dcut, "upper limit on acceptable distance violation for elimination of spurious NOESY cross peaks (A)", -1, 1.5, 0.9, 0.6, 0.3, 0.1, 0.1 );
94  // NEW_OPT7( noesy_weights::defaults::reswise_min, "Threshold for acceptable lower limit of network-anchoring per residue", 1.0, 0.75, 0.5, 0.5, 0.5, 0.5, 0.5 );
95  // NEW_OPT7( noesy_weights::defaults::atomwise_min, "contribution of network anchoring to peak volume", 0.25, 0.25, 0.4, 0.4, 0.4, 0.4, 0.4 );
96  NEW_OPT7( noesy_weights::defaults::dcalibrate, "upper limit on acceptable distance violation for structure dependent calibration (A)", -1, 1.5, 0.9, 0.6, 0.3, 0.1, 0.1 );
97  NEW_OPT7( noesy_weights::defaults::calibration_target, "target for NOE calibration > 1 -- (A) (structure independent ) <1 (%) of models violated", 3.8, 0.15, 0.15, 0.1, 0.1, 0.1, 0.1 );
98 
99  //cycle dependent
100  NEW_OPT( noesy_weights::Vmin, "acceptable minimial volume contribution per assignment", 0.01 );
101  NEW_OPT( noesy_weights::symmetry, "contribution of symmetry compliance to peak volume", 10.0 );
102  NEW_OPT( noesy_weights::covalent, "contribution of local covalent compliance to peak volume", 10.0 );
103  // NEW_OPT( noesy_weights::decoys, "exponent controlling contribution of decoy compliance to peak volume", 3 );
104  NEW_OPT( noesy_weights::Smax,"maximum cumulative contribution of symmetry, covalent and network to peak volume", 20 );
105  NEW_OPT( noesy_weights::dcut, "upper limit on acceptable distance violation for elimination of spurious NOESY cross peaks (A)", -1 );
106 
107  // NEW_OPT( noesy_weights::network_min, "Threshold for acceptable lower limit of network-anchoring per residue", 1.0 );
108  //NEW_OPT( noesy_weights::network_atom_min, "contribution of network anchoring to peak volume", 0.25 );
109  NEW_OPT( noesy_weights::dcalibrate, "upper limit on acceptable distance violation for structure dependent calibration (A)", -1 );
110  NEW_OPT( noesy_weights::calibration_target, "target for NOE calibration > 1 -- (A) (structure independent ) <1 (%) of models violated", 5 );
111  NEW_OPT( noesy::atom_dependent_calibration, "individual calibration constants per atom-group: backbone, side-chain, methyl", false );
112 
113  NEW_OPT( noesy::map_to_cen_atom,"map the centroid restraints to CEN atom", false );
114 
115  NEW_OPT( noesy_weights::elim_dist_viol, "percentage of decoys that can be violated by distance constraints before it is eliminated ->set to 1 to switch this feature off", 0.5 );
116 
117  NEW_OPT( noesy_weights::cst_strength, "curvature of the constraint potential after upper distance is violated", 4 );
118  NEW_OPT( noesy_weights::cycle, "set to cycle 1-7 to select a set of cycle-dependent options", 1 );
119  NEW_OPT( noesy_weights::centroid_padding, "if sidechain NOESY are mapped to CB add some padding", 0.5 );
120  NEW_OPT( noesy_weights::min_symmetry_reinforcement, "minimum contribution to symmetry score from a symmetric peak", 0.0 );
121  NEW_OPT( noesy::no_network, "skip network analysis", false );
122  NEW_OPT( noesy::network::reswise_min, "Threshold for acceptable lower limit of network-anchoring per residue", 1.0 );
123  NEW_OPT( noesy::network::reswise_high, "Threshold for always accepted (disregard atomwise_min) network anchoring per residue", 4.0 );
124  NEW_OPT( noesy::network::atomwise_min, "Threshold for acceptable network-anchoring per assignment", 0.25 );
125  NEW_OPT( noesy::network::include_reverse_dir, "scan a->y->b and also b->y->a noesy connections to validate a->b", true );
126  NEW_OPT( noesy::network::allow_same_residue_connect, "scan also a->y->b', a'->y->b and a'->y-b' with a' and b' in same residues as a and b, respectively", true);
127  NEW_OPT( noesy::network::use_all_covalent_atoms, "resonance list contains atoms (e.g., CA, CB) that are never part of an assignment (e.g., H, QD1, etc.) should CA, CB be included in network analysis? ", false );
128  NEW_OPT( noesy::network::mode, "choose implementation of network anchoring to be used [orig,clean]", "clean" );
129  NEW_OPT( noesy::network::vmin, "minimum contribution to peak-volume to be considered for network anchoring", 0.1 );
130  NEW_OPT( noesy::network::vmax, "minimum contribution to peak-volume to be considered for network anchoring", 1.0 );
131  NEW_OPT( noesy::use_local_distviol, "don't use global distance-violation parameter dcut, but make-up local one using the distribution of distances", false );
132  NEW_OPT( noesy::local_distviol::range, "get distance-difference between lowest X% and hightest X% of decoys", 0.99 );
133  NEW_OPT( noesy::local_distviol::global_buffer, "add an extra grace-buffer (A) to the local range before you evaluate dist-cutoff", 0.5 );
134  NEW_OPT( noesy::local_distviol::global_factor, "allow violation of X*interval beofre eliminated", 1.0 );
135  NEW_OPT( noesy::local_distviol::cutoff, "peaks with a low-quartil distance of more than X are always removed", 8.0 );
136  NEW_OPT( noesy::local_distviol::cutoff_buffer, "peaks with a low-quartil distance of more than X+distance_bound are always removed", 2.0 );
137 
138  NEW_OPT( noesy::calibration::convergence, "use only distance with stddev (over ensemble) of less than X Angstrom for calibration (0=all)", 0 );
139  NEW_OPT( noesy::calibration::max_noe_dist, "use max_noe_dist to cap upper distance bounds, this value is overwritten by content in file", 0 );
140  NEW_OPT( noesy::calibration::max_nudging, "individual restraint can be extended by maximum of X% of original calibrated distance", 1.0 );
141  NEW_OPT( noesy::calibration::start_nudging,"start nudging if X% or more conformers violate original calibrated distance", 0.1 );
142  NEW_OPT( noesy::calibration::stop_nudging,"stop nudging if only X% of conformers violated original calibrated distance", 0.1 );
143  NEW_OPT( noesy::calibration::eliminate, "enable elimination by distance violation and nudging even when dcalibrate -1", false );
144  NEW_OPT( noesy::calibration::use_median, "use median and not average for calibration", false );
145  NEW_OPT( noesy::calibration::cycles, "how many cycles of calibration and elimination by distance-violation", 1 );
146  NEW_OPT( noesy::calibration::ignore_eliminated_peaks, "ignore peaks that are already eliminated", false );
147 
148  NEW_OPT5( noesy::prob::sigmoid::tau, "tau and m parameter for sigmoids in crosspeak-probability score", 0.3, 1, .2, 0.2, 2);
149  NEW_OPT5( noesy::prob::sigmoid::m, "tau and m parameter for sigmoids in crosspeak-probability score", 0.5, 2, .4, 0.5, 4);
150  NEW_OPT2( noesy::prob::level, "selection levels for HI, MED, LOW probability cross-peaks", 0.7, 0.45 );
151  NEW_OPT5( noesy::prob::sigmoid::w, "sigmoid contribution", 0.2000, 0.6000, 0.2000, 0.4000, 0.2000 );
152  options_registered_ = true;
153 }
154 
155 
156 static basic::Tracer tr("protocols.noesy_assign.parameters");
157 
158 
160  using namespace basic::options::OptionKeys;
161  using namespace basic::options;
162 
163  runtime_assert( options_registered_ );
164 
165  //set cycle from cmdline if not specified
166  //if ( cycle_selector_ == 0 )
167  if ( !cycle_selector ) {
168  cycle_selector_ = option[ noesy_weights::cycle ]();
169  } else {
170  cycle_selector_ = cycle_selector;
171  }
172 
173  //cycle independent
174  chemshift_overlap_weight_ = option[ noesy_weights::chemshift ](); //Gamma, eq. (4)
175  ignore_resonancefile_tolerances_ = option[ noesy::ignore_resonancefile_tolerances ]();
176  ignore_resonancefile_intensities_ = option[ noesy::ignore_resonancefile_intensities ]();
177  // dmax_ = 5.5;
178  vmin_ = option[ noesy::network::vmin ](); //previously 0.1 minimum peak-volume contribution to network anchoring
179  vmax_ = option[ noesy::network::vmax ](); //previously 1.0; //maximum peak-volume contribution to network anchoring
180  nmax_ = 20; //maximum number of assignments
181  nr_conformers_violatable_ = option[ noesy_weights::elim_dist_viol ](); // M/2
182  network_reswise_min_ = option[ noesy::network::reswise_min ]();
183  network_atom_min_ = option[ noesy::network::atomwise_min ]();
184  // opt_read_out_macro( network_reswise_min_, network_min );
185  // opt_read_out_macro( network_atom_min_, network_atom_min );
186  network_reswise_high_ = option[ noesy::network::reswise_high ]();// 4.0; //used in network-based elimination
187  centroid_mapping_distance_padding_ = option[ noesy_weights::centroid_padding ]();
188 
189  //cycle dependent
190 #define opt_read_out_macro( VAR, OPT ) \
191 { VAR = option[ noesy_weights::defaults::OPT ]()[ cycle_selector_ ]; \
192  if ( option [ noesy_weights::OPT ].user() ) { \
193  VAR = option[ noesy_weights::OPT ](); \
194  }\
195 }\
196 
197 
198  //read cycle-dependent default value -- overwrite if option is selected
199  opt_read_out_macro( min_volume_, Vmin );
200  opt_read_out_macro( symmetry_compliance_weight_, symmetry );
201  opt_read_out_macro( covalent_compliance_weight_, covalent );
202  // opt_read_out_macro( decoy_compatibility_exponent_, decoys );
203  opt_read_out_macro( smax_, Smax );
204  opt_read_out_macro( dcut_, dcut );
205  opt_read_out_macro( dcalibrate_, dcalibrate );
206 
207  opt_read_out_macro( calibration_target_, calibration_target );
208 
209  atom_dependent_calibration_ = option[ noesy::atom_dependent_calibration ];
210  map_to_cen_atom_ = option[ noesy::map_to_cen_atom ];
211 
212  no_network_ = option[ noesy::no_network ]();
213  network_include_reverse_dir_= option[ noesy::network::include_reverse_dir ];
214  network_allow_same_residue_connect_ = option[ noesy::network::allow_same_residue_connect ];
215  network_use_all_covalent_atoms_ = option[ noesy::network::use_all_covalent_atoms ];
216  network_mode_ = option[ noesy::network::mode ]();
217  cst_strength_ = option[ noesy_weights::cst_strength ]();
218  min_contribution_symmetric_peaks_ = option[ noesy_weights::min_symmetry_reinforcement ];
219  use_local_distviol_ = option[ noesy::use_local_distviol ]();
220  local_distviol_range_ = option[ noesy::local_distviol::range ]();
221  local_distviol_global_buffer_ = option[ noesy::local_distviol::global_buffer ]();
222  local_distviol_global_factor_ = option[ noesy::local_distviol::global_factor ]();
223  local_distviol_cutoff_ = option[ noesy::local_distviol::cutoff ]();
224  local_distviol_cutoff_buffer_ = option[ noesy::local_distviol::cutoff_buffer ]();
225 
226  calibration_convergence_ = option[ noesy::calibration::convergence ]();
227  calibration_max_noe_dist_ = option[ noesy::calibration::max_noe_dist ]();
228  calibration_stop_nudging_ = option[ noesy::calibration::stop_nudging ]();
229  calibration_start_nudging_ = option[ noesy::calibration::start_nudging ]();
230  calibration_max_nudging_ = option[ noesy::calibration::max_nudging ]();
231  calibration_eliminate_ = option[ noesy::calibration::eliminate ]();
232  calibration_use_median_ = option[ noesy::calibration::use_median ]();
233  calibration_ignore_eliminated_peaks_ = option[ noesy::calibration::ignore_eliminated_peaks ]();
234  calibration_cycles_ = option[ noesy::calibration::cycles ]();
235 
236  if ( local_distviol_range_ <= 0.5 ) {
237  utility_exit_with_message( "local_distviol::range must be in the range 0.5...1.0" );
238  }
239 
240  prob_level_ = option[ noesy::prob::level ]();
241  prob_sigmoid_tau_ = option[ noesy::prob::sigmoid::tau ]();
242  prob_sigmoid_m_ = option[ noesy::prob::sigmoid::m ]();
243  prob_sigmoid_w_ = option[ noesy::prob::sigmoid::w ]();
244  show_on_tracer();
245 }
246 
248  os << " ============== cycle-dependent parameter selection for Noesy peak assignment =============== " << std::endl;
249  os << " cycle: " << cycle_selector_ << std::endl;
250  os << "----------------------------------------------------------------------------------------------" << std::endl;
251  os << " Vmin: " << min_volume_ << std::endl;
252  os << " T: " << symmetry_compliance_weight_ << std::endl;
253  os << " V: " << covalent_compliance_weight_ << std::endl;
254  // os << " eta: " << decoy_compatibility_exponent_ << std::endl;
255  os << " Smax: " << smax_ << std::endl;
256  os << " dcut: " << dcut_ << std::endl;
257  os << " Nmin(res): " << network_reswise_min_ << std::endl;
258  os << " Nmin(atom): " << network_atom_min_ << std::endl;
259  os << " Calibration Target: " << calibration_target_ << ( calibration_target_ >= 1 ? " (A) average distance " : " fract. of constraints violate input structures " ) << std::endl;
260  os << " Calibration distance: " << dcalibrate_ << " A above upper bound is a violation" << std::endl;
261  os << "==============================================================================================" << std::endl;
262 
263  os << " ============== cycle-independent parameter for Noesy peak assignment =============== " << std::endl;
264  os << " chemical shift agreement-weight: " << chemshift_overlap_weight_ << std::endl;
265  os << " elimination of peak if distance-bound violates more than: " << nr_conformers_violatable_ << std::endl;
266  os << " elimination MAXASSIGN if assignments count is above: " << nmax_ << std::endl;
267  // os << " contribution of network anchoring to peak volume XXX" << std::endl;
268  os << " strength (curvature) of the constraint potential after upper distance is violated " << cst_strength_ << std::endl;
269  os << " padding for CB-mapped protons in centroid mode: " << centroid_mapping_distance_padding_ << std::endl;
270  os << " atom_dependent_calibration: " << (atom_dependent_calibration_ ? "yes" : "no" ) << std::endl;
271  os << "----------------------------------------------------------------------------------------------" << std::endl;
272  if ( !no_network_ ) {
273  os << " network-anchoring options: " << std::endl;
274  os << " minimum contribution to peak-volume " << vmin_ << std::endl;
275  os << " maximum contribution to peak-volume " << vmax_ << std::endl;
276  os << " do not eliminate if network score per residue is above " << network_reswise_high_ << std::endl;
277  os << " network_include_reverse_dir: " << (network_include_reverse_dir_ ? "yes ": "no " ) << std::endl;
278  os << " network_allow_same_residue_connection: " << (network_allow_same_residue_connect_ ? "yes ": "no " ) << std::endl;
279  os << " network_use_all_covalent_atoms: " << (network_use_all_covalent_atoms_ ? "yes" : "no" ) << std::endl;
280  } else {
281  os << " no network-anchoring applied! " << std::endl;
282  }
283  if ( use_local_distviol_ ) {
284  os << " use local distance violation " << std::endl;
285  os << " local distance violation range " << local_distviol_range_*100 << "%" << std::endl;
286  os << " add the following constant distance " << local_distviol_global_buffer_ << std::endl;
287  os << " multiply max-extension by " << local_distviol_global_factor_ << std::endl;
288  }
289  os << "==============================================================================================" << std::endl;
290 }
291 
293  show( tr.Info );
294 }
295 
296 
297 namespace protocols {
298 namespace noesy_assign {
299 using namespace core;
300 
301 }
302 }