29 #include <utility/tag/Tag.hh>
31 #include <utility/string_util.hh>
40 #include <basic/options/option_macros.hh>
41 #include <basic/Tracer.hh>
52 static basic::Tracer
tr( "protocols.canonical_sampling.SilentTrajectoryRecorder" );
57 using namespace basic::options;
58 using namespace OptionKeys;
62 NEW_OPT( trajectory::score_stride,
"write x-times score-only before a decoy is written", 1 );
68 namespace canonical_sampling {
72 SilentTrajectoryRecorderCreator::keyname()
const {
73 return SilentTrajectoryRecorderCreator::mover_name();
77 SilentTrajectoryRecorderCreator::create_mover()
const {
82 SilentTrajectoryRecorderCreator::mover_name() {
83 return "SilentTrajectoryRecorder";
86 SilentTrajectoryRecorder::SilentTrajectoryRecorder() {
87 using namespace basic::options;
88 using namespace OptionKeys;
90 score_stride_ = option[ OptionKeys::trajectory::score_stride ]();
94 SilentTrajectoryRecorder::SilentTrajectoryRecorder(
98 score_stride_(other.score_stride_)
116 return "SilentTrajectoryRecorder";
139 tr.Debug <<
"write model " <<
filename <<
" count: " << mc << std::endl;
156 physical_filename.base( jd2_filename.base()+
"_"+
filename );
164 tr.Info <<
"restarting from trajector file " << physical_filename <<
". Reading tags now ..." << std::endl;
166 std::ostringstream replica_id_str;
169 tr.Info <<
"tag to match: " << tag << std::endl;
171 bool found = sfd.
matched_tags( tag,
"last", matched_tags_in_file );
172 tr.Info <<
"if matched_tags?: " << found << std::endl;
175 runtime_assert( sfd.
size() == 1 );
176 sfd.
begin()->fill_pose( pose );
181 std::string decoy_tag=matched_tags_in_file.front();
182 tr.Info <<
"decoy_tag matched: " << decoy_tag << std::endl;
183 Size ind=decoy_tag.find_last_of(
'_' );
184 cycle = utility::string2int(decoy_tag.substr( ind+1 ) )*
stride();
185 tr.Info <<
"cycle number got from the decoy_tag: " << cycle << std::endl;
186 if ( sfd.
begin()->has_energy(
"temp_level" ) ) {
187 temp_level = (
Size) sfd.
begin()->get_energy(
"temp_level" );
189 if ( sfd.
begin()->has_energy(
"temperature" )) {
190 temperature = sfd.
begin()->get_energy(
"temperature" );
192 tr.Info <<
"temp_level: " << temp_level << std::endl;
193 sfd.
begin()->print_scores(
tr.Info );
205 tr.Info << std::setprecision( 3 );
206 tr.Debug << std::setprecision( 3 );
218 tr.Info <<
step_count() <<
" E=" << pose.energies().total_energy();
220 for ( jd2::Job::StringRealPairs::const_iterator it( job->output_string_real_pairs_begin()),
end(job->output_string_real_pairs_end()); it !=
end; ++it ) {
221 tr.Info <<
" " << it->first <<
"=" << it->second;
224 tr.Info << std::endl;