Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DumpPdb.cc
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/moves/DumpPdb.cc
11 /// @brief
12 /// @author Sarel Fleishman (sarelf@u.washington.edu), Jacob Corn (jecorn@u.washington.edu)
13 
14 // Unit headers
17 
18 
19 #include <core/pose/Pose.hh>
22 #include <utility/tag/Tag.hh>
23 #include <basic/Tracer.hh>
24 
25 #include <utility/basic_sys_util.hh>
26 
27 #ifdef USEMPI
28 #include <utility/mpi_util.hh>
29 #include <utility/string_util.hh>
30 #endif
31 
32 namespace protocols {
33 namespace simple_moves {
34 
35 using namespace core;
36 using namespace std;
37 using namespace core::scoring;
38 using namespace protocols::moves;
39 
40 static basic::Tracer TR( "protocols.simple_moves.DumpPdb" );
41 
44 {
46 }
47 
50  return new DumpPdb;
51 }
52 
55 {
56  return "DumpPdb";
57 }
58 
60  protocols::moves::Mover( DumpPdbCreator::mover_name() ),
61  fname_("dump.pdb"),
62  scorefxn_(0),
63  addtime_(false)
64 {}
65 
66 DumpPdb::DumpPdb( std::string const fname ) :
67  protocols::moves::Mover( DumpPdbCreator::mover_name() ),
68  fname_(fname),
69  scorefxn_(0),
70  addtime_(false)
71 {}
72 
74 
77  if ( addtime_ ) {
78 #ifdef USEMPI
79  name += "_" + utility::to_string(utility::mpi_rank());
80 #endif
81  name += "_" + utility::timestamp_short() + ".pdb";
82  TR << "Dumping PDB " << name << std::endl;
83  }
84  if ( scorefxn_ ) {
85  pose.dump_scored_pdb( name, *scorefxn_ );
86  } else {
87  pose.dump_pdb( name );
88  }
89 }
90 
92  scorefxn_ = scorefxn;
93 }
94 void
96 {
97  fname_ = tag->getOption<std::string>( "fname", "dump.pdb" );
98  if ( tag->hasOption("scorefxn") ) {
100  }
101 
102  tag_time( tag->getOption<bool>( "tag_time", false ) );
103  TR<<"dump pdb\n";
104  TR<<"WARNING: DEFINED DUMP_PDB MOVER. THIS IS USUALLY ONLY GOOD FOR DEBUGGING.\n";
105  TR<<"with filename "<<fname_<<std::endl;
106 }
107 
111 }
112 
113 } //simple_moves
114 } //protocols