Rosetta 3.5
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
src
core
scoring
saxs
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
19
#include <
core/scoring/saxs/DistanceHistogram.hh
>
20
// AUTO-REMOVED #include <core/scoring/saxs/FormFactorManager.hh>
21
#include <
core/scoring/saxs/FormFactor.hh
>
22
#include <
core/scoring/saxs/SAXSEnergyCreatorCEN.hh
>
23
#include <
core/scoring/saxs/SAXSEnergyCreatorFA.hh
>
24
#include <
core/scoring/saxs/SAXSEnergyCreator.hh
>
25
26
// AUTO-REMOVED #include <core/chemical/ChemicalManager.hh>
27
28
29
// AUTO-REMOVED #include <core/scoring/EnergyMap.hh>
30
#include <
core/scoring/methods/WholeStructureEnergy.hh
>
31
// AUTO-REMOVED #include <core/scoring/methods/EnergyMethodOptions.hh>
32
33
#include <
core/scoring/ScoreType.hh
>
34
#include <
core/scoring/ScoreFunction.fwd.hh
>
35
36
// Project headers
37
#include <
core/pose/Pose.fwd.hh
>
38
39
#include <string>
40
41
#include <
core/chemical/ResidueTypeSet.fwd.hh
>
42
#include <
core/scoring/saxs/FormFactorManager.fwd.hh
>
43
#include <utility/vector1.hh>
44
#include <map>
45
46
47
namespace
core {
48
namespace
scoring {
49
namespace
saxs {
50
51
52
class
SAXSEnergy
:
public
methods::WholeStructureEnergy
{
53
public
:
54
55
static
std::string
fa_cfg_file_
;
56
static
std::string
cen_cfg_file_
;
57
58
SAXSEnergy
(
std::string
&,
core::chemical::ResidueTypeSetCAP
,
ScoreType
,
SAXSEnergyCreator
*);
59
60
SAXSEnergy
(
const
std::string
&,
const
utility::vector1<Real>
&,
const
utility::vector1<Real>
&,
61
ScoreType
,
SAXSEnergyCreator
*);
62
63
virtual
~SAXSEnergy
() {}
64
65
virtual
methods::EnergyMethodOP
clone
()
const
{
66
67
if
(
saxs_score_variant_
==
saxs_fa_score
)
68
return
new
SAXSEnergy
(
the_config_file_
,
q_
,
reference_intensities_
,
saxs_score_variant_
,
new
SAXSEnergyCreatorFA
);
69
else
70
return
new
SAXSEnergy
(
the_config_file_
,
q_
,
reference_intensities_
,
saxs_score_variant_
,
new
SAXSEnergyCreatorCEN
);
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
78
methods::EnergyMethodOP
create_energy_method
(
methods::EnergyMethodOptions
const
&)
const
{
79
80
if
(
saxs_score_variant_
==
saxs_fa_score
)
81
return
new
SAXSEnergy
(
the_config_file_
,
q_
,
reference_intensities_
,
saxs_score_variant_
,
new
SAXSEnergyCreatorFA
);
82
else
83
return
new
SAXSEnergy
(
the_config_file_
,
q_
,
reference_intensities_
,
saxs_score_variant_
,
new
SAXSEnergyCreatorCEN
);
84
}
85
86
utility::vector1<Real>
&
get_reference_intensities
() {
return
reference_intensities_
; }
87
utility::vector1<Real>
&
get_pose_intensities
() {
return
pose_intensities_
; }
88
utility::vector1<Real>
&
get_q
() {
return
q_
; }
89
Size
count_scoring_atoms
() {
return
ff_ops_
.size(); }
90
91
Real
total_energy
(
const
pose::Pose
& pose)
const
;
92
93
Real
compute_zero_intensity
()
const
;
94
95
protected
:
96
97
ScoreType
saxs_score_variant_
;
98
std::string
the_config_file_
;
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)
110
void
read_spectrum
(
std::string
&,
utility::vector1<Real>
&,
utility::vector1<Real>
&)
const
;
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
114
void
fit_intensities
(
const
utility::vector1<Real>
&,
const
utility::vector1<Real>
&,
utility::vector1<Real>
&)
const
;
115
116
/// @brief A shortcut that calls read_spectrum() and then fit_intensities()
117
void
read_intensities
(
std::string
&,
utility::vector1<Real>
&)
const
;
118
119
/// @brief computes I(q) from a pose
120
void
compute_intensities
(
const
core::pose::Pose
&,
utility::vector1<Real>
&)
const
;
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
138
bool
if_hydrogens_
;
139
mutable
Real
zero_
;
140
Real
score_bias_
;
141
utility::vector1<Real>
q_
;
142
mutable
utility::vector1<Real>
pose_intensities_
;
143
mutable
utility::vector1<Real>
reference_intensities_
;
144
FormFactorManager
*
ff_manager_
;
145
146
Real
compute_chi
(
utility::vector1<Real>
const
&,
utility::vector1<Real>
const
&)
const
;
147
Real
compute_chi_with_fit
(
utility::vector1<Real>
const
&,
utility::vector1<Real>
const
&)
const
;
148
Real
compute_L1
(
utility::vector1<Real>
const
&,
utility::vector1<Real>
const
&)
const
;
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
Generated on Sat Jun 1 2013 11:40:07 for Rosetta 3.5 by
1.8.4