Rosetta
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
erraser_minimizer.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
11 /// @brief
12 
13 #include <protocols/farna/util.hh>
14 #include <core/pose/rna/RNA_IdealCoord.hh>
15 #include <protocols/stepwise/modeler/rna/util.hh>
16 #include <protocols/stepwise/modeler/output_util.hh>
17 // libRosetta headers
18 #include <core/types.hh>
19 #include <core/chemical/AA.hh>
20 #include <core/chemical/AtomType.hh>
21 #include <core/chemical/ChemicalManager.hh>
22 #include <core/chemical/ResidueTypeSet.hh>
23 #include <core/chemical/util.hh>
24 #include <core/chemical/VariantType.hh>
25 #include <core/conformation/ResidueFactory.hh>
26 #include <core/conformation/Residue.hh>
27 #include <core/conformation/Conformation.hh>
28 
29 #include <core/scoring/ScoringManager.hh>
30 #include <core/scoring/ScoreFunctionFactory.hh>
31 
32 #include <core/sequence/util.hh>
33 #include <core/sequence/Sequence.hh>
34 
35 #include <core/init/init.hh>
36 
37 #include <core/optimization/AtomTreeMinimizer.hh>
38 #include <core/optimization/MinimizerOptions.hh>
39 
40 #include <basic/options/option.hh>
42 #include <basic/options/util.hh>
44 
45 #include <protocols/viewer/viewers.hh>
46 
47 #include <core/id/AtomID.hh>
48 #include <core/id/NamedAtomID.hh>
49 #include <core/pose/Pose.hh>
50 #include <core/pose/util.hh>
51 #include <core/pose/full_model_info/util.hh>
52 #include <core/pose/full_model_info/FullModelInfo.hh>
53 #include <core/scoring/rms_util.tmpl.hh>
54 #include <core/scoring/ScoreFunction.hh>
55 #include <core/scoring/ScoreType.hh>
56 #include <core/scoring/rna/RNA_TorsionPotential.hh>
57 #include <core/pose/rna/util.hh>
58 #include <core/chemical/rna/util.hh>
59 #include <core/io/silent/SilentFileData.fwd.hh>
60 #include <core/io/silent/SilentFileData.hh>
61 #include <core/io/silent/BinarySilentStruct.hh>
62 #include <core/import_pose/import_pose.hh>
63 #include <core/pose/annotated_sequence.hh>
64 
65 #include <core/scoring/EnergyGraph.hh>
66 #include <core/scoring/Energies.hh>
67 #include <core/scoring/EnergyMap.hh>
68 #include <core/kinematics/FoldTree.hh>
69 #include <core/kinematics/AtomTree.hh>
70 #include <core/kinematics/Jump.hh>
71 #include <core/kinematics/MoveMap.hh>
72 
73 #include <core/pack/rotamer_trials.hh>
74 #include <core/pack/pack_rotamers.hh>
75 #include <core/pack/task/PackerTask.hh>
76 #include <core/pack/task/TaskFactory.hh>
77 #include <core/pack/rotamer_set/RotamerCouplings.hh>
78 #include <core/pack/rotamer_set/WaterAnchorInfo.hh>
79 #include <core/pack/rotamer_set/WaterPackingInfo.hh>
80 #include <core/pack/rotamer_set/WaterPackingInfo.fwd.hh>
81 
82 #include <protocols/moves/Mover.hh>
83 #include <protocols/moves/Mover.fwd.hh>
84 
85 #include <core/scoring/constraints/Constraint.hh>
86 #include <core/scoring/constraints/ConstraintIO.hh>
87 #include <core/scoring/constraints/ConstraintSet.hh>
88 #include <core/scoring/constraints/ConstraintSet.fwd.hh>
89 #include <core/scoring/constraints/CoordinateConstraint.hh>
90 #include <core/scoring/constraints/AtomPairConstraint.hh>
91 #include <core/scoring/constraints/AngleConstraint.hh>
92 #include <core/scoring/func/HarmonicFunc.hh>
93 #include <core/scoring/constraints/util.hh>
94 
95 //////////////////////////////////////////////////
96 #include <basic/options/keys/out.OptionKeys.gen.hh>
97 #include <basic/options/keys/in.OptionKeys.gen.hh>
98 #include <basic/options/keys/score.OptionKeys.gen.hh>
99 #include <basic/options/keys/edensity.OptionKeys.gen.hh>
100 #include <basic/options/keys/rna.OptionKeys.gen.hh>
101 ///////////////////////////////////////////////////
102 
103 #include <core/pose/PDBInfo.hh>
104 #include <core/chemical/rna/RNA_FittedTorsionInfo.hh>
105 #include <core/kinematics/FoldTree.hh>
106 #include <core/types.hh>
107 
108 #include <utility/vector1.hh>
109 #include <utility/io/ozstream.hh>
110 #include <utility/io/izstream.hh>
111 #include <numeric/conversions.hh>
112 #include <numeric/xyz.functions.hh>
113 //////////////////////////////////////////////////////////
114 
115 
116 // C++ headers
117 #include <iostream>
118 #include <string>
119 
121 
122 using namespace core;
123 using namespace basic::options;
124 using namespace basic::options::OptionKeys;
125 using utility::vector1;
126 
127 OPT_KEY ( String, out_pdb )
128 OPT_KEY ( Boolean, vary_geometry )
129 OPT_KEY ( Boolean, constrain_P )
130 OPT_KEY ( Boolean, ready_set_only )
131 OPT_KEY ( Boolean, skip_minimize )
132 OPT_KEY ( Boolean, attempt_pyrimidine_flip )
133 OPT_KEY ( IntegerVector, fixed_res )
134 OPT_KEY ( IntegerVector, cutpoint_open )
135 
136 ////////////////////////////////////////////////////////////////////////
137 bool
138 check_num_in_vector ( int input_num, utility::vector1< int > const & input_vector ) {
139  for ( Size i = 1; i <= input_vector.size(); ++i ) {
140  if ( input_num == input_vector[i] ) return true;
141  }
142  return false;
143 }
144 ////////////////////////////////////////////////////////////////////////
145 void
146 translate_residue ( conformation::Residue & rsd,
147  Vector const & nbr_atom_xyz ) {
148  Vector const translate ( nbr_atom_xyz - rsd.nbr_atom_xyz() );
149 
150  for ( Size i = 1; i <= rsd.natoms(); ++i ) {
151  rsd.set_xyz ( i, rsd.xyz ( i ) + translate );
152  }
153 }
154 //////////////////////////////////////////////////////////////////////////////////////////////
155 bool
156 check_in_bonded_list ( core::id::AtomID const & atom_id1,
157  core::id::AtomID const & atom_id2,
158  utility::vector1< std::pair< core::id::AtomID, core::id::AtomID > > & bonded_atom_list ) {
159  for ( Size n = 1; n <= bonded_atom_list.size(); n++ ) {
160  if ( atom_id1 == bonded_atom_list[ n ].first && atom_id2 == bonded_atom_list[ n ].second ) return true;
161 
162  if ( atom_id2 == bonded_atom_list[ n ].first && atom_id1 == bonded_atom_list[ n ].second ) return true;
163  }
164 
165  return false;
166 }
167 
168 
169 //////////////////////////////////////////////////////////////////////////////////////////////
170 bool
171 check_in_bond_angle_list ( core::id::AtomID const & atom_id1,
172  core::id::AtomID const & atom_id2,
173  core::id::AtomID const & atom_id3,
174  utility::vector1< std::pair< core::id::AtomID, std::pair< core::id::AtomID, core::id::AtomID > > > & bond_angle_list ) {
175  for ( Size n = 1; n <= bond_angle_list.size(); n++ ) {
176  if ( atom_id1 == bond_angle_list[ n ].first ) {
177  if ( atom_id2 == bond_angle_list[ n ].second.first && atom_id3 == bond_angle_list[ n ].second.second ) return true;
178 
179  if ( atom_id3 == bond_angle_list[ n ].second.first && atom_id2 == bond_angle_list[ n ].second.second ) return true;
180  }
181  }
182 
183  return false;
184 }
185 //////////////////////////////////////////////////////////////////////////////////////////////
186 void
187 apply_ideal_coordinates ( pose::Pose const & pose, pose::Pose & pose_reference ) {
188  using namespace core::pose::rna;
189  using namespace core::chemical::rna;
190  RNA_FittedTorsionInfo const rna_fitted_torsion_info;
191  Real const DELTA_CUTOFF ( rna_fitted_torsion_info.delta_cutoff() );
192  bool const is_use_phenix_geo = option[ basic::options::OptionKeys::rna::corrected_geo ];
193  utility::vector1 <PuckerState> pucker_conformation (pose_reference.total_residue(), NO_PUCKER);
194 
195  RNA_IdealCoord ideal_coord;
196  for ( Size n = 1; n <= pose.total_residue(); n++ ) {
197  if ( pose.residue ( n ).aa() == core::chemical::aa_vrt ) continue; //FCC
198 
199  Real const delta = pose.residue ( n ).mainchain_torsion ( DELTA );
200 
201  if ( delta > DELTA_CUTOFF ) { //south
202  apply_ideal_c2endo_sugar_coords ( pose_reference, n );
203  pucker_conformation[n] = SOUTH;
204  } else { //north
205  pucker_conformation[n] = NORTH;
206  }
207  }
208  if ( is_use_phenix_geo ) {
209  ideal_coord.apply(pose_reference, pucker_conformation, false /*donot keep torsions*/);
210  }
211 }
212 ////////////////////////////////////////////////////////////////
213 void
214 add_bond_constraint ( core::id::AtomID const & atom_id1,
215  core::id::AtomID const & atom_id2,
216  utility::vector1< std::pair< core::id::AtomID, core::id::AtomID > > & bonded_atom_list,
217  core::pose::Pose const & pose,
218  core::pose::Pose const & pose_reference,
219  core::scoring::constraints::ConstraintSetOP & cst_set ) {
220  using namespace core::scoring;
221  using namespace core::scoring::constraints;
222  std::string const & atom_name1 = pose.residue ( atom_id1.rsd() ).atom_name ( atom_id1.atomno() );
223  std::string const & atom_name2 = pose.residue ( atom_id2.rsd() ).atom_name ( atom_id2.atomno() );
224 
225  if ( !pose_reference.residue ( atom_id1.rsd() ).has ( atom_name1 ) ) return;
226 
227  if ( !pose_reference.residue ( atom_id2.rsd() ).has ( atom_name2 ) ) return;
228 
229  if ( !check_in_bonded_list ( atom_id1, atom_id2, bonded_atom_list ) ) {
230  bonded_atom_list.push_back ( std::make_pair ( atom_id1, atom_id2 ) );
231  Real const bond_length_sd_ ( 0.05 );
232  Real const bond_length = ( pose_reference.residue ( atom_id1.rsd() ).xyz ( atom_name1 ) -
233  pose_reference.residue ( atom_id2.rsd() ).xyz ( atom_name2 ) ).length();
234  core::scoring::func::FuncOP dist_harm_func_( new core::scoring::func::HarmonicFunc ( bond_length, bond_length_sd_ ) );
235  cst_set->add_constraint ( ConstraintCOP( ConstraintOP( new AtomPairConstraint ( atom_id1 ,
236  atom_id2,
237  dist_harm_func_,
238  rna_bond_geometry ) ) ) );
239 
240  if ( false ) {
241  std::cout << "PUTTING CONSTRAINT ON DISTANCE: " <<
242  atom_id2.rsd() << " " << atom_name1 << "; " <<
243  atom_id1.rsd() << " " << atom_name2 << " " <<
244  bond_length <<
245  std::endl;
246  }
247  }
248 }
249 ///////////////////////////////////////////////////////
250 void
251 add_bond_angle_constraint ( core::id::AtomID const & atom_id1,
252  core::id::AtomID const & atom_id2,
253  core::id::AtomID const & atom_id3,
254  utility::vector1< std::pair < core::id::AtomID, std::pair< core::id::AtomID, core::id::AtomID > > > & bond_angle_list,
255  core::pose::Pose const & pose,
256  core::pose::Pose const & pose_reference,
257  core::scoring::constraints::ConstraintSetOP & cst_set ) {
258  using namespace core::scoring;
259  using namespace core::scoring::constraints;
260  using namespace numeric::conversions;
261 
262  if ( atom_id2 == atom_id3 ) return;
263 
264  if ( atom_id1 == atom_id3 ) return;
265 
266  if ( atom_id1 == atom_id2 ) return;
267 
268  std::string const & atom_name1 = pose.residue ( atom_id1.rsd() ).atom_name ( atom_id1.atomno() );
269  std::string const & atom_name2 = pose.residue ( atom_id2.rsd() ).atom_name ( atom_id2.atomno() );
270  std::string const & atom_name3 = pose.residue ( atom_id3.rsd() ).atom_name ( atom_id3.atomno() );
271 
272  if ( !pose_reference.residue ( atom_id1.rsd() ).has ( atom_name1 ) ) return;
273 
274  if ( !pose_reference.residue ( atom_id2.rsd() ).has ( atom_name2 ) ) return;
275 
276  if ( !pose_reference.residue ( atom_id3.rsd() ).has ( atom_name3 ) ) return;
277 
278  if ( !check_in_bond_angle_list ( atom_id1, atom_id2, atom_id3, bond_angle_list ) ) {
279  bond_angle_list.push_back ( std::make_pair ( atom_id1, std::make_pair ( atom_id2, atom_id3 ) ) );
280  Real const bond_angle_sd_ ( radians ( 3.0 ) );
281  Real const bond_angle = angle_radians (
282  pose_reference.residue ( atom_id2.rsd() ).xyz ( atom_name2 ) ,
283  pose_reference.residue ( atom_id1.rsd() ).xyz ( atom_name1 ) ,
284  pose_reference.residue ( atom_id3.rsd() ).xyz ( atom_name3 )
285  );
286 
287  if ( bond_angle < 0.001 ) std::cout << "WHAT THE HELL????????? " << std::endl;
288 
289  core::scoring::func::FuncOP angle_harm_func_( new core::scoring::func::HarmonicFunc ( bond_angle, bond_angle_sd_ ) );
290  cst_set->add_constraint ( ConstraintCOP( ConstraintOP( new AngleConstraint (
291  atom_id2 , atom_id1, atom_id3, angle_harm_func_, rna_bond_geometry ) ) ) );
292 
293  if ( false ) {
294  std::cout << "PUTTING CONSTRAINT ON ANGLE: " <<
295  atom_id2.rsd() << " " << pose_reference.residue ( atom_id2.rsd() ).atom_name ( atom_id2.atomno() ) << "; " <<
296  atom_id1.rsd() << " " << pose_reference.residue ( atom_id1.rsd() ).atom_name ( atom_id1.atomno() ) << "; " <<
297  atom_id3.rsd() << " " << pose_reference.residue ( atom_id3.rsd() ).atom_name ( atom_id3.atomno() ) << " ==> " << degrees ( bond_angle ) << " " << degrees ( bond_angle_sd_ ) <<
298  std::endl;
299  }
300  }
301 }
302 
303 ////////////////////////////////////////////////
304 bool
306  core::pose::Pose const & pose,
307  core::id::AtomID const & atom_id1,
308  core::id::AtomID const & atom_id2 ) {
309  if ( atom_id1.rsd() == atom_id2.rsd() ) return true;
310 
311  core::kinematics::tree::AtomCOP atom1 ( pose.atom_tree().atom ( atom_id1 ).get_self_ptr() );
312  core::kinematics::tree::AtomCOP atom2 ( pose.atom_tree().atom ( atom_id2 ).get_self_ptr() );
313 
314  if ( atom1->parent() == atom2 ) return true;
315 
316  if ( atom2->parent() == atom1 ) return true;
317 
318  return false;
319 }
320 
321 ////////////////////////////////////////////////
322 bool
323 i_want_this_atom_to_move ( conformation::Residue const & residue2, Size const & k ) {
324  if ( k > residue2.first_sidechain_atom() &&
325  k != chemical::rna::first_base_atom_index ( residue2 ) ) return false;
326 
327  if ( residue2.is_virtual( k ) ) {
328  // std::cout << "Is this virtual? " << residue2.atom_name( k ) << std::endl;
329  return false;
330  }
331 
332  return true;
333 }
334 
335 bool
336 i_want_this_atom_to_move ( pose::Pose const & pose, core::id::AtomID const & atom_id ) {
337  return i_want_this_atom_to_move ( pose.residue ( atom_id.rsd() ) ,
338  atom_id.atomno() );
339 }
340 
341 bool
342 is_atom_exist_in_reference ( pose::Pose const & pose, pose::Pose const & pose_reference, core::id::AtomID const & atom_id ) {
343  std::string const & atom_name = pose.residue ( atom_id.rsd() ).atom_name ( atom_id.atomno() );
344 
345  if ( pose_reference.residue ( atom_id.rsd() ).has ( atom_name ) ) {
346  return true;
347  } else {
348  std::cout << atom_name << std::endl;
349  return false;
350  }
351 }
352 //////////////////////////////////////////////////////////////////////////////
353 void
355  pose::Pose const & pose,
356  pose::Pose & pose_reference ) {
357  using namespace core::chemical;
358  ResidueTypeSetCOP rsd_set;
359  rsd_set = core::chemical::ChemicalManager::get_instance()->residue_type_set ( FA_STANDARD );
360  make_pose_from_sequence ( pose_reference, pose.sequence(), *rsd_set );
361  apply_ideal_coordinates ( pose, pose_reference );
362 }
363 
364 //////////////////////////////////////////////////////////////////////////////
365 // Following has not (yet) been carefully debugged.
366 void
368  core::kinematics::MoveMap & mm,
369  pose::Pose & pose,
370  pose::Pose const & pose_reference,
371  ObjexxFCL::FArray1D< bool > & allow_insert_ ) {
372  using namespace core::id;
373  using namespace core::scoring;
374  using namespace core::scoring::constraints;
375  using namespace core::kinematics;
376  using namespace numeric::conversions;
377  ConstraintSetOP cst_set = pose.constraint_set()->clone();
378  pose.constraint_set ( cst_set );
379  Size const nres ( pose.total_residue() );
380  //std::map< AtomID, utility::vector1< AtomID > > lists_of_angle_bonded_atoms;
381  std::cout << "Enter the vary_bond_geometry....." << std::endl;
382 
383  for ( Size i = 1; i <= nres; i++ ) {
384  if ( pose.residue ( i ).aa() == core::chemical::aa_vrt ) continue; //FCC
385 
386  if ( !allow_insert_ ( i ) ) continue;
387 
388  conformation::Residue const & residue ( pose.residue ( i ) );
389 
390  for ( Size j = 1; j <= residue.natoms(); j++ ) {
391  if ( !i_want_this_atom_to_move ( residue, j ) ) continue;
392 
393  if ( !is_atom_exist_in_reference ( pose, pose_reference , AtomID ( j, i ) ) ) continue;
394 
395  core::kinematics::tree::AtomCOP current_atom ( pose.atom_tree().atom ( AtomID ( j, i ) ).get_self_ptr() );
396 
397  if ( current_atom->is_jump() ) continue;
398 
399  ///////////////////
400  core::kinematics::tree::AtomCOP input_stub_atom1 ( current_atom->input_stub_atom1() );
401 
402  if ( !input_stub_atom1 ) continue;
403 
404  if ( !i_want_this_atom_to_move ( pose, input_stub_atom1->id() ) ) continue;
405 
406  if ( !is_atom_exist_in_reference ( pose, pose_reference, input_stub_atom1->id() ) ) continue;
407 
408  mm.set ( DOF_ID ( AtomID ( j, i ), D ), true );
409 
410  if ( input_stub_atom1->is_jump() ) continue;
411 
412  core::kinematics::tree::AtomCOP input_stub_atom2 ( current_atom->input_stub_atom2() );
413 
414  ///////////////////
415  if ( !input_stub_atom2 ) continue;
416 
417  if ( input_stub_atom2 == current_atom ) continue;
418 
419  if ( !i_want_this_atom_to_move ( pose, input_stub_atom2->id() ) ) continue;
420 
421  if ( !is_atom_exist_in_reference ( pose, pose_reference, input_stub_atom2->id() ) ) continue;
422 
423  mm.set ( DOF_ID ( AtomID ( j, i ), THETA ), true );
424 
425  if ( input_stub_atom2->is_jump() ) continue;
426 
427  ///////////////////
428  core::kinematics::tree::AtomCOP input_stub_atom3 ( current_atom->input_stub_atom3() );
429 
430  if ( !input_stub_atom3 ) continue;
431 
432  if ( !i_want_this_atom_to_move ( pose, input_stub_atom3->id() ) ) continue;
433 
434  if ( !is_atom_exist_in_reference ( pose, pose_reference, input_stub_atom3->id() ) ) continue;
435 
436  if ( input_stub_atom3 == current_atom ) continue;
437 
438  mm.set ( DOF_ID ( AtomID ( j, i ), PHI ), true );
439  }
440  }
441 
444 
445  for ( Size i = 1; i <= nres; i++ ) {
446  if ( pose.residue ( i ).aa() == core::chemical::aa_vrt ) continue; //FCC
447 
448  //Go through all bonds in pose...
449  if ( !allow_insert_ ( i ) ) continue;
450 
451  conformation::Residue const & residue ( pose.residue ( i ) );
452 
453  for ( Size j = 1; j <= residue.natoms(); j++ ) {
454  if ( !i_want_this_atom_to_move ( residue, j ) ) continue;
455 
456  AtomID atom_id1 ( j, i );
457  utility::vector1< AtomID > nbrs ( pose.conformation().bonded_neighbor_all_res ( atom_id1 ) );
458 
459  // Bond lengths.
460  for ( Size n = 1; n <= nbrs.size(); n++ ) {
461  AtomID const & atom_id2 ( nbrs[ n ] );
462  conformation::Residue const & residue2 ( pose.residue ( atom_id2.rsd() ) ) ;
463  Size const & k ( atom_id2.atomno() ) ;
464 
465  if ( ! check_if_really_connected ( pose, atom_id1, atom_id2 ) ) continue;
466 
467  if ( i_want_this_atom_to_move ( residue2, k ) ) {
468  add_bond_constraint ( atom_id1, atom_id2,
469  bond_list,
470  pose, pose_reference, cst_set );
471  }
472  }
473 
474  // Bond angles
475  for ( Size m = 1; m <= nbrs.size(); m++ ) {
476  AtomID const & atom_id2 ( nbrs[ m ] );
477  conformation::Residue const & residue2 ( pose.residue ( atom_id2.rsd() ) ) ;
478 
479  if ( ! check_if_really_connected ( pose, atom_id1, atom_id2 ) ) continue;
480 
481  Size const & k ( atom_id2.atomno() ) ;
482 
483  for ( Size n = 1; n <= nbrs.size(); n++ ) {
484  AtomID const & atom_id3 ( nbrs[ n ] );
485  conformation::Residue const & residue3 ( pose.residue ( atom_id3.rsd() ) ) ;
486 
487  if ( ! check_if_really_connected ( pose, atom_id1, atom_id3 ) ) continue;
488 
489  Size const & q ( atom_id3.atomno() ) ;
490 
491  if ( i_want_this_atom_to_move ( residue2, k ) &&
492  i_want_this_atom_to_move ( residue3, q ) ) {
493  add_bond_angle_constraint ( atom_id1, atom_id2, atom_id3, bond_angle_list,
494  pose, pose_reference, cst_set );
495  }
496  }
497 
498  utility::vector1< AtomID > nbrs2 ( pose.conformation().bonded_neighbor_all_res ( atom_id2 ) );
499 
500  for ( Size n = 1; n <= nbrs2.size(); n++ ) {
501  AtomID const & atom_id3 ( nbrs2[ n ] );
502  conformation::Residue const & residue3 ( pose.residue ( atom_id3.rsd() ) ) ;
503 
504  if ( ! check_if_really_connected ( pose, atom_id2, atom_id3 ) ) continue;
505 
506  Size const & q ( atom_id3.atomno() ) ;
507 
508  if ( i_want_this_atom_to_move ( residue2, k ) &&
509  i_want_this_atom_to_move ( residue3, q ) ) {
510  add_bond_angle_constraint ( atom_id1, atom_id2, atom_id3, bond_angle_list,
511  pose, pose_reference, cst_set );
512  }
513  }
514  }
515  }
516  }
517 
518  pose.constraint_set ( cst_set );
519 }
520 /////////////////////////////////////////////////////////////////////////////
521 //FCC: Adding Virtual res
522 int
524  int nres = pose.total_residue();
525 
526  // if already rooted on virtual residue , return
527  if ( pose.residue ( pose.fold_tree().root() ).aa() == core::chemical::aa_vrt ) {
528  std::cout << "add_virtual_res() called but pose is already rooted on a VRT residue ... continuing." << std::endl;
529  return pose.fold_tree().root();
530  }
531 
532  // attach virt res there
533  core::chemical::ResidueTypeSet const & residue_set = *pose.residue_type ( 1 ).residue_type_set();
534  core::conformation::ResidueOP new_res ( core::conformation::ResidueFactory::create_residue ( *( residue_set.get_representative_type_name3( "VRT" ) ) ) );
535  pose.append_residue_by_jump ( *new_res , nres );
536  // make the virt atom the root
537  kinematics::FoldTree newF ( pose.fold_tree() );
538  newF.reorder ( nres + 1 );
539  pose.fold_tree ( newF );
540 
541  core::pose::full_model_info::FullModelInfoOP full_model_info( new core::pose::full_model_info::FullModelInfo( pose ) );
542  set_full_model_info( pose, full_model_info );
543 
544  return ( nres + 1 );
545 }
546 ///////////////////////////////////////////////////////////
547 void
549  using namespace chemical;
550  using namespace core::scoring;
551  using namespace core::chemical::rna;
552  using namespace core::conformation;
553  using namespace core::kinematics;
554  using namespace core::id;
555  Size const nres ( pose.total_residue() );
556  Size const num_jumps ( cutpoint_list.size() );
557  ObjexxFCL::FArray2D <int> jump_points ( 2, num_jumps );
558  ObjexxFCL::FArray1D <int> cuts ( num_jumps );
559 
560  for ( Size n = 1; n <= cutpoint_list.size(); n++ ) {
561  jump_points ( 1, n ) = cutpoint_list[n];
562  jump_points ( 2, n ) = cutpoint_list[n] + 1;
563  cuts ( n ) = cutpoint_list[n];
564  }
565 
566  FoldTree f ( nres );
567  f.tree_from_jumps_and_cuts ( nres, num_jumps, jump_points, cuts, 1, false );
568  pose.fold_tree ( f );
569 }
570 ///////////////////////////////////////////////////////////
571 bool
573  for ( Size i = 1; i <= list.size(); ++i ) {
574  if ( elem == list[i] ) return true;
575  }
576 
577  return false;
578 }
579 ///////////////////////////////////////////////
580 void
582  using namespace chemical;
583  using namespace core::scoring;
584  using namespace core::conformation;
585  using namespace core::kinematics;
586  using namespace core::id;
587  Size const nres ( pose.total_residue() );
588  FoldTree f ( nres );
589  bool is_segment_sample_res = is_elem_in_list ( 1, sample_res_list );
590 
591  for ( Size i = 2; i < nres; ++i ) {
592  bool is_res_sample_res = is_elem_in_list ( i, sample_res_list );
593 
594  if ( is_res_sample_res != is_segment_sample_res ) {
595  is_segment_sample_res = is_res_sample_res;
596  f.new_jump ( i - 1, nres, i - 1 );
597  }
598  }
599 
600  f.new_jump ( nres - 1, nres, nres - 1 );
601  f.reorder ( nres );
602  pose.fold_tree ( f );
603 }
604 ///////////////////////////////////////////
605 void
607  utility::vector1< Size > const & fixed_res_list,
608  scoring::ScoreFunctionOP scorefxn )
609 {
610  using namespace core::id;
611  using namespace core::scoring;
612  using namespace core::chemical::rna;
613  using namespace core::conformation;
614  using namespace core::pose;
615  using namespace core::chemical;
616 
617  Size const total_res = pose.total_residue();
618  Pose screen_pose = pose;
619  Real orig_score, new_score;
620  orig_score = (*scorefxn) (pose);
621  new_score = (*scorefxn) (screen_pose);
622  std::cout << "Start pyrimidine_flip_trial. Filp residue :";
623  for ( Size i = 1; i <= total_res; ++i ) {
624  if ( check_num_in_vector( i, fixed_res_list ) ) continue;
625  Residue const & res = pose.residue(i);
626  if ( res.is_RNA() && (res.aa() == na_rcy || res.aa() == na_ura) ) {
627  Real const orig_chi = pose.torsion( TorsionID( i, id::CHI, 1 ) );
628  Real const new_chi = orig_chi + 180.0;
629  screen_pose.set_torsion( TorsionID( i, id::CHI, 1 ), new_chi );
630  new_score = (*scorefxn) (screen_pose);
631  if ( new_score < orig_score ) { //Flip the chi!
632  pose.set_torsion( TorsionID( i, id::CHI, 1 ), new_chi );
633  orig_score = new_score;
634  std::cout << ' ' << i;
635  } else { //Keep the original chi
636  screen_pose.set_torsion( TorsionID( i, id::CHI, 1 ), orig_chi );
637  }
638  }
639  }
640  std::cout << std::endl;
641 }
642 ///////////////////////////////////////////
643 void
645  using namespace core::pose;
646  using namespace core::conformation;
647  using namespace core::chemical;
648  using namespace core::kinematics;
649  using namespace core::scoring;
650  using namespace core::chemical::rna;
651  using namespace core::scoring::constraints;
652  using namespace core::optimization;
653  using namespace core::id;
654  using namespace protocols::stepwise::modeler::rna;
655 
656  ResidueTypeSetCOP rsd_set = core::chemical::ChemicalManager::get_instance()->
657  residue_type_set ( FA_STANDARD );
658  bool const vary_bond_geometry_ = option[ vary_geometry ];
659  bool const constrain_phosphate = option[ constrain_P ];
660  bool const ready_set_only_ = option[ ready_set_only ];
661  bool const skip_minimize_ = option[ skip_minimize ];
662  bool const attempt_pyrimidine_flip_ = option[ attempt_pyrimidine_flip ];
663  utility::vector1< core::Size > const fixed_res_list = option[ fixed_res ]();
664  utility::vector1< core::Size > const cutpoint_list = option[cutpoint_open]();
665 
666  // Read in the pose from pdb.
667  Pose pose;
668  std::string pdb_name;
669  if ( option[ in::file::native ].user() ) {
670  import_pose::pose_from_pdb ( pose, *rsd_set, option[in::file::native]() );
671  protocols::farna::make_phosphate_nomenclature_matches_mini(pose);
672  pdb_name = option[in::file::native]();
673  } else {
674  utility_exit_with_message("User must specify -native option!");
675  }
676 
677  std::string output_pdb_name;
678  if ( option[ out_pdb ].user() ) {
679  output_pdb_name = option[ out_pdb ] ();
680  } else {
681  output_pdb_name = pdb_name;
682  size_t found = output_pdb_name.find(".pdb");
683  if ( found != std::string::npos ) {
684  if ( ready_set_only_ ) {
685  output_pdb_name.replace(found, found + 4, "_ready_set.pdb");
686  } else {
687  output_pdb_name.replace(found, found + 4, "_minimize.pdb");
688  }
689  } else {
690  if ( ready_set_only_ ) {
691  output_pdb_name.append("_ready_set.pdb");
692  } else {
693  output_pdb_name.append("_minimize.pdb");
694  }
695  }
696  }
697 
698  if ( ready_set_only_ ) {
699  pose.dump_pdb(output_pdb_name);
700  return;
701  }
702 
703  //Setup score function.
704  std::string score_weight_file = "stepwise/rna/rna_hires_elec_dens";
706  score_weight_file= option[ basic::options::OptionKeys::score::weights ]();
707  std::cout << "User passed in score:weight option: " << score_weight_file << std::endl;
708  }
709  core::scoring::ScoreFunctionOP scorefxn =
710  ScoreFunctionFactory::create_score_function ( score_weight_file );
711 
712  core::scoring::ScoreFunctionOP edens_scorefxn( new ScoreFunction );
713  edens_scorefxn -> set_weight(
714  elec_dens_atomwise, scorefxn -> get_weight(elec_dens_atomwise) );
715 
716  //Setup fold tree using user input or using Rhiju's function
717  if ( cutpoint_list.size() == 0 ) {
718  core::pose::rna::figure_out_reasonable_rna_fold_tree ( pose );
719  } else {
720  setup_fold_tree ( pose, cutpoint_list );
721  }
722 
723  //Add a virtual residue for density scoring
724  Size const virtual_res_pos = add_virtual_res ( pose );
725  pose::Pose const pose_full = pose;
726  Size const nres ( pose.total_residue() );
727  Size const nres_moving ( nres - fixed_res_list.size() );
728 
729  //Output the sequence
730  std::string working_sequence = pose.sequence();
731  std::cout << "Pose sequence = " << working_sequence << std::endl;
732  // protocols::stepwise::modeler::rna::output_fold_tree_info ( pose.fold_tree(), "rna_pdb_minimizing" ); // in legacy now.
733 
734  //Try flipping the pyrimidines
735  if ( attempt_pyrimidine_flip_ ) {
736  pyrimidine_flip_trial( pose, fixed_res_list, scorefxn);
737  }
738  if ( skip_minimize_ ) {
739  pose.dump_pdb(output_pdb_name);
740  return;
741  }
742 
743 
744  //Set the MoveMap, avoiding moving the virtual residue
745  std::cout << "Setting up movemap ..." << std::endl;
746  kinematics::MoveMap mm;
747  ObjexxFCL::FArray1D< bool > allow_insert ( nres, false );
748  mm.set_bb ( false );
749  mm.set_chi ( false );
750  mm.set_jump ( false );
751 
752  for ( Size ii = 1; ii <= pose.total_residue(); ++ii ) {
753  if ( pose.residue ( ii ).aa() != core::chemical::aa_vrt ) {
754  allow_insert ( ii ) = true;
755  mm.set_bb ( ii, true );
756  mm.set_chi ( ii, true );
757  }
758  }
759 
760  kinematics::FoldTree fold_tree ( pose.fold_tree() );
761 
762  utility::vector1< core::Size > cut_upper, cut_lower;
763  for ( Size i = 1; i <= fold_tree.num_jump(); ++i ) {
764  Size const k = fold_tree.upstream_jump_residue ( i );
765  Size const m = fold_tree.downstream_jump_residue ( i );
766  cut_lower.push_back(k);
767  cut_upper.push_back(m);
768 
769  if ( pose.residue ( k ).aa() != core::chemical::aa_vrt &&
770  pose.residue ( m ).aa() != core::chemical::aa_vrt ) {
771  if ( fixed_res_list.size() != 0 &&
772  ! ( check_num_in_vector(k, fixed_res_list) ) &&
773  ! ( check_num_in_vector(m, fixed_res_list) ) ) {
774  mm.set_jump ( i, true );
775  }
776  }
777  }
778 
779 
780  //Fixed res mode
781  if ( fixed_res_list.size() != 0 ) {
782  std::cout << "fixed res: ";
783  }
784 
785  for ( Size i = 1; i <= fixed_res_list.size(); ++i ) {
786  Size fixed_res_num ( fixed_res_list[i] );
787  std::cout << fixed_res_num << " ";
788  Real const coord_sdev ( 0.1 );
789  Size const my_anchor ( virtual_res_pos ); //anchor on virtual residue
790  ConstraintSetOP cst_set = pose.constraint_set()->clone();
791  Residue const & rsd ( pose.residue ( fixed_res_num ) );
792  Size const atm_indexP = rsd.atom_index ( "P" );
793  Size const atm_indexO3 = rsd.atom_index ( "O3'" );
794  Size const atm_indexOP2 = rsd.atom_index ( "OP2" );
795  Size const atm_indexC6 = rsd.atom_index ( "C6" );
796  Size atm_indexBase = 0;
797  if ( rsd.aa() == core::chemical::na_rgu || rsd.aa() == core::chemical::na_rad ) {
798  atm_indexBase = rsd.atom_index ( "N9" );
799  } else if ( rsd.aa() == core::chemical::na_ura || rsd.aa() == core::chemical::na_rcy ) {
800  atm_indexBase = rsd.atom_index ( "N1" );
801  } else {
802  utility_exit_with_message("Fixed residue is not a RNA residue!!!!");
803  }
804 
805  cst_set -> add_constraint ( ConstraintCOP( ConstraintOP( new CoordinateConstraint ( AtomID ( atm_indexP, fixed_res_num ), AtomID ( 1, my_anchor ), rsd.xyz ( atm_indexP ), core::scoring::func::FuncOP( new core::scoring::func::HarmonicFunc ( 0.0, coord_sdev ) ) ) ) ) );
806  cst_set -> add_constraint ( ConstraintCOP( ConstraintOP( new CoordinateConstraint ( AtomID ( atm_indexO3, fixed_res_num ), AtomID ( 1, my_anchor ), rsd.xyz ( atm_indexO3 ), core::scoring::func::FuncOP( new core::scoring::func::HarmonicFunc ( 0.0, coord_sdev ) ) ) ) ) );
807  cst_set -> add_constraint ( ConstraintCOP( ConstraintOP( new CoordinateConstraint ( AtomID ( atm_indexBase, fixed_res_num ), AtomID ( 1, my_anchor ), rsd.xyz ( atm_indexBase ), core::scoring::func::FuncOP( new core::scoring::func::HarmonicFunc ( 0.0, coord_sdev ) ) ) ) ) );
808  cst_set -> add_constraint ( ConstraintCOP( ConstraintOP( new CoordinateConstraint ( AtomID ( atm_indexC6, fixed_res_num ), AtomID ( 1, my_anchor ), rsd.xyz ( atm_indexC6 ), core::scoring::func::FuncOP( new core::scoring::func::HarmonicFunc ( 0.0, coord_sdev ) ) ) ) ) );
809  cst_set -> add_constraint ( ConstraintCOP( ConstraintOP( new CoordinateConstraint ( AtomID ( atm_indexOP2, fixed_res_num ), AtomID ( 1, my_anchor ), rsd.xyz ( atm_indexOP2 ), core::scoring::func::FuncOP( new core::scoring::func::HarmonicFunc ( 0.0, coord_sdev ) ) ) ) ) );
810  pose.constraint_set ( cst_set );
811  scorefxn->set_weight ( coordinate_constraint, 10 );
812 
813  mm.set_chi ( fixed_res_num, false );
814  mm.set_bb ( fixed_res_num, false );
815 
816  allow_insert(fixed_res_num) = false;
817 
818  if ( fixed_res_num - 1 > 0 &&
819  ! ( check_num_in_vector( fixed_res_num - 1, fixed_res_list ) ) &&
820  ! ( check_num_in_vector( fixed_res_num, cut_lower ) ) ) {
821  allow_insert(fixed_res_num) = true;
822  }
823  if ( fixed_res_num + 1 <= nres &&
824  ! ( check_num_in_vector( fixed_res_num + 1, fixed_res_list ) ) &&
825  ! ( check_num_in_vector( fixed_res_num, cut_upper ) ) ) {
826  allow_insert(fixed_res_num) = true;
827  }
828 
829  }
830  std::cout << std::endl;
831 
832  //constrain phosphate mode
833  if ( constrain_phosphate ) {
834  for ( Size i = 1; i <= nres; ++i ) {
835  if ( pose.residue ( i ).aa() == core::chemical::aa_vrt ) continue;
836 
837  bool is_fixed_res = false;
838  for ( Size j = 1; j <= fixed_res_list.size(); ++j ) {
839  if ( i == fixed_res_list[j] ) {
840  is_fixed_res = true;
841  break;
842  }
843  }
844 
845  if ( is_fixed_res ) continue;
846 
847  Real const coord_sdev ( 0.3 );
848  Size const my_anchor ( virtual_res_pos ); //anchor on virtual residue
849  ConstraintSetOP cst_set = pose.constraint_set()->clone();
850  Residue const & rsd ( pose.residue ( i ) );
851  Size const atm_indexP = rsd.atom_index ( "P" );
852  cst_set -> add_constraint ( ConstraintCOP( ConstraintOP( new CoordinateConstraint ( AtomID ( atm_indexP, i ), AtomID ( 1, my_anchor ), rsd.xyz ( atm_indexP ), core::scoring::func::FuncOP( new core::scoring::func::HarmonicFunc ( 0.0, coord_sdev ) ) ) ) ) );
853  pose.constraint_set ( cst_set );
854  scorefxn->set_weight ( coordinate_constraint, 10 );
855  }
856  }
857 
858  //Vary Geometry
859  if ( vary_bond_geometry_ ) {
860  std::cout << "Setup vary_bond_geometry" << std::endl;
861  pose::Pose pose_reference;
862  create_pose_reference ( pose_full, pose_reference );
863  vary_bond_geometry ( mm, pose, pose_reference, allow_insert );
864  }
865 
866  protocols::stepwise::modeler::output_movemap ( mm, pose );
867  scorefxn->show ( std::cout, pose );
868  Real const score_before = ( (*scorefxn) (pose) );
869  Real const edens_score_before = ( (*edens_scorefxn) (pose) );
870 
871  protocols::viewer::add_conformation_viewer ( pose.conformation(), "current", 400, 400 );
872 
873  //Start Minimizing the Full Structure
874  Pose const start_pose = pose;
875  AtomTreeMinimizer minimizer;
876  float const dummy_tol ( 0.00000001 );
877 
878  std::cout << "Minimize using dfpmin with use_nb_list=true .." << std::endl;
879  MinimizerOptions min_options_dfpmin ( "dfpmin", dummy_tol, true, false, false );
880  min_options_dfpmin.max_iter ( std::min( 3000, std::max( 1000, int(nres_moving * 12) ) ) );
881  minimizer.run ( pose, mm, *scorefxn, min_options_dfpmin );
882 
883  scorefxn -> show ( std::cout, pose );
884  Real const score = ( (*scorefxn) (pose) );
885  Real const edens_score = ( (*edens_scorefxn) (pose) );
886  if ( score > score_before + 5 || edens_score > edens_score_before * 0.9 ) {
887  std::cout << "current_score = " << score << ", start_score = " << score_before << std::endl;
888  std::cout << "current_edens_score = " << edens_score << ", start_edens_score = " << edens_score_before << std::endl;
889  std::cout << "The minimization went wild!!! Try alternative minimization using dfpmin with use_nb_list=false .." << std::endl;
890 
891  pose = start_pose;
892 
893  MinimizerOptions min_options_dfpmin_no_nb ( "dfpmin", dummy_tol, false, false, false );
894  min_options_dfpmin_no_nb.max_iter ( std::min( 3000, std::max( 1000, int(nres_moving * 12) ) ) );
895  minimizer.run ( pose, mm, *scorefxn, min_options_dfpmin_no_nb );
896  scorefxn -> show ( std::cout, pose );
897  Real const score = ( (*scorefxn) (pose) );
898  Real const edens_score = ( (*edens_scorefxn) (pose) );
899  if ( score > score_before + 5 || edens_score > edens_score_before * 0.9 ) {
900  std::cout << "current_score = " << score << ", start_score = " << score_before << std::endl;
901  std::cout << "current_edens_score = " << edens_score << ", start_edens_score = " << edens_score_before << std::endl;
902  pose = start_pose;
903  std::cout << "The minimization went wild again!!! Skip the minimization!!!!!" << std::endl;
904  }
905  }
906 
907 
908  pose.dump_pdb ( output_pdb_name );
909  std::cout << "Job completed sucessfully." << std::endl;
910 }
911 ///////////////////////////////////////////////////////////////
912 void*
913 my_main ( void* ) {
914  pdb_minimizer();
915  protocols::viewer::clear_conformation_viewers();
916  exit ( 0 );
917 }
918 ///////////////////////////////////////////////////////////////////////////////
919 int
920 main ( int argc, char * argv [] ) {
921  try {
922  utility::vector1< Size > blank_size_vector;
923  utility::vector1< std::string > blank_string_vector;
924  NEW_OPT ( out_pdb, "name of output pdb file", "" );
925  NEW_OPT ( vary_geometry, "vary geometry", false );
926  NEW_OPT ( constrain_P, "constrain phosphate", false );
927  NEW_OPT ( fixed_res, "optional: residues to be held fixed in minimizer", blank_size_vector );
928  NEW_OPT ( cutpoint_open, "optional: chainbreak in full sequence", blank_size_vector );
929  NEW_OPT ( ready_set_only, "load in and output directly for reformatting the pdb", false );
930  NEW_OPT ( skip_minimize, "output the pdb without minimization", false );
931  NEW_OPT ( attempt_pyrimidine_flip, "try to flip pyrimidine by 180 degree and pick the better energy conformer", false );
932 
933  ////////////////////////////////////////////////////////////////////////////
934  // setup
935  ////////////////////////////////////////////////////////////////////////////
936  core::init::init ( argc, argv );
937 
938  ////////////////////////////////////////////////////////////////////////////
939  // end of setup
940  ////////////////////////////////////////////////////////////////////////////
941  protocols::viewer::viewer_main ( my_main );
942  } catch ( utility::excn::EXCN_Base const & e ) {
943  std::cout << "caught exception " << e.msg() << std::endl;
944  return -1;
945  }
946 }
#define utility_exit_with_message(m)
Exit with file + line + message.
Definition: exit.hh:47
static T min(T x, T y)
Definition: Svm.cc:16
void add_bond_constraint(core::id::AtomID const &atom_id1, core::id::AtomID const &atom_id2, utility::vector1< std::pair< core::id::AtomID, core::id::AtomID > > &bonded_atom_list, core::pose::Pose const &pose, core::pose::Pose const &pose_reference, core::scoring::constraints::ConstraintSetOP &cst_set)
utility::pointer::shared_ptr< Constraint > ConstraintOP
utility::keys::lookup::has< KeyType > const has
Lookup functors.
bool i_want_this_atom_to_move(conformation::Residue const &residue2, Size const &k)
virtual std::string const msg() const
Definition: EXCN_Base.hh:70
std::string String
Definition: remodel.cc:69
void angle_radians(xyzVector< T > const &p1, xyzVector< T > const &p2, xyzVector< T > const &p3, T &angle)
Plane angle in radians: angle value passed.
bool check_in_bond_angle_list(core::id::AtomID const &atom_id1, core::id::AtomID const &atom_id2, core::id::AtomID const &atom_id3, utility::vector1< std::pair< core::id::AtomID, std::pair< core::id::AtomID, core::id::AtomID > > > &bond_angle_list)
bool is_atom_exist_in_reference(pose::Pose const &pose, pose::Pose const &pose_reference, core::id::AtomID const &atom_id)
BooleanOptionKey const user("options:user")
Definition: OptionKeys.hh:40
core::pose::Pose Pose
Definition: supercharge.cc:101
Conversions between degrees and radians.
bool is_elem_in_list(core::Size const elem, utility::vector1< core::Size > const &list)
xyzVector< Real > xyz(Real const &r1, Real const &omega1, Real const &t, Real const &dz1, Real const &delta_omega1, Real const &delta_z1)
Returns the x-, y-, and z-coordinates of a point on a helix given r1, omega1, and t...
Definition: HelixParams.cc:67
void * my_main(void *)
common derived classes for thrown exceptions
int main(int argc, char *argv[])
tuple scorefxn
Definition: PyMOL_demo.py:63
void pyrimidine_flip_trial(pose::Pose &pose, utility::vector1< Size > const &fixed_res_list, scoring::ScoreFunctionOP scorefxn)
void show(utility::vector1< T_ > vector)
bool check_if_really_connected(core::pose::Pose const &pose, core::id::AtomID const &atom_id1, core::id::AtomID const &atom_id2)
void setup_fold_tree_sample_res(pose::Pose &pose, utility::vector1< core::Size > const &sample_res_list)
bool check_in_bonded_list(core::id::AtomID const &atom_id1, core::id::AtomID const &atom_id2, utility::vector1< std::pair< core::id::AtomID, core::id::AtomID > > &bonded_atom_list)
void add_bond_angle_constraint(core::id::AtomID const &atom_id1, core::id::AtomID const &atom_id2, core::id::AtomID const &atom_id3, utility::vector1< std::pair< core::id::AtomID, std::pair< core::id::AtomID, core::id::AtomID > > > &bond_angle_list, core::pose::Pose const &pose, core::pose::Pose const &pose_reference, core::scoring::constraints::ConstraintSetOP &cst_set)
xyzVector< Real > Vector
void setup_fold_tree(pose::Pose &pose, utility::vector1< core::Size > const &cutpoint_list)
basic::options::OptionKeys collection
Input file stream wrapper for uncompressed and compressed files.
bool check_num_in_vector(int input_num, utility::vector1< int > const &input_vector)
std::vector with 1-based indexing
Definition: vector1.fwd.hh:44
T degrees(T const &radians)
Degrees of radians.
Definition: conversions.hh:80
rule< Scanner, options_closure::context_t > options
Definition: Tag.cc:377
#define OPT_KEY(type, key)
Output file stream wrapper for uncompressed and compressed files.
list native
Definition: ContactMap.py:108
double Real
Definition: types.hh:39
#define NEW_OPT(akey, help, adef)
int add_virtual_res(core::pose::Pose &pose)
void create_pose_reference(pose::Pose const &pose, pose::Pose &pose_reference)
ocstream cout(std::cout)
Wrapper around std::cout.
Definition: ocstream.hh:287
void apply_ideal_coordinates(pose::Pose const &pose, pose::Pose &pose_reference)
utility::pointer::shared_ptr< Constraint const > ConstraintCOP
BooleanOptionKey const exit("options:exit")
Definition: OptionKeys.hh:51
vector1: std::vector with 1-based indexing
void pdb_minimizer()
void vary_bond_geometry(core::kinematics::MoveMap &mm, pose::Pose &pose, pose::Pose const &pose_reference, ObjexxFCL::FArray1D< bool > &allow_insert_)
T radians(T const &degrees)
Radians of degrees.
Definition: conversions.hh:32
xyzVector and xyzMatrix functions
void init()
set global 'init_was_called' to true
Definition: init.cc:26
Program options global and initialization function.
static T max(T x, T y)
Definition: Svm.cc:19
platform::Size Size
Definition: random.fwd.hh:30
void translate_residue(conformation::Residue &rsd, Vector const &nbr_atom_xyz)
rule< Scanner, option_closure::context_t > option
Definition: Tag.cc:378
FArray2D: Fortran-Compatible 2D Array.
Definition: FArray2.hh:27
FArray1D: Fortran-Compatible 1D Array.
Definition: FArray1.hh:30