Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CrossPeakList.impl.hh
Go to the documentation of this file.
1 // (c) This file is part of the Rosetta software suite and is made available under license.
2 // (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
3 // (c) For more information, see http://www.rosettacommons.org. Questions about this can be
4 // (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
5 
6 /// @file CrossPeakList.hh
7 /// @author Oliver Lange
8 
9 #ifndef INCLUDED_protocols_noesy_assign_CrossPeakList_impl_HH
10 #define INCLUDED_protocols_noesy_assign_CrossPeakList_impl_HH
11 
12 
13 // Unit Header
15 
16 // Package Headers
18 // AUTO-REMOVED #include <protocols/noesy_assign/PeakFileFormat.hh>
19 // AUTO-REMOVED #include <protocols/noesy_assign/PeakAssignmentResidueMap.hh>
23 
26 
27 // Project Headers
28 #include <core/types.hh>
29 //#include <core/id/NamedAtomID.fwd.hh>
30 #include <core/chemical/AA.hh>
31 // AUTO-REMOVED #include <core/io/silent/SilentFileData.hh>
32 //#include <core/scoring/constraints/ConstraintSet.fwd.hh>
33 #include <core/pose/Pose.hh>
34 
35 // Utility headers
36 #include <utility/exit.hh>
37 // #include <utility/excn/Exceptions.hh>
38 #include <utility/vector1.hh>
39 #include <utility/pointer/ReferenceCount.hh>
40 // #include <numeric/numeric.functions.hh>
41 #include <basic/prof.hh>
42 #include <basic/Tracer.hh>
43 // #include <core/options/option.hh>
44 // #include <core/options/keys/abinitio.OptionKeys.gen.hh>
45 // #include <core/options/keys/run.OptionKeys.gen.hh>
46 //#include <core/options/keys/templates.OptionKeys.gen.hh>
47 
48 //// C++ headers
49 #include <cstdlib>
50 #include <string>
51 #include <list>
52 #include <map>
53 #include <cmath>
54 
55 
56 
57 namespace protocols {
58 namespace noesy_assign {
59 
60 
61 template< class DecoyIterator >
62 void CrossPeakList::update_decoy_compatibility_score( DecoyIterator const& decoys_begin, DecoyIterator const& decoys_end ) {
63  using namespace core;
64  using namespace basic;
65  static basic::Tracer tr("devel.noesy_assign.crosspeaks");
66 
67  if ( decoys_begin == decoys_end ) return;
68 
69  Size ct_structures( 0 );
70  for ( DecoyIterator iss = decoys_begin; iss != decoys_end; ++iss ) {
71  ++ct_structures;
72  }
73  tr.Info << "compute decoy compatibility from " << ct_structures << " structures" << std::endl;
74 
76 
77  //compatibility with decoys.
78  pose::Pose pose;
79  decoys_begin->fill_pose( pose );
80  protocols::jumping::JumpSample jumps( pose.fold_tree() );
81  jumps.remove_chainbreaks( pose );
82  DistanceScoreMoverOP cst_tool = new DistanceScoreMover( *this, pose, params.dcut_ );
83  cst_tool->prepare_scoring( false /*not use for calibration */ );
84 
85  for ( DecoyIterator iss = decoys_begin; iss != decoys_end; ++iss ) {
86  PROF_START( basic::NOESY_ASSIGN_DIST_MAKE_POSE );
87  pose::Pose pose;
88  iss->fill_pose( pose );
90  jumps.remove_chainbreaks( pose );
91  PROF_STOP( basic::NOESY_ASSIGN_DIST_MAKE_POSE );
92  tr.Debug << "score decoys " << iss->decoy_tag() << std::endl;
93  cst_tool->apply( pose );
94  }
95 
96  cst_tool->finalize_scoring();
97  tr.Debug << "finished with decoy compatibility" << std::endl;
98 }
99 
100 
101 template < class DecoyIterator >
102 void CrossPeakList::calibrate( DecoyIterator const& begin, DecoyIterator const& end ) {
103  using namespace core;
104  using namespace basic;
105  static basic::Tracer tr("protocols.noesy_assign.crosspeaks");
106 
108  bool const structure_independent_calibration( params.calibration_target_ > 1.0 || begin == end );
109  bool const elimination( params.calibration_eliminate_ && begin != end );
110 
111  if ( structure_independent_calibration ) {
112  tr.Info << "structure independent calibration..."<<std::endl;
113  PeakCalibratorMap calibrators( *this, new StructureIndependentPeakCalibrator );
114  calibrators.set_target_and_tolerance( params.calibration_target_, 0.1 );
115  calibrators.do_calibration();
116  };
117 
118  if ( !structure_independent_calibration || elimination ) {
119  typedef utility::vector1< pose::PoseOP > Poses;
120  Poses pose_cache;
121  for ( DecoyIterator iss = begin; iss != end; ++iss ) {
122  pose::PoseOP pose=new pose::Pose;
123  iss->fill_pose( *pose ); //has to reread RDC file for each pose!
124  protocols::jumping::JumpSample jumps( pose->fold_tree() );
125  jumps.remove_chainbreaks( *pose );
126  pose_cache.push_back( pose );
127  }
128 
129  for ( Size cycles( params.calibration_cycles_ ); cycles >= 1; --cycles ) {
130  PeakCalibratorMap calibrators( *this, new StructureDependentPeakCalibrator( pose_cache, params.dcalibrate_ ) );
131  if ( !structure_independent_calibration ) {
132  tr.Info << "structure dependent calibration..."<<std::endl;
133  calibrators.set_target_and_tolerance( params.calibration_target_, 0.005 );
134  calibrators.do_calibration();
135  }
136  tr.Info << "structure dependent elimination and nudging ..."<< std::endl;
137  calibrators.eliminate_violated_constraints(); //here also the nudging happens...
138  }
139  }
140 }
141 
142 }
143 }
144 
145 #endif