36 #include <boost/foreach.hpp>
37 #define foreach BOOST_FOREACH
44 #include <utility/vector0.hh>
45 #include <utility/vector1.hh>
46 #include <basic/Tracer.hh>
52 static basic::Tracer
TR(
"protocols.protein_interface_design.util" );
55 namespace protein_interface_design {
57 using namespace core::scoring;
58 using namespace protocols::moves;
76 linear_ft.
add_edge( chain_end-1, chain_end, jump_num );
82 linear_ft.
add_edge( 1,chain_begin, jump_num );
88 TR<<linear_ft<<std::endl;
98 if( residue_type ==
"GLN" || residue_type ==
"GLU" )
100 if( residue_type ==
"ARG" )
102 if( residue_type ==
"MET" )
104 if( residue_type ==
"LEU" || residue_type ==
"PHE" || residue_type ==
"TRP" || residue_type ==
"TYR" || residue_type ==
"ASN" || residue_type ==
"ASP" )
106 if( residue_type ==
"LYS" )
108 if( residue_type ==
"GLY" )
111 return( connect_to );
119 using namespace core::chemical;
120 using namespace core::kinematics;
130 ft.add_edge( nearest_resi_on_target, resi, jump );
132 connection_points.push_back( nearest_resi_on_target );
134 std::sort( connection_points.begin(), connection_points.end() );
135 std::unique( connection_points.begin(), connection_points.end() );
137 foreach(
core::Size const con, connection_points ){
138 ft.add_edge( upstream_position, con, Edge::PEPTIDE );
139 upstream_position = con;
141 ft.add_edge( connection_points[ connection_points.size() ], pose.
conformation().
chain_end( 1 ), Edge::PEPTIDE );
142 ft.delete_self_edges();
149 using namespace core::scoring;
150 using namespace core::scoring::constraints;
156 (*scorefxn)(nonconst_pose);
160 ConstraintCOPs original_csts = nonconst_pose.constraint_set()->get_all_constraints();
162 for( ConstraintCOPs::const_iterator it = original_csts.begin(),
end = original_csts.end(); it !=
end; ++it ) {
164 if( cst->type() ==
"AmbiguousConstraint" ) {
167 if( ambiguous_cst->active_constraint()->type() ==
"BackboneStub" ) {
168 new_csts.push_back( ambiguous_cst->active_constraint() );
181 using namespace core::scoring;
182 using namespace core::scoring::constraints;
192 (*scorefxn)(nonconst_pose);
196 for(
core::Size i=nonconst_pose.conformation().chain_begin( chain ); i<=nonconst_pose.conformation().chain_end( chain ); ++i ){
199 core::Real const curr_energy( weight * score );
200 all_residues.push_back(std::make_pair( curr_energy, i ));
202 sort( all_residues.begin(), all_residues.end() );
205 if( all_residues[i].first < 0 ) best_residues.push_back( all_residues[i].second );
207 assert( best_residues.size() <= n_return );
208 return best_residues;
214 using namespace core::scoring;
218 lowest_energy = 100000.0;
220 using namespace core::scoring;
223 if( curr_energy<=lowest_energy ){
224 lowest_energy = curr_energy;
235 using namespace core::scoring::constraints;
239 for( ConstraintCOPs::const_iterator it = original_csts.begin(),
end = original_csts.end(); it !=
end; ++it ) {
241 if( cst->type() ==
"CoordinateConstraint" ) {
244 crd_csts.push_back( cst );
261 if( ss ==
'H' || ss ==
'S' )
break;
268 for(
core::Size res = prev_d; res <= d-1; ++res ){
270 if( pose.
secstruct( res + 1 ) ==
'L' && pose.
secstruct( res + 2 ) ==
'L' )
return res;
273 for(
core::Size res = prev_u; res <= u-1; ++res ){
275 if( pose.
secstruct( res + 1 ) ==
'L' && pose.
secstruct( res + 2 ) ==
'L' )
return res;
278 for(
core::Size res = prev_d; res <= d; ++res ){
279 if( pose.
secstruct( res ) ==
'L' )
return res;
281 for(
core::Size res = prev_u; res <= u-1; ++res ){
282 if( pose.
secstruct( res ) ==
'L' )
return res;
295 if( distance<=nearest_dist ){
300 runtime_assert( nearest_resi );
301 return( nearest_resi );