Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
InterfaceDefinitionCalculatorBase.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 core/pose/metrics/simple_metrics/InterfaceDefinitionCalculatorBase.cc
11 /// @brief InterfaceDefinitionCalculatorBase class
12 /// @author John Karanicolas
13 
14 // Unit headers
16 
18 #include <core/pose/Pose.hh>
19 #include <core/pose/PDBInfo.hh>
20 
21 #include <cassert>
22 
23 #include <utility/vector1.hh>
24 
25 
26 using namespace core;
27 using namespace core::pose;
28 using namespace core::pose::metrics;
29 
30 namespace core{
31 namespace pose {
32 namespace metrics {
33 namespace simple_calculators {
34 
35 
36 InterfaceDefinitionCalculator::InterfaceDefinitionCalculator( Size const chain1_number, Size const chain2_number ) :
38  chain1_number_(chain1_number),
39  chain2_number_(chain2_number),
40  got_chain_numbers_(true)
41 {
42 }
43 
44 InterfaceDefinitionCalculator::InterfaceDefinitionCalculator( char const chain1_letter, char const chain2_letter ) :
46  chain1_letter_(chain1_letter),
47  chain2_letter_(chain2_letter),
48  got_chain_numbers_(false)
49 {
50 }
51 
52 
54  if ( ! got_chain_numbers_ ) {
57  got_chain_numbers_ = true;
58  }
59  fill_in_chain_terminii( pose );
60  return;
61 }
62 
63 
64 // helper method to convert a single chain letter to a single chain number.
65 // returns 0 if chain letter not found
67  char temp_letter_ = chain_id;
68  for ( Size i = 1; i <= pose.total_residue(); ++i ) {
69  if ( pose.pdb_info()->chain( i ) == temp_letter_ ) {
70  return pose.chain( i );
71  }
72  else continue;
73  }
74  return 0; // if this happens, we haven't found our chain letter in the pose
75 }
76 
77 
78 // figures out chain terminii from chain numbers
84  return;
85 }
86 
87 } // simple_calculators
88 } // metrics
89 } // pose
90 } // core