Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
design_utils.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 devel/protein_interface_design/design_utils.hh
11 /// @brief definition of various classes for interface design.
12 /// @author Sarel Fleishman (sarelf@u.washington.edu)
13 
14 #ifndef INCLUDED_protocols_protein_interface_design_design_utils_hh
15 #define INCLUDED_protocols_protein_interface_design_design_utils_hh
16 
17 // Project Headers
18 #include <utility/exit.hh>
20 #include <core/types.hh>
21 #include <core/pose/Pose.fwd.hh>
22 #include <utility/vector1.fwd.hh>
23 // AUTO-REMOVED #include <core/pack/task/PackerTask.fwd.hh>
24 
25 // C++ headers
26 #include <list>
27 #include <set>
28 
29 #include <utility/vector1.hh>
30 
31 
32 namespace protocols {
33 namespace protein_interface_design {
34 
35 // @brief returns the weighted total energy of a given residue. assumes that the pose has been previously scored.
37 
38 /// @details Class ReportSequenceDifferences takes in two poses and provides information on the sequence
39 /// changes between them, including the residue energies associated with those changes.
41 {
42 public:
43  typedef core::Size Size;
44  typedef core::Real Real;
46 public:
48  {
49  scorefxn_ = scorefxn;
50  }
51  ReportSequenceDifferences( ReportSequenceDifferences const & init ) { // copy constructor
54  res_name1_ = init.res_name1_;
55  res_name2_ = init.res_name2_;
57  }
58  void calculate( Pose const & pose1, Pose const & pose2 );
59  std::map< Size, Real> const * get_res_energy( Size const num ) const {
60  runtime_assert(num==1 || num==2);
61  return( num==1 ? &res_energy1_ : &res_energy2_ );
62  }
63  void report( std::ostream & out ) const;
64  std::map< Size, std::string > const & res_name1() const { return res_name1_; }
65  std::map< Size, std::string > const & res_name2() const { return res_name2_; }
67 private:
68  std::map< Size, Real > res_energy1_;
69  std::map< Size, Real > res_energy2_;
70  std::map< Size, std::string > res_name1_;
71  std::map< Size, std::string > res_name2_;
73 };
74 
75 /// @details class Revert takes in 'wt' and 'designed' poses and attempts to revert all substitutions in the
76 /// design to their wt identities. Each substitution is tried separately in the context of the designed protein
77 /// and reversions that don't adversely affect ddg are made. If the energy of the residue in the design is
78 /// higher than 0, but the reversion did not succeed, Revert will attempt an Ala substitution.
79 class Revert
80 {
81 public:
85 public:
86  Revert( ScoreFunctionCOP scorefxn, core::Real const ddg_tolerance, core::Size ddg_cycles = 5 ){
87  scorefxn_ = new ScoreFunction( *scorefxn );
88  ddg_tolerance_ = ddg_tolerance;
89  ddg_cycles_ = ddg_cycles;
90  }
91  Revert( Revert const & init ) { // copy constructor
94  ddg_cycles_ = init.ddg_cycles_;
95  }
96  void apply( core::pose::Pose & pose_wt, core::pose::Pose & pose_des ) const;
97  virtual ~Revert(){};
98 private:
102 };
103 
104 /// @details class FavorNativeResidue changes a pose object so that its residue identities at the
105 /// initialization of FavorNativeResidue are kept in memory. If the res_type_constraint score term is set
106 /// to a value other than 0, an energy bonus will be assigned if the residue doesn't change. This is useful
107 /// e.g., in design based on a native scaffold where we want a barrier to mutation.
109 {
110 public:
112  typedef core::Real Real;
113 public:
114  FavorNativeResidue( Pose & pose, Real const native_residue_bonus );
115  FavorNativeResidue( Pose & pose, utility::vector1< Real > const native_residue_bonus );
116  virtual ~FavorNativeResidue(){};
117 private:
118  void add_residue_constraints( Pose & pose ) const;
120 };
121 
122 /// @details class FavorNonNativeResidue changes a pose object so that its residue identities at the
123 /// initialization of FavorNonNativeResidue are kept in memory. If the res_type_constraint score term is set
124 /// to a value other than 0, an energy bonus will be assigned if the residue changes. This is useful
125 /// if we want to encourage mutation. A negative score would discourage mutation.
127 {
128 public:
130  typedef core::Real Real;
131 public:
132  FavorNonNativeResidue( Pose & pose, Real const native_residue_bonus );
133  FavorNonNativeResidue( Pose & pose, utility::vector1< Real > const native_residue_bonus );
135 private:
136  void add_residue_constraints( Pose & pose ) const;
138 };
139 
140 
141 } // protein_interface_design
142 } // devel
143 
144 // @brief utility function for minimizing sidechain in rigid-body dof, the interface sc, and bb in the entire protein.
145 // The fold_tree for minimization will be set from the centre of target_residues to the closest residue on the partner.
146 // The packertask is used to decide which residues to minimize (those that are not set to prevent_repacking)
147 void MinimizeInterface( core::pose::Pose & pose, core::scoring::ScoreFunctionCOP scorefxn, utility::vector1< bool > const min_bb, utility::vector1< bool > const min_sc, utility::vector1< bool > const min_rb, bool const optimize_foldtree, utility::vector1< core::Size > const target_residues, bool const simultaneous_minimization = false );
148 
149 void SymMinimizeInterface( core::pose::Pose & pose, core::scoring::ScoreFunctionCOP scorefxn, utility::vector1< bool > const min_bb, utility::vector1< bool > const min_sc, utility::vector1< bool > const min_rb, /*bool const optimize_foldtree, utility::vector1< core::Size > const target_residues*/ bool const simultaneous_minimization = false );
150 
151 // @brief utility function for finding hbonding partners among a list of potential binder residues to a specific target
152 // residue
153 std::list< core::Size >
154 hbonded( core::pose::Pose const & pose, core::Size const target_residue, std::set< core::Size > const & binders,
155  bool const bb, bool const sc, core::Real const energy_thres, bool const bb_bb = false );
156 
157 #endif /*INCLUDED_DESIGN_UTILS_H_*/
158 
159