Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
UpstreamDownstreamCollisionFilter.hh
Go to the documentation of this file.
1 // -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*-
2 // vi: set ts=2 noet:
3 // :noTabs=false:tabSize=4:indentSize=4:
4 //
5 // (c) Copyright Rosetta Commons Member Institutions.
6 // (c) This file is part of the Rosetta software suite and is made available under license.
7 // (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
8 // (c) For more information, see http://www.rosettacommons.org. Questions about this can be
9 // (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
10 
11 /// @file protocols/match/output/UpstreamDownstreamCollisionFilter.hh
12 /// @brief Declaration for class to filter matches where the upstream residues collide with the downstream partner
13 /// @author Alex Zanghellini (zanghell@u.washington.edu)
14 /// @author Andrew Leaver-Fay (aleaverfay@gmail.com), porting to mini
15 
16 #ifndef INCLUDED_protocols_match_output_UpstreamDownstreamCollisionFilter_hh
17 #define INCLUDED_protocols_match_output_UpstreamDownstreamCollisionFilter_hh
18 
19 // Unit headers
21 
22 // Package headers
27 
28 // Project headers
30 #include <core/pose/Pose.hh>
31 // AUTO-REMOVED #include <core/id/AtomID.hh>
34 
35 
36 // Utility headers
37 // AUTO-REMOVED #include <utility/vector1.hh>
38 #include <utility/pointer/ReferenceCount.hh>
39 
40 #include <utility/vector1.hh>
41 
42 #ifdef WIN32
44 #endif
45 
46 
47 namespace protocols {
48 namespace match {
49 namespace output {
50 
51 /// @brief This class is used to detect collisions between upstream residues
52 /// and downstream poses.
54 public:
55  typedef core::Real Real;
57 
58 public:
61  UpstreamHitCacherOP coordinate_cacher );
62 
63  virtual
65 
66  void
67  set_downstream_pose( core::pose::Pose const & downstream_pose );
68 
69  void
71 
72  /// @brief Do not perform any collision detection between an upstream residue and the downstream
73  /// pose if there is a chemical bond between them
74  void
76 
77  void
79 
80  void set_tolerated_overlap( Real setting );
81 
82  /// @brief Returns true if there is at least one placement of the
83  /// downstream partner which does not exceed the collision tolerance
84  /// with any of the upstream residues.
85  virtual
86  bool
88  match const & m
89  ) const;
90 
91  /// @brief Returns true if the specified downstream position does not
92  /// collide more than tolerated with any of the upstream residues
93  virtual
94  bool
96  match_dspos1 const & m
97  ) const;
98 
99  bool
101  core::Size geomcst_up,
102  core::Size geomcst_down,
103  Hit const & upstream_hit,
104  Hit const & downstream_hit
105  ) const;
106 
107  inline
108  bool
110  core::Size geomcst,
111  Hit const & upstream_hit,
112  utility::vector1< core::Vector > const & coords
113  ) const
114  {
115  core::conformation::ResidueCOP iires = cacher_->upstream_conformation_for_hit( geomcst, upstream_hit );
116  Size ii_first_sc = iires->first_sidechain_atom();
117  for ( Size jj = 1; jj <= downstream_pose_->total_residue(); ++jj ) {
118  core::conformation::Residue const & jjres = downstream_pose_->residue( jj );
119  Real intxn_dis = iires->nbr_radius() + jjres.nbr_radius() + max_overlap_dis_;
120  if ( iires->xyz( iires->nbr_atom() ).distance_squared(
121  coords[ per_res_atom_ind_[ jj ][ jjres.nbr_atom() ]] ) >
122  intxn_dis * intxn_dis ) {
123  continue;
124  }
125 
126  for ( Size kk = ii_first_sc; kk <= iires->nheavyatoms(); ++kk ) {
127  ProbeRadius kk_rad = probe_radius_for_atom_type( iires->atom_type_index( kk ) );
128  for ( Size ll = 1; ll <= jjres.nheavyatoms(); ++ll ) {
130  Real minsep = bump_grid()->required_separation_distance( kk_rad, ll_rad );
131  if ( iires->xyz( kk ).distance_squared( coords[ per_res_atom_ind_[ jj ][ ll ]]) < minsep * minsep ) {
132  return false;
133  }
134  }
135  }
136  }//loop over residues of downstream pose
137  return true;
138  }
139 
140 private:
141  bool passes_etable_filter( match_dspos1 const & m ) const;
142  bool passes_hardsphere_filter( match_dspos1 const & m ) const;
143 
144 private:
146 
148 
149  utility::vector1< bool > us_ds_chemical_bond_; // skip residues that form a chemical bond to the downstream partner
150 
151  /// NOT THREADSAFE!
156 };
157 
158 
159 }
160 }
161 }
162 
163 #endif