Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
AtomTypesFeatures.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/features/AtomTypesFeatures.cc
11 /// @brief report AtomType properties to features Statistics Scientific Benchmark
12 /// @author Matthew O'Meara
13 
14 // Unit Headers
16 
17 // Project Headers
18 #include <basic/Tracer.hh>
24 #include <core/pose/Pose.hh>
25 #include <core/types.hh>
26 #include <basic/database/sql_utils.hh>
27 
28 // Utility Headers
29 #include <utility/sql_database/DatabaseSessionManager.hh>
30 #include <utility/vector1.hh>
31 
32 // External Headers
33 #include <cppdb/frontend.h>
34 
35 // Boost Headers
36 #include <boost/foreach.hpp>
37 #define foreach BOOST_FOREACH
38 
39 // C++ Headers
40 #include <sstream>
41 
42 namespace protocols{
43 namespace features{
44 
45 using std::string;
46 using std::stringstream;
47 using std::endl;
48 using std::pair;
49 using std::set;
50 using core::Size;
51 using core::Real;
52 using core::pose::Pose;
53 using utility::sql_database::sessionOP;
56 using utility::vector1;
57 using basic::Tracer;
58 
59 static Tracer TR("protocols.features.AtomTypesFeatures");
60 
62 
64 
65 string
66 AtomTypesFeatures::type_name() const { return "AtomTypesFeatures"; }
67 
68 void
70  sessionOP db_session
71 ) const {
72  // NOTE: To support building feature databases in parallel, the
73  // ResidueTypeSet and ResidueType objects must be identified by
74  // their names rather then assigning them a unique id.
75  return atom_type_dbio_.write_schema_to_db(db_session);
76 }
77 
80  vector1<string> dependencies;
81  return dependencies;
82 }
83 
84 Size
86  Pose const & pose,
87  vector1< bool > const &,
88  boost::uuids::uuid const,
89  sessionOP db_session
90 ){
91  if(pose.total_residue() == 0) return 0;
92 
93  // All residues in a pose must have the same atom type set. So look
94  // up the atom type set of the first residue if it exists
95  AtomTypeSet const & atom_type_set(pose.residue(1).atom_type_set());
96 
97  atom_type_dbio_.write_atom_type_set_to_database(atom_type_set, db_session);
98  return 0;
99 }
100 
101 
102 } // namesapce
103 } // namespace