46 #include <basic/Tracer.hh>
47 #include <basic/prof.hh>
54 #include <utility/io/ozstream.hh>
55 #include <utility/file/FileName.hh>
57 #include <utility/vector1.hh>
66 static basic::Tracer
tr(
"protocols.noesy_assign.crosspeaks");
70 using namespace basic;
73 namespace noesy_assign {
75 CrossPeakList::CrossPeakList() :
84 total_size+=(*it)->assignments().size();
90 tr.Info <<
"remove diagonal peaks..." << std::endl;
93 bool delete_peak(
false );
95 if ( (*ait)->resonance_id( 1 )==(*ait)->resonance_id( 2 ) ) {
101 tr.Debug <<
"remove peak because it might be a diagonal peak " << (*it)->peak_id() << std::endl;
112 while ( is.good() ) {
117 utility_exit_with_message(
"nothing to read after peak-file header" );
119 while ( is.good() && ( cp = input_adaptor.
read_peak( is, new_peak_line )) ) {
120 cp->set_resonances( resonances );
121 input_adaptor.
write_peak(
tr.Debug, cp->peak_id(), *cp );
122 tr.Debug << std::endl;
123 if ( std::abs( cp->volume() ) < 0.1 ) {
124 tr.Warning <<
"ignored peak: zero intensity for peak " << cp->peak_id() << std::endl;
128 tr.Warning <<
"ignored peak [#IGNORE_NEGATIVE_INTENSITY]: negative intensity for peak " << cp->peak_id() << std::endl;
135 if ( is.fail() && is.eof() && is.bad() ) {
136 tr.Error <<
"[ERROR WHILE READING]" << std::endl;
143 Size last_peak_id( 0 );
144 for ( CrossPeaks::const_iterator it =
peaks_.begin(); it !=
peaks_.end(); ++it ) {
145 if ( last_peak_id > (*it)->peak_id() ) {
149 last_peak_id=(*it)->peak_id();
150 output_adaptor.
write_peak( os, (*it)->peak_id(), **it );
165 utility::io::ozstream os;
169 Size last_peak_id( 0 );
170 for ( CrossPeaks::const_iterator it =
peaks_.begin(); it !=
peaks_.end(); ++it ) {
171 if ( last_peak_id > (*it)->peak_id() ) {
178 last_peak_id=(*it)->peak_id();
179 output_adaptor.
write_peak( os, (*it)->peak_id(), **it );
185 tr.Info <<
"determine initial assignments..." << std::endl;
187 for ( CrossPeaks::const_iterator it =
peaks_.begin(); it !=
peaks_.end(); ++it ) {
188 (*it)->find_assignments();
206 PROF_START( NOESY_ASSIGN_UPDATE_PEAK_VOL );
207 tr.Info <<
"update peak volumina..." << std::endl;
209 Real sum_volume( 0.0 );
211 sum_volume+=(*ait)->peak_volume();
213 (*it)->set_cumulative_peak_volume( sum_volume );
215 PROF_STOP( NOESY_ASSIGN_UPDATE_PEAK_VOL );
219 tr.Info <<
"compute chemical shift score..." << std::endl;
222 (*ait)->update_chemshiftscore_from_peak();
228 tr.Info <<
"compute uppder distance (covalent) score " << std::endl;
231 (*ait)->update_upperdistance_score();
239 tr.Info <<
"set trivial 1/n decoy compatibility" << std::endl;
241 Real invn = 1.0/(*it)->n_assigned();
243 (*ait)->set_decoy_compatibility( invn );
250 tr.Info <<
" symmetry score " << std::endl;
259 tr.Info <<
" network analysis ... " << std::endl;
269 utility_exit_with_message(
" network mode " + params.
network_mode_ +
" is unknown " );
275 (*it)->eliminated(
true );
280 Real average_dist( 0.0 );
284 (*it)->calibrate( calibrator, calibration_types );
285 average_dist += (*it)->distance_bound();
286 ct += ( (*it)->distance_bound() > 0.0 );
288 if ( ct == 0 )
return 0.0;
289 return average_dist / ct;
301 bool ignore_elimination_candidates,
302 bool elimination_candidates
307 if ( (*it)->eliminated() )
continue;
308 if ( (*it)->min_seq_separation_residue_assignment( 0.1 ) < min_seq_separation )
continue;
311 Size const quality( (*it)->quality_class() );
312 if ( quality < min_quali || quality > max_quali )
continue;
317 if ( (*it)->eliminated() )
continue;
318 if ( (*it)->min_seq_separation_residue_assignment( 0.1 ) < min_seq_separation )
continue;
320 Size const quality( (*it)->quality_class() );
321 if ( quality < min_quali || quality > max_quali )
continue;
323 if ( !ignore_elimination_candidates ) {
324 if ( (*it)->is_elimination_candidate() != elimination_candidates )
continue;
329 (*it)->create_fa_and_cen_constraint( fa_cst, cen_cst, pose, centroid_pose, ct, padding );
330 runtime_assert( fa_cst && cen_cst );
331 fa_set->add_constraint( fa_cst );
332 cen_set->add_constraint( cen_cst );
334 tr.Error <<
"failed to generate " <<
"constraint for peak: " << (**it) << std::endl;
335 tr.Error << excn << std::endl;
337 tr.Debug <<
" with these atoms ";
340 tr.Info <<
" residue-type in centroid_pose: " << centroid_pose.
residue_type( excn.
atom().
rsd() ).name3() <<
" " << excn.
atom().
rsd() << std::endl;
341 tr.Debug <<
" with these atoms ";
349 using namespace core::scoring::constraints;
353 if (
tr.Debug.visible() ) pose.
dump_pdb(
"pose_in_generate_constraints.pdb");
356 centroid_pose = pose;
358 if (
tr.Debug.visible() ) {
359 centroid_pose.dump_pdb(
"centroid_pose.pdb" );
365 if ( (*it)->eliminated() )
continue;
366 if ( (*it)->min_seq_separation_residue_assignment( 0.1 ) < min_seq_separation )
continue;
373 if ( (*it)->eliminated() )
continue;
374 if ( (*it)->min_seq_separation_residue_assignment( 0.1 ) < min_seq_separation )
continue;
376 if ( !centroid ) cstset->add_constraint( (*it)->create_constraint( pose, ct ) );
377 else cstset->add_constraint( (*it)->create_centroid_constraint( pose, centroid_pose, ct ) );
379 tr.Error <<
"failed to generate " << ( centroid ?
"centroid " :
"full-atom " ) <<
"constraint for peak: " << (**it) << std::endl;
380 tr.Error << excn << std::endl;
381 core::pose::Pose const & current_pose = ( centroid ? centroid_pose : pose );
382 tr.Info <<
" residue-type in pose: " << current_pose.
residue_type( excn.
atom().
rsd() ).name3() <<
" " << excn.
atom().
rsd() << std::endl;
383 tr.Debug <<
" with these atoms ";