libcootapi
 
Loading...
Searching...
No Matches
sfcalc-genmap.hh
1/*
2 * coot-utils/sfcalc-genmap.hh
3 *
4 * Copyright 2020 by Medical Research Council
5 * Author: Paul Emsley
6 *
7 * This file is part of Coot
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU Lesser General Public License as published
11 * by the Free Software Foundation; either version 3 of the License, or (at
12 * your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
18 *
19 * You should have received a copies of the GNU General Public License and
20 * the GNU Lesser General Public License along with this program; if not,
21 * write to the Free Software Foundation, Inc., 51 Franklin Street,
22 * Fifth Floor, Boston, MA, 02110-1301, USA.
23 * See http://www.gnu.org/licenses/
24 *
25 */
26
27#ifndef SFCALC_GENMAP_HH
28#define SFCALC_GENMAP_HH
29
30#include <mmdb2/mmdb_manager.h>
31#include <clipper/core/hkl_datatypes.h>
32#include <clipper/core/xmap.h>
33
34namespace coot {
35
36 namespace util {
37
38 class sfcalc_genmap_stats_t {
39 public:
40 class loc_table_t {
41 public:
42 class loc_table_item_t {
43 public:
44 float invresolsq;
45 float scale;
46 float lack_of_closure;
47 loc_table_item_t(float i, float s, float loc) : invresolsq(i), scale(s), lack_of_closure(loc) {}
48 };
49 std::vector<loc_table_item_t> items;
50 loc_table_t() {}
51 void add(const loc_table_item_t &item) {
52 items.push_back(item);
53 }
54 std::size_t size() const { return items.size(); }
55 };
56 float r_factor;
57 float free_r_factor;
58 float bulk_solvent_volume;
59 float bulk_correction;
60 unsigned int n_splines;
61 loc_table_t loc_table;
62 sfcalc_genmap_stats_t(float r_factor_in, float free_r_factor, float bulk_solvent_volume, float bulk_correction, unsigned int n_splines,
63 const loc_table_t &loc_table) : r_factor(r_factor_in), free_r_factor(free_r_factor), bulk_solvent_volume(bulk_solvent_volume),
64 bulk_correction(bulk_correction), n_splines(n_splines), loc_table(loc_table) {}
65 sfcalc_genmap_stats_t() {
66 r_factor = -1;
67 free_r_factor = -1;
68 bulk_solvent_volume = -1;
69 bulk_correction = -1;
70 n_splines = 0;
71 }
72 };
73
74 void sfcalc_genmap(mmdb::Manager *mol,
75 const clipper::HKL_data<clipper::data32::F_sigF> &fobs,
76 const clipper::HKL_data<clipper::data32::Flag> &free,
77 clipper::Xmap<float> *xmap_p);
78
79 sfcalc_genmap_stats_t sfcalc_genmaps_using_bulk_solvent(mmdb::Manager *mol,
80 const clipper::HKL_data<clipper::data32::F_sigF> &fobs,
81 const clipper::HKL_data<clipper::data32::Flag> &free,
82 const clipper::Cell &cell_for_fobs,
83 clipper::Xmap<float> *xmap_2fofc_p,
84 clipper::Xmap<float> *xmap_fofc_p);
85 }
86}
87
88#endif // SFCALC_GENMAP_HH
89
Definition sfcalc-genmap.hh:38