Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
NeighborsByDistanceCalculator.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 /src/protocols/toolbox/PoseMetricCalculators/NeighborsByDistanceCalculator.hh
11 /// @brief NeighborsByDistanceCalculator can determine all the neighbors of a residue within a certain distance. The pose does not have to have been scored (have a full Energies object). It uses the PointGraph tools to find neighbors. There is probably a much more sophisticated way to do this with existing Graph tools but I don't know what it is.
12 /// @author Steven Lewis
13 
14 #ifndef INCLUDED_protocols_toolbox_pose_metric_calculators_NeighborsByDistanceCalculator_hh
15 #define INCLUDED_protocols_toolbox_pose_metric_calculators_NeighborsByDistanceCalculator_hh
16 
17 //Unit headers
20 
21 //
22 #include <core/pose/Pose.fwd.hh>
23 #include <basic/MetricValue.fwd.hh>
24 
25 //Utility headers
26 #include <basic/options/option.hh>
27 #include <core/types.hh>
28 
29 //C++ headers
30 #include <set>
31 
32 // option key includes
33 #include <basic/options/keys/pose_metrics.OptionKeys.gen.hh>
34 
35 namespace protocols{
36 namespace toolbox {
37 namespace pose_metric_calculators {
38 
39 ///@details this calculator determines the number and resids of residues within X angstroms of the given residue. Its intended purpose is the backend for a TaskOperation that allows one to construct a PackerTask based on neighborhoods around a set of particular residues. (It combines with a NeighborhoodByDistanceCalculator for that purpose). It can return the identity of its seeded central residue and distance (just get functions) and calculate the neighbors and count of neighbors around that residue within that distance. It uses the PointGraph class to do this; if you have a better/faster implementation please code it up and replace this one. Note that returned data is INCLUSIVE of the central residue - it is part of the count and part of the std::set.
41 
42 public:
44 
45  ///@brief central_residue is the residue whose neighbors we find
48  core::Real dist_cutoff = basic::options::option[basic::options::OptionKeys::pose_metrics::neighbor_by_distance_cutoff]
49  );
50 
52 
54 
55  //accessors for non-recomputed input data
56  ///@brief return central residue
58 
59  ///@brief return distance cutoff
60  core::Real dist_cutoff() const { return dist_cutoff_; }
61 
62 protected:
63 
64  virtual void lookup( std::string const & key, basic::MetricValueBase * valptr ) const;
65  virtual std::string print( std::string const & key ) const;
66  virtual void recompute( core::pose::Pose const & pose );
67 
68 private:
69 
70  ///@brief stores the input - whose neighbors are we finding?
72  ///@brief stores the input - how far away is a neighbor?
74  ///@brief the number of neighbors, INCLUSIVE of this residue
76  ///@brief the set of neighbors, INCLUSIVE of this residue
77  std::set< core::Size > neighbors_;
78 
79 };
80 
81 
82 } // namespace pose_metric_calculators
83 } // namespace toolbox
84 } // namespace protocols
85 
86 #endif //INCLUDED_protocols_toolbox_PoseMetricCalculators_NeighborsByDistanceCalculator_HH
87