Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PeakAssignment.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 protocols/noesy_assign/PeakAssignment.hh
11 /// @author Oliver Lange
12 
13 #ifndef INCLUDED_protocols_noesy_assign_PeakAssignment_HH
14 #define INCLUDED_protocols_noesy_assign_PeakAssignment_HH
15 
16 
17 // Unit Headers
19 
20 // Package Headers
24 
25 
26 // Project Headers
27 // AUTO-REMOVED #include <core/scoring/constraints/AmbiguousNMRDistanceConstraint.hh>
28 #include <core/pose/Pose.fwd.hh>
29 // AUTO-REMOVED #include <core/scoring/constraints/Func.hh>
30 
32 #include <core/types.hh>
33 
34 // Utility headers
35 #include <utility/exit.hh>
36 #include <utility/vector1.hh>
37 #include <utility/pointer/ReferenceCount.hh>
38 
39 //// C++ headers
40 // AUTO-REMOVED #include <cstdlib>
41 #include <string>
42 // AUTO-REMOVED #include <list>
43 #include <map>
44 #include <iostream>
45 
47 
48 //Auto Headers
50 namespace protocols {
51 namespace noesy_assign {
52 
53 
54 ///@brief fast access to assignments that are stored in CrossPeak -- similar to FragID
56 public:
57  ///@brief Automatically generated virtual destructor for class deriving directly from ReferenceCount
58  virtual ~PeakAssignment();
61 
62  PeakAssignment( CrossPeakAP const&, core::Size assign_spin1, core::Size assign_spin2 );
63 
64  core::Size spin_id( core::Size select ) const {
65  runtime_assert( select == 1 || select == 2 );
66  return select == 1 ? spin_assign_index1_ : spin_assign_index2_;
67  }
68 
69  ///@brief return resonance_id, i.e., pointer into Resonance list that will resolve in assigned atom
71  runtime_assert( select == 1 || select == 2 );
72  return select == 1 ? resonance1_ : resonance2_;
73  }
74 
75  bool has_label( core::Size select ) const {
76  return crosspeak_->has_label( select );
77  }
78 
79  bool has_proton( core::Size select ) const {
80  return crosspeak_->has_proton( select );
81  }
82 
83 
84  ///@brief return resonance_id, i.e., pointer into Resonance list that will resolve in assigned atom
86 
87  ///@brief returns atom 1 or 2 of the assigned cross-peak. --- might throw Exception if atom not found in ResonanceList
88  core::id::NamedAtomID const& atom( core::Size iatom ) const{
89  return resonances()[ resonance_id( iatom ) ].atom();
90  }
91 
93  return resonances()[ label_resonance_id( iatom ) ].atom();
94  }
95 
97  return resonances()[ resonance_id( iatom ) ].calibration_atom_type();
98  }
99 
101  core::pose::Pose const& pose,
102  core::scoring::constraints::FuncOP = NULL ) const;
103 
104  ///@brief returns residue number of a1 or a2 of the assigned cross-peak, --- might throw Exception if atom not found
105  core::Size resid( core::Size iatom ) const {
106  return resonances()[ resonance_id( iatom ) ].resid();
107  }
108 
109  bool operator==( PeakAssignment const& other ) const {
110  return crosspeak_.get() == other.crosspeak_.get() && spin_id( 1 ) == other.spin_id( 1 ) && spin_id( 2 ) == other.spin_id( 2 );
111  }
112 
113  bool is_symmetric_partner_of( PeakAssignment const& other ) const;
114 
115  ResonanceList const& resonances() const; //can't inline due to circularity
116  //void invalidate_assignment();
117 
118  CrossPeak& crosspeak() { return *crosspeak_; };
119  CrossPeak const& crosspeak() const { return *crosspeak_; }
120 
121  //core::Size assignment_index() const { return assignment_index_; }
122  void set_symmetry( core::Real setting = 0 ) {
123  symmetry_compliance_ = setting;
124  }
125 
127  return symmetry_compliance_;
128  }
129 
131  return chemshift_overlap_; //Ck
132  }
133 
135  network_anchoring_ = setting;
136  // network_anchoring_per_residue_ = reswise_setting;
137  }
138 
140  network_anchoring_per_residue_ = reswise_setting;
141  }
142 
144  return network_anchoring_;
145  }
146 
149  }
150 
152  return decoy_compatibility_;
153  }
154 
156  decoy_compatibility_ = setting;
157  }
158 
161 
162  ///@brief this is not normalized
163  core::Real peak_volume() const;
164 
165  ///@brief only correct if peak_volumes have been update in CrossPeaks.
167 
168  void show( std::ostream& os ) const;
169 
170  void dump_weights( std::ostream& os ) const;
171 
173  native_distance_viol_= setting;
174  }
176  return native_distance_viol_;
177  }
178 
179 private:
181 
183  core::Size spin_assign_index1_; //points to assignment of spin1 and spin2
184  core::Size spin_assign_index2_; //points to assignment of spin1 and spin2
185  core::Size resonance1_; //the spin1 and spin2 resonance (short cut to avoid lengthy access thru CrossPeak)
186  core::Size resonance2_; //the spin1 and spin2 resonance (short cut to avoid lengthy access thru CrossPeak)
187 
188 
189  // should these live in inherited class or in PeakAssignmentWeights ?
197 
198 };
199 
200 std::ostream& operator<<( std::ostream& os, PeakAssignment const& pa );
201 
203 
204 }
205 }
206 #endif