Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ElectronDensityAtomwise.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/electron_density_atomwise/ElectronDensityAtomwise.hh
11 /// @brief Scoring a structure against an electron density map
12 /// @author Fang-Chieh Chou
13 
14 #ifndef INCLUDED_core_scoring_electron_density_atomwise_ElectronDensityAtomwise_HH
15 #define INCLUDED_core_scoring_electron_density_atomwise_ElectronDensityAtomwise_HH
16 
17 // Project headers
18 #include <core/types.hh>
19 #include <core/pose/Pose.fwd.hh>
22 
23 // Utility headers
24 #include <numeric/xyzMatrix.fwd.hh>
25 #include <numeric/xyzVector.hh>
26 #include <utility/exit.hh>
27 
28 // ObjexxFCL Headers
29 #include <ObjexxFCL/FArray3D.hh>
30 
31 // C++ headers
32 #include <string>
33 #include <map>
34 
35 //Auto Headers
36 #include <core/kinematics/RT.hh>
37 #include <utility/vector1_bool.hh>
38 #include <numeric/xyzMatrix.hh>
39 
40 
41 namespace core {
42 namespace scoring {
43 namespace electron_density_atomwise {
44 
45 const core::Real MAX_FLT = 1e37;
46 
48 public:
49  /// @brief constructor
51 
52  /// @brief Is a map loaded?
53  bool isMapLoaded() {
54  return is_map_loaded;
55  };
56 
57  /// @brief Load an MRC (="new-CCP4") density map
58  void readMRCandResize();
59 
60  //Compute Normalization factor given a pose
61  void compute_normalization ( pose::Pose const & pose );
62 
63  //Pre-compute the unweighted score of atom in a gride
65 
66  //Return the score of a given residue
69 
70  //Return the gradient of an atom
72  pose, core::Size const & rsd_id, core::Size const & atm_id );
73 
74 private:
75 
77 
79 
81 
82  //Stored 1d gaussian
84 
85  // the density data and precomputed score array
86  ObjexxFCL::FArray3D< float > density;
87  ObjexxFCL::FArray3D< double > unweighted_score_coeff;
88  //Stored atom weight
90 
91  // map info
96  //symmetry
98 
99  //helper function for symmetry
100  void computeCrystParams();
101  void expandToUnitCell();
102  void initializeSymmOps ( utility::vector1< std::string > const & symList );
103 
104  //resize the map
105  void resize ( core::Real approxGridSpacing );
106 
107 //////////////////////////////////////////////////////////////////////
108  //compute index to cartesian transformation
109  void calculate_index2cart();
110 
111  //generate 1d gaussian function and store it.
112  void generate_gaussian_1d ( core::Real const & sigma );
113  //Return the value of 1D gaussian given the distance using stored values
114  core::Real gaussian_1d ( core::Real const & dist );
115 
116  //return the weight of atom given its element type
117  core::Size get_atom_weight ( std::string const & elt );
118 
119  //Spline interpolation
120  core::Real spline_interpolation ( ObjexxFCL::FArray3D < double >
121  & coeffs, numeric::xyzVector< core::Real > const & idxX ) const;
122 
123  void spline_coeffs ( ObjexxFCL::FArray3D< double > & data,
124  ObjexxFCL::FArray3D< double > & coeffs );
125 
126  //Trilinear Interpolation
127  core::Real trilinear_interpolation ( ObjexxFCL::FArray3D< double > & score,
128  numeric::xyzVector< core::Real > const & index );
129 
131  <double> & score, numeric::xyzVector< core::Real > const & index );
132 
133  //Convert a vector from xyz coordinate to index coordinate, shift w/ respect to the origin and fold into the unit cell
135 
136  //Convert a vector from fractional coordinate to index coordinate
138 
139  //Convert a vector from index coordinate to fractional coordinate
142 };
143 
144 //@brief The EDM instance
146 
147 } // electron_density_atomwise
148 } // scoring
149 } // core
150 
151 
152 #endif