Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DecoySetEvaluation.impl.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 toolbox/Cluster.impl.hh
11 /// @brief template implementation for clustering of silentstructs that are provided by iterators
12 /// @author Oliver Lange
13 
14 #ifndef INCLUDED_protocols_toolbox_DecoySetEvaluation_impl_hh
15 #define INCLUDED_protocols_toolbox_DecoySetEvaluation_impl_hh
16 
18 
19 #include <core/types.hh>
20 #include <core/pose/Pose.hh>
22 // AUTO-REMOVED #include <core/io/silent/silent.fwd.hh>
23 #include <basic/Tracer.hh>
24 
25 #include <utility/vector1.hh>
26 
27 
28 namespace protocols {
29 namespace toolbox {
30 
31 
32 
33 
34 template< typename SilentStructIterator >
35 void DecoySetEvaluation::push_back_CA_xyz_from_silent_file( Size n_decoys_in, SilentStructIterator begin, SilentStructIterator end, bool store_energies ) {
36  static basic::Tracer _impl_tr("protocols.toolbox.DecoySetEvaluation");
37 
38  Size n_new_decoys( n_decoys_in );
39 
40  if ( begin == end ) return;
41  core::pose::Pose pose;
42  begin->fill_pose( pose);
43  Size pos = 1;
44  for ( ; pos <= pose.total_residue(); ++pos ) {
45  if ( !pose.residue( pos ).is_protein() ) break;
46  }
47  --pos;
48  if ( pos < pose.total_residue() ) {
49  _impl_tr.Warning << "Found no CA in sequnce at position " << pos+1 << " Will stop pool before this position... " << std::endl;
50  set_n_atom( pos );
51  }
52 
53  //if you read more than one sfd, don't switch the behaviour with energy storage around
54  runtime_assert( store_energies == store_energies_ || n_decoys() == 0 );
55  store_energies_ = store_energies;
56 
57  if ( n_decoys_max() <= n_decoys() + n_new_decoys ) {
58  reserve( n_decoys() + n_new_decoys );
59  }
60 
61  for ( SilentStructIterator it=begin; it!=end && n_new_decoys>0; ++it, --n_new_decoys ) {
62  push_back_CA_xyz( it->get_CA_xyz(), n_atoms() > 0 ? n_atoms() : it->nres() );
63  if ( store_energies_ ) {
64  all_energies_.push_back( it->get_energy( "score" ) );
65  }
66  }
67 }
68 
69 }
70 }
71 
72 #endif