Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ScoreFileSilentStruct.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 // :noTabs=false:tabSize=4:indentSize=4:
4 //
5 // (c) Copyright Rosetta Commons Member Institutions.
6 // (c) This file is part of the Rosetta software suite and is made available under license.
7 // (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
8 // (c) For more information, see http://www.rosettacommons.org. Questions about this can be
9 // (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
10 
11 /// @file core/io/silent/ScoreFileSilentStruct.cc
12 ///
13 /// @brief Representation of PDB files in a silent-file format.
14 /// @author James Thompson
15 
16 // C++ Headers
17 #include <utility>
18 #include <string>
19 #include <sstream>
20 
21 // mini headers
22 #include <basic/Tracer.hh>
23 #include <basic/prof.hh>
30 
31 #include <core/pose/Pose.hh>
32 
34 
35 #include <ObjexxFCL/FArray2D.hh>
36 
37 #include <utility/exit.hh>
38 // AUTO-REMOVED #include <utility/io/mpistream.hh>
39 
40 #include <utility/vector1.hh>
41 
42 
43 namespace core {
44 namespace io {
45 namespace silent {
46 
47 using namespace ObjexxFCL;
48 
49 static basic::Tracer tr("core.io.silent.ScoreFileSilentStruct");
50 
52  core::pose::Pose const & pose,
53  std::string tag
54 ) {
55  fill_struct( pose, tag );
56  decoy_tag( tag );
57 } // ScoreFileSilentStruct
58 
60  core::pose::Pose const & pose,
61  std::string tag
62 ) {
63  basic::ProfileThis doit( basic::SILENT_FILL_STRUCT );
64  energies_from_pose( pose );
65  decoy_tag( tag );
66  if ( tag == "empty_tag" ) set_tag_from_pose( pose );
67  sequence( pose.sequence() );
68 }
69 
70 void
71 ScoreFileSilentStruct::print_header( std::ostream & out ) const {
72  print_score_header( out );
73 }
74 
75 void ScoreFileSilentStruct::print_conformation( std::ostream & /* out */ ) const {
76  // do nothing!
77 }
78 
79 
81  utility::vector1< std::string > const & lines,
82  SilentFileData & container
83 ) {
84  bool success( false );
85  using std::string;
86  using utility::vector1;
87 
88  vector1< std::string > energy_names_;
89  vector1< std::string >::const_iterator iter = lines.begin();
90  if ( iter->substr(0,9) == "SEQUENCE:" ) iter++; // ignore sequence for now
91  if ( iter->substr(0,6) != "SCORE:" ) {
92  // get sequence and scorename data from the silent-file data object, because I don't have it!
94  static_cast< EnergyNames * > (
95  container.get_shared_silent_data( energynames )()
96  )
97  );
98 
99  energy_names_ = enames->energy_names();
100  } else {
101  // get scorename data from the first two lines provided, put into container
102  // for further use by other SilentStruct objects.
103 
104  EnergyNamesOP enames( new EnergyNames( *iter ) );
105  container.set_shared_silent_data( energynames, enames );
106  energy_names_ = enames->energy_names();
107  } // get header information
108 
109  success = true;
110  return success;
111 } // init_from_lines
112 
114  core::pose::Pose & pose,
115  core::chemical::ResidueTypeSet const & /* residue_set */
116 ) const {
117  basic::ProfileThis doit( basic::SILENT_FILL_POSE );
118 
119  // put energies into pose!
120  energies_into_pose( pose );
121 } // fill_pose
122 
124  tr.Error << "get_debug_rmsd stubbed out!" << std::endl;
125  return 0.0;
126 }
127 
128 ObjexxFCL::FArray2D< Real >
130  tr.Error << "get_CA_xyz() stubbed out!" << std::endl;
131  return ObjexxFCL::FArray2D< Real > ( 3, 1 );
132 }
133 
135  ScoreFileSilentStruct const &
136 )
137 {
138  utility_exit_with_message( "called ScoreFileSilentStruct::operator=)" );
139  exit(0); // just to keep the compiler happy
140 }
141 
142 } // namespace silent
143 } // namespace io
144 } // namespace core