Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SAXSEnergy.hh
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 core/scoring/saxs/SAXSEnergy.hh
11 /// @brief "Energy" based on a similarity of theoretical SAXS spectrum computed for a pose and the experimental data
12 /// @author Dominik Gront (dgront@chem.uw.edu.pl)
13 
14 
15 #ifndef INCLUDED_core_scoring_saxs_SAXSEnergy_hh
16 #define INCLUDED_core_scoring_saxs_SAXSEnergy_hh
17 
18 // Package headers
20 // AUTO-REMOVED #include <core/scoring/saxs/FormFactorManager.hh>
25 
26 // AUTO-REMOVED #include <core/chemical/ChemicalManager.hh>
27 
28 
29 // AUTO-REMOVED #include <core/scoring/EnergyMap.hh>
31 // AUTO-REMOVED #include <core/scoring/methods/EnergyMethodOptions.hh>
32 
35 
36 // Project headers
37 #include <core/pose/Pose.fwd.hh>
38 
39 #include <string>
40 
43 #include <utility/vector1.hh>
44 #include <map>
45 
46 
47 namespace core {
48 namespace scoring {
49 namespace saxs {
50 
51 
53 public:
54 
57 
59 
62 
63  virtual ~SAXSEnergy() {}
64 
65  virtual methods::EnergyMethodOP clone() const {
66 
69  else
71  }
72 
73  virtual void finalize_total_energy(pose::Pose & pose,ScoreFunction const &,EnergyMap & totals) const;
74 
75  virtual void indicate_required_context_graphs(utility::vector1< bool > & /*context_graphs_required*/
76  ) const {}
77 
79 
82  else
84  }
85 
89  Size count_scoring_atoms() { return ff_ops_.size(); }
90 
91  Real total_energy(const pose::Pose & pose) const;
92 
94 
95 protected:
96 
99 
100 
101  void init_ff(const std::string &);
102 
103  /// @brief Sets a vector of q arguments to be used by this class in all SAXS-related calculations
104  void set_up_q(const utility::vector1<Real> &);
105 
106  /// @brief Sets a vector of q arguments using the command-line flags to be used by this class in all SAXS-related calculations
107  void set_up_q();
108 
109  /// @brief Reads two vectors from a file: q and I(q) (meant to be experimental values)
111 
112  /// @brief Takes two vectors: q and I(q) and returns a SAXS spectrum as a function of Q as defined in this class
113  /// @detailed This is basically done by fiting a spline and re-evaluating I(q) at different q values
115 
116  /// @brief A shortcut that calls read_spectrum() and then fit_intensities()
118 
119  /// @brief computes I(q) from a pose
121 
122  /// @brief ce-calculates form factors
123  /// @detailed This is necessary when :
124  /// - this is the first time
125  /// - an amino acid sequence within the scored pose has been changed
126  /// - teh q-value set has been affected
127  void rehash_form_factors(const core::pose::Pose & pose) const;
128 
129 private:
130 
131  mutable utility::vector1<Size> atom_ff_types_; // its size is nAtoms
132  mutable utility::vector1<FormFactorOP> ff_ops_; // its size is nUniqFFs
133  mutable std::map<FormFactorOP,Size> ff_map_; // its size is nUniqFFs
134  mutable utility::vector1< utility::vector1< DistanceHistogramOP > > dhist_; // its size is nUniqFFs x nUniqFFs
135  mutable utility::vector1<Size> r_ids_; // its size is nAtoms
136  mutable utility::vector1<Size> a_ids_; // its size is nAtoms
137 
139  mutable Real zero_;
145 
149  void compute_distance_histogram(const core::pose::Pose & pose) const;
150 
151  virtual core::Size version() const;
152 };
153 
154 
155 }
156 }
157 }
158 
159 #endif