28 #include <numeric/xyzVector.hh>
35 #include <utility/string_util.hh>
36 #include <boost/foreach.hpp>
37 #include <utility/tag/Tag.hh>
42 #define foreach BOOST_FOREACH
44 #include <basic/Tracer.hh>
45 #include <utility/vector1.hh>
52 #include <utility/vector0.hh>
60 namespace seeded_abinitio {
63 using namespace scoring::constraints;
64 using namespace protocols::moves;
66 static basic::Tracer
TR(
"protocols.seeded_abinitio.CoordinateCst" );
67 static basic::Tracer
TR_debug(
"CoordinateCst.Debug" );
83 return "CoordinateCst";
114 utility::vector1 < std::pair < std::string, std::string > >
const span_vector,
115 std::set < core::Size > resi_collection
119 for(
Size iter = 1 ; iter <= span_vector.size() ; ++ iter ){
120 TR.Debug <<
"sanity check, span_vector[iter].first " <<span_vector[iter].first <<std::endl;
127 for (
Size resi = begin; resi <=
end ; resi ++ ){
128 resi_collection.insert( resi );
129 TR <<
"runtime parsed of span, residue: " << resi << std::endl;
146 design_res.push_back( resnum);
147 TR.Debug<<
"parsed "<<key<<std::endl;
158 std::set < core::Size > resi_collection
165 resi_collection.insert( resnum );
171 std::set < core::Size >
const constrain_residues,
180 using namespace core::scoring::constraints;
181 using namespace core::conformation;
185 if ( anchor_atom_name ==
"" ) {
186 anchor_atom_name = atom_name;
189 if( anchor_resnum != 0 ){
190 TR<<
"Anchor residue for the coordinate constraint is "<< anchor_resnum <<std::endl;
192 if ( anchor_atom_name ==
"CB" ){
194 anchor_atom_name =
"CA";
198 if ( ! pose.
residue( anchor_resnum ).
has( anchor_atom_name ) ) {
199 utility_exit_with_message(
"Could not add coordinate constraint to anchor residue atom " + anchor_atom_name +
" on residue "
200 + utility::to_string( anchor_resnum ) +
" (" + pose.
residue( anchor_resnum ).
name()
201 +
") since that residue does not have an atom with that name" );
205 if( !coord_cst_func ) {
208 coord_cst_func->sd( coord_sdev );
212 if ( ! pose.
residue( res ).
has( atom_name ) ) {
213 utility_exit_with_message(
"Could not add coordinate constraint to " + atom_name +
" on residue " + utility::to_string( res ) +
" (" +
214 pose.
residue( res ).
name() +
") since that residue does not have an atom with that name" );
216 TR<<
"Coordinate-constraining residue " << pose.
residue( res ).
name() <<
" " << res <<std::endl;
235 using namespace core;
238 std::set < core::Size > constrain_residues_set;
240 if( unparsed_residue_ !=
"" ) {
244 parse_spans( pose, span_vector_ , constrain_residues_set );
246 TR.Debug <<
"constrain residue set size : " << constrain_residues_set.size() <<
" -- if this is 0, you did NOT read in any residues "<< std::endl;
249 TR.Debug<<
"anchor " << anchor_res_ <<std::endl;
251 if( !use_jumps_ && anchor_res_ !=
"" ){
257 anchor_res = anchor_res_vec[1];
258 TR <<
"-- anchor residue: " << anchor_res <<
" --" << std::endl;
263 TR<<
"no jump detected, defaulting anchor to 1" << std::endl;
266 if( constrain_residues_set.size() == 0 ) {
268 TR<<
"adding constraints to the downstream jump atom" << std::endl;
272 TR<<
"setting anchor residue to upstream jump residue: " << anchor_res_ << std::endl;
297 TR<<
"CoordinateCst mover has been invoked"<<std::endl;
298 stddev_ = tag->getOption<
core::Real>(
"stddev", 0.5);
300 TR<<
"setting constraint standard deviation to "<< stddev_<< std::endl;
303 atom_id_ = tag->getOption<
std::string >(
"atom" ,
"CA" );
307 anchor_atom_id_ = tag->getOption<
std::string > (
"anchor_atom",
"" );
309 if( tag->hasOption(
"anchor_res" ) ){
310 anchor_res_ = tag->getOption<
std::string >(
"anchor_res" );
311 TR<<
"user specified following residue as anchor atom for the coordinate constraints: " << anchor_res_ << std::endl;
313 if( anchor_res_ !=
"" ){
314 TR<<
"WARNING, if jump is specified, it will not be used, since the specification of an anchor residue will override it" <<std::endl;
319 if( tag->hasOption(
"jump" )) {
320 jump_ = tag->getOption<
core::Size >(
"jump", 0 );
324 TR<<
"using jump atoms for anchor, that is the first one, for jump #: " << jump_ << std::endl;
332 foreach(
TagPtr const btag, branch_tags ){
334 if( btag->getName() ==
"Span" || btag->getName() ==
"span" || btag->getName() ==
"Seeds") {
337 std::pair <std::string,std::string> seedpair;
338 seedpair.first = beginS;
339 TR.Debug<<
"parsing loop verteces: " << beginS <<
" " <<endS <<std::endl;
340 seedpair.second = endS;
341 span_vector_.push_back( seedpair );
345 if( btag->getName() ==
"residue" ) {
346 unparsed_residue_ = tag->getOption<
std::string >(
"residue");