36 #include <ObjexxFCL/FArray1D.hh>
42 #include <utility/string_util.hh>
44 #include <numeric/conversions.hh>
45 #include <numeric/xyzVector.hh>
46 #include <numeric/HomogeneousTransform.hh>
59 #include <utility/vector1.hh>
68 typedef std::pair< std::set<core::Size>,std::set<core::Size> >
InterfacePair;
69 typedef numeric::HomogeneousTransform< core::Real >
HTReal;
81 utility::vector1_bool & interface_residues
110 utility::vector1_bool
119 nearby_atom_cutoff, vector_angle_cutoff, vector_dist_cutoff );
123 utility::vector1_bool
131 utility::vector1_bool at_interface(pose.
total_residue(),
false);
138 vector_angle_cutoff, vector_dist_cutoff, at_interface );
147 utility::vector1_bool
150 int const interface_jump,
157 utility::vector1_bool at_interface(pose.
total_residue(),
false);
164 vector_angle_cutoff, vector_dist_cutoff, at_interface );
173 utility::vector1_bool
181 nearby_atom_cutoff, vector_angle_cutoff, vector_dist_cutoff );
188 std::set< core::Size > & part1res,
189 std::set< core::Size > & part2res,
196 utility::vector1_bool at_interface(pose.
total_residue(),
false);
201 std::set<core::Size> side1_within_cutoff, side2_within_cutoff;
205 core::conformation::find_neighbors<core::conformation::PointGraphVertexData,core::conformation::PointGraphEdgeData>( pg, CB_dist_cutoff );
210 for ( std::set<Size>::const_iterator side1_it = part1res.begin(); side1_it != part1res.end(); ++side1_it ) {
212 edge_end_iter = pg->get_vertex( *side1_it ).upper_edge_list_end(); edge_iter != edge_end_iter; ++edge_iter ) {
214 Size const edge_res = edge_iter->upper_vertex();
216 if ( part2res.count( edge_res ) ) {
217 side1_within_cutoff.insert( *side1_it );
218 side2_within_cutoff.insert( edge_res );
225 CB_pairs_list = std::make_pair( side1_within_cutoff, side2_within_cutoff );
229 vector_angle_cutoff, vector_dist_cutoff, at_interface );
246 utility::vector1_bool & interface_residues ){
248 using namespace utility;
249 using namespace core;
251 for( std::set<Size>::const_iterator chain1_it = interface_pairs.first.begin(); chain1_it!=interface_pairs.first.end(); ++chain1_it ){
253 for( std::set<Size>::const_iterator chain2_it = interface_pairs.second.begin(); chain2_it!=interface_pairs.second.end(); ++chain2_it ){
256 if( interface_residues[*chain1_it] && interface_residues[*chain2_it] )
263 interface_residues[*chain1_it] =
true;
271 interface_residues[*chain2_it] =
true;
278 if( interface_residues[*chain1_it] && interface_residues[*chain2_it] )
283 interface_residues[*chain1_it] =
true;
291 interface_residues[*chain2_it] =
true;
313 using namespace core;
314 bool within_cutoff(
false);
315 Real cutoff_squared( cutoff * cutoff );
323 for( conformation::Atoms::const_iterator res2atm = res2.
atom_begin(); res2atm != res2.
heavyAtoms_end(); ++res2atm ){
324 if ( (*res1atm).xyz().distance_squared( (*res2atm).xyz() ) < cutoff_squared){
325 within_cutoff =
true;
336 for( conformation::Atoms::const_iterator res2atm = res2.
atom_begin(); res2atm != res2.
heavyAtoms_end(); ++res2atm ){
337 if ( pretend_CB.distance_squared( (*res2atm).xyz() ) < cutoff_squared){
338 within_cutoff =
true;
343 return within_cutoff;
359 std::set<core::Size> side1_within_cutoff, side2_within_cutoff;
364 core::conformation::find_neighbors<core::conformation::PointGraphVertexData,core::conformation::PointGraphEdgeData>( pg, big_cutoff );
369 for (
Size partner1_res = ch1_begin_num; partner1_res <= ch1_end_num; ++partner1_res ) {
371 edge_end_iter = pg->get_vertex( partner1_res ).upper_edge_list_end(); edge_iter != edge_end_iter; ++edge_iter ) {
373 Size const partner2_res = edge_iter->upper_vertex();
375 if ( ( partner2_res >= ch2_begin_num ) && (partner2_res <= ch2_end_num ) ) {
376 side1_within_cutoff.insert( partner1_res );
377 side2_within_cutoff.insert( partner2_res );
384 return std::make_pair( side1_within_cutoff, side2_within_cutoff );
390 std::set<core::Size> side1_within_cutoff, side2_within_cutoff;
395 core::conformation::find_neighbors<core::conformation::PointGraphVertexData,core::conformation::PointGraphEdgeData>( pg, big_cutoff );
401 ObjexxFCL::FArray1D_bool partners_array ( pose.
total_residue(), false );
409 edge_end_iter = pg->get_vertex( ii ).upper_edge_list_end(); edge_iter != edge_end_iter; ++edge_iter ){
411 Size const pointgraph_res = edge_iter->upper_vertex();
414 if( partners_array[ii - 1] == partners_array[ pointgraph_res -1 ] )
continue;
416 if( partners_array[ ii - 1 ] ) {
417 side1_within_cutoff.insert( ii );
418 side2_within_cutoff.insert( pointgraph_res );
421 side1_within_cutoff.insert( pointgraph_res );
422 side2_within_cutoff.insert( ii );
428 return std::make_pair( side1_within_cutoff, side2_within_cutoff );
435 if ( ! res.
has(
"CA") ) {
442 return cbvector.normalize();
449 using namespace numeric;
450 using namespace core;
455 }
else if ( res.
has(
"CA") && res.
has(
"C") && res.
has(
"N") ) {
470 HTReal input_frame( N_xyz, halfpoint_input, CA_xyz );
481 HTReal ideal_frame( idealN, ideal_halfpoint, idealCA );
498 using namespace numeric;
499 bool is_pointed_at(
false);
500 core::Real dist_squared(dist_cutoff * dist_cutoff);
507 if ( base_position.distance_squared( dest_position ) <= dist_squared){
510 core::Real r1_dot_r2 = dot_product (res1_vector, base_to_dest);
511 core::Real costheta = std::cos( conversions::to_radians( angle_cutoff ) );
513 if (r1_dot_r2 > costheta){
514 is_pointed_at =
true;
521 return is_pointed_at;