35 #include <utility/vector1.hh>
36 #include <utility/exit.hh>
37 #include <utility/tag/Tag.hh>
39 #include <basic/Tracer.hh>
41 #include <utility/vector0.hh>
45 namespace simple_moves {
48 static basic::Tracer
TZ(
"protocols.simple_moves.symmetry.SetupNCSMover");
79 for (
Size i=1; i<=tgt.size(); ++i)
85 runtime_assert( src.size() == tgt.size() );
86 for (
Size i=1; i<=tgt.size(); ++i)
103 src_.push_back( src );
104 tgt_.push_back( tgt );
108 srcE_.push_back( src );
109 tgtE_.push_back( tgt );
113 srcD_.push_back( src );
114 tgtD_.push_back( tgt );
120 using namespace utility;
121 using namespace core;
122 using namespace core::id;
123 using namespace core::scoring::constraints;
125 assert(
src_.size() ==
tgt_.size() );
129 TZ.Debug <<
"Size src angle " << test1a <<
" Size tgt angle " << test2a << std::endl;
133 for (
Size i=1; i<=
src_.size(); ++i) {
137 TZ.Debug <<
"src angle size " << temp_a << std::endl;
142 TZ.Debug <<
"src angle size " << temp_b << std::endl;
144 runtime_assert( src_i.size() == tgt_i.size() );
147 if ( src_i.size() == 0 ) {
148 utility_exit_with_message(
"Error creating NCS constraints: " +
src_[i] +
" : "+
tgt_[i]);
151 for (
Size j=1; j<=src_i.size(); ++j) {
152 core::Size resnum_src = src_i[j], resnum_tgt = tgt_i[j];
153 id::AtomID id_a1,id_a2,id_a3,id_a4, id_b1,id_b2,id_b3,id_b4;
155 TZ.Debug <<
"Add constraint " << resnum_src <<
" <--> " << resnum_tgt << std::endl;
181 TZ.Error <<
"Trying to constrain sidechain torsions of different residue types!" << std::endl;
182 TZ.Error <<
" >>> " << resnum_src <<
" vs " << resnum_tgt << std::endl;
188 TZ.Error <<
"Trying to constrain sidechains with different number of chi angles!" << std::endl;
192 for (
Size k=1, k_end = pose.
residue(resnum_src).
nchi(); k<= k_end; ++k ) {
217 runtime_assert( srcE_i.size() == tgtE_i.size() );
220 if ( srcE_i.size() == 0 ) {
221 utility_exit_with_message(
"Error creating NCS constraints: " +
srcE_[i] +
" : "+
tgtE_[i]);
224 for (
Size j=1; j<=srcE_i.size(); ++j) {
225 core::Size resnum_srcE = srcE_i[j], resnum_tgtE = tgtE_i[j];
227 TZ.Debug <<
"Symmetrizing residues " << resnum_srcE <<
" <--> " << resnum_tgtE << std::endl;
242 TZ.Debug <<
"Size src " << test1 <<
" Size tgt " << test2 << std::endl;
250 TZ.Debug <<
"src 1 size " << temp_d << std::endl;
253 runtime_assert( srcD_i.size() == tgtD_i.size() );
254 runtime_assert( srcD_i.size() % 2 == 0 );
257 if ( srcD_i.size() == 0 ) {
258 utility_exit_with_message(
"Error creating NCS distance pair constraints: " +
srcD_[i] +
" : " +
tgtD_[i] );
261 for (
Size j=1; j<=srcD_i.size()/2; ++j) {
262 core::Size resnum_src1 = srcD_i[j], resnum_tgt1 = tgtD_i[j], resnum_src2 = srcD_i[j+srcD_i.size()/2], resnum_tgt2 = tgtD_i[j+srcD_i.size()/2];
265 TZ.Debug <<
"Add distance pair constraint " << resnum_src1 <<
" - " << resnum_src2 <<
" <--> " << resnum_tgt1 <<
" - " << resnum_tgt2 << std::endl;
293 if (tag->hasOption(
"bb" ))
bb_ = tag->getOption<
bool >(
"bb" );
294 if (tag->hasOption(
"chi" ))
chi_ = tag->getOption<
bool >(
"chi" );
295 if (tag->hasOption(
"wt" ))
wt_ = tag->getOption<
core::Real >(
"wt" );
296 if (tag->hasOption(
"limit" ))
limit_ = tag->getOption<
core::Real >(
"limit" );
297 if (tag->hasOption(
"symmetric_sequence" ))
symmetric_sequence_ = tag->getOption<
bool >(
"symmetric_sequence" );
298 if (tag->hasOption(
"sd" ))
sd_ = tag->getOption<
core::Real >(
"sd" );
299 if (tag->hasOption(
"distance_pair" ))
distance_pair_ = tag->getOption<
bool >(
"distance_pair" );
305 for( tag_it = branch_tags.begin(); tag_it!=branch_tags.end(); ++tag_it ){
306 if( (*tag_it)->getName() ==
"NCSgroup" || (*tag_it)->getName() ==
"ncsgroup" ){
310 TZ.Debug <<
"Symmetrizing sequences " << src_i <<
" -> " << tgt_i << std::endl;
312 TZ.Debug <<
"Adding NCS cst " << src_i <<
" -> " << tgt_i << std::endl;
316 if( (*tag_it)->getName() ==
"NCSend" || (*tag_it)->getName() ==
"ncsend" ){
320 TZ.Debug <<
"Symmetrizing sequences at ends" << srcE_i <<
" -> " << tgtE_i << std::endl;
327 if( (*tag_it)->getName() ==
"NCSdistance" || (*tag_it)->getName() ==
"ncsdistance" ){