Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
NeighborhoodByDistanceCalculator.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/NeighborhoodByDistanceCalculator.hh
11 /// @brief NeighborhoodByDistanceCalculator can determine all the neighbors of group of residues within a certain distance.
12 /// @author Steven Lewis
13 
14 #ifndef INCLUDED_protocols_toolbox_pose_metric_calculators_NeighborhoodByDistanceCalculator_hh
15 #define INCLUDED_protocols_toolbox_pose_metric_calculators_NeighborhoodByDistanceCalculator_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 <core/types.hh>
27 
28 // AUTO-REMOVED #include <basic/options/keys/pose_metrics.OptionKeys.gen.hh>
29 
30 //C++ headers
31 #include <set>
32 
33 #include <utility/vector1.hh>
34 #include <map>
35 
36 
37 namespace protocols{
38 namespace toolbox {
39 namespace pose_metric_calculators {
40 
41 ///@details this calculator determines the number and resids of residues within X angstroms of a group of given residues. 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 can return its set of central residues, the total count of their neighbors as determined by the sub-calculators (inclusive of the central residues), and the identities of those neighbors.
43 
44 public:
46 
47  ///@brief ctor for positions, dist_cutoff will be initialized using default value from option system
48  NeighborhoodByDistanceCalculator(std::set< core::Size > central_residues);
49 
50  ///@brief ctor for positions, with custom dist_cutoff supplied by user
52 
53  ///@brief copy ctor
55 
57 
58  //accessors for constant/input data
59  ///@brief return central residues set
60  std::set< core::Size > const & central_residues() const { return central_residues_; }
61 
62  ///@brief return distance cutoff
63  core::Real dist_cutoff() const { return dist_cutoff_; }
64 
65 protected:
66  virtual void lookup( std::string const & key, basic::MetricValueBase * valptr ) const;
67  virtual std::string print( std::string const & key ) const;
68  virtual void recompute( core::pose::Pose const & pose );
69 
70 private:
71 
72  ///@brief whose neighbors are we finding?
73  std::set< core::Size > central_residues_;
74  ///@brief stores the input - how far away is a neighbor?
76  ///@brief the number of neighbors, INCLUSIVE of central residues
78  ///@brief the number of neighbors for each of the central residues
79  std::map<core::Size, core::Size> num_neighbors_map_;
80  ///@brief the set of neighbors, INCLUSIVE of central_residues
81  std::set< core::Size > neighbors_;
82 
83 };
84 
85 
86 } // namespace pose_metric_calculators
87 } // namespace toolbox
88 } // namespace protocols
89 
90 #endif //INCLUDED_protocols_toolbox_PoseMetricCalculators_NeighborhoodByDistanceCalculator_HH
91