Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
AlterSpecDisruptionDriver.cc
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 // This file is part of the Rosetta software suite and is made available under license.
5 // The Rosetta software is developed by the contributing members of the Rosetta Commons consortium.
6 // (C) 199x-2009 Rosetta Commons participating institutions and developers.
7 // For more information, see http://www.rosettacommons.org/.
8 
9 /// @file protocols/pmut_scan/AlterSpecDisruptionDriver.cc
10 /// @brief A protocol that tries to find interface-disrupting mutations as phase 1 of an altered-specificity protocol
11 /// @author Steven Lewis smlewi@gmail.com
12 
13 // Unit headers
16 
17 //project Headers
18 #include <core/pose/Pose.hh>
19 
21 
23 
24 // Utility Headers
25 #include <utility/excn/Exceptions.hh>
26 #include <utility/vector1.hh>
27 
28 #include <basic/Tracer.hh>
29 
30 namespace protocols {
31 namespace pmut_scan {
32 
33 static basic::Tracer TR("protocols.pmut_scan.AlterSpecDisruptionDriver");
34 
35 ///
36 /// @begin AlterSpecDisruptionDriver::AlterSpecDisruptionDriver
37 ///
38 /// @brief
39 /// Main constructor for the class.
40 ///
41 AlterSpecDisruptionDriver::AlterSpecDisruptionDriver( utility::vector1< std::string > & pdb_file_names, bool double_mutant_scan, std::string list_file, bool output_mutant_structures ) :
42  PointMutScanDriver(pdb_file_names, double_mutant_scan, list_file, output_mutant_structures), IAM_(NULL)
43 {
45  1, //interface_jump
46  true, //output to Tracer - we are ignoring this output and will collect from getters
47  get_scorefxn(), //pass in the scorefunction we are using
48  false, //do not compute packstat
49  true, //do repack input - we already did, but this will keep the PackerTasks similar
50  true, //do repack separated pose
51  false); //do not bother with JD2 tracer name hookups
52 
53  IAM_->set_use_resfile(false);
54  IAM_->set_use_centroid_dG(false);
55  IAM_->set_compute_packstat(false); //should be redundant
56  IAM_->set_compute_interface_sc(false);
57  IAM_->set_compute_separated_sasa(false);
58  IAM_->set_compute_interface_energy(true); //this is the one value we'll need
59  IAM_->set_calc_hbond_sasaE(false);
60  IAM_->set_compute_interface_delta_hbond_unsat(false);
61  IAM_->set_skip_reporting(true);
62 
63  interface_set_.clear();
64 
65 }
66 
67 
68 ///
69 /// @begin AlterSpecDisruptionDriver::~AlterSpecDisruptionDriver
70 ///
71 /// @brief
72 /// Destructor.
73 ///
75 
76 ///@details calculate dG of binding by scoring, separating, repacking, and rescoring
77 
79 
80  //It would be good if there were a way to test an invariant here - primarily that we have an interface of two chains!
81  //runtime_assert(pose.num_chains() >= 2);
82  if(!(pose.conformation().num_chains() >= 2)){
83  throw utility::excn::EXCN_Msg_Exception("AlterSpecDisruptionDriver requires two chains to calculate an interface to disrupt.");
84  }
85 
86  //no clear way to get IAM to use the same TaskFactory
87  IAM_->set_compute_interface_energy(true); //speed
88  IAM_->apply(pose);
89  //NOTICE THIS IS NEGATED! The parent code is expecting to stabilize things; we want to destabilize them.
90  return -IAM_->get_separated_interface_energy();
91 
92 }
93 
94 ///@brief offers a chance for child classes to inject mutant selection logic
96 
97  if(reject_on_chains(mutant)) return true;
98 
99  if(reject_on_interface(mutant, pose)) return true;
100 
101  return false;
102 
103 }
104 
105 ///@brief reject Mutant based on chain IDs of constituent mutations
107 
108  if(mutant.n_mutations() >= 2){ //if there is more than one mutation, check that they are on the same chain. Disruptions on different chains are likely unrecoverable clashes.
110 
111  char const chain(mutant.mutations_begin()->pdb_chain());
112  for ( mut_iter it(mutant.mutations_begin()), end(mutant.mutations_end()); it != end; ++it ) {
113  if(chain != it->pdb_chain()) {
114  //TR << "skipping Mutant " << mutant << " because it has a mutation on chain " << it->pdb_chain() << " which does not match the first mutation's chain " << chain << std::endl;
115  return true;
116  } //if skipping
117  } //for all mutations
118  } //if we have more than one mutation
119 
120  return false;
121 }
122 
123 ///@brief reject Mutant based on interface-ness of constituent mutations. This function accumulates state - on first call it determines what the interface is, and assumes that interface is the same for all subsequent calls! If you are trying to use different Poses this may cause problems.
125 {
126 
127  if( interface_set_.empty() ){
128  IAM_->set_compute_interface_energy(false); //speed
129 
130  core::pose::Pose copy(pose);
131  IAM_->apply(copy);
132  interface_set_ = IAM_->get_interface_set();
133 
134  // TR << "interface set:";
135  // for(std::set< core::Size >::const_iterator it(interface_set_.begin()), end(interface_set_.end()); it != end; ++it)
136  // TR << " " << *it;
137  // TR << std::endl;
138 
139  IAM_->set_compute_interface_energy(true); //speed
140  }
141 
143 
144  std::set< core::Size >::iterator const interface_end(interface_set_.end());
145  for( mut_iter it(mutant.mutations_begin()), end(mutant.mutations_end()); it != end; ++it ) {
146  core::Size const resid(it->pose_resnum());
147  if(interface_set_.find(resid) == interface_end) { //if a mutation is not in the interface set, skip this Mutant
148  //TR << "skipping Mutant " << mutant << " because it contains position " << resid << " which is not in the interface" << std::endl;
149  return true;
150  }
151  }
152 
153  return false;
154 }
155 
156 
157 
158 } // namespace pmut_scan
159 } // namespace protocols
160