Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
HeavyAtomFilter.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 // (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/ligand_docking/HeavyAtomFilter.cc
11 /// @brief Find packing defects at an interface using packstat score terms
12 /// @author Jacob Corn (jecorn@u.washington.edu)
13 
14 // Unit headers
17 
18 
20 // Project Headers
21 #include <core/types.hh>
22 #include <core/pose/Pose.hh>
24 #include <utility/tag/Tag.hh>
25 #include <protocols/moves/Mover.fwd.hh> //Movers_map
26 // AUTO-REMOVED #include <core/pose/PDBInfo.hh>
27 #include <core/pose/util.hh>
28 #include <utility/exit.hh>
29 
30 #include <basic/Tracer.hh>
31 
32 //Auto Headers
33 #include <utility/vector0.hh>
34 #include <utility/excn/Exceptions.hh>
35 #include <utility/vector1.hh>
36 
37 
38 namespace protocols {
39 namespace ligand_docking {
40 
41 static basic::Tracer heavy_atom_tracer( "protocols.ligand_docking.HeavyAtomFilter" );
42 
43 bool
45  assert(chain_.size()==1 );
46  assert(heavy_atom_limit_ >0 );
48  core::Size const start = pose.conformation().chain_begin(chain_id);
49  core::Size const end = pose.conformation().chain_end(chain_id);
50 
51  if( core::pose::num_heavy_atoms(start,end,pose) > heavy_atom_limit_ ){
52  heavy_atom_tracer<< "Reached heavy atom limit"<< std::endl;
53  return false;
54  }
55  return true;
56 }
57 
58 void
60 {
61 
62  if ( tag->getName() != "HeavyAtom" ) {
63  heavy_atom_tracer << " received incompatible Tag " << tag << std::endl;
64  assert(false);
65  return;
66  }
67  if ( ! (tag->hasOption("chain") && tag->hasOption("heavy_atom_limit") ) ){
68  throw utility::excn::EXCN_RosettaScriptsOption("HeavyAtom filter needs a 'chain' and a 'heavy_atom_limit' option");
69  }
70  chain_ = tag->getOption<std::string>("chain");
71  heavy_atom_limit_ = tag->getOption<core::Size>("heavy_atom_limit");
72 
73 }
74 
77 
79 HeavyAtomFilterCreator::keyname() const { return "HeavyAtom"; }
80 
81 
82 
83 } // ligand_docking
84 } // protocols