40 #include <numeric/xyzVector.hh>
43 #include <utility/tag/Tag.hh>
44 #include <basic/Tracer.hh>
47 #include <basic/options/option.hh>
48 #include <basic/options/keys/relax.OptionKeys.gen.hh>
50 static basic::Tracer
TR(
"protocols.simple_moves.AddConstraintsToCurrentConformationMover" );
53 namespace simple_moves {
56 using namespace basic::options;
59 using namespace operation;
60 using namespace scoring;
61 using namespace constraints;
64 use_distance_cst_ =
false;
76 using namespace conformation;
78 using namespace basic::options;
79 using namespace basic::options::OptionKeys;
80 using namespace core::pose::datacache;
81 using namespace core::scoring;
82 using namespace core::scoring::constraints;
83 using namespace core::id;
84 using namespace protocols::moves;
85 using namespace core::scoring;
87 if (!use_distance_cst_) {
102 for (
Size ires = 1; ires <= nres; ++ires ) {
109 anchor_xyz = sum_xyz / natom;
113 Size best_anchor = 0;
114 for (
Size ires = 1; ires <= nres; ++ires ) {
118 if (dist2 < min_dist2) {
125 if (best_anchor == 0)
return;
129 for (
Size ires = 1; ires <= nres; ++ires ) {
141 if ( bound_width_ < 1e-3 ) {
146 TR.Debug <<
"Constraint added to residue " << ires <<
", atom " << iatom << std::endl;
160 new BoundFunc( 0, bound_width_, coord_dev_,
"xyz" )) );
161 TR <<
"Constraint added to residue " << ires <<
", atom " << iatom << std::endl;
167 new BoundFunc( 0, bound_width_, coord_dev_,
"xyz" )) );
184 if ( dist <= max_distance_ ) {
185 TR.Debug <<
"Constraint added to residue " << ires <<
", atom " << iatom <<
" and residue " << jres <<
", atom " << jatom <<
" with weight " << cst_weight_ << std::endl;
210 if ( tag->hasOption(
"use_distance_cst") ) {
211 use_distance_cst_ = tag->getOption<
bool>(
"use_distance_cst");
213 if ( tag->hasOption(
"max_distance") ) {
214 max_distance_ = tag->getOption<
core::Real>(
"max_distance");
216 if ( tag->hasOption(
"coord_dev") ) {
217 coord_dev_ = tag->getOption<
core::Real>(
"coord_dev");
219 if ( tag->hasOption(
"bound_width") ) {
220 bound_width_ = tag->getOption<
core::Real>(
"bound_width");
222 if ( tag->hasOption(
"min_seq_sep") ) {
223 min_seq_sep_ = tag->getOption<
core::Size>(
"min_seq_sep");
225 if ( tag->hasOption(
"cst_weight") ) {
226 cst_weight_ = tag->getOption<
core::Real>(
"cst_weight");
242 if ( new_task_factory == 0)
return;
243 task_factory( new_task_factory );
248 runtime_assert( tf );
269 return "AddConstraintsToCurrentConformationMover";
274 return "AddConstraintsToCurrentConformationMover";