Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Assignment.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 CrossPeakList.hh
11 /// @author Oliver Lange
12 
13 #ifndef INCLUDED_protocols_noesy_assign_Assignment_hh
14 #define INCLUDED_protocols_noesy_assign_Assignment_hh
15 
16 
17 // Unit Headers
21 #include <core/types.hh>
22 
23 // Package Headers
25 
26 // Project Headers
27 
28 // Utility headers
29 #include <utility/exit.hh>
30 // #include <utility/excn/Exceptions.hh>
31 #include <utility/vector1.hh>
32 #include <utility/pointer/ReferenceCount.hh>
33 // #include <numeric/numeric.functions.hh>
34 // #include <basic/prof.hh>
35 //#include <basic/Tracer.hh>
36 // #include <basic/options/option.hh>
37 // #include <basic/options/keys/abinitio.OptionKeys.gen.hh>
38 // #include <basic/options/keys/run.OptionKeys.gen.hh>
39 //#include <basic/options/keys/templates.OptionKeys.gen.hh>
40 
41 //// C++ headers
42 #include <cstdlib>
43 #include <string>
44 #include <list>
45 #include <map>
46 
47 namespace protocols {
48 namespace noesy_assign {
49 
50 
51 ///@brief fast access to assignments that are stored in CrossPeak -- similar to FragID
52 class PeakAssignment : public utility::pointer::ReferenceCount {
53 public:
54  PeakAssignment( CrossPeakAP, core::Size assign_spin1, core::Size assign_spin2 );
55 
56  core::Size spin_id( core::Size select ) {
57  runtime_assert( select == 1 || select == 2 );
58  return select == 1 ? spin_assign_index1_ : spin_assign_index2_;
59  }
60 
61  ///@brief return resonance_id, i.e., pointer into Resonance list that will resolve in assigned atom
62  core::Size resonance_id( core::Size select ) const {
63  runtime_assert( select == 1 || select == 2 );
64  return select == 1 ? resonance1_ : resonance2_;
65  }
66 
67 
68 
69  ///@brief returns atom 1 or 2 of the assigned cross-peak. --- might throw Exception if atom not found in ResonanceList
70  core::id::NamedAtomID const& atom( ResonanceList const& resonances, core::Size iatom ) const{
71  return resonances[ resonance_id( iatom ) ].atom();
72  }
73 
74  ///@brief returns residue number of a1 or a2 of the assigned cross-peak, --- might throw Exception if atom not found
75  core::Size resid( ResonanceList const& resonances, core::Size iatom ) const {
76  return resonances[ resonance_id( iatom ) ].resid();
77  }
78 
79 
80  bool operator==( PeakAssignment const& other ) const {
81  return crosspeak_.get() == other.crosspeak_.get() && assignment_index_ == other.assignment_index_;
82  }
83 
84  bool is_symmetric_partner_of( PeakAssignment const& other ) const {
85  return resonance_id( 1 ) == other.resonance_id( 2 ) && resonance_id( 2 ) == other.resonance_id( 1 );
86  }
87 
88  void invalidate_assignment();
89 
90  CrossPeak& crosspeak() { return *crosspeak_; };
91  CrossPeak const& crosspeak() const { return *crosspeak_; }
92 
93  core::Size assignment_index() const { return assignment_index_; }
94 
95 private:
97  core::Size spin_assign_index1_; //points to assignment of spin1 and spin2
98  core::Size spin_assign_index2_; //points to assignment of spin1 and spin2
99  core::Size resonance1_; //the spin1 and spin2 resonance (short cut to avoid lengthy access thru CrossPeak)
100  core::Size resonance2_; //the spin1 and spin2 resonance (short cut to avoid lengthy access thru CrossPeak)
101 
102 
103 
104  // should these live in inherited class or in PeakAssignmentWeights ?
105  Real chem_shift_overlap_; //Ck
109  Real Network_anchoring_; //Nk
110 };
111 
112 extern PeakAssignment const BOGUS_ASSIGNMENT;
113 
114 #endif