Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
RestrictToCDRH3Loop.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/toolbox/task_operations/RestrictToCDRH3Loop.cc
11 /// @brief
12 /// @author Brian D. Weitzner (brian.weitzner@gmail.com)
13 
14 // Unit headers
18 
19 // Project headers
20 #include <core/pose/Pose.hh>
21 #include <core/pose/PDBInfo.hh>
23 
24 // Utility headers
25 #include <utility/exit.hh>
26 
27 
28 
29 namespace protocols {
30 namespace toolbox {
31 namespace task_operations {
32 
33 using core::pose::Pose;
37 
38 
40 
42 
44 
46 {
47  return new RestrictToCDRH3Loop( *this );
48 }
49 
50 void RestrictToCDRH3Loop::apply( Pose const & pose, PackerTask & task ) const
51 {
52 
53 
56 
57  for ( Size residue_number = 1; residue_number <= pose.total_residue(); ++residue_number )
58  {
59  if ( residue_is_in_h3_loop( pose, residue_number ) )
60  {
61  turn_on_packing.include_residue( residue_number );
62  }
63  else
64  {
65  turn_off_packing.include_residue( residue_number );
66  }
67  }
68 
69  turn_off_packing.apply( pose, task );
70  turn_on_packing.apply( pose, task );
71 }
72 
73 bool RestrictToCDRH3Loop::residue_is_in_h3_loop( Pose const & pose, Size residue_number ) const
74 {
75  Size const pose_numbered_h3_loop_start( pose.pdb_info()->pdb2pose( heavy_chain, pdb_numbered_h3_loop_start ) );
76  Size const pose_numbered_h3_loop_end( pose.pdb_info()->pdb2pose( heavy_chain, pdb_numbered_h3_loop_end ) );
77 
78  return ( residue_number >= pose_numbered_h3_loop_start ) && ( residue_number <= pose_numbered_h3_loop_end );
79 }
80 
82 {
83  return new RestrictToCDRH3Loop;
84 }
85 
86 } //namespace task_operations
87 } //namespace toolbox
88 } //namespace protocols