Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ContactMap.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 //////////////////////////////////////////////////////////////////////////////////////////////
11 /// @file ContactMap.hh
12 ///
13 /// @brief Mover to create a ContactMap
14 ///
15 /// @detailed :
16 /// This mover takes a pose and creates a matrix with true(1) or false(0) values for
17 /// atom pairs depending on whether both atoms are within a specified cutoff distance.
18 /// For protein residues (specified via region1/2 tag) CB or CA (Gly) atoms and for ligands
19 /// (specified via ligand tag) all heavy atoms are used for distance calculations.
20 /// Depending on the options specified values may be added up to include multiple poses in
21 /// one ContactMap output file
22 ///
23 /// @author Joerg Schaarschmidt
24 //////////////////////////////////////////////////////////////////////////////////////////////
25 
26 #ifndef INCLUDED_protocols_contact_map_ContactMap_hh
27 #define INCLUDED_protocols_contact_map_ContactMap_hh
28 
29 // Unit headers
31 #include <protocols/moves/Mover.hh>
32 
33 #include <core/types.hh>
35 
36 #include <utility/vector1.hh>
37 
38 
39 namespace protocols {
40 namespace contact_map {
41 
42 class ContactMap : public moves::Mover {
43 
44 public:
45  /// @brief Default constructor
46  ContactMap();
47  /// @brief Copy constructor
48  ContactMap(ContactMap const &);
49 
50  /// @brief Destructor
51  ~ContactMap();
52 
53  virtual moves::MoverOP clone() const;
54  virtual moves::MoverOP fresh_instance() const;
55 
56  virtual void parse_my_tag(
57  TagPtr const,
60  moves::Movers_map const &,
61  Pose const & );
62 
63  virtual void apply( Pose & pose );
64 
65  virtual std::string get_name() const;
66  virtual void test_move( Pose & pose ){
67  apply(pose);
68  }
69 
70  /// @brief Setter functions for private class variables
71  void set_output_prefix( std::string prefix){ output_prefix_ = prefix; }
72  void set_distance_cutoff( core::Real cutoff ){ distance_cutoff_ = cutoff; }
73 
74  /// @brief :
75  /// Parses region string end sets the boundaries accordingly
76  /// @details:
77  /// Possible formats for the region definition are "<int seqpos>" (e.g '12'),
78  /// "<int begin>-<int end>" (e.g. '1-10') or "<char chainID>"(e.g. 'A')
80  core::Size & ,
81  core::Size &,
82  Pose const &);
83 
84  /// @brief Resets the movers n_poses_ variable and the counts of all contacts to 0
85  void reset();
86 
87  /// @brief Output function that writes the ContactMap to the specified file
89 
90 private:
91  /// @brief Container for all AtomPairs included in the ContactMap
93  /// @brief Vector that maps the matrix position to the index of the contact in contacts_
94  /// @detail Vector of size columns*rows with field(row, column) stored at (row-1)*[#columns] + column
101  /// @brief int value after how many models an output file will be generated
103  /// @brief bool value indicating whether the reset function will be called after file output
106 
107  /// @brief Initializes ContactMap within a single region
108  void fill_contacts(
109  core::Size region_begin,
110  core::Size region_end,
111  Pose const & pose);
112 
113  /// @brief Initializes ContactMap between a single region and a ligand
114  void fill_contacts(
115  core::Size region_begin,
116  core::Size region_end,
117  core::Size seqpos_ligand,
118  Pose const & pose);
119 
120  /// @brief Initializes ContactMap between two separate regions
121  void fill_contacts(
122  core::Size region1_begin,
123  core::Size region1_end,
124  core::Size region2_begin,
125  core::Size region2_end,
126  Pose const & pose);
127 
128 }; //class ContactMap
129 
130 
131 
132 /// @brief Simple class that holds the information on an atom involved in a contact
134 
135 public:
136  /// @brief Default constructor
138  seqpos_(seqpos),
139  resname_(resname),
140  atomname_(aname){}
141 
142  /// @brief Returns string representation of the ContactPartner
144 
145  /// @brief Accessor functions for private class variables
149 
150 private:
154 }; // class ContactPartner
155 
156 
157 
158 /// @brief Simple class representing a contact between two atoms
159 class Contact{
160 
161 public:
162  /// @brief Default constructor
164  count_(0),
165  partner1_(p1),
166  partner2_(p2)
167  {}
168 
169  /// @brief Adds distance to the contact
171 
172  /// @brief Resets count to 0
173  void reset_count();
174 
175  /// @brief Returns string representation of the Contact
177 
178  /// @brief Returns string representation of the Contact as percentage value
180 
181  /// @brief Returns string representation of the Contact including partner names
183 
184  /// @brief Accessor functions for private class variables
187 
188 private:
192 }; // class Contact
193 
194 
195 } // moves
196 } // protocols
197 #endif //INCLUDED_protocols_moves_ContactMap_HH