libcootapi
 
Loading...
Searching...
No Matches
/opt/conda/conda-bld/coot-headless_1759975870518/work/api/molecules-container.hh
1
2#ifndef MOLECULES_CONTAINER_HH
3#define MOLECULES_CONTAINER_HH
4
5#include <memory>
6#ifdef SWIG
7#include "Python.h"
8#endif
9
10#include <vector>
11
12#ifdef HAVE_SSMLIB
13#include <ssm/ssm_align.h>
14#endif
15
16#if NB_VERSION_MAJOR // for flychecking
17#include <nanobind/nanobind.h>
18#endif
19
20#include "compat/coot-sysdep.h"
21
22#include "coords/Cartesian.hh"
23#include "coords/ramachandran-container.hh"
24#include "coot-molecule.hh"
25#include "coot-utils/coot-rama.hh"
26#include "coot-utils/coot-coord-extras.hh" // the missing atoms type
27#include "coot-utils/coot-map-utils.hh"
28#include "utils/coot-utils.hh"
29#include "utils/setup-syminfo.hh"
30#include "ideal/simple-restraint.hh" // needed?
31#include "atom-pull.hh"
32#include "validation-information.hh"
33#include "superpose-results.hh"
34#include "lsq-results.hh"
35#include "coot-utils/simple-mesh.hh"
36#include "coot-utils/texture-as-floats.hh"
37#include "phi-psi-prob.hh"
38#include "instancing.hh"
39#include "coot-colour.hh" // put this in utils
40#include "saved-strand-info.hh"
41#include "svg-store-key.hh"
42#include "moorhen-h-bonds.hh"
43#include "header-info.hh"
44#include "positioned-atom-spec.hh"
45#include "user-defined-colour-table.hh"
46
49
50 std::vector<coot::molecule_t> molecules;
51 coot::protein_geometry geom;
52 coot::rotamer_probability_tables rot_prob_tables;
53 ramachandrans_container_t ramachandrans_container;
54 static std::atomic<bool> on_going_updating_map_lock;
55 bool draw_missing_residue_loops_flag;
56
57 class rail_points_t {
58 public:
59 int model_rail_points_delta; // for the latest change, I mean
60 int map_rail_points_delta;
61 float rmsd_of_difference_map;
62 explicit rail_points_t(float rmsd) {
63 model_rail_points_delta = 0;
64 map_rail_points_delta = 0;
65 rmsd_of_difference_map = rmsd;
66 }
67 rail_points_t(float rmsd_diff_map_current, const rail_points_t &rail_points_prev) {
68 model_rail_points_delta = 0;
69 rmsd_of_difference_map = rmsd_diff_map_current;
70 map_rail_points_delta = rail_points_delta(rail_points_prev);
71 }
72 int rail_points_delta(const rail_points_t &prev) {
73 float fudge = 2.4; // 20230117-PE makes 1000 rail points equal ~1% in R-factor for the tutorial data
74 return int(100000.0 * fudge * (prev.rmsd_of_difference_map - rmsd_of_difference_map));
75 }
76 static int total(const std::vector<rail_points_t> &rail_point_history) {
77 int sum = 0;
78 for (const auto &item : rail_point_history) {
79 sum += item.map_rail_points_delta;
80 }
81 return sum;
82 }
83 };
84 std::vector<rail_points_t> rail_point_history; // map and model (model currently not used)
85
86 class updating_maps_info_f {
87 public:
88 bool maps_need_an_update;
89 int imol_model;
90 int imol_2fofc;
91 int imol_fofc;
92 int imol_with_data_info_attached;
93 updating_maps_info_f() {
94 maps_need_an_update = false;
95 imol_model = -1;
96 imol_2fofc = -1;
97 imol_fofc = -1;
98 imol_with_data_info_attached = -1;
99 }
100 };
101#ifdef SKIP_FOR_PYTHON_DOXYGEN
102#else
108 updating_maps_info_f updating_maps_info;
109 void set_updating_maps_need_an_update(int imol);
110 // Checks the above information before acting, of course.
111 // No action if imol is the the model for updating maps.
112
116 void update_updating_maps(int imol); // called from the get_map_contours_mesh() function
117
118 coot::util::sfcalc_genmap_stats_t latest_sfcalc_stats;
119#endif
120 // --------------------- superposition --------------------------
121
122 // --------------------- refinement --------------------------
123
124 // 201803004:
125 // refinement now uses references to Xmaps.
126 // A dummy_map is created and a reference to that is created. Then
127 // the reference is reset to a real xmap in a molecule (imol_for_map).
128 // But, for a reason I don't understand, the refinement crashes when I do that.
129 // When the initial dummy_xmap doesn't go out of scope, then the refinement is OK.
130 // So this static dummy map is the map that doesn't go out of scope.
131 // We only need one of it, so it goes here, rather than get created every
132 // time we do a refinement. It may need to be public in future.
133 //
134 // 20221018-PE:
135 // Now that we are in api, then I am now no longer sure that this should be static
136 // or what static means in WebAssembly.
137 static clipper::Xmap<float> *dummy_xmap;
138 float map_weight;
139 float geman_mcclure_alpha;
140
141 bool use_rama_plot_restraints;
142 float rama_plot_restraints_weight;
143
144 bool use_torsion_restraints;
145 float torsion_restraints_weight;
146
147 ctpl::thread_pool thread_pool;
148 bool show_timings;
149
150 coot::restraints_container_t *last_restraints;
151 bool continue_threaded_refinement_loop;
152 bool refinement_is_quiet;
153 int cif_dictionary_read_number;
154
158 std::string adjust_refinement_residue_name(const std::string &resname) const;
159#ifdef DOXYGEN_SHOULD_PARSE_THIS
160#else
161 bool make_last_restraints(const std::vector<std::pair<bool,mmdb::Residue *> > &local_residues,
162 const std::vector<mmdb::Link> &links,
163 const coot::protein_geometry &geom,
164 mmdb::Manager *mol_for_residue_selection,
165 const std::vector<coot::atom_spec_t> &fixed_atom_specs,
166 coot::restraint_usage_Flags flags,
167 bool use_map_flag,
168 const clipper::Xmap<float> *xmap_p);
169 coot::refinement_results_t refine_residues_vec(int imol,
170 const std::vector<mmdb::Residue *> &residues,
171 const std::string &alt_conf,
172 mmdb::Manager *mol);
173
174 atom_selection_container_t make_moving_atoms_asc(mmdb::Manager *residues_mol,
175 const std::vector<mmdb::Residue *> &residues) const;
176
177 int find_serial_number_for_insert(int seqnum_new,
178 const std::string &ins_code_for_new,
179 mmdb::Chain *chain_p) const;
180
181 // return 0 if any of the residues in selection don't have (at least) bond
182 // restraints. Try to auto-load the dictionary cifs and try again.
183 // The vector is a list of residues for which no restraints could be found.
184
185 std::pair<int, std::vector<std::string> >
186 check_dictionary_for_residue_restraints(int imol, mmdb::PResidue *SelResidues, int nSelResidues);
187
188 std::pair<int, std::vector<std::string> >
189 check_dictionary_for_residue_restraints(int imol, const std::vector<mmdb::Residue *> &residues);
190
191 std::pair<mmdb::Manager *, std::vector<mmdb::Residue *> >
192 create_mmdbmanager_from_res_vector(const std::vector<mmdb::Residue *> &residues,
193 int imol,
194 mmdb::Manager *mol_in,
195 std::string alt_conf);
196
197 // simple mmdb::Residue * interface to refinement. 20081216
198 coot::refinement_results_t
199 generate_molecule_and_refine(int imol, // needed for UDD Atom handle transfer
200 const std::vector<mmdb::Residue *> &residues,
201 const std::string &alt_conf,
202 mmdb::Manager *mol,
203 bool use_map_flag=true);
204
205 static void thread_for_refinement_loop_threaded();
206
207 static std::atomic<bool> restraints_lock;
208 static void get_restraints_lock(const std::string &calling_function_name);
209 static void release_restraints_lock(const std::string &calling_function_name);
210 static std::string restraints_locking_function_name; // static because it is set by above
211
212 bool particles_have_been_shown_already_for_this_round_flag;
213
214#ifdef DOXYGEN_SHOULD_PARSE_THIS
215#else
216 int servalcat_refine_xray_internal(int imol, int imol_map, const std::string &output_prefix,
217 const std::map<std::string, std::string> &key_value_pairs);
218#endif
219
220
221#ifdef SKIP_FOR_PYTHON_DOXYGEN
222#else
227 std::pair<short int, clipper::RTop_orth> get_lsq_matrix_internal(int imol_ref, int imol_mov, bool summary_to_screen) const;
228#endif
229
231 get_q_score_validation_information(mmdb::Manager *mol, int udd_q_score, bool do_per_atom) const;
232
233#endif
234
235
236 bool refinement_immediate_replacement_flag = true;
237 int imol_moving_atoms;
238 enum moving_atoms_asc_t {
239 NEW_COORDS_UNSET = 0, // moving_atoms_asc_type values
240 NEW_COORDS_ADD = 1, // not used?
241 NEW_COORDS_REPLACE = 2,
242 NEW_COORDS_REPLACE_CHANGE_ALTCONF = 3,
243 NEW_COORDS_INSERT = 4,
244 NEW_COORDS_INSERT_CHANGE_ALTCONF = 5};
245 short int moving_atoms_asc_type;
246
247#ifdef DOXYGEN_SHOULD_PARSE_THIS
248#else
249 static void all_atom_pulls_off();
250 static std::vector<atom_pull_info_t> atom_pulls;
251 // nanobinds doesn't have a atom_spec_t, does it?
252 static void atom_pull_off(const coot::atom_spec_t &spec);
253 static void atom_pulls_off(const std::vector<coot::atom_spec_t> &specs);
254#endif
255
256#ifdef DOXYGEN_SHOULD_PARSE_THIS
257#else
258 std::vector<std::pair<mmdb::Residue *, std::vector<coot::dict_torsion_restraint_t> > > make_rotamer_torsions(const std::vector<std::pair<bool, mmdb::Residue *> > &local_residues) const;
259#endif
260
269
270#ifdef DOXYGEN_SHOULD_PARSE_THIS
271#else
273 int refine_direct(int imol, std::vector<mmdb::Residue *> rv, const std::string &alt_loc, int n_cycles);
274
276 double phi_psi_probability(const coot::util::phi_psi_t &phi_psi, const ramachandrans_container_t &rc) const;
277#endif
278
279#ifdef SKIP_FOR_PYTHON_DOXYGEN
280#else
282 void read_standard_residues();
283
284 std::map<svg_store_key_t, std::string> ligand_svg_store;
285
286 atom_selection_container_t standard_residues_asc;
287#endif
288
289#ifdef DOXYGEN_SHOULD_PARSE_THIS
290#else
291
292 coot::graph_match_info_t overlap_ligands_internal(int imol_ligand, int imol_ref, const std::string &chain_id_ref,
293 int resno_ref, bool apply_rtop_flag);
294
295 int install_model(const coot::molecule_t &m);
296
298 superpose_with_atom_selection(atom_selection_container_t asc_ref,
299 atom_selection_container_t asc_mov,
300 int imol_mov,
301 std::string moving_mol_name,
302 std::string reference_mol_name,
303 bool move_copy_of_imol2_flag);
304#endif
305
306#ifdef HAVE_SSMLIB
307
308 void print_ssm_sequence_alignment(ssm::Align *SSMAlign,
309 atom_selection_container_t asc_ref,
310 atom_selection_container_t asc_mov,
311 mmdb::PAtom *atom_selection1,
312 mmdb::PAtom *atom_selection2,
313 int n_selected_atoms_1, int n_selected_atoms_2,
314 bool move_copy_of_imol2_flag);
315
317 make_ssm_sequence_alignment_as_validation_information(ssm::Align *SSMAlign,
318 atom_selection_container_t asc_ref,
319 atom_selection_container_t asc_mov,
320 mmdb::PAtom *atom_selection1, mmdb::PAtom *atom_selection2,
321 int n_selected_atoms_1, int n_selected_atoms_2,
322 bool move_copy_of_imol2_flag);
323
324 void make_and_print_horizontal_ssm_sequence_alignment(ssm::Align *SSMAlign,
325 atom_selection_container_t asc_ref,
326 atom_selection_container_t asc_mov,
327 mmdb::PAtom *atom_selection1,
328 mmdb::PAtom *atom_selection2,
329 int n_selected_atoms_1, int n_selected_atoms_2) const;
330
331 void map_secondary_structure_headers(ssm::Align *SSMAlign,
332 atom_selection_container_t asc_ref,
333 atom_selection_container_t asc_mov,
334 mmdb::PAtom *atom_selection1,
335 mmdb::PAtom *atom_selection2,
336 int n_selected_atoms_1, int n_selected_atoms_2) const;
337
338 std::pair<std::string, std::string>
339 get_horizontal_ssm_sequence_alignment(ssm::Align *SSMAlign,
340 atom_selection_container_t asc_ref,
341 atom_selection_container_t asc_mov,
342 mmdb::PAtom *atom_selection1, mmdb::PAtom *atom_selection2,
343 int n_selected_atoms_1, int n_selected_atoms_2) const;
344
345 // for gesampt this will be vector of vector
346 std::vector<std::pair<coot::residue_validation_information_t, coot::residue_validation_information_t> >
347 get_pairs(ssm::Align *SSMAlign,
348 atom_selection_container_t asc_ref,
349 atom_selection_container_t asc_mov,
350 mmdb::PAtom *atom_selection1, mmdb::PAtom *atom_selection2,
351 int n_selected_atoms_1, int n_selected_atoms_2) const;
352
353
354 void print_horizontal_ssm_sequence_alignment(std::pair<std::string, std::string> aligned_sequences) const;
355
356 std::string generate_horizontal_ssm_sequence_alignment_string(const std::pair<std::string, std::string> &aligned_sequences) const;
357
358#endif // HAVE_SSMLIB
359
360#ifdef SKIP_FOR_PYTHON_DOXYGEN
361#else
363 int valid_labels(const std::string &mtz_file_name, const std::string &f_col, const std::string &phi_col,
364 const std::string &weight_col, int use_weights) const;
365
366 // water fitting settings
367 float ligand_water_to_protein_distance_lim_max;
368 float ligand_water_to_protein_distance_lim_min;
369 float ligand_water_variance_limit;
370 float ligand_water_sigma_cut_off;
371#endif
372
373 unsigned int max_number_of_simple_mesh_vertices;
374
375 // --------------------- init --------------------------
376#ifdef SKIP_FOR_PYTHON_DOXYGEN
377#else
378 void init(); // private
379#endif
380
381#ifdef SKIP_FOR_PYTHON_DOXYGEN
382#else
384 void debug() const;
385
386 bool map_is_contoured_using_thread_pool_flag;
387 double contouring_time;
388#endif
389
390public:
391
393 explicit molecules_container_t(bool verbose=true);
394
396
400 int imol_refinement_map; // direct access
404 int imol_difference_map; // direct access
405
406 bool use_gemmi; // for mmcif and PDB parsing. 20240112-PE set to true by default in init()
407
408 // -------------------------------- Basic Utilities -----------------------------------
410
415 std::string package_version() const;
416
420 void set_use_gemmi(bool state) { use_gemmi = state; }
421
423 bool get_use_gemmi() { return use_gemmi; }
424
425
429 void set_make_backups(bool state) { make_backups_flag = state; }
430
434 bool get_make_backups() const { return make_backups_flag; }
435
438
444 std::string file_name_to_string(const std::string &file_name) const;
445
449 unsigned int get_number_of_molecules() const { return molecules.size(); }
450
457 void create_empty_molecules(unsigned int n_empty);
458
463
467 void set_map_weight(float w) { map_weight = w; }
468
472 float get_map_weight() const { return map_weight; }
473
478 void scale_map(int imol_map, float scale_factor);
479
486 coot::atom_spec_t atom_cid_to_atom_spec(int imol, const std::string &cid) const;
487
494 coot::residue_spec_t residue_cid_to_residue_spec(int imol, const std::string &cid) const;
495
502 void set_show_timings(bool s) { show_timings = s; }
503
504 // duplicate?
505 // coot::protein_geometry & get_geom() { return geom; }
506
514 moorhen::header_info_t get_header_info(int imol) const;
515
521 int get_imol_enc_any() const;
522
523 // -------------------------------- generic utils -----------------------------------
525
531 std::string get_molecule_name(int imol) const;
532
537 void set_molecule_name(int imol, const std::string &new_name);
538
541
549 bool is_valid_model_molecule(int imol) const;
550
558 bool is_valid_map_molecule(int imol_map) const;
559
565 bool is_a_difference_map(int imol_map) const;
566
570 int new_molecule(const std::string &name);
571
577 int close_molecule(int imol);
578
582
584 void pop_back();
585
587 void clear();
588
597 std::vector<double> get_eigenvalues(int imol, const std::string &chain_id, int res_no, const std::string &ins_code);
598
603
604#ifdef SWIG
605#else
606#ifdef DOXYGEN_SHOULD_PARSE_THIS
607#else
609 coot::molecule_t & operator[] (unsigned int imol);
610#endif
611#endif
612
613#ifdef DOXYGEN_SHOULD_PARSE_THIS
614#else
616 mmdb::Manager *get_mol(unsigned int imol) const;
617#endif
618
621
626 void accept_rotamer_probability_tables_compressed_data(const std::string &data_stream);
627
628 // -------------------------------- backup and saving -----------------------------------
630
637
640
641 // -------------------------------- geometry/dictionaries --------------------------------
643
646
652 std::vector<std::string> non_standard_residue_types_in_model(int imol) const;
653
654#ifdef MAKE_ENHANCED_LIGAND_TOOLS
661 // RDKit::RWMol get_rdkit_mol(const std::string &residue_name, int imol_enc);
662
663 // std::shared_ptr<RDKit::RWMol> get_rdkit_mol_shared(const std::string &residue_name, int imol_enc);
664
670 std::string get_rdkit_mol_pickle_base64(const std::string &residue_name, int imol_enc);
671#endif
672
673 // -------------------------------- coordinates utils -----------------------------------
675
681 int read_coordinates(const std::string &file_name);
682
690 int read_pdb(const std::string &file_name);
691
697 int read_small_molecule_cif(const std::string &file_name);
698
702 void print_secondary_structure_info(int imol) const;
703
711 void replace_molecule_by_model_from_file(int imol, const std::string &pdb_file_name);
712
718 std::vector<int> split_multi_model_molecule(int imol);
719
725 int make_ensemble(const std::string &model_molecules_list);
726
732 std::string molecule_to_PDB_string(int imol) const;
733
739 std::string molecule_to_mmCIF_string(int imol) const;
740
750 std::pair<int, std::string> get_active_atom(float x, float y, float z, const std::string &displayed_model_molecules_list) const;
751
758 int import_cif_dictionary(const std::string &cif_file_name, int imol_enc);
759
766 std::string get_cif_file_name(const std::string &comp_id, int imol_enc) const;
767
774 std::string get_cif_restraints_as_string(const std::string &comp_id, int imol_enc) const;
775
781 bool copy_dictionary(const std::string &monomer_name, int imol_current, int imol_new);
782
788 int get_monomer(const std::string &monomer_name);
789
798 int get_monomer_from_dictionary(const std::string &comp_id, int imol, bool idealised_flag);
799
809 int get_monomer_and_position_at(const std::string &comp_id, int imol, float x, float y, float z);
810
819 std::map<std::string, std::string>
820 dictionary_atom_name_map(const std::string &comp_id_1, int imol_1, const std::string &comp_id_2, int imol_2);
821
823 std::vector<std::string> get_types_in_molecule(int imol) const;
824
825 // 20221030-PE nice to have one day:
826 // int get_monomer_molecule_by_network_and_dict_gen(const std::string &text);
827
835 std::vector<std::string> get_groups_for_monomers(const std::vector<std::string> &residue_names) const;
836
843 std::string get_group_for_monomer(const std::string &residue_name) const;
844
853 std::string get_hb_type(const std::string &compound_id, int imol_enc, const std::string &atom_name) const;
854
862 std::vector<std::pair<std::string, std::string> > get_gphl_chem_comp_info(const std::string &compound_id, int imol_enc);
863
871 std::vector<std::pair<std::string, std::string> > get_acedrg_atom_types(const std::string &compound_id, int imol_enc) const;
872
879 coot::acedrg_types_for_residue_t get_acedrg_atom_types_for_ligand(int imol, const std::string &residue_cid) const;
880
886 void set_occupancy(int imol, const std::string &cid, float occ_new);
887
894 void write_png(const std::string &compound_id, int imol, const std::string &file_name) const;
895
902 int write_coordinates(int imol, const std::string &file_name) const;
903
912
927 coot::simple_mesh_t get_bonds_mesh(int imol, const std::string &mode,
928 bool against_a_dark_background,
929 float bond_width, float atom_radius_to_bond_width_ratio,
930 int smoothness_factor);
931
949 coot::instanced_mesh_t get_bonds_mesh_instanced(int imol, const std::string &mode,
950 bool against_a_dark_background,
951 float bond_width, float atom_radius_to_bond_width_ratio,
952 bool show_atoms_as_aniso_flag,
953 bool show_aniso_atoms_as_ortep_flag,
954 bool draw_hydrogen_atoms_flag,
955 int smoothness_factor);
956
962 coot::instanced_mesh_t get_bonds_mesh_for_selection_instanced(int imol, const std::string &atom_selection_cid,
963 const std::string &mode,
964 bool against_a_dark_background,
965 float bond_width, float atom_radius_to_bond_width_ratio,
966 bool show_atoms_as_aniso_flag,
967 bool show_aniso_atoms_as_ortep_flag,
968 bool draw_hydrogen_atoms_flag,
969 int smoothness_factor);
970
979 coot::instanced_mesh_t get_goodsell_style_mesh_instanced(int imol, float colour_wheel_rotation_step,
980 float saturation, float goodselliness);
981
993 void export_map_molecule_as_gltf(int imol, float pos_x, float pos_y, float pos_z, float radius, float contour_level,
994 const std::string &file_name);
995
1004 const std::string &selection_cid,
1005 const std::string &mode,
1006 bool against_a_dark_background,
1007 float bonds_width, float atom_radius_to_bond_width_ratio, int smoothness_factor,
1008 bool draw_hydrogen_atoms_flag, bool draw_missing_residue_loops,
1009 const std::string &file_name);
1010
1021 void export_molecular_representation_as_gltf(int imol, const std::string &atom_selection_cid,
1022 const std::string &colour_scheme, const std::string &style,
1023 int secondary_structure_usage_flag,
1024 const std::string &file_name);
1025
1028 void export_chemical_features_as_gltf(int imol, const std::string &cid,
1029 const std::string &file_name) const;
1030
1035 void set_gltf_pbr_roughness_factor(int imol, float roughness_factor);
1036
1041 void set_gltf_pbr_metalicity_factor(int imol, float metalicity);
1042
1049 std::vector<glm::vec4> get_colour_table(int imol, bool against_a_dark_background) const;
1050
1055 void set_colour_wheel_rotation_base(int imol, float r);
1056
1063 void set_base_colour_for_bonds(int imol, float r, float g, float b);
1064
1069 void add_to_non_drawn_bonds(int imol, const std::string &atom_selection_cid);
1070
1075
1079 void print_non_drawn_bonds(int imol) const;
1080
1082 void set_user_defined_bond_colours(int imol, const std::map<unsigned int, std::array<float, 4> > &colour_map);
1083
1087 void set_user_defined_atom_colour_by_selection(int imol, const std::vector<std::pair<std::string, unsigned int> > &indexed_residues_cids,
1088 bool colour_applies_to_non_carbon_atoms_also);
1089
1091 void add_colour_rule(int imol, const std::string &selection_cid, const std::string &colour);
1092
1098 void add_colour_rules_multi(int imol, const std::string &selections_and_colours_combo_string);
1099
1103 void delete_colour_rules(int imol);
1104
1108 std::vector<std::pair<std::string, std::string> > get_colour_rules(int imol) const;
1109
1113 void print_colour_rules(int imol) const;
1114
1118 void set_use_bespoke_carbon_atom_colour(int imol, bool state);
1119
1124
1126 void M2T_updateFloatParameter(int imol, const std::string &param_name, float value);
1127
1129 void M2T_updateIntParameter(int imol, const std::string &param_name, int value);
1130
1141 coot::simple_mesh_t get_molecular_representation_mesh(int imol, const std::string &cid, const std::string &colour_scheme,
1142 const std::string &style, int secondary_structure_usage_flag);
1143
1154 coot::simple_mesh_t get_gaussian_surface(int imol, float sigma, float contour_level,
1155 float box_radius, float grid_scale, float b_factor) const;
1156
1163 coot::simple_mesh_t get_chemical_features_mesh(int imol, const std::string &cid) const;
1164
1175 mmdb::Atom *get_atom_using_cid(int imol, const std::string &cid) const;
1176
1187 mmdb::Residue *get_residue_using_cid(int imol, const std::string &cid) const;
1188
1189#ifdef DOXYGEN_SHOULD_PARSE_THIS
1190#else
1194 mmdb::Atom *get_atom(int imol, const coot::atom_spec_t &atom_spec) const;
1198 mmdb::Residue *get_residue(int imol, const coot::residue_spec_t &residue_spec) const;
1200 std::pair<bool, coot::Cartesian> get_atom_position(int imol, coot::atom_spec_t &atom_spec);
1201#endif
1202
1211 bool residue_is_nucleic_acid(int imol, const std::string &cid) const;
1212
1219 std::vector<double> get_residue_CA_position(int imol, const std::string &cid) const;
1220
1227 std::vector<double> get_residue_average_position(int imol, const std::string &cid) const;
1228
1235 std::vector<double> get_residue_sidechain_average_position(int imol, const std::string &cid) const;
1236
1242 unsigned int get_number_of_atoms(int imol) const;
1243
1249 float get_molecule_diameter(int imol) const;
1250
1256 int get_number_of_hydrogen_atoms(int imol) const;
1257
1263 std::vector<std::string> get_chains_in_model(int imol) const;
1264
1270 std::vector<std::vector<std::string> > get_ncs_related_chains(int imol) const;
1271
1278 std::vector<std::pair<coot::residue_spec_t, std::string> > get_single_letter_codes_for_chain(int imol, const std::string &chain_id) const;
1279
1285 std::vector<std::string> get_residue_names_with_no_dictionary(int imol) const;
1286
1295 std::string get_residue_name(int imol, const std::string &chain_id, int res_no, const std::string &ins_code) const;
1296
1304 std::string get_SMILES_for_residue_type(const std::string &residue_name, int imol_enc) const;
1305
1312 std::vector<coot::residue_spec_t> residues_with_missing_atoms(int imol);
1313
1314#ifdef DOXYGEN_SHOULD_PARSE_THIS
1315#else
1317 // (20230117-PE I should fix that)
1323 coot::util::missing_atom_info missing_atoms_info_raw(int imol);
1324#endif
1325
1330 std::vector<coot::residue_range_t> get_missing_residue_ranges(int imol) const;
1331
1339 std::vector<coot::residue_spec_t> get_residues_near_residue(int imol, const std::string &residue_cid, float dist) const;
1340
1347 std::vector<coot::atom_distance_t>
1348 get_distances_between_atoms_of_residues(int imol, const std::string &cid_res_1, const std::string &cid_res_2,
1349 float dist_max) const;
1350
1359 superpose_results_t SSM_superpose(int imol_ref, const std::string &chain_id_ref,
1360 int imol_mov, const std::string &chain_id_mov);
1361
1371 void add_lsq_superpose_match(const std::string &chain_id_ref, int res_no_ref_start, int res_no_ref_end,
1372 const std::string &chain_id_mov, int res_no_mov_start, int res_no_mov_end,
1373 int match_type);
1374
1383 void add_lsq_superpose_atom_match(const std::string &chain_id_ref, int res_no_ref, const std::string &atom_name_ref,
1384 const std::string &chain_id_mov, int res_no_mov, const std::string &atom_name_mov);
1385
1388
1389 std::vector<coot::lsq_range_match_info_t> lsq_matchers;
1390
1396 bool lsq_superpose(int imol_ref, int imol_mov);
1397
1408 int transform_map_using_lsq_matrix(int imol_map, lsq_results_t lsq_matrix, float x, float y, float z, float radius);
1418 lsq_results_t get_lsq_matrix(int imol_ref, int imol_mov, bool summary_to_screen) const;
1419
1423 coot::symmetry_info_t
1424 get_symmetry(int imol, float symmetry_search_radius, float centre_x, float centre_y, float centre_z) const;
1425
1433 ::api::cell_t get_cell(int imol) const;
1434
1441
1447 int undo(int imol);
1448
1454 int redo(int imol);
1455
1463 std::pair<int, double> get_torsion(int imol, const std::string &cid, const std::vector<std::string> &atom_names);
1464
1470 void set_temperature_factors_using_cid(int imol, const std::string &cid, float temp_fact);
1471
1472 // -------------------------------- map utils -------------------------------------------
1474
1475#ifdef DOXYGEN_SHOULD_PARSE_THIS
1476#else
1478 float map_sampling_rate;
1479#endif
1480
1484 float get_map_sampling_rate() { return map_sampling_rate; }
1485
1492 void set_map_sampling_rate(float msr) { map_sampling_rate = msr; }
1493
1504 int read_mtz(const std::string &file_name, const std::string &f, const std::string &phi, const std::string &weight,
1505 bool use_weight, bool is_a_difference_map);
1506
1514 int replace_map_by_mtz_from_file(int imol, const std::string &file_name, const std::string &f, const std::string &phi,
1515 const std::string &weight, bool use_weight);
1516
1518 class auto_read_mtz_info_t {
1519 public:
1521 int idx;
1523 std::string F;
1525 std::string phi;
1527 std::string w;
1531 std::string F_obs;
1533 std::string sigF_obs;
1535 std::string Rfree;
1536 // constructor
1537 auto_read_mtz_info_t() {idx = -1; weights_used = false; }
1538 // constructor
1539 auto_read_mtz_info_t(int index, const std::string &F_in, const std::string &phi_in) :
1540 idx(index), F(F_in), phi(phi_in), weights_used(false) {}
1541 // set Fobs sigFobs column labels
1542 void set_fobs_sigfobs(const std::string &f, const std::string &s) {
1543 F_obs = f;
1544 sigF_obs = s;
1545 }
1546 };
1547
1553 std::vector<auto_read_mtz_info_t> auto_read_mtz(const std::string &file_name);
1554
1563 int read_ccp4_map(const std::string &file_name, bool is_a_difference_map);
1564
1571 int write_map(int imol, const std::string &file_name) const;
1572
1578 float get_map_mean(int imol) const;
1579
1587 float get_map_rmsd_approx(int imol_map) const;
1588
1597 coot::molecule_t::histogram_info_t get_map_histogram(int imol, unsigned int n_bins, float zoom_factor) const;
1598
1599
1604
1610 bool is_EM_map(int imol) const;
1611
1619 int sharpen_blur_map(int imol_map, float b_factor, bool in_place_flag);
1620
1631 int sharpen_blur_map_with_resample(int imol_map, float b_factor, float resample_factor, bool in_place_flag);
1632
1646 int mask_map_by_atom_selection(int imol_coords, int imol_map, const std::string &cid, float atom_radius, bool invert_flag);
1647
1660 std::vector<int> partition_map_by_chain(int imol_map, int imol_model);
1661
1670 int make_mask(int imol_map_ref, int imol_model, const std::string &atom_selection_cid, float radius);
1671
1677 int flip_hand(int imol_map);
1678
1685 std::vector<int> make_masked_maps_split_by_chain(int imol, int imol_map);
1686
1692 int dedust_map(int imol);
1693
1704 void set_map_colour(int imol, float r, float g, float b);
1705
1710
1723 coot::simple_mesh_t get_map_contours_mesh(int imol, double position_x, double position_y, double position_z,
1724 float radius, float contour_level);
1725
1741 double position_x, double position_y, double position_z,
1742 float radius, float contour_level,
1743 float other_map_for_colouring_min_value,
1744 float other_map_for_colouring_max_value,
1745 bool invert_colour_ramp);
1750 void set_map_colour_saturation(int imol, float s);
1751 void set_colour_map_for_map_coloured_by_other_map(std::vector<std::pair<double, std::vector<double> > > colour_table );
1752
1753 user_defined_colour_table_t colour_map_by_other_map_user_defined_table;
1754
1764 double position_x, double position_y, double position_z,
1765 float radius, float contour_level,
1766 unsigned int n_bins);
1767
1768
1769
1773 coot::util::sfcalc_genmap_stats_t get_latest_sfcalc_stats() const { return latest_sfcalc_stats; }
1774
1776 public:
1777 float r_factor; // 0 to 1
1778 float free_r_factor;
1779 int rail_points_total;
1780 int rail_points_new;
1781 };
1782
1787
1793 std::string r_factor_stats_as_string(const r_factor_stats &rfs) const;
1794
1805 int average_map(const std::string &imol_maps, std::vector<float> &scales);
1806
1817 bool regen_map(int imol_map, const std::string &imol_maps, const std::vector<float> &scales);
1818
1819 // -------------------------------- coordinates modelling -------------------------------
1821
1832 int auto_fit_rotamer(int imol, const std::string &chain_id, int res_no, const std::string &ins_code, const std::string &alt_conf,
1833 int imol_map);
1834
1842 coot::molecule_t::rotamer_change_info_t change_to_next_rotamer(int imol, const std::string &residue_cid, const std::string &alt_conf);
1843
1851 coot::molecule_t::rotamer_change_info_t change_to_previous_rotamer(int imol, const std::string &residue_cid, const std::string &alt_conf);
1852
1860 coot::molecule_t::rotamer_change_info_t change_to_first_rotamer(int imol, const std::string &residue_cid, const std::string &alt_conf);
1861
1869 std::pair<int, unsigned int> delete_using_cid(int imol, const std::string &cid, const std::string &scope);
1870
1881 std::pair<int, unsigned int> delete_atom(int imol, const std::string &chain_id, int res_no, const std::string &ins_code,
1882 const std::string &atom_name, const std::string &alt_conf);
1883
1890 std::pair<int, unsigned int> delete_atom_using_cid(int imol, const std::string &cid);
1891
1900 std::pair<int, unsigned int> delete_residue(int imol, const std::string &chain_id, int res_no, const std::string &ins_code);
1901
1908 std::pair<int, unsigned int> delete_residue_using_cid(int imol, const std::string &cid);
1909
1919 std::pair<int, unsigned int> delete_residue_atoms_with_alt_conf(int imol, const std::string &chain_id, int res_no,
1920 const std::string &ins_code, const std::string &alt_conf);
1926 std::pair<int, unsigned int> delete_residue_atoms_using_cid(int imol, const std::string &cid);
1927
1936 std::pair<int, unsigned int> delete_side_chain(int imol, const std::string &chain_id, int res_no, const std::string &ins_code);
1937
1944 std::pair<int, unsigned int> delete_side_chain_using_cid(int imol, const std::string &cid);
1945
1952 std::pair<int, unsigned int> delete_chain_using_cid(int imol, const std::string &cid);
1953
1960 std::pair<int, unsigned int> delete_literal_using_cid(int imol, const std::string &cid);
1961
1968
1969 // (I should have) change(d) that stupid (alt) loc (I should have made you leave your key)
1970 //
1982 int change_alt_locs(int imol, const std::string &cid, const std::string &change_mode);
1983
1992 std::pair<int, std::string> add_terminal_residue_directly(int imol, const std::string &chain_id, int res_no, const std::string &ins_code);
1993
1994 // std::pair<int, std::string> add_terminal_residue_directly_using_cid(int imol, const std::string &cid);
1995 //
2001 int add_terminal_residue_directly_using_cid(int imol, const std::string &cid);
2002
2010
2016
2021 ligand_water_to_protein_distance_lim_min = d;
2022 }
2023
2028 ligand_water_to_protein_distance_lim_max = d;
2029 }
2030
2035 ligand_water_variance_limit = d;
2036 }
2037
2042 ligand_water_sigma_cut_off = d;
2043 }
2044
2051 int add_waters(int imol_model, int imol_map);
2052
2060 int flood(int imol_model, int imol_map, float n_rmsd);
2061
2067 int add_hydrogen_atoms(int imol_model);
2068
2074 int delete_hydrogen_atoms(int imol_model);
2075
2082 int add_alternative_conformation(int imol_model, const std::string &cid);
2083
2092 int fill_partial_residue(int imol, const std::string &chain_id, int res_no, const std::string &ins_code);
2093
2100 int fill_partial_residue_using_cid(int imol, const std::string &cid);
2101
2108
2117 void add_named_glyco_tree(int imol_model, int imol_map, const std::string &glycosylation_name,
2118 const std::string &asn_chain_id, int asn_res_no);
2119
2120#if NB_VERSION_MAJOR
2121#else
2129 int flip_peptide(int imol, const coot::atom_spec_t &atom_spec, const std::string &alt_conf);
2130#endif
2131
2139 int flip_peptide_using_cid(int imol, const std::string &atom_cid, const std::string &alt_conf);
2140
2147 void eigen_flip_ligand(int imol, const std::string &chain_id, int res_no, const std::string &ins_code);
2148
2153 void eigen_flip_ligand_using_cid(int imol, const std::string &residue_cid);
2154
2162 int mutate(int imol, const std::string &cid, const std::string &new_residue_type);
2163
2170 int side_chain_180(int imol, const std::string &atom_cid);
2171
2179 std::string jed_flip(int imol, const std::string &atom_cid, bool invert_selection);
2180
2189 int move_molecule_to_new_centre(int imol, float x, float y, float z);
2190
2196 void multiply_residue_temperature_factors(int imol, const std::string &cid, float factor);
2197
2203 coot::Cartesian get_molecule_centre(int imol) const;
2204
2211 double get_radius_of_gyration(int imol) const;
2212
2218 int copy_molecule(int imol);
2219
2226 int copy_fragment_using_cid(int imol, const std::string &multi_cid);
2227
2239 int copy_fragment_for_refinement_using_cid(int imol, const std::string &multi_cid);
2240
2249 int copy_fragment_using_residue_range(int imol, const std::string &chain_id, int res_no_start, int res_no_end);
2250
2254 int apply_transformation_to_atom_selection(int imol, const std::string &atoms_selection_cid,
2255 int n_atoms, // for validation of the atom selection, (int because mmdb atom type)
2256 float m00, float m01, float m02,
2257 float m10, float m11, float m12,
2258 float m20, float m21, float m22,
2259 float c0, float c1, float c2, // the centre of the rotation
2260 float t0, float t1, float t2); // translation
2261
2267 int new_positions_for_residue_atoms(int imol, const std::string &residue_cid, std::vector<coot::api::moved_atom_t> &moved_atoms);
2268
2273 int new_positions_for_atoms_in_residues(int imol, const std::vector<coot::api::moved_residue_t> &moved_residues);
2274
2284 std::pair<int, std::vector<merge_molecule_results_info_t> >
2285 merge_molecules(int imol, const std::string &list_of_other_molecules);
2286
2287 // this is called by the above function and is useful for other non-api functions (such as add_compound()).
2288
2289#ifdef SKIP_FOR_PYTHON_DOXYGEN
2290//#ifdef DOXYGEN_SHOULD_PARSE_THIS
2291#else
2292 std::pair<int, std::vector<merge_molecule_results_info_t> >
2293 merge_molecules(int imol, std::vector<mmdb::Manager *> mols);
2294#endif
2295
2302 int cis_trans_convert(int imol, const std::string &atom_cid);
2303
2318 void replace_residue(int imol, const std::string &residue_cid, const std::string &new_residue_type, int imol_enc);
2319
2327 int replace_fragment(int imol_base, int imol_reference, const std::string &atom_selection);
2328
2334 int rigid_body_fit(int imol, const std::string &multi_cid, int imol_map);
2335
2350 int rotate_around_bond(int imol, const std::string &residue_cid,
2351 const std::string &atom_name_1,
2352 const std::string &atom_name_2,
2353 const std::string &atom_name_3,
2354 const std::string &atom_name_4,
2355 double torsion_angle);
2356
2368 std::pair<int, std::string> change_chain_id(int imol, const std::string &from_chain_id,
2369 const std::string &to_chain_id,
2370 bool use_resno_range,
2371 int start_resno, int end_resno);
2372
2382 int split_residue_using_map(int imol, const std::string &residue_cid, int imol_diff_map);
2383
2389 void associate_sequence(int imol, const std::string &name_or_chain_id, const std::string &sequence);
2390
2399 void assign_sequence(int imol_model, int imol_map);
2400
2405 std::vector<std::pair<std::string, std::string> > get_sequence_info(int imol) const;
2406
2414 coot::chain_mutation_info_container_t get_mutation_info(int imol) const;
2415
2416 // -------------------------------- Coordinates Refinement ------------------------------
2418
2428 int refine_residues_using_atom_cid(int imol, const std::string &cid, const std::string &mode, int n_cycles);
2429
2442 int refine_residues(int imol, const std::string &chain_id, int res_no, const std::string &ins_code,
2443 const std::string &alt_conf, const std::string &mode, int n_cycles);
2444
2454 int refine_residue_range(int imol, const std::string &chain_id, int res_no_start, int res_no_end, int n_cycles);
2455
2471 std::pair<int, coot::instanced_mesh_t>
2472 minimize_energy(int imol, const std::string &atom_selection_cid,
2473 int n_cycles,
2474 bool do_rama_plot_restraints, float rama_plot_weight,
2475 bool do_torsion_restraints, float torsion_weight, bool refinement_is_quiet);
2476
2488 float
2489 minimize(int imol, const std::string &atom_selection_cid,
2490 int n_cycles,
2491 bool do_rama_plot_restraints, float rama_plot_weight,
2492 bool do_torsion_restraints, float torsion_weight, bool refinement_is_quiet);
2493
2500 void fix_atom_selection_during_refinement(int imol, const std::string &atom_selection_cid);
2501
2509 void add_target_position_restraint(int imol, const std::string &atom_cid, float pos_x, float pos_y, float pos_z);
2510
2515 void clear_target_position_restraint(int imol, const std::string &atom_cid);
2516
2521
2525 void set_logging_level(const std::string &level);
2526
2530 void set_logging_file(const std::string &file_name);
2531
2535 void set_use_rama_plot_restraints(bool state) { use_rama_plot_restraints = state; }
2536
2540 bool get_use_rama_plot_restraints() const { return use_rama_plot_restraints; }
2541
2545 void set_rama_plot_restraints_weight(float f) { rama_plot_restraints_weight = f; }
2546
2550 float get_rama_plot_restraints_weight() const { return rama_plot_restraints_weight; }
2551
2555 void set_use_torsion_restraints(bool state) { use_torsion_restraints = state; }
2556
2560 bool get_use_torsion_restraints() const { return use_torsion_restraints; }
2561
2565 void set_torsion_restraints_weight(float f) { torsion_restraints_weight = f; }
2566
2570 float get_torsion_restraints_weight() const { return torsion_restraints_weight; }
2571
2577 void init_refinement_of_molecule_as_fragment_based_on_reference(int imol_frag, int imol_ref, int imol_map);
2578
2589 std::pair<int, coot::instanced_mesh_t> refine(int imol, int n_cycles);
2590
2606 float pos_x, float pos_y, float pos_z,
2607 int n_cycles);
2612
2617 void clear_refinement(int imol);
2618
2624 void set_refinement_is_verbose(bool state) { refinement_is_quiet = !state; }
2625
2629 void set_refinement_geman_mcclure_alpha(float a) { geman_mcclure_alpha = a; }
2630
2634 float get_geman_mcclure_alpha() const { return geman_mcclure_alpha; }
2635
2640 int generate_self_restraints(int imol, float local_dist_max);
2641
2647 void generate_chain_self_restraints(int imol, float local_dist_max,
2648 const std::string &chain_id);
2649
2655 void generate_local_self_restraints(int imol, float local_dist_max,
2656 const std::string &residue_cids);
2657
2664 const std::string &residue_cid_1,
2665 const std::string &residue_cid_2);
2666
2672
2676 int read_extra_restraints(int imol, const std::string &file_name);
2677
2682
2690 int servalcat_refine_xray(int imol, int imol_map, const std::string &output_prefix);
2691
2692#if NB_VERSION_MAJOR
2701 int servalcat_refine_xray_with_keywords(int imol, int imol_map, const std::string &output_prefix,
2702 const nanobind::dict &key_value_pairs);
2703#endif
2704
2705 // -------------------------------- Coordinates validation ------------------------------
2707
2714
2721
2730
2736 std::vector<coot::phi_psi_prob_t> ramachandran_validation(int imol) const;
2737
2745 coot::instanced_mesh_t contact_dots_for_ligand(int imol, const std::string &cid, unsigned int smoothness_factor) const;
2746
2753 coot::instanced_mesh_t all_molecule_contact_dots(int imol, unsigned int smoothness_factor) const;
2754
2762 // Note this function is not const because we pass a pointer to the protein_geometry geom.
2763 coot::simple::molecule_t get_simple_molecule(int imol, const std::string &residue_cid, bool draw_hydrogen_atoms_flag);
2764
2772
2780 std::vector<moorhen::h_bond> get_h_bonds(int imol, const std::string &cid_str, bool mcdonald_and_thornton_mode) const;
2781
2789 // Function is not const because it might change the protein_geometry geom.
2791
2799 std::vector<coot::geometry_distortion_info_container_t>
2800 get_ligand_validation_vs_dictionary(int imol, const std::string &ligand_cid, bool include_non_bonded_contacts);
2801
2809 std::vector<coot::geometry_distortion_info_container_t>
2810 get_validation_vs_dictionary_for_selection(int imol, const std::string &selection_cid, bool include_non_bonded_contacts);
2811
2821 std::pair<int, double> get_ligand_distortion(int imol, const std::string &ligand_cid, bool include_non_bonded_contacts);
2822
2831 bool match_ligand_torsions(int imol_ligand, int imol_ref, const std::string &chain_id_ref, int resno_ref);
2832
2844 bool match_ligand_position(int imol_ligand, int imol_ref, const std::string &chain_id_ref, int resno_ref);
2845
2854 bool match_ligand_torsions_and_position(int imol_ligand, int imol_ref, const std::string &chain_id_ref, int resno_ref);
2855
2861 bool match_ligand_torsions_and_position_using_cid(int imol_ligand, int imol_ref, const std::string &cid);
2862
2863 // not const because it can dynamically add dictionaries
2865 coot::atom_overlaps_dots_container_t get_overlap_dots(int imol);
2866
2871 coot::atom_overlaps_dots_container_t get_overlap_dots_for_ligand(int imol, const std::string &cid_ligand);
2872
2874 // not const because it can dynamically add dictionaries
2877 std::vector<coot::plain_atom_overlap_t> get_overlaps(int imol);
2878
2883 float get_atom_overlap_score(int imol);
2884
2886 // not const because it can dynamically add dictionaries
2890 std::vector<coot::plain_atom_overlap_t> get_overlaps_for_ligand(int imol, const std::string &cid_ligand);
2891
2899 std::vector <positioned_atom_spec_t>
2900 get_atom_differences(int imol1, int imol2);
2901
2902
2903 // -------------------------------- Coordinates and map validation ----------------------
2905
2914 coot::validation_information_t density_fit_analysis(int imol_model, int imol_map) const;
2915
2918 double get_sum_density_for_atoms_in_residue(int imol, const std::string &cid,
2919 const std::vector<std::string> &atom_names,
2920 int imol_map);
2921
2927 int get_number_of_atoms_in_residue(int imol, const std::string &residue_cid) const;
2928
2936
2943
2950
2959 coot::validation_information_t ramachandran_analysis_for_chain(int imol_model, const std::string &chain_id) const;
2960
2967
2973 float get_median_temperature_factor(int imol) const;
2974
2981 float get_temperature_factor_of_atom(int imol, const std::string &atom_cid) const;
2982
2988 std::vector<coot::molecule_t::interesting_place_t> get_interesting_places(int imol, const std::string &mode) const;
2989
2997 std::vector<coot::molecule_t::interesting_place_t> difference_map_peaks(int imol_map, int imol_protein, float n_rmsd) const;
2998
3006 std::vector<coot::molecule_t::interesting_place_t> pepflips_using_difference_map(int imol_coords, int imol_difference_map, float n_sigma) const;
3007
3016 std::vector<coot::molecule_t::interesting_place_t> unmodelled_blobs(int imol_model, int imol_map,
3017 float rmsd_cut_off) const;
3018
3031 // Use the string_user_data of the spec for the button label
3032 std::vector <coot::atom_spec_t>
3033 find_water_baddies(int imol_model, int imol_map,
3034 float b_factor_lim,
3035 float outlier_sigma_level,
3036 float min_dist, float max_dist,
3037 bool ignore_part_occ_contact_flag,
3038 bool ignore_zero_occ_flag);
3039
3046 float start_pos_x, float start_pos_y, float start_pos_z,
3047 float end_pos_x, float end_pos_y, float end_pos_z) const;
3048
3049 // Calculate the MMRRCC for the residues in the chain
3050 // Multi Masked Residue Range Corellation Coefficient
3051#ifdef SWIG
3052#else
3053 std::pair<std::map<coot::residue_spec_t, coot::util::density_correlation_stats_info_t>,
3054 std::map<coot::residue_spec_t, coot::util::density_correlation_stats_info_t> >
3055 mmrrcc(int imol, const std::string &chain_id, int imol_map) const;
3056#endif
3057
3058 // calculate the MMRRCC for the residues in the chain
3059 // Multi Masked Residue Range Corellation Coefficient
3060#ifdef SWIG
3061#else
3062 std::pair<std::map<coot::residue_spec_t, coot::util::density_correlation_stats_info_t>,
3063 std::map<coot::residue_spec_t, coot::util::density_correlation_stats_info_t> >
3064 mmrrcc_internal(const atom_selection_container_t &asc,
3065 const std::string &chain_id,
3066 const clipper::Xmap<float> &xmap) const;
3067#endif
3068
3077 std::vector<std::pair<double, double> > fourier_shell_correlation(int imol_map_1, int imol_map_2) const;
3078
3085 int make_power_scaled_map(int imol_ref, int imol_map_for_scaling);
3086
3093 coot::validation_information_t get_q_score(int imol_model, int imol_map) const;
3094
3102 coot::validation_information_t get_q_score_for_cid(int imol_model, const std::string &cid, int imol_map) const;
3103
3110 std::pair<float,float> get_mean_and_variance_of_density_for_non_water_atoms(int imol_coords, int imol_map) const;
3111
3118 float get_spherical_variance(int imol_map, int imol_model, const std::string &atom_cid, float mean_density_other_atoms) const;
3119
3120 // -------------------------------- Rail Points ------------------------------------------
3122
3127
3132
3133 // -------------------------------- Updating Maps ---------------------------------------
3135
3145 void associate_data_mtz_file_with_map(int imol, const std::string &data_mtz_file_name,
3146 const std::string &f_col, const std::string &sigf_col,
3147 const std::string &free_r_col);
3148
3160 int connect_updating_maps(int imol_model, int imol_with_data_info_attached, int imol_map_2fofc, int imol_map_fofc);
3161
3169 void sfcalc_genmap(int imol_model,
3170 int imol_map_with_data_attached,
3171 int imol_updating_difference_map);
3172
3189 int imol_2fofc_map,
3190 int imol_updating_difference_map,
3191 int imol_map_with_data_attached);
3192
3203 bool shift_field_b_factor_refinement(int imol, int imol_with_data_attached);
3204
3212 float get_density_at_position(int imol_map, float x, float y, float z) const;
3213
3221 // This is a light-weight fetch, the values have already been computed, here
3222 // were are merely copying them.
3223 std::vector<std::pair<clipper::Coord_orth, float> > get_diff_diff_map_peaks(int imol_diff_map,
3224 float screen_centre_x,
3225 float screen_centre_y,
3226 float screen_centre_z) const;
3227
3228
3232 std::string get_data_set_file_name(int imol) const;
3233
3234 // -------------------------------- Go To Blob ---------------------------------------
3236
3253 std::pair<bool, clipper::Coord_orth> go_to_blob(float x1, float y1, float z1, float x2, float y2, float z2,
3254 float contour_level);
3255
3256
3257 // -------------------------------- Ligand Functions ---------------------------------------
3259
3262 // I am not yet clear what extra cut-offs and flags need to be added here.
3278 std::vector<int> fit_ligand_right_here(int imol_protein, int imol_map, int imol_ligand, float x, float y, float z,
3279 float n_rmsd, bool use_conformers, unsigned int n_conformers);
3280
3284
3285 class fit_ligand_info_t {
3286 public:
3287 int imol; // the imol of the fitted ligand
3288 int cluster_idx; // the index of the cluster
3289 int ligand_idx; // the ligand idx for a given cluster
3290 float fitting_score;
3291 float cluster_volume;
3292 fit_ligand_info_t(int i, int c, int l) : imol(i), cluster_idx(c), ligand_idx(l) { fitting_score = -1.0; cluster_volume = -1.0;}
3293 fit_ligand_info_t() { imol = -1; cluster_idx = -1; ligand_idx = -1; fitting_score = 1.0; cluster_volume = -1.0; }
3295 float get_fitting_score() const { return fitting_score; }
3296 float get_cluster_volume() const { return cluster_volume; }
3297 };
3298
3309 std::vector<fit_ligand_info_t> fit_ligand(int imol_protein, int imol_map, int imol_ligand,
3310 float n_rmsd, bool use_conformers, unsigned int n_conformers);
3311
3322 std::vector<fit_ligand_info_t> fit_ligand_multi_ligand(int imol_protein, int imol_map, const std::string &multi_ligand_molecule_number_list,
3323 float n_rmsd, bool use_conformers, unsigned int n_conformers);
3324
3333 float fit_to_map_by_random_jiggle(int imol, const coot::residue_spec_t &res_spec, int n_trials, float translation_scale_factor);
3334
3343 float fit_to_map_by_random_jiggle_using_cid(int imol, const std::string &cid, int n_trials, float translation_scale_factor);
3344
3354 float fit_to_map_by_random_jiggle_with_blur_using_cid(int imol, int imol_map, const std::string &cid, float b_factor,
3355 int n_trials, float translation_scale_factor);
3356
3369
3370 int add_compound(int imol, const std::string &tlc, int imol_dict, int imol_map, float x, float y, float z);
3371 // This is a ligand function, not really a ligand-fitting function.
3395 std::string get_svg_for_residue_type(int imol, const std::string &comp_id,
3396 bool use_rdkit_svg,
3397 const std::string &background_type);
3398
3413 std::string get_svg_for_2d_ligand_environment_view(int imol, const std::string &residue_cid, bool add_key);
3414
3421 std::vector<coot::residue_spec_t> get_non_standard_residues_in_molecule(int imol) const;
3422
3429
3440 std::vector<int> get_dictionary_conformers(const std::string &comp_id, int imol_enc, bool remove_internal_clash_conformers);
3441
3452 texture_as_floats_t get_map_section_texture(int imol, int section_id, int axis,
3453 float data_value_for_bottom, float data_value_for_top) const;
3454
3459 int get_number_of_map_sections(int imol_map, int axis_id) const;
3460
3461 // -------------------------------- Others -------------------------------------
3463
3467 coot::simple_mesh_t make_mesh_from_gltf_file(const std::string &file_name);
3468
3474 coot::simple_mesh_t get_octahemisphere(unsigned int n_divisions) const;
3475
3476 unsigned int get_max_number_of_simple_mesh_vertices() const;
3477 void set_max_number_of_simple_mesh_vertices(unsigned int n);
3478
3481 std::string pae_png(const std::string &pae_file_name) const;
3482
3483 // -------------------------------- Testing -------------------------------------
3485
3486 class ltj_stats_t {
3487 public:
3488 unsigned int count;
3489 float function_value;
3490 std::chrono::time_point<std::chrono::high_resolution_clock> timer_start;
3491 std::chrono::time_point<std::chrono::high_resolution_clock> timer;
3492 ltj_stats_t() : timer(std::chrono::high_resolution_clock::now()) {
3493 count = 0;
3494 function_value = 0;
3495 timer_start = timer;
3496 }
3499 timer = std::chrono::high_resolution_clock::now();
3500 count += 1;
3501 }
3502
3507 timer = std::chrono::high_resolution_clock::now();
3508 auto d10 = std::chrono::duration_cast<std::chrono::microseconds>(timer - timer_start).count();
3509 return d10;
3510 }
3511 };
3512
3515
3516 // not for user-control
3517 bool interrupt_long_term_job;
3518
3524 void testing_start_long_term_job(unsigned int n_seconds);
3525
3530
3535
3539 double get_contouring_time() const { return contouring_time; }
3540
3546 void set_max_number_of_threads(unsigned int n_threads);
3547
3551 void set_max_number_of_threads_in_thread_pool(unsigned int n_threads);
3552
3558 double test_the_threading(int n_threads);
3559
3566 double test_launching_threads(unsigned int n_threads_per_batch, unsigned int n_batches) const;
3567
3573 double test_thread_pool_threads(unsigned int n_threads);
3574
3584 int mmcif_tests(bool last_test_only);
3585
3586 // I want this function in the C++ documentation, but not the Python API documentation.
3587 // Hmm.
3588#ifdef DOXYGEN_SHOULD_PARSE_THIS
3589#else
3591 coot::protein_geometry & get_geometry() {
3592 return geom;
3593 }
3594#endif
3595
3596 // -------------------------------- Blender Interface ---------------------------------------
3597
3599
3601 void make_mesh_for_map_contours_for_blender(int imol, float x, float y, float z, float level, float radius);
3603 void make_mesh_for_bonds_for_blender(int imol, const std::string &mode, bool against_a_dark_background,
3604 float bond_width, float atom_radius_to_bond_width_ratio,
3605 int smoothness_factor);
3618 const std::string &cid,
3619 const std::string &colour_scheme,
3620 const std::string &style,
3621 int secondary_structure_usage_flag);
3623 void make_mesh_for_gaussian_surface_for_blender(int imol, float sigma, float contour_level, float box_radius, float grid_scale, float b_factor);
3625
3627 void make_mesh_for_goodsell_style_for_blender(int imol, float colour_wheel_rotation_step,
3628 float saturation, float goodselliness);
3629
3631 std::vector<float> get_colour_table_for_blender(int imol);
3633 std::vector<float> get_vertices_for_blender(int imol);
3635 std::vector<int> get_triangles_for_blender(int imol);
3636
3637 // -------------------------------- Other ---------------------------------------
3638
3639 void test_function(const std::string &s);
3640
3641#if NB_VERSION_MAJOR
3642 // skip this (old) block for nanobinds
3643#else
3644#ifdef DOXYGEN_SHOULD_PARSE_THIS
3645
3647
3649 enum mesh_mode_t { UNKNOWN, SINGLE_COLOUR, MULTI_COLOUR };
3651 PyObject *simple_mesh_to_pythonic_mesh(const coot::simple_mesh_t &mesh, int mesh_mode);
3653 PyObject *get_pythonic_bonds_mesh(int imol, const std::string &mode, bool against_a_dark_background,
3654 float bond_width, float atom_radius_to_bond_width_ratio,
3655 int smoothness_factor);
3657 PyObject *get_pythonic_map_mesh(int imol, float x, float y, float z, float radius, float contour_level);
3659 PyObject *get_pythonic_molecular_representation_mesh(int imol, const std::string &atom_selection,
3660 const std::string &colour_sheme,
3661 const std::string &style,
3662 int secondary_structure_usage_flag);
3664 PyObject *get_pythonic_gaussian_surface_mesh(int imol, float sigma, float contour_level,
3665 float box_radius, float grid_scale, float fft_b_factor);
3682 PyObject *get_pythonic_simple_molecule(int imol, const std::string &cid, bool include_hydrogen_atoms_flag);
3683
3684#endif
3685#endif
3686
3687};
3688
3689#endif // MOLECULES_CONTAINER_HH
Definition api-cell.hh:35
Definition residue-and-atom-specs.hh:35
Definition coot-colour.hh:35
Definition instancing.hh:58
map histogram class
Definition coot-molecule.hh:1408
a container class for information about changing rotamers
Definition coot-molecule.hh:1192
Definition coot-molecule.hh:122
Definition residue-and-atom-specs.hh:216
The basic mesh for transfering mesh geometry and colours.
Definition simple-mesh.hh:38
map molecule centre
Definition coot-map-utils.hh:146
Definition sfcalc-genmap.hh:38
Definition validation-information.hh:39
Definition generic-3d-lines.hh:12
class for the information about columns extracted from auto-reading the given mtz file
Definition molecules-container.hh:1518
std::string Rfree
R-Free column. There were not available if the return value is empty.
Definition molecules-container.hh:1535
std::string sigF_obs
sigF_obs column
Definition molecules-container.hh:1533
std::string phi
phi column
Definition molecules-container.hh:1525
std::string w
weights column
Definition molecules-container.hh:1527
int idx
molecule index
Definition molecules-container.hh:1521
std::string F
F column.
Definition molecules-container.hh:1523
std::string F_obs
F_obs column. There were not available if the return value is empty.
Definition molecules-container.hh:1531
bool weights_used
flag for weights usage
Definition molecules-container.hh:1529
float get_fitting_score() const
Definition molecules-container.hh:3295
Definition molecules-container.hh:3486
void update_timer()
This function is called by the long-term job, udating the timer and count.
Definition molecules-container.hh:3498
double time_difference()
Definition molecules-container.hh:3506
Definition molecules-container.hh:1775
std::pair< int, unsigned int > delete_chain_using_cid(int imol, const std::string &cid)
void set_use_rama_plot_restraints(bool state)
Definition molecules-container.hh:2535
int imol_difference_map
Definition molecules-container.hh:404
std::pair< int, coot::instanced_mesh_t > minimize_energy(int imol, const std::string &atom_selection_cid, int n_cycles, bool do_rama_plot_restraints, float rama_plot_weight, bool do_torsion_restraints, float torsion_weight, bool refinement_is_quiet)
void set_max_number_of_threads(unsigned int n_threads)
std::vector< double > get_residue_sidechain_average_position(int imol, const std::string &cid) const
std::map< std::string, std::string > dictionary_atom_name_map(const std::string &comp_id_1, int imol_1, const std::string &comp_id_2, int imol_2)
std::string molecule_to_mmCIF_string(int imol) const
void set_imol_refinement_map(int i)
Definition molecules-container.hh:462
int fill_partial_residue_using_cid(int imol, const std::string &cid)
std::vector< std::pair< clipper::Coord_orth, float > > get_diff_diff_map_peaks(int imol_diff_map, float screen_centre_x, float screen_centre_y, float screen_centre_z) const
coot::instanced_mesh_t get_rotamer_dodecs_instanced(int imol)
coot::simple_mesh_t get_gaussian_surface(int imol, float sigma, float contour_level, float box_radius, float grid_scale, float b_factor) const
void clear_extra_restraints(int imol)
std::vector< positioned_atom_spec_t > get_atom_differences(int imol1, int imol2)
float fit_to_map_by_random_jiggle_using_cid(int imol, const std::string &cid, int n_trials, float translation_scale_factor)
void print_non_drawn_bonds(int imol) const
float fit_to_map_by_random_jiggle(int imol, const coot::residue_spec_t &res_spec, int n_trials, float translation_scale_factor)
bool is_valid_model_molecule(int imol) const
ltj_stats_t testing_interrogate_long_term_job()
Definition molecules-container.hh:3534
int servalcat_refine_xray(int imol, int imol_map, const std::string &output_prefix)
::api::cell_t get_cell(int imol) const
void set_use_torsion_restraints(bool state)
Definition molecules-container.hh:2555
void set_refinement_is_verbose(bool state)
Definition molecules-container.hh:2624
void clear()
Delete all molecules.
int get_monomer_from_dictionary(const std::string &comp_id, int imol, bool idealised_flag)
int generate_self_restraints(int imol, float local_dist_max)
int apply_transformation_to_atom_selection(int imol, const std::string &atoms_selection_cid, int n_atoms, float m00, float m01, float m02, float m10, float m11, float m12, float m20, float m21, float m22, float c0, float c1, float c2, float t0, float t1, float t2)
coot::acedrg_types_for_residue_t get_acedrg_atom_types_for_ligand(int imol, const std::string &residue_cid) const
int delete_hydrogen_atoms(int imol_model)
int copy_molecule(int imol)
std::vector< int > make_masked_maps_split_by_chain(int imol, int imol_map)
std::pair< int, unsigned int > delete_residue(int imol, const std::string &chain_id, int res_no, const std::string &ins_code)
void set_map_sampling_rate(float msr)
Definition molecules-container.hh:1492
bool is_valid_map_molecule(int imol_map) const
void add_lsq_superpose_match(const std::string &chain_id_ref, int res_no_ref_start, int res_no_ref_end, const std::string &chain_id_mov, int res_no_mov_start, int res_no_mov_end, int match_type)
void set_colour_wheel_rotation_base(int imol, float r)
int import_cif_dictionary(const std::string &cif_file_name, int imol_enc)
void eigen_flip_ligand(int imol, const std::string &chain_id, int res_no, const std::string &ins_code)
coot::util::sfcalc_genmap_stats_t sfcalc_genmaps_using_bulk_solvent(int imol_model, int imol_2fofc_map, int imol_updating_difference_map, int imol_map_with_data_attached)
void associate_sequence(int imol, const std::string &name_or_chain_id, const std::string &sequence)
std::pair< int, coot::instanced_mesh_t > refine(int imol, int n_cycles)
texture_as_floats_t get_map_section_texture(int imol, int section_id, int axis, float data_value_for_bottom, float data_value_for_top) const
std::pair< int, std::vector< merge_molecule_results_info_t > > merge_molecules(int imol, const std::string &list_of_other_molecules)
coot::simple_mesh_t test_origin_cube() const
coot::molecule_t::histogram_info_t get_map_vertices_histogram(int imol, int imol_map_for_sampling, double position_x, double position_y, double position_z, float radius, float contour_level, unsigned int n_bins)
int refine_residues(int imol, const std::string &chain_id, int res_no, const std::string &ins_code, const std::string &alt_conf, const std::string &mode, int n_cycles)
void set_map_colour_saturation(int imol, float s)
bool copy_dictionary(const std::string &monomer_name, int imol_current, int imol_new)
void set_user_defined_atom_colour_by_selection(int imol, const std::vector< std::pair< std::string, unsigned int > > &indexed_residues_cids, bool colour_applies_to_non_carbon_atoms_also)
std::string get_cif_file_name(const std::string &comp_id, int imol_enc) const
void add_target_position_restraint(int imol, const std::string &atom_cid, float pos_x, float pos_y, float pos_z)
std::pair< int, unsigned int > delete_atom(int imol, const std::string &chain_id, int res_no, const std::string &ins_code, const std::string &atom_name, const std::string &alt_conf)
void make_mesh_for_goodsell_style_for_blender(int imol, float colour_wheel_rotation_step, float saturation, float goodselliness)
blender
coot::simple_mesh_t get_mesh_for_ligand_validation_vs_dictionary(int imol, const std::string &ligand_cid)
void set_rama_plot_restraints_weight(float f)
Definition molecules-container.hh:2545
void export_molecular_representation_as_gltf(int imol, const std::string &atom_selection_cid, const std::string &colour_scheme, const std::string &style, int secondary_structure_usage_flag, const std::string &file_name)
std::vector< std::string > get_residue_names_with_no_dictionary(int imol) const
void print_secondary_structure_info(int imol) const
float get_torsion_restraints_weight() const
Definition molecules-container.hh:2570
bool match_ligand_torsions_and_position_using_cid(int imol_ligand, int imol_ref, const std::string &cid)
coot::validation_information_t get_q_score(int imol_model, int imol_map) const
void set_gltf_pbr_metalicity_factor(int imol, float metalicity)
coot::molecule_t::rotamer_change_info_t change_to_previous_rotamer(int imol, const std::string &residue_cid, const std::string &alt_conf)
coot::validation_information_t ramachandran_analysis(int imol_model) const
std::vector< coot::residue_spec_t > residues_with_missing_atoms(int imol)
int get_monomer(const std::string &monomer_name)
int make_mask(int imol_map_ref, int imol_model, const std::string &atom_selection_cid, float radius)
void add_to_non_drawn_bonds(int imol, const std::string &atom_selection_cid)
void replace_residue(int imol, const std::string &residue_cid, const std::string &new_residue_type, int imol_enc)
std::string package_version() const
void M2T_updateFloatParameter(int imol, const std::string &param_name, float value)
Update float parameter for MoleculesToTriangles molecular mesh.
void export_chemical_features_as_gltf(int imol, const std::string &cid, const std::string &file_name) const
std::pair< int, unsigned int > delete_literal_using_cid(int imol, const std::string &cid)
int get_monomer_and_position_at(const std::string &comp_id, int imol, float x, float y, float z)
std::vector< fit_ligand_info_t > fit_ligand_multi_ligand(int imol_protein, int imol_map, const std::string &multi_ligand_molecule_number_list, float n_rmsd, bool use_conformers, unsigned int n_conformers)
bool get_use_gemmi()
Get the state of using GEMMI for coordinates parsing.
Definition molecules-container.hh:423
float get_geman_mcclure_alpha() const
Definition molecules-container.hh:2634
std::string get_group_for_monomer(const std::string &residue_name) const
void set_add_waters_water_to_protein_distance_lim_min(float d)
Definition molecules-container.hh:2020
void clear_non_drawn_bonds(int imol)
std::vector< coot::atom_distance_t > get_distances_between_atoms_of_residues(int imol, const std::string &cid_res_1, const std::string &cid_res_2, float dist_max) const
void set_logging_level(const std::string &level)
bool shift_field_b_factor_refinement(int imol, int imol_with_data_attached)
void set_draw_missing_residue_loops(bool state)
int transform_map_using_lsq_matrix(int imol_map, lsq_results_t lsq_matrix, float x, float y, float z, float radius)
moorhen::header_info_t get_header_info(int imol) const
std::pair< int, std::string > change_chain_id(int imol, const std::string &from_chain_id, const std::string &to_chain_id, bool use_resno_range, int start_resno, int end_resno)
coot::instanced_mesh_t add_target_position_restraint_and_refine(int imol, const std::string &atom_cid, float pos_x, float pos_y, float pos_z, int n_cycles)
int redo(int imol)
int rotate_around_bond(int imol, const std::string &residue_cid, const std::string &atom_name_1, const std::string &atom_name_2, const std::string &atom_name_3, const std::string &atom_name_4, double torsion_angle)
int replace_fragment(int imol_base, int imol_reference, const std::string &atom_selection)
bool make_backups_flag
the backup-enable state (raw public if needed/preferred)
Definition molecules-container.hh:437
ltj_stats_t long_term_job_stats
long term job
Definition molecules-container.hh:3514
std::string r_factor_stats_as_string(const r_factor_stats &rfs) const
void set_use_bespoke_carbon_atom_colour(int imol, bool state)
void testing_start_long_term_job(unsigned int n_seconds)
coot::validation_information_t peptide_omega_analysis(int imol_model) const
superpose_results_t SSM_superpose(int imol_ref, const std::string &chain_id_ref, int imol_mov, const std::string &chain_id_mov)
generic_3d_lines_bonds_box_t make_exportable_environment_bond_box(int imol, coot::residue_spec_t &spec, float max_dist)
float minimize(int imol, const std::string &atom_selection_cid, int n_cycles, bool do_rama_plot_restraints, float rama_plot_weight, bool do_torsion_restraints, float torsion_weight, bool refinement_is_quiet)
coot::simple_mesh_t get_bonds_mesh(int imol, const std::string &mode, bool against_a_dark_background, float bond_width, float atom_radius_to_bond_width_ratio, int smoothness_factor)
void fill_rotamer_probability_tables()
Fill the rotamer probability tables (currently not ARG and LYS)
void set_base_colour_for_bonds(int imol, float r, float g, float b)
std::vector< float > get_vertices_for_blender(int imol)
Function for Blender interface.
std::pair< int, unsigned int > delete_residue_using_cid(int imol, const std::string &cid)
coot::instanced_mesh_t get_goodsell_style_mesh_instanced(int imol, float colour_wheel_rotation_step, float saturation, float goodselliness)
std::vector< std::pair< coot::residue_spec_t, std::string > > get_single_letter_codes_for_chain(int imol, const std::string &chain_id) const
float get_map_mean(int imol) const
coot::molecule_t::histogram_info_t get_map_histogram(int imol, unsigned int n_bins, float zoom_factor) const
coot::chain_mutation_info_container_t get_mutation_info(int imol) const
void set_user_defined_bond_colours(int imol, const std::map< unsigned int, std::array< float, 4 > > &colour_map)
User-defined colour-index to colour.
std::vector< coot::molecule_t::interesting_place_t > pepflips_using_difference_map(int imol_coords, int imol_difference_map, float n_sigma) const
int copy_fragment_using_residue_range(int imol, const std::string &chain_id, int res_no_start, int res_no_end)
std::string get_cif_restraints_as_string(const std::string &comp_id, int imol_enc) const
void fix_atom_selection_during_refinement(int imol, const std::string &atom_selection_cid)
std::vector< std::pair< std::string, std::string > > get_gphl_chem_comp_info(const std::string &compound_id, int imol_enc)
int add_compound(int imol, const std::string &tlc, int imol_dict, int imol_map, float x, float y, float z)
double get_sum_density_for_atoms_in_residue(int imol, const std::string &cid, const std::vector< std::string > &atom_names, int imol_map)
coot::instanced_mesh_t get_extra_restraints_mesh(int imol, int mode)
int mask_map_by_atom_selection(int imol_coords, int imol_map, const std::string &cid, float atom_radius, bool invert_flag)
coot::simple_mesh_t get_map_contours_mesh_using_other_map_for_colours(int imol_ref, int imol_map_for_colouring, double position_x, double position_y, double position_z, float radius, float contour_level, float other_map_for_colouring_min_value, float other_map_for_colouring_max_value, bool invert_colour_ramp)
float fit_to_map_by_random_jiggle_with_blur_using_cid(int imol, int imol_map, const std::string &cid, float b_factor, int n_trials, float translation_scale_factor)
coot::validation_information_t rotamer_analysis(int imol_model) const
void export_map_molecule_as_gltf(int imol, float pos_x, float pos_y, float pos_z, float radius, float contour_level, const std::string &file_name)
coot::atom_overlaps_dots_container_t get_overlap_dots_for_ligand(int imol, const std::string &cid_ligand)
std::vector< coot::geometry_distortion_info_container_t > get_ligand_validation_vs_dictionary(int imol, const std::string &ligand_cid, bool include_non_bonded_contacts)
void set_temperature_factors_using_cid(int imol, const std::string &cid, float temp_fact)
bool get_use_torsion_restraints() const
Definition molecules-container.hh:2560
int dedust_map(int imol)
std::vector< int > split_multi_model_molecule(int imol)
coot::validation_information_t ramachandran_analysis_for_chain(int imol_model, const std::string &chain_id) const
coot::simple_mesh_t get_rotamer_dodecs(int imol)
coot::util::sfcalc_genmap_stats_t get_latest_sfcalc_stats() const
Definition molecules-container.hh:1773
coot::instanced_mesh_t get_bonds_mesh_instanced(int imol, const std::string &mode, bool against_a_dark_background, float bond_width, float atom_radius_to_bond_width_ratio, bool show_atoms_as_aniso_flag, bool show_aniso_atoms_as_ortep_flag, bool draw_hydrogen_atoms_flag, int smoothness_factor)
int undo(int imol)
void generate_chain_self_restraints(int imol, float local_dist_max, const std::string &chain_id)
coot::atom_spec_t atom_cid_to_atom_spec(int imol, const std::string &cid) const
void assign_sequence(int imol_model, int imol_map)
std::pair< int, double > get_torsion(int imol, const std::string &cid, const std::vector< std::string > &atom_names)
void print_colour_rules(int imol) const
void set_logging_file(const std::string &file_name)
std::pair< int, double > get_ligand_distortion(int imol, const std::string &ligand_cid, bool include_non_bonded_contacts)
int mmcif_tests(bool last_test_only)
std::vector< std::pair< std::string, std::string > > get_sequence_info(int imol) const
std::vector< int > get_dictionary_conformers(const std::string &comp_id, int imol_enc, bool remove_internal_clash_conformers)
void geometry_init_standard()
Read the standard list of residues.
int rail_points_total() const
std::pair< int, unsigned int > delete_residue_atoms_using_cid(int imol, const std::string &cid)
void multiply_residue_temperature_factors(int imol, const std::string &cid, float factor)
std::vector< std::string > get_chains_in_model(int imol) const
std::vector< coot::molecule_t::interesting_place_t > difference_map_peaks(int imol_map, int imol_protein, float n_rmsd) const
int average_map(const std::string &imol_maps, std::vector< float > &scales)
void make_mesh_for_molecular_representation_for_blender(int imol, const std::string &cid, const std::string &colour_scheme, const std::string &style, int secondary_structure_usage_flag)
std::vector< moorhen::h_bond > get_h_bonds(int imol, const std::string &cid_str, bool mcdonald_and_thornton_mode) const
std::vector< coot::residue_spec_t > get_residues_near_residue(int imol, const std::string &residue_cid, float dist) const
float get_suggested_initial_contour_level(int imol) const
int imol_refinement_map
Definition molecules-container.hh:400
int get_number_of_map_sections(int imol_map, int axis_id) const
bool try_read_dictionaries_for_new_residue_types(int imol)
int new_positions_for_residue_atoms(int imol, const std::string &residue_cid, std::vector< coot::api::moved_atom_t > &moved_atoms)
void generate_local_self_restraints(int imol, float local_dist_max, const std::string &residue_cids)
void init_refinement_of_molecule_as_fragment_based_on_reference(int imol_frag, int imol_ref, int imol_map)
std::string molecule_to_PDB_string(int imol) const
int auto_fit_rotamer(int imol, const std::string &chain_id, int res_no, const std::string &ins_code, const std::string &alt_conf, int imol_map)
std::pair< int, unsigned int > delete_residue_atoms_with_alt_conf(int imol, const std::string &chain_id, int res_no, const std::string &ins_code, const std::string &alt_conf)
void set_torsion_restraints_weight(float f)
Definition molecules-container.hh:2565
void add_named_glyco_tree(int imol_model, int imol_map, const std::string &glycosylation_name, const std::string &asn_chain_id, int asn_res_no)
void export_model_molecule_as_gltf(int imol, const std::string &selection_cid, const std::string &mode, bool against_a_dark_background, float bonds_width, float atom_radius_to_bond_width_ratio, int smoothness_factor, bool draw_hydrogen_atoms_flag, bool draw_missing_residue_loops, const std::string &file_name)
std::string file_name_to_string(const std::string &file_name) const
bool match_ligand_torsions_and_position(int imol_ligand, int imol_ref, const std::string &chain_id_ref, int resno_ref)
void eigen_flip_ligand_using_cid(int imol, const std::string &residue_cid)
std::pair< int, std::string > get_active_atom(float x, float y, float z, const std::string &displayed_model_molecules_list) const
int mutate(int imol, const std::string &cid, const std::string &new_residue_type)
void add_parallel_plane_restraint(int imol, const std::string &residue_cid_1, const std::string &residue_cid_2)
void set_show_timings(bool s)
Definition molecules-container.hh:502
void set_bespoke_carbon_atom_colour(int imol, const coot::colour_t &col)
int flood(int imol_model, int imol_map, float n_rmsd)
int make_power_scaled_map(int imol_ref, int imol_map_for_scaling)
void set_add_waters_variance_limit(float d)
Definition molecules-container.hh:2034
void delete_colour_rules(int imol)
coot::simple_mesh_t get_chemical_features_mesh(int imol, const std::string &cid) const
std::string jed_flip(int imol, const std::string &atom_cid, bool invert_selection)
std::vector< std::string > non_standard_residue_types_in_model(int imol) const
float get_density_at_position(int imol_map, float x, float y, float z) const
std::vector< coot::residue_spec_t > get_non_standard_residues_in_molecule(int imol) const
int read_coordinates(const std::string &file_name)
std::string pae_png(const std::string &pae_file_name) const
std::string get_hb_type(const std::string &compound_id, int imol_enc, const std::string &atom_name) const
int flip_hand(int imol_map)
int refine_residues_using_atom_cid(int imol, const std::string &cid, const std::string &mode, int n_cycles)
std::vector< fit_ligand_info_t > fit_ligand(int imol_protein, int imol_map, int imol_ligand, float n_rmsd, bool use_conformers, unsigned int n_conformers)
void associate_data_mtz_file_with_map(int imol, const std::string &data_mtz_file_name, const std::string &f_col, const std::string &sigf_col, const std::string &free_r_col)
std::string get_residue_name(int imol, const std::string &chain_id, int res_no, const std::string &ins_code) const
void make_mesh_for_gaussian_surface_for_blender(int imol, float sigma, float contour_level, float box_radius, float grid_scale, float b_factor)
Function for Blender interface.
void set_max_number_of_threads_in_thread_pool(unsigned int n_threads)
std::string get_rdkit_mol_pickle_base64(const std::string &residue_name, int imol_enc)
bool match_ligand_torsions(int imol_ligand, int imol_ref, const std::string &chain_id_ref, int resno_ref)
coot::molecule_t::rotamer_change_info_t change_to_first_rotamer(int imol, const std::string &residue_cid, const std::string &alt_conf)
void set_refinement_geman_mcclure_alpha(float a)
Definition molecules-container.hh:2629
float get_map_sampling_rate()
Definition molecules-container.hh:1484
std::vector< coot::atom_spec_t > find_water_baddies(int imol_model, int imol_map, float b_factor_lim, float outlier_sigma_level, float min_dist, float max_dist, bool ignore_part_occ_contact_flag, bool ignore_zero_occ_flag)
void set_molecule_name(int imol, const std::string &new_name)
std::vector< auto_read_mtz_info_t > auto_read_mtz(const std::string &file_name)
std::vector< glm::vec4 > get_colour_table(int imol, bool against_a_dark_background) const
int replace_map_by_mtz_from_file(int imol, const std::string &file_name, const std::string &f, const std::string &phi, const std::string &weight, bool use_weight)
void set_map_is_contoured_with_thread_pool(bool state)
mmdb::Residue * get_residue_using_cid(int imol, const std::string &cid) const
double get_radius_of_gyration(int imol) const
int fill_partial_residues(int imol)
bool delete_all_carbohydrate(int imol)
int write_coordinates(int imol, const std::string &file_name) const
bool regen_map(int imol_map, const std::string &imol_maps, const std::vector< float > &scales)
int copy_fragment_using_cid(int imol, const std::string &multi_cid)
void make_mesh_for_bonds_for_blender(int imol, const std::string &mode, bool against_a_dark_background, float bond_width, float atom_radius_to_bond_width_ratio, int smoothness_factor)
Function for Blender interface.
void end_delete_closed_molecules()
int read_small_molecule_cif(const std::string &file_name)
int add_terminal_residue_directly_using_cid(int imol, const std::string &cid)
void display_molecule_names_table() const
Debugging function: display the table of molecule and names.
void add_lsq_superpose_atom_match(const std::string &chain_id_ref, int res_no_ref, const std::string &atom_name_ref, const std::string &chain_id_mov, int res_no_mov, const std::string &atom_name_mov)
float get_map_rmsd_approx(int imol_map) const
coot::simple_mesh_t make_mesh_from_gltf_file(const std::string &file_name)
int get_imol_enc_any() const
int sharpen_blur_map_with_resample(int imol_map, float b_factor, float resample_factor, bool in_place_flag)
std::pair< int, std::string > add_terminal_residue_directly(int imol, const std::string &chain_id, int res_no, const std::string &ins_code)
mmdb::Atom * get_atom_using_cid(int imol, const std::string &cid) const
unsigned int get_number_of_molecules() const
Definition molecules-container.hh:449
coot::validation_information_t get_q_score_for_cid(int imol_model, const std::string &cid, int imol_map) const
std::pair< float, float > get_mean_and_variance_of_density_for_non_water_atoms(int imol_coords, int imol_map) const
std::vector< int > fit_ligand_right_here(int imol_protein, int imol_map, int imol_ligand, float x, float y, float z, float n_rmsd, bool use_conformers, unsigned int n_conformers)
std::vector< coot::plain_atom_overlap_t > get_overlaps(int imol)
Get Atom Overlaps.
bool get_make_backups() const
Definition molecules-container.hh:434
std::vector< int > partition_map_by_chain(int imol_map, int imol_model)
float get_spherical_variance(int imol_map, int imol_model, const std::string &atom_cid, float mean_density_other_atoms) const
int get_number_of_hydrogen_atoms(int imol) const
std::vector< double > get_residue_CA_position(int imol, const std::string &cid) const
int refine_residue_range(int imol, const std::string &chain_id, int res_no_start, int res_no_end, int n_cycles)
int new_molecule(const std::string &name)
coot::molecule_t::rotamer_change_info_t change_to_next_rotamer(int imol, const std::string &residue_cid, const std::string &alt_conf)
double test_thread_pool_threads(unsigned int n_threads)
std::vector< float > get_colour_table_for_blender(int imol)
Function for Blender interface.
int copy_fragment_for_refinement_using_cid(int imol, const std::string &multi_cid)
float get_temperature_factor_of_atom(int imol, const std::string &atom_cid) const
coot::residue_spec_t residue_cid_to_residue_spec(int imol, const std::string &cid) const
r_factor_stats get_r_factor_stats()
coot::simple_mesh_t get_ramachandran_validation_markup_mesh(int imol) const
int read_extra_restraints(int imol, const std::string &file_name)
void set_use_gemmi(bool state)
Definition molecules-container.hh:420
coot::instanced_mesh_t contact_dots_for_ligand(int imol, const std::string &cid, unsigned int smoothness_factor) const
void set_map_colour(int imol, float r, float g, float b)
int cis_trans_convert(int imol, const std::string &atom_cid)
int read_mtz(const std::string &file_name, const std::string &f, const std::string &phi, const std::string &weight, bool use_weight, bool is_a_difference_map)
std::string get_SMILES_for_residue_type(const std::string &residue_name, int imol_enc) const
int get_number_of_atoms_in_residue(int imol, const std::string &residue_cid) const
coot::symmetry_info_t get_symmetry(int imol, float symmetry_search_radius, float centre_x, float centre_y, float centre_z) const
molecules_container_t(bool verbose=true)
the one and only constructor
int close_molecule(int imol)
bool match_ligand_position(int imol_ligand, int imol_ref, const std::string &chain_id_ref, int resno_ref)
void testing_stop_long_term_job()
void clear_target_position_restraints(int imol)
float get_rama_plot_restraints_weight() const
Definition molecules-container.hh:2550
std::vector< std::string > get_types_in_molecule(int imol) const
get types
std::pair< int, unsigned int > delete_atom_using_cid(int imol, const std::string &cid)
coot::validation_information_t density_fit_analysis(int imol_model, int imol_map) const
lsq_results_t get_lsq_matrix(int imol_ref, int imol_mov, bool summary_to_screen) const
int fill_partial_residue(int imol, const std::string &chain_id, int res_no, const std::string &ins_code)
std::string get_molecule_name(int imol) const
void scale_map(int imol_map, float scale_factor)
bool is_EM_map(int imol) const
std::string get_svg_for_2d_ligand_environment_view(int imol, const std::string &residue_cid, bool add_key)
void clear_target_position_restraint(int imol, const std::string &atom_cid)
coot::simple_mesh_t get_octahemisphere(unsigned int n_divisions) const
unsigned int get_number_of_atoms(int imol) const
int read_pdb(const std::string &file_name)
int add_hydrogen_atoms(int imol_model)
std::vector< double > get_residue_average_position(int imol, const std::string &cid) const
float get_median_temperature_factor(int imol) const
bool contains_unsaved_models() const
bool lsq_superpose(int imol_ref, int imol_mov)
std::vector< coot::plain_atom_overlap_t > get_overlaps_for_ligand(int imol, const std::string &cid_ligand)
Gat Atom Overlaps for a ligand or residue.
std::vector< std::vector< std::string > > get_ncs_related_chains(int imol) const
float get_map_weight() const
Definition molecules-container.hh:472
void set_add_waters_water_to_protein_distance_lim_max(float d)
Definition molecules-container.hh:2027
double test_launching_threads(unsigned int n_threads_per_batch, unsigned int n_batches) const
void clear_lsq_matches()
Clear any existing lsq matchers.
int sharpen_blur_map(int imol_map, float b_factor, bool in_place_flag)
bool is_a_difference_map(int imol_map) const
void add_colour_rule(int imol, const std::string &selection_cid, const std::string &colour)
Add a colour rule for M2T representations.
std::pair< bool, clipper::Coord_orth > go_to_blob(float x1, float y1, float z1, float x2, float y2, float z2, float contour_level)
int move_molecule_to_new_centre(int imol, float x, float y, float z)
void turn_off_when_close_target_position_restraint(int imol)
int servalcat_refine_xray_with_keywords(int imol, int imol_map, const std::string &output_prefix, const nanobind::dict &key_value_pairs)
void set_make_backups(bool state)
Definition molecules-container.hh:429
double test_the_threading(int n_threads)
std::vector< coot::phi_psi_prob_t > ramachandran_validation(int imol) const
std::pair< int, unsigned int > delete_side_chain(int imol, const std::string &chain_id, int res_no, const std::string &ins_code)
int side_chain_180(int imol, const std::string &atom_cid)
coot::validation_information_t density_correlation_analysis(int imol_model, int imol_map) const
void write_png(const std::string &compound_id, int imol, const std::string &file_name) const
coot::util::map_molecule_centre_info_t get_map_molecule_centre(int imol) const
void sfcalc_genmap(int imol_model, int imol_map_with_data_attached, int imol_updating_difference_map)
std::pair< int, unsigned int > delete_side_chain_using_cid(int imol, const std::string &cid)
coot::simple::molecule_t get_simple_molecule(int imol, const std::string &residue_cid, bool draw_hydrogen_atoms_flag)
int read_ccp4_map(const std::string &file_name, bool is_a_difference_map)
coot::atom_overlaps_dots_container_t get_overlap_dots(int imol)
int change_alt_locs(int imol, const std::string &cid, const std::string &change_mode)
void set_map_weight(float w)
Definition molecules-container.hh:467
coot::simple_mesh_t get_map_contours_mesh(int imol, double position_x, double position_y, double position_z, float radius, float contour_level)
void set_gltf_pbr_roughness_factor(int imol, float roughness_factor)
std::vector< std::pair< double, double > > fourier_shell_correlation(int imol_map_1, int imol_map_2) const
int new_positions_for_atoms_in_residues(int imol, const std::vector< coot::api::moved_residue_t > &moved_residues)
float get_molecule_diameter(int imol) const
std::vector< std::pair< std::string, std::string > > get_acedrg_atom_types(const std::string &compound_id, int imol_enc) const
std::string get_svg_for_residue_type(int imol, const std::string &comp_id, bool use_rdkit_svg, const std::string &background_type)
void accept_rotamer_probability_tables_compressed_data(const std::string &data_stream)
std::vector< coot::molecule_t::interesting_place_t > get_interesting_places(int imol, const std::string &mode) const
std::vector< std::pair< std::string, std::string > > get_colour_rules(int imol) const
int connect_updating_maps(int imol_model, int imol_with_data_info_attached, int imol_map_2fofc, int imol_map_fofc)
coot::instanced_mesh_t get_bonds_mesh_for_selection_instanced(int imol, const std::string &atom_selection_cid, const std::string &mode, bool against_a_dark_background, float bond_width, float atom_radius_to_bond_width_ratio, bool show_atoms_as_aniso_flag, bool show_aniso_atoms_as_ortep_flag, bool draw_hydrogen_atoms_flag, int smoothness_factor)
std::string get_data_set_file_name(int imol) const
coot::instanced_mesh_t get_HOLE(int imol, float start_pos_x, float start_pos_y, float start_pos_z, float end_pos_x, float end_pos_y, float end_pos_z) const
coot::simple_mesh_t get_molecular_representation_mesh(int imol, const std::string &cid, const std::string &colour_scheme, const std::string &style, int secondary_structure_usage_flag)
double get_contouring_time() const
Definition molecules-container.hh:3539
coot::instanced_mesh_t all_molecule_contact_dots(int imol, unsigned int smoothness_factor) const
std::vector< double > get_eigenvalues(int imol, const std::string &chain_id, int res_no, const std::string &ins_code)
int flip_peptide_using_cid(int imol, const std::string &atom_cid, const std::string &alt_conf)
std::vector< coot::molecule_t::interesting_place_t > unmodelled_blobs(int imol_model, int imol_map, float rmsd_cut_off) const
int make_ensemble(const std::string &model_molecules_list)
void clear_refinement(int imol)
void pop_back()
Delete the most recent/last molecule in the molecule vector.
std::vector< coot::residue_range_t > get_missing_residue_ranges(int imol) const
void replace_molecule_by_model_from_file(int imol, const std::string &pdb_file_name)
void make_mesh_for_map_contours_for_blender(int imol, float x, float y, float z, float level, float radius)
Function for Blender interface.
void create_empty_molecules(unsigned int n_empty)
void M2T_updateIntParameter(int imol, const std::string &param_name, int value)
Update int parameter for MoleculesToTriangles molecular mesh.
int split_residue_using_map(int imol, const std::string &residue_cid, int imol_diff_map)
void set_add_waters_sigma_cutoff(float d)
Definition molecules-container.hh:2041
std::vector< std::string > get_groups_for_monomers(const std::vector< std::string > &residue_names) const
std::vector< int > get_triangles_for_blender(int imol)
Function for Blender interface.
bool residue_is_nucleic_acid(int imol, const std::string &cid) const
int write_map(int imol, const std::string &file_name) const
std::vector< coot::geometry_distortion_info_container_t > get_validation_vs_dictionary_for_selection(int imol, const std::string &selection_cid, bool include_non_bonded_contacts)
void set_occupancy(int imol, const std::string &cid, float occ_new)
int add_alternative_conformation(int imol_model, const std::string &cid)
bool get_use_rama_plot_restraints() const
Definition molecules-container.hh:2540
void save_unsaved_model_changes()
Save the unsaved model - this function has not yet been written!
float get_atom_overlap_score(int imol)
std::pair< int, unsigned int > delete_using_cid(int imol, const std::string &cid, const std::string &scope)
int add_terminal_residue_directly_using_bucca_ml_growing_using_cid(int imol, const std::string &cid)
coot::Cartesian get_molecule_centre(int imol) const
int add_waters(int imol_model, int imol_map)
void add_colour_rules_multi(int imol, const std::string &selections_and_colours_combo_string)
int rigid_body_fit(int imol, const std::string &multi_cid, int imol_map)
int add_terminal_residue_directly_using_bucca_ml_growing(int imol, const coot::residue_spec_t &spec)
superposition results
Definition superpose-results.hh:6