23 #include <basic/Tracer.hh>
40 #include <utility/string_util.hh>
47 namespace match_enzdes_util{
49 static basic::Tracer
tr(
"protocols.toolbox.match_enzdes_util.util_functions");
60 std::map< std::string, core::PointPosition > atom_name_to_xyz;
63 atom_name_to_xyz.insert( std::pair< std::string, core::PointPosition > (pose.
residue(res_pos).
atom_name(at_ct), pose.
residue(res_pos).
xyz( at_ct ) ) );
72 std::map< std::string, core::PointPosition>::iterator xyz_map_it = atom_name_to_xyz.find( pose.
residue(res_pos).
atom_name(at_ct) );
74 if(xyz_map_it == atom_name_to_xyz.end() ) {
75 std::cerr <<
"ERROR: when trying to make dsflkj constraint covalent, atom " << pose.
residue(res_pos).
atom_name(at_ct) <<
" was not found for residue " << pose.
residue(res_pos).
name3() <<
" at position " << res_pos << std::endl;
76 utility::exit( EXIT_FAILURE, __FILE__, __LINE__);
90 std::list< core::conformation::ResidueCOP >
const & invrots,
103 std::list< core::conformation::ResidueCOP >
const & invrots,
110 using namespace core::scoring::constraints;
112 if( !constraint_func ) constraint_func =
new BoundFunc( 0, 0.05, 0.4,
"invrot");
120 for(
core::Size i =1; i <= seqpos.size(); ++i ){
123 if( cur_remodel_res->name3() ==
"GLY" )
continue;
126 core::id::AtomID rem_CA( cur_remodel_res->type().atom_index(
"CA"), seqpos[i] );
127 core::id::AtomID rem_CB( cur_remodel_res->type().atom_index(
"CB"), seqpos[i] );
128 core::id::AtomID rem_N( cur_remodel_res->type().atom_index(
"N"), seqpos[i] );
130 for( std::list< core::conformation::ResidueCOP >::const_iterator invrot_it( invrots.begin() ), invrot_end( invrots.end() ); invrot_it != invrot_end; ++invrot_it ){
133 cur_res_invrot_csts.push_back(
new BackboneStubConstraint( pose, seqpos[i], fixed_pt, **invrot_it, -20.0, 0.8) );
137 cur_res_invrot_csts.push_back(
new CoordinateConstraint( rem_CA, fixed_pt, (*invrot_it)->xyz(
"CA"), constraint_func ) );
138 cur_res_invrot_csts.push_back(
new CoordinateConstraint( rem_CB, fixed_pt, (*invrot_it)->xyz(
"CB"), constraint_func ) );
139 cur_res_invrot_csts.push_back(
new CoordinateConstraint( rem_N, fixed_pt, (*invrot_it)->xyz(
"N"), constraint_func ) );
141 all_res_invrot_csts.push_back(
new MultiConstraint( cur_res_invrot_csts ) );
145 tr <<
"Created a total of " << all_res_invrot_csts.size() <<
" constraints between " << invrots.size() <<
" inverse rotamers and " << totrescount <<
" residues." << std::endl;
161 if( !enz_ob )
return NULL;
163 EnzCstTemplateResCacheCOP res_cache( enz_ob->cst_cache()->param_cache( geomcst )->template_res_cache( geomcst_template_res) );
164 runtime_assert( res_cache );
165 if( res_cache->not_in_pose() )
return NULL;
167 runtime_assert( res_cache->seqpos_map_size() == 1 );
186 utility::add_spaces_right_align( posA, 4 );
189 utility::add_spaces_right_align( posB, 4 );
191 return "MATCH TEMPLATE "+ chainA +
" "+ resA +
" "+ posA +
" MATCH MOTIF "+ chainB +
" " + resB +
" "+posB +
" " + utility::to_string( cst_block ) +
" " + utility::to_string( ex_geom_id );
210 std::istringstream line_stream;
214 line_stream.str( line );
216 line_stream >> buffer >> tag;
217 if( tag ==
"TEMPLATE"){
218 line_stream >> chainA >> resA >> seqposA >> buffer >> buffer;
219 line_stream >> chainB >> resB >> seqposB >> cst_block;
220 if( resA.size() == 2 ) resA =
" " + resA;
221 if( resB.size() == 2 ) resB =
" " + resB;
223 if( line_stream.bad() ){
224 tr <<
"ERROR when trying to split up pdb remark line. Not all fields seem to have been specified." << std::endl;
228 line_stream >> ex_geom_id;
229 if( !line_stream.good() ) ex_geom_id = 1;
252 tr <<
"No non-ligand residues were detected!!" << std::endl;
253 runtime_assert(
false );
272 tr <<
"No non-ligand residues were detected!!" << std::endl;
273 runtime_assert(
false );