Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ScoreFileData.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/raw_data/ScoreFileData.cc
12 ///
13 /// @brief a way to write out just the score using the SilentFile stuff
14 /// @author Monica Berrondo
15 
16 // C++ Headers
17 #include <iostream>
18 #include <string>
19 #include <map>
20 
21 // mini headers
22 #include <utility/io/ozstream.hh>
23 
24 #include <basic/Tracer.hh>
27 
28 #include <core/pose/Pose.hh>
29 
30 #include <utility/vector1.hh>
31 #include <utility/file/file_sys_util.hh>
32 
33 
34 using basic::T;
35 using basic::Error;
36 using basic::Warning;
37 
38 namespace core {
39 namespace io {
40 namespace raw_data {
41 
42  /// @brief write the given Score_Silent_Struct to the supplied filename.
44  ScoreStruct s,
45  std::map < std::string, core::Real > const & score_map,
46  std::map < std::string, std::string > const & string_map
47  ) {
48  bool success = false;
49 
50  utility::io::ozstream output;
52  output.open( filename_ );
53  s.print_header( output, score_map, string_map );
54  } else {
55  output.open_append( filename_ );
56  }
57 
58  s.print_scores ( output, score_map, string_map );
59 
60  return success;
61  }
62 
63 
64  /// @brief write the given Score_Silent_Struct to the supplied filename.
66  const core::pose::Pose & pose,
67  std::map < std::string, core::Real > const & score_map,
68  std::string tag = "empty_tag",
69  std::map < std::string, std::string > const & string_map
70  ) {
71  ScoreStruct s( pose, tag );
72  bool success = write_struct( s, score_map, string_map );
73  return success;
74  }
75 
76 } // namespace silent
77 } // namespace io
78 } // namespace core