Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SeqprofConsensusOperation.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 protocols/toolbox/task_operations/SeqprofConsensus.hh
11 /// @brief set every position to be designable to residues observed in sequence profile
12 /// @author Florian Richter, floric@u.washington.edu, april 2011
13 
14 #ifndef INCLUDED_protocols_toolbox_task_operations_SeqprofConsensusOperation_hh
15 #define INCLUDED_protocols_toolbox_task_operations_SeqprofConsensusOperation_hh
16 
17 // unit headers
19 
20 //package headers
22 
23 //project headers
24 #include <core/chemical/AA.hh>
27 #include <core/types.hh>
29 
30 // Utility Headers
31 #include <utility/tag/Tag.fwd.hh>
32 #include <utility/vector1.hh>
33 
34 // AUTO-REMOVED #include <iostream>
35 
36 #include <map>
37 
38 
39 using namespace core::pack::task;
40 
41 namespace protocols{
42 namespace toolbox{
43 namespace task_operations{
44 
46 public:
47 
49  typedef core::Real Real;
56 
57 
58 public:
59 
60  /// @brief default constructor
62 
63  /// @brief destructor
65 
66  /// @brief make clone
67  virtual TaskOperationOP clone() const;
68 
69 public:
70 
71  void parse_tag( TagPtr tag );
72 
73  /// @brief apply
74  virtual void apply( Pose const & pose, PackerTask & task ) const;
75 
77  seqprof() const;
78 
79  void
81  ignore_pose_profile_length_mismatch_ = setting; }
82 
83  /// @brief Set the sequence profile. If reweight is true, convert the profile into per-residue probabilities first
84  void
85  set_seqprof( core::sequence::SequenceProfileCOP seqprof, bool reweight = false );
86 
87 private:
88 
90  /// @details Stored as a per-position probability weighted value
92  /// @brief mininum probability that an aa must have in the sequence profile to be considered
94  /// @brief whether probability of a given aa to be included needs to be higher than the probability of the aa in the input pose
96 
97  /// @default false. if true, every pose seqpos that is bigger
98  /// than the size of the sequence_profile will be set to repacking
99  /// allows using this taskop in situations where one wants to
100  /// do consensus design on one chain of a protein/protein interface
102 
103 };
104 
105 /// @brief a Task operation that will check whether the amino acid at a
106 /// position is conserved in the sequence profile and has an unfavorable
107 /// ddG when mutated to ala. all positions that match this criterion will
108 /// get set to repacking.
109 /// @details wt ala positions are set to repacking based on seqprof criterion
110 /// only.
111 /// If the input pose contains a forbidden (i.e. non wildtype ) residue
112 /// at an untouchable position, the residue currently in the pose is
113 /// also allowed.
115 
116 public:
118 
120 
122 
123  virtual TaskOperationOP clone() const;
124 
125  void parse_tag( TagPtr tag );
126 
127  virtual void apply( Pose const & pose, PackerTask & task ) const;
128 
129  /// @brief returns true if seqpos has a sequence profile
130  /// frequency > conservation_cutoff_ and an X->A ddG of >
131  /// ddG_cutoff_
132  bool
133  position_untouchable(
134  core::Size seqpos,
135  core::chemical::AA seqprof_wt
136  ) const;
137 
138  //convenience function that returns the wild type residue
139  //in the pssm file at seqpos
141  seqprof_wt_aa( core::Size seqpos ) const;
142 
143  /// @brief convenience function to query
144  /// what the ddG is for a to ala mutation
145  /// at a certain position
146  core::Real
147  position_ala_ddG( core::Size seqpos ) const;
148 
149  bool
150  verbose() const {
151  return verbose_;}
152 
153 private:
155  std::map< core::Size, core::io::PositionDdGInfo::PositionDdGInfoOP > position_ddGs_;
156  core::Real conservation_cutoff_; //how freqeunt a residue must be in the sequence profile to count as conserved
157  core::Real ddG_cutoff_; //how favorable the ddG at a position has to be for the residue to be considered untouchable
158  bool verbose_; //spit out information about untouchable residues
159 
160 };
161 
162 
163 } // TaskOperations
164 } // toolbox
165 } // protocols
166 #endif