Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Patch.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
11 /// @author Phil Bradley
12 // see Patch.cc to understand what's going on
13 
14 #ifndef INCLUDED_core_chemical_Patch_hh
15 #define INCLUDED_core_chemical_Patch_hh
16 
17 
18 // // Unit headers
20 
21 // // Package headers
24 
25 #include <utility/vector1.hh>
26 
27 
28 // Project headers
29 
30 // Utility headers
31 // Commented by inclean daemon #include <utility/vector1.hh>
32 // Commented by inclean daemon #include <utility/pointer/owning_ptr.hh>
33 // Commented by inclean daemon #include <utility/pointer/ReferenceCount.hh>
34 
35 // C++ headers
36 
37 namespace core {
38 namespace chemical {
39 
40 
41 
42 /// @brief the string used to create new residue names after patching
43 extern std::string const patch_linker;
44 
45 /// @brief helper function, returns the base residue name prior to any patching
47 residue_type_base_name( ResidueType const & rsd_type );
48 
49 /// @brief helper function, returns the name of all added patches
51 residue_type_all_patches_name( ResidueType const & rsd_type );
52 
53 /// @brief A single case of a patch, eg proline Nterminus is a case of NtermProteinFull
55 public:
56  ///@brief Automatically generated virtual destructor for class deriving directly from ReferenceCount
57  virtual ~PatchCase();
58 
59  /// @brief whether the PatchCase is applicable to this ResidueType?
60  bool
61  applies_to( ResidueType const & rsd ) const
62  {
63  return selector_[ rsd ];
64  }
65 
66  /// @brief returns patched residue, 0 if patch failed
67  virtual
69  apply( ResidueType const & rsd_in ) const;
70 
71  /// @brief add one more operation in this PatchCase
72  void
74  {
75  operations_.push_back( operation );
76  }
77 
78  /// @brief to which ResidueTypes this PatchCase applies to?
81  {
82  return selector_;
83  }
84 
85 
86  // data:
87 private:
88  /// @brief to which ResidueTypes this PatchCase applies to?
90  /// @brief operations to done in this PatchCase
92 
93 };
94 
95 
96 ////////////////////////////////////////////////////////////////////////////////////////
97 /// @brief A class patching basic ResidueType to create variant types, containing multiple PatchCase
99 public:
100  ///@brief Automatically generated virtual destructor for class deriving directly from ReferenceCount
101  virtual ~Patch();
102  /// @brief constructor from file
103  void
104  read_file( std::string const & filename );
105 
106  /// can I operate on this residue type?
107  virtual
108  bool
109  applies_to( ResidueType const & rsd ) const
110  {
111  return selector_[ rsd ];
112  }
113 
114  /// do I replace this residue type?
115  virtual
116  bool
117  replaces( ResidueType const & rsd ) const
118  {
119  return applies_to( rsd ) && replaces_residue_type_;
120  }
121 
122  /// @brief returns patched residue, 0 if patch failed
123  virtual
125  apply( ResidueType const & rsd_type ) const;
126 
127 
128  /// @brief unique name of this patch, eg Nter-simple, Cter-full, Phospho, ... ?
129  virtual
130  std::string const &
131  name() const
132  {
133  return name_;
134  }
135 
136  /// @brief the variant types created by applying this patch
137  virtual
139  types() const
140  {
141  return types_;
142  }
143 
144  /// private data
145 private:
146  /// name of the patch
148 
149  /// @brief variant types created by the patch
151 
152  /// @brief criteria to select ResidueTypes to which the patch is applied
154 
155  /// @brief different cases to which the patch is applied slightly differently, e.g., N-terminus patch to PRO and GLY
157 
158  /// @brief if set this patch will not change the name of the ResidueType and returns true for replaces()
160 
161 };
162 
163 
164 
165 } // chemical
166 } // core
167 
168 
169 
170 #endif