Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CountPairGeneric.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 //
4 // (c) Copyright Rosetta Commons Member Institutions.
5 // (c) This file is part of the Rosetta software suite and is made available under license.
6 // (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
7 // (c) For more information, see http://www.rosettacommons.org. Questions about this can be
8 // (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
9 
10 /// @file core/scoring/etable/count_pair/CountPairGeneric.hh
11 /// @brief
12 /// @author Andrew Leaver-Fay (leaverfa@email.unc.edu)
13 
14 
15 #ifndef INCLUDED_core_scoring_etable_count_pair_CountPairGeneric_hh
16 #define INCLUDED_core_scoring_etable_count_pair_CountPairGeneric_hh
17 
18 // Unit Headers
20 
21 // Package Headers
23 // AUTO-REMOVED #include <core/scoring/etable/atom_pair_energy_inline.hh>
24 
25 #include <core/types.hh>
26 // AUTO-REMOVED #include <core/conformation/Atom.hh>
27 
29 #include <utility/vector1_bool.hh>
30 
31 
32 namespace core {
33 namespace scoring {
34 namespace etable {
35 namespace count_pair {
36 
38 {
39 public:
40  public:
42 
43 public:
45  conformation::Residue const & res1,
46  conformation::Residue const & res2
47  );
48 
49  /// @brief Create a count pair object that pretends there exist
50  /// a chemical bond between some number of atoms in residue 1 and
51  /// some number of atoms in residue2; the bond_pairs vector is
52  /// a set of ordered-pairs of atom-indices, where the first
53  /// is an atom from restype1 and the second is an atom of restype2.
55  chemical::ResidueType const & restype1,
56  chemical::ResidueType const & restype2,
57  utility::vector1< std::pair< Size, Size > > bond_pairs
58  );
59 
60  void set_crossover( Size );
61 
62  virtual ~CountPairGeneric();
63 
64  ///@brief function required by templated functions in atom_pair_energy_inline
65  inline
66  bool
68  int const at1,
69  int const at2,
70  Real & weight,
71  Size & minpathdist
72  ) const
73  {
74  minpathdist = path_distance( at1, at2 );
75 
76  //std::cout << "CPGeneric: r1= " << r1_.seqpos() << " r2=" << r2_.seqpos();
77  //std::cout << " at1: " << r1_.atom_name( at1 ) << " at2: " << r2_.atom_name( at2 );
78  //std::cout << " minpathdist= " << minpathdist << " count? ";
79  //std::cout << ( minpathdist < crossover_ ? "not counted" : minpathdist == crossover_ ? "half" : "yes") << std::endl;
80 
81  if ( (int) minpathdist < crossover_ ) { return false; }
82  if ( (int) minpathdist > crossover_ ) { return true; }
83  weight = cp_half;
84  return true;
85  }
86 
87  int
88  path_distance( int const at1, int const at2 ) const
89  {
90  int minpathdist = 10;
91 
92  // Check genuine connections
93  for ( Size ii = 1; ii <= n_connect_; ++ii ) {
94  int ii_pathdist = res1_conn_point_path_dists_[ ii ]->operator[](at1) + res2_conn_point_path_dists_[ ii ]->operator[](at2) + 1;
95  if ( ii_pathdist < minpathdist ) minpathdist = ii_pathdist;
96  }
97 
98  // Check pseudobond connections
99  for ( Size ii = 1; ii <= n_pconnect_; ++ii ) {
100  int ii_pathdist = res1_pbconn_point_path_dists_[ ii ]->operator[]( at1 )
101  + res2_pbconn_point_path_dists_[ ii ]->operator[]( at2 )
102  + pb_lengths_[ ii ];
103  if ( ii_pathdist < minpathdist ) minpathdist = ii_pathdist;
104  }
105  return minpathdist;
106  }
107 
108  virtual
109  bool
110  count(
111  int const at1,
112  int const at2,
113  Real &,
114  Size & path_dist
115  ) const;
116 
117  /// Type Resolution Functions ///
118 
119  virtual
120  void
122  conformation::Residue const & res1,
123  conformation::Residue const & res2,
125  EnergyMap &
126  ) const;
127 
128 
129  virtual
130  void
132  conformation::Residue const &,
133  conformation::Residue const &,
135  EnergyMap &
136  ) const;
137 
138 
139  virtual
140  void
142  conformation::Residue const &,
143  conformation::Residue const &,
145  EnergyMap &
146  ) const;
147 
148 
149  virtual
150  void
152  conformation::Residue const &,
153  conformation::Residue const &,
155  EnergyMap &
156  ) const;
157 
158 
159  virtual
160  void
162  conformation::Residue const &,
163  conformation::Residue const &,
165  EnergyMap &
166  ) const;
167 
168  virtual
169  void
171  conformation::Residue const & res1,
172  conformation::Residue const & res2,
174  EnergyMap &
175  ) const;
176 
177 
178  virtual
179  void
181  conformation::Residue const &,
182  conformation::Residue const &,
184  EnergyMap &
185  ) const;
186 
187 
188  virtual
189  void
191  conformation::Residue const &,
192  conformation::Residue const &,
194  EnergyMap &
195  ) const;
196 
197 
198  virtual
199  void
201  conformation::Residue const &,
202  conformation::Residue const &,
204  EnergyMap &
205  ) const;
206 
207 
208  virtual
209  void
211  conformation::Residue const &,
212  conformation::Residue const &,
214  EnergyMap &
215  ) const;
216 
217 
218 private:
219  //conformation::Residue const & r1_;
220  //conformation::Residue const & r2_;
221 
225 
230 
232 };
233 
234 } // namespace count_pair
235 } // namespace etable
236 } // namespace scoring
237 } // namespace core
238 
239 #endif