Coot Scripting Interface  7000
cc-interface.hh
Go to the documentation of this file.
1 /* src/cc-interface.hh
2  *
3  * Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007 The University of York
4  * Copyright 2007 by Paul Emsley
5  * Copyright 2008, 2009, 2010, 2011, 2012 by The University of Oxford
6  * Copyright 2015 by Medical Research Council
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 3 of the License, or (at
11  * your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful, but
14  * WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
21  */
22 
23 #ifndef CC_INTERFACE_HH
24 #define CC_INTERFACE_HH
25 
26 #include <gtk/gtk.h>
27 
28 #ifdef USE_GUILE
29 #include <libguile.h>
30 #endif // USE_GUILE
31 
32 #ifdef USE_PYTHON
33 #include "Python.h"
34 #endif
35 
36 #include "utils/coot-utils.hh"
37 #include "coot-utils/coot-coord-utils.hh"
38 #include "coot-utils/coot-density-stats.hh"
39 
40 #include "ligand/dipole.hh"
41 #include "high-res/sequence-assignment.hh" // for residue_range_t
42 
43 #include "coords/mmdb-extras.h"
44 #include "coords/mmdb-crystal.h"
45 
46 #include "pli/flev-annotations.hh" // animated ligand interactions
47 #include "named-rotamer-score.hh"
48 
49 #include "coords/phenix-geo.hh"
50 
55 namespace coot {
56 
58  class alias_path_t {
59  public:
60  int index;
61  std::string s;
62  bool flag;
63  alias_path_t(int index_in, const std::string &s_in, bool flag_in) : s(s_in) {
64  index = index_in;
65  flag = flag_in;
66  }
67  };
68 
70  //
72  public:
74  n_h_bonds = 0;
75  n_salt_bridges = 0;
76  n_cov_bonds = 0;
77  n_ss_bonds = 0;
78  }
79  int n_h_bonds;
80  int n_salt_bridges;
81  int n_cov_bonds;
82  int n_ss_bonds;
83  };
84 
85 #ifdef USE_GUILE
86  pisa_interface_bond_info_t get_pisa_interface_bond_info_scm(SCM bonds_info_scm);
87 #endif
88 #ifdef USE_PYTHON
89  pisa_interface_bond_info_t get_pisa_interface_bond_info_py(PyObject *bonds_info_py);
90 #endif
91 
92 }
93 
94 std::string git_commit();
95 
96 std::vector<std::string> filtered_by_glob(const std::string &pre_directory,
97  int data_type);
98 /* Return 1 if search appears in list, 0 if not) */
99 short int
100 string_member(const std::string &search, const std::vector<std::string> &list);
101 bool compare_strings(const std::string &a, const std::string &b);
102 
103 
104 std::string pre_directory_file_selection(GtkWidget *sort_button);
105 void filelist_into_fileselection_clist(GtkWidget *fileselection, const std::vector<std::string> &v);
106 
107 GtkWidget *wrapped_nothing_bad_dialog(const std::string &label);
108 
109 std::pair<short int, float> float_from_entry(GtkWidget *entry);
110 std::pair<short int, int> int_from_entry(GtkWidget *entry);
111 
112 void
113 add_validation_mol_menu_item(int imol, const std::string &name, GtkWidget *menu, GtkSignalFunc callback);
114 void create_initial_validation_graph_submenu_generic(GtkWidget *window1,
115  const std::string &menu_name,
116  const std::string &sub_menu_name);
117 
118 std::string probe_dots_short_contact_name_to_expanded_name(const std::string &short_name);
119 
120 // To be used to (typically) get the menu item text label from chain
121 // option menus (rather than the ugly/broken casting of
122 // GtkPositionType data. A wrapper to a static graphics_info_t
123 // function.
124 std::string menu_item_label(GtkWidget *menu_item);
125 
126 // CaBLAM
127 std::vector<std::pair<coot::residue_spec_t, double> >
128 add_cablam_markup(int imol, const std::string &cablam_file_name);
129 #ifdef USE_GUILE
130 SCM add_cablam_markup_scm(int imol, const std::string &cablam_log_file_name);
131 #endif
132 #ifdef USE_PYTHON
133 PyObject *add_cablam_markup_py(int imol, const std::string &cablam_log_file_name);
134 #endif
135 
136 /* ---------------------------------------------------------------------- */
137 /* go to atom : */
138 /* ---------------------------------------------------------------------- */
139 
140 void set_rotation_centre(const clipper::Coord_orth &pos);
141 
142 #ifdef USE_GUILE
143 //
144 // Pass the current values, return new values
145 SCM goto_next_atom_maybe_scm(const char *chain_id, int resno, const char *ins_code, const char *atom_name);
146 SCM goto_prev_atom_maybe_scm(const char *chain_id, int resno, const char *ins_code, const char *atom_name);
147 #endif
148 
149 #ifdef USE_PYTHON
150 
151 PyObject *goto_next_atom_maybe_py(const char *chain_id, int resno, const char *ins_code, const char *atom_name);
152 PyObject *goto_prev_atom_maybe_py(const char *chain_id, int resno, const char *ins_code, const char *atom_name);
153 #endif
154 
155 int set_go_to_atom_from_spec(const coot::atom_spec_t &atom_spec);
156 int set_go_to_atom_from_res_spec(const coot::residue_spec_t &spec);
157 #ifdef USE_GUILE
158 int set_go_to_atom_from_res_spec_scm(SCM residue_spec);
159 int set_go_to_atom_from_atom_spec_scm(SCM residue_spec);
160 #endif
161 #ifdef USE_PYTHON
162 int set_go_to_atom_from_res_spec_py(PyObject *residue_spec);
163 int set_go_to_atom_from_atom_spec_py(PyObject *residue_spec);
164 #endif
165 
166 
167 // This is to make porting the active atom more easy for Bernhard.
168 // Return a class rather than a list, and rewrite the active-residue
169 // function use this atom-spec. The first value of the pair indicates
170 // if an atom spec was found.
171 //
172 std::pair<bool, std::pair<int, coot::atom_spec_t> > active_atom_spec();
173 #ifdef USE_PYTHON
174 // return a tuple of (Py_Bool (number, atom_spec))
175 PyObject *active_atom_spec_py();
176 #endif // USE_PYTHON
177 
178 
179 /* ---------------------------------------------------------------------- */
180 /* symmetry functions: */
181 /* ---------------------------------------------------------------------- */
182 // get the symmetry operators strings for the given molecule
183 //
184 #ifdef USE_GUILE
185 
188 
194 SCM get_symmetry(int imol);
195 #endif // USE_GUILE
196 
197 #ifdef USE_PYTHON
198 // return a python object as a list (or some other python container)
199 PyObject *get_symmetry_py(int imol);
200 #endif // USE_PYTHON
201 
208 int clashes_with_symmetry(int imol, const char *chain_id, int res_no, const char *ins_code,
209  float clash_dist);
210 
211 void add_molecular_symmetry(int imol,
212  double r_00, double r_01, double r_02,
213  double r_10, double r_11, double r_12,
214  double r_20, double r_21, double r_22,
215  double about_origin_x,
216  double about_origin_y,
217  double about_origin_z);
218 
219 int add_molecular_symmetry_from_mtrix_from_file(int imol, const std::string &file_name);
220 
221 int add_molecular_symmetry_from_mtrix_from_self_file(int imol);
222 
223 
225 
226 /* ---------------------------------------------------------------------- */
227 /* map functions: */
228 /* ---------------------------------------------------------------------- */
231 
239 std::vector<int> auto_read_make_and_draw_maps(const char *filename);
241 std::vector<int> auto_read_make_and_draw_maps_from_mtz(const char *filename);
242 std::vector<int> auto_read_make_and_draw_maps_from_cns(const char *filename);
243 
244 
245 void add_map_colour_mol_menu_item(int imol, const std::string &name,
246  GtkWidget *sub_menu, GtkSignalFunc callback);
247 /* Actually this function is generic and could be renamed so. */
248 void add_map_scroll_wheel_mol_menu_item(int imol,
249  const std::string &name,
250  GtkWidget *menu,
251  GtkSignalFunc callback);
252 
259 int sharpen_blur_map(int imol_map, float b_factor);
260 
269 int sharpen_blur_map_with_resampling(int imol_map, float b_factor, float resample_factor);
270 
271 #ifdef USE_GUILE
272 void multi_sharpen_blur_map_scm(int imol_map, SCM b_factors_list);
277 #endif
278 
279 #ifdef USE_PYTHON
280 void multi_sharpen_blur_map_py(int imol_map, PyObject *b_factors_list);
285 #endif
286 
287 #ifdef USE_PYTHON
288 PyObject *amplitude_vs_resolution_py(int mol_map);
289 #endif
290 
291 #ifdef USE_GUILE
292 SCM amplitude_vs_resolution_scm(int mol_map);
293 #endif
294 
299 int flip_hand(int imol_map);
300 
301 #ifndef SWIG
302 int analyse_map_point_density_change(const std::vector<int> &map_number_list);
304 #endif
305 
306 #ifdef USE_PYTHON
307 int analyse_map_point_density_change_py(PyObject *map_number_list);
308 #endif
309 
313 void go_to_map_molecule_centre(int imol_map);
314 
322 float b_factor_from_map(int imol_map);
323 
328 #ifdef USE_GUILE
329 SCM map_colour_components(int imol);
330 #endif // GUILE
331 
332 #ifdef USE_PYTHON
333 //
336 //
337 PyObject *map_colour_components_py(int imol);
338 #endif // PYTHON
339 
341 int read_ccp4_map(const std::string &filename, int is_diff_map_flag);
342 
344 int handle_read_ccp4_map(const std::string &filename, int is_diff_map_flag);
345 
346 int handle_read_emdb_data(const std::string &dir_name);
348 
349 
352 #ifdef USE_GUILE
353 
357 SCM multi_residue_torsion_fit_scm(int imol, SCM residues_specs_scm, int n_trials);
358 #endif // GUILE
359 void multi_residue_torsion_fit(int imol, const std::vector<coot::residue_spec_t> &specs, int n_trials);
360 
361 #ifdef USE_PYTHON
362 
366 PyObject *multi_residue_torsion_fit_py(int imol, PyObject *residues_specs_py, int n_trials);
367 #endif // PYTHON
368 
370 
371 /* ------------------------------------------------------------------------ */
372 /* merge fragments */
373 /* ------------------------------------------------------------------------ */
377 //
379 //
380 int merge_fragments(int imol);
382 
383 
384 /* ------------------------------------------------------------------------ */
385 /* refmac stuff */
386 /* ------------------------------------------------------------------------ */
390 //
392 //
393 void
394 execute_refmac_real(std::string pdb_in_filename,
395  std::string pdb_out_filename,
396  std::string mtz_in_filename,
397  std::string mtz_out_filename,
398  std::string cif_lib_filename, /* use "" for none */
399  std::string fobs_col_name,
400  std::string sigfobs_col_name,
401  std::string r_free_col_name,
402  short int have_sensible_free_r_flag,
403  short int make_molecules_flag,
404  std::string refmac_count_string,
405  int swap_map_colours_post_refmac_flag,
406  int imol_refmac_map,
407  int diff_map_flag,
408  int phase_combine_flag,
409  std::string phib_string,
410  std::string fom_string,
411  std::string ccp4i_project_dir);
412 
416 std::string refmac_name(int imol);
417 
419 
420 
421 /* ------------------------------------------------------------------- */
422 /* file selection */
423 /* ------------------------------------------------------------------- */
424 
425 namespace coot {
427  class str_mtime {
428  public:
429  str_mtime(std::string file_in, time_t mtime_in) {
430  mtime = mtime_in;
431  file = file_in;
432  }
433  str_mtime() {}
434  time_t mtime;
435  std::string file;
436  };
437 
440  public:
441  std::string directory_prefix;
442  std::vector<str_mtime> file_mtimes;
443  };
444 }
445 
446 
447 bool compare_mtimes(coot::str_mtime a, coot::str_mtime b);
448 
449 std::vector<std::pair<std::string, std::string> > parse_ccp4i_defs(const std::string &filename);
450 
451 std::string ccp4_project_directory(const std::string &ccp4_project_name);
452 
453 /* -------------------------------------------------------------------- */
454 /* history */
455 /* -------------------------------------------------------------------- */
456 #include "command-arg.hh"
457 
458 void add_to_history(const std::vector<std::string> &ls);
459 void add_to_history_simple(const std::string &cmd);
460 void add_to_history_typed(const std::string &command,
461  const std::vector<coot::command_arg_t> &args);
462 std::string single_quote(const std::string &s);
463 std::string pythonize_command_name(const std::string &s);
464 std::string schemize_command_name(const std::string &s);
465 std::string languagize_command(const std::vector<std::string> &command_parts);
466 
467 void add_to_database(const std::vector<std::string> &command_strings);
468 
469 
470 /* ----------------------------------------------------------------------- */
471 /* Merge Molecules */
472 /* ----------------------------------------------------------------------- */
473 #include "merge-molecule-results-info-t.hh"
474 // return the status and vector of chain-ids of the new chain ids.
475 //
476 std::pair<int, std::vector<merge_molecule_results_info_t> > merge_molecules_by_vector(const std::vector<int> &add_molecules, int imol);
477 
478 /* ----------------------------------------------------------------------- */
479 /* Dictionaries */
480 /* ----------------------------------------------------------------------- */
483 std::vector<std::string> dictionary_entries();
484 void debug_dictionary();
485 // this can throw an exception
486 std::string SMILES_for_comp_id(const std::string &comp_id);
488 #ifdef USE_GUILE
489 SCM dictionaries_read();
490 SCM cif_file_for_comp_id_scm(const std::string &comp_id);
491 SCM dictionary_entries_scm();
492 SCM SMILES_for_comp_id_scm(const std::string &comp_id);
493 #endif // USE_GUILE
494 
495 
496 #ifdef USE_PYTHON
497 PyObject *dictionaries_read_py();
498 PyObject *cif_file_for_comp_id_py(const std::string &comp_id);
499 PyObject *dictionary_entries_py();
500 PyObject *SMILES_for_comp_id_py(const std::string &comp_id);
501 #endif // PYTHON
502 
504 
505 /* ----------------------------------------------------------------------- */
506 /* Restraints */
507 /* ----------------------------------------------------------------------- */
508 #ifdef USE_GUILE
509 SCM monomer_restraints(const char *monomer_type);
514 
519 SCM set_monomer_restraints(const char *monomer_type, SCM restraints);
520 #endif // USE_GUILE
521 
522 #ifdef USE_PYTHON
523 PyObject *monomer_restraints_py(std::string monomer_type);
524 PyObject *monomer_restraints_for_molecule_py(std::string monomer_type, int imol);
525 PyObject *set_monomer_restraints_py(const char *monomer_type, PyObject *restraints);
526 #endif // USE_PYTHON
527 
529 
530 /* ----------------------------------------------------------------------- */
531 /* list nomenclature errors */
532 /* ----------------------------------------------------------------------- */
533 std::vector<std::pair<std::string, coot::residue_spec_t> >
534 list_nomenclature_errors(int imol);
535 
536 #ifdef USE_GUILE
537 SCM list_nomenclature_errors_scm(int imol);
538 #endif // USE_GUILE
539 #ifdef USE_PYTHON
540 PyObject *list_nomenclature_errors_py(int imol);
541 #endif // USE_PYTHON
542 
543 void
544 show_fix_nomenclature_errors_gui(int imol,
545  const std::vector<std::pair<std::string, coot::residue_spec_t> > &nomenclature_errors);
546 
547 /* ----------------------------------------------------------------------- */
548 /* dipole */
549 /* ----------------------------------------------------------------------- */
550 // This is here because it uses a C++ class, coot::dipole
551 //
552 #ifdef USE_GUILE
553 SCM dipole_to_scm(std::pair<coot::dipole, int> dp);
554 #endif // USE_GUILE
555 #ifdef USE_PYTHON
556 PyObject *dipole_to_py(std::pair<coot::dipole, int> dp);
557 #endif // USE_PYTHON
558 
559 
560 #ifdef USE_PYTHON
561 PyObject *coot_has_guile();
562 #endif
563 
564 bool coot_can_do_lidia_p();
565 
566 
567 /* commands to run python commands from guile and vice versa */
568 /* we ignore return values for now */
569 #ifdef USE_PYTHON
570 PyObject *run_scheme_command(const char *scheme_command);
571 #endif // USE_PYTHON
572 #ifdef USE_GUILE
573 SCM run_python_command(const char *python_command);
574 #endif // USE_GUILE
575 
576 // This is not inside a #ifdef USE_PYTHON because we want to use it
577 // from the guile level and USE_PYTHON is not passed as an argument to
578 // swig when generating coot_wrap_guile.cc.
579 //
580 // [Consider removing safe_python_command_by_char_star() which is
581 // conditionally compiled].
582 int pyrun_simple_string(const char *python_command);
583 
584 #ifdef USE_GUILE
585 // Return a list describing a residue like that returned by
586 // residues-matching-criteria (list return-val chain-id resno ins-code)
587 // This is a library function really. There should be somewhere else to put it.
588 // It doesn't need expression at the scripting level.
589 // return a null list on problem
590 SCM residue_spec_to_scm(const coot::residue_spec_t &res);
591 #endif
592 
593 #ifdef USE_PYTHON
594 // Return a list describing a residue like that returned by
595 // residues-matching-criteria [return_val, chain_id, resno, ins_code]
596 // This is a library function really. There should be somewhere else to put it.
597 // It doesn't need expression at the scripting level.
598 // return a null list on problem
599 PyObject *residue_spec_to_py(const coot::residue_spec_t &res);
600 #endif
601 
602 #ifdef USE_PYTHON
603 PyObject *residue_spec_make_triple_py(PyObject *residue_spec_py);
604 #endif // USE_PYTHON
605 
606 #ifdef USE_GUILE
607 coot::residue_spec_t residue_spec_from_scm(SCM residue_in);
608 #endif
609 
610 #ifdef USE_PYTHON
611 coot::residue_spec_t residue_spec_from_py(PyObject *residue_in);
612 #endif
613 
614 // return a spec for the first residue with the given type.
615 // test the returned spec for unset_p().
616 //
617 coot::residue_spec_t get_residue_by_type(int imol, const std::string &residue_type);
618 
619 std::vector<coot::residue_spec_t> get_residue_specs_in_mol(int imol, const std::string &residue_type);
620 
621 #ifdef USE_PYTHON
622 // Always returns a list
623 PyObject *get_residue_specs_in_mol_py(int imol, const std::string &residue_type);
624 #endif
625 
626 #ifdef USE_GUILE
627 // return a residue spec or scheme false
628 SCM get_residue_by_type_scm(int, const std::string &residue_type);
629 #endif
630 #ifdef USE_PYTHON
631 // return a residue spec or Python False.
632 PyObject *get_residue_by_type_py(int, const std::string &residue_type);
633 #endif
634 
635 
636 /* ----------------------------------------------------------------------- */
637 /* Atom info */
638 /* ----------------------------------------------------------------------- */
639 
640 #ifdef USE_GUILE
641 SCM atom_info_string_scm(int imol, const char *chain_id, int resno,
648  const char *ins_code, const char *atname,
649  const char *altconf);
650 SCM molecule_to_pdb_string_scm(int imol);
651 #endif // USE_GUILE
652 
656 std::string resname_from_serial_number(int imol, const char *chain_id, int serial_num);
657 
659 std::string residue_name(int imol, const std::string &chain_id, int resno, const std::string &ins_code);
660 
664 //
665 int serial_number_from_residue_specs(int imol, const std::string &chain_id, int res_no, const std::string &ins_code);
666 
667 
668 #ifdef USE_GUILE
669 SCM residue_info(int imol, const char* chain_id, int resno, const char *ins_code);
681 SCM residue_name_scm(int imol, const char* chain_id, int resno, const char *ins_code);
682 
684 SCM chain_fragments_scm(int imol, short int screen_output_also);
685 
689 int add_molecule(SCM molecule_expression, const char *name);
690 
697 int clear_and_update_molecule(int molecule_number, SCM molecule_expression);
698 
709 SCM active_residue();
710 
720 
729 SCM closest_atom(int imol);
730 
741 
748 SCM residues_near_residue(int imol, SCM residue_in_scm, float radius);
749 
756 SCM residues_near_residues_scm(int imol, SCM residues_in, float radius);
757 
765 SCM residues_near_position_scm(int imol, SCM pos, float radius);
766 
769 void label_closest_atoms_in_neighbour_residues_scm(int imol, SCM residue_spec_scm, float radius);
770 
771 #endif /* USE_GUILE */
772 
776 void hydrogenate_region(float radius);
777 
779 void add_hydrogens_from_file(int imol, std::string pdb_with_Hs_file_name);
780 
781 /* Here the Python code for ATOM INFO */
782 
787 #ifdef USE_PYTHON
788 PyObject *atom_info_string_py(int imol, const char *chain_id, int resno,
789  const char *ins_code, const char *atname,
790  const char *altconf);
791 
795 PyObject *molecule_to_pdb_string_py(int imol);
796 
799 //
806 PyObject *residue_info_py(int imol, const char* chain_id, int resno, const char *ins_code);
807 PyObject *residue_name_py(int imol, const char* chain_id, int resno, const char *ins_code);
808 
809 // the expanded form of this is in c-interface.h
810 PyObject *residue_centre_from_spec_py(int imol,
811  PyObject *spec_py);
812 
813 PyObject *chain_fragments_py(int imol, short int screen_output_also);
814 
815 #ifdef USE_PYTHON
816 void set_b_factor_residues_py(int imol, PyObject *residue_specs_b_value_tuple_list_py);
817 #endif
818 
819 #ifdef USE_GUILE
820 void set_b_factor_residues_scm(int imol, SCM residue_specs_b_value_tuple_list_scm);
821 #endif
822 
824 
827 
828 // And going the other way, given an python-expression, update
829 // molecule_number by the given molecule. Clear what's currently
830 // there first though.
831 //
832 int clear_and_update_molecule_py(int molecule_number, PyObject *molecule_expression);
833 // return a molecule number, -1 on error
834 int add_molecule_py(PyObject *molecule_expression, const char *name);
835 
842 //
844 //
845 PyObject *active_residue_py();
846 
855 PyObject *closest_atom_simple_py();
856 
858 //
864 //
865 PyObject *closest_atom_py(int imol);
866 
874 PyObject *closest_atom_raw_py();
875 
876 
878 // Return residue specs for residues that have atoms that are
879 // closer than radius Angstroems to any atom in the residue
880 // specified by residue_in.
881 //
882 PyObject *residues_near_residue_py(int imol, PyObject *residue_in, float radius);
883 
885 // Return residue specs for residues that have atoms that are
886 // closer than radius Angstroems to any atom in the residues
887 // specified by residues_in.
888 //
889 PyObject *residues_near_residues_py(int imol, PyObject *residues_in, float radius);
890 
895 PyObject *residues_near_position_py(int imol, PyObject *pos_in, float radius);
896 
899 void label_closest_atoms_in_neighbour_residues_py(int imol, PyObject *residue_spec_py, float radius);
900 
902 //
903 PyObject *get_bonds_representation(int imol);
904 
906 //
907 PyObject *get_dictionary_radii();
908 
910 // the specified residue
911 PyObject *get_environment_distances_representation_py(int imol, PyObject *residue_spec_py);
912 
914 //
916 
917 #endif // USE_PYTHON
918 
920 //
921 // 0 means off, 1 means on.
922 // Given the current wiring of the refinement, this is always 0, i.e. refine_residues()
923 // will return only after the atoms have finished moving.
925 
926 
928 
931 // status bar atom info text here?!
932 std::string atom_info_as_text_for_statusbar(int atom_index, int imol);
933 std::string atom_info_as_text_for_statusbar(int atom_index, int imol,
934  const std::pair<symm_trans_t, Cell_Translation> &sts);
936 
937 
938 /* ----------------------------------------------------------------------- */
939 /* Refinement */
940 /* ----------------------------------------------------------------------- */
941 
944 
947 #ifdef USE_GUILE
949 #endif
950 #ifdef USE_PYTHON
951 PyObject *all_residues_with_serial_numbers_py(int imol);
952 #endif
953 
954 
958 void regularize_residues(int imol, const std::vector<coot::residue_spec_t> &residues);
959 
961 std::string mtz_file_name(int imol);
962 
963 #ifdef USE_GUILE
964 
968 SCM refine_zone_with_full_residue_spec_scm(int imol, const char *chain_id,
969  int resno1,
970  const char*inscode_1,
971  int resno2,
972  const char*inscode_2,
973  const char *altconf);
974 #endif // USE_GUILE
975 
976 #ifdef USE_PYTHON
977 PyObject *refine_zone_with_full_residue_spec_py(int imol, const char *chain_id,
978  int resno1,
979  const char*inscode_1,
980  int resno2,
981  const char*inscode_2,
982  const char *altconf);
983 #endif // USE_PYTHON
984 
985 void set_show_intermediate_atoms_rota_markup(short int state);
986 void set_show_intermediate_atoms_rama_markup(short int state);
987 
988 void set_cryo_em_refinement(bool mode);
989 bool get_cryo_em_refinement();
990 
991 #ifdef USE_GUILE
992 SCM accept_moving_atoms_scm();
993 #endif
994 #ifdef USE_PYTHON
995 PyObject *accept_moving_atoms_py();
996 #endif
997 
998 
999 #ifdef USE_PYTHON
1000 void register_post_intermediate_atoms_moved_hook(PyObject *function_name);
1001 #endif
1002 
1003 void set_regenerate_bonds_needs_make_bonds_type_checked(bool state);
1004 bool get_regenerate_bonds_needs_make_bonds_type_checked_state();
1005 
1007 
1008 
1009 /* ----------------------------------------------------------------------- */
1010 /* rigid body fitting (multiple residue ranges) */
1011 /* ----------------------------------------------------------------------- */
1012 
1016 int rigid_body_fit_with_residue_ranges(int imol, const std::vector<coot::residue_range_t> &ranges);
1017 
1018 // Model morphing (average the atom shift by using shifts of the
1019 // atoms within shift_average_radius A of the central residue).
1020 //
1021 // return 0 on fail to move atoms and 1 on fitting happened.
1022 //
1023 int morph_fit_all(int imol, float transformation_averaging_radius);
1024 
1026 int morph_fit_chain(int imol, std::string chain_id, float transformation_averaging_radius);
1027 #ifdef USE_GUILE
1028 int morph_fit_residues_scm(int imol, SCM residue_specs, float transformation_averaging_radius);
1029 #endif
1030 #ifdef USE_PYTHON
1031 int morph_fit_residues_py( int imol, PyObject *residue_specs, float transformation_averaging_radius);
1032 #endif
1033 int morph_fit_residues(int imol, const std::vector<coot::residue_spec_t> &residue_specs,
1035  float transformation_averaging_radius);
1036 
1039 int morph_fit_by_secondary_structure_elements(int imol, const std::string &chain_id);
1040 
1041 
1042 /* ----------------------------------------------------------------------- */
1043 /* check water baddies */
1044 /* ----------------------------------------------------------------------- */
1045 
1046 std::vector<coot::atom_spec_t>
1047 check_waters_baddies(int imol, float b_factor_lim, float map_sigma_lim, float min_dist, float max_dist, short int part_occ_contact_flag, short int zero_occ_flag, short int logical_operator_and_or_flag);
1048 
1049 // blobs, returning position and volume
1050 //
1051 std::vector<std::pair<clipper::Coord_orth, double> >
1052 find_blobs(int imol_model, int imol_map, float cut_off_density_level);
1053 
1054 #ifdef USE_GUILE
1055 SCM find_blobs_scm(int imol_model, int imol_map, float cut_off_density_level);
1057 #endif
1058 #ifdef USE_PYTHON
1059 PyObject *find_blobs_py(int imol_model, int imol_map, float cut_off_density_level);
1060 #endif
1061 
1063 void b_factor_distribution_graph(int imol);
1064 
1065 /* ----------------------------------------------------------------------- */
1066 /* water chain */
1067 /* ----------------------------------------------------------------------- */
1068 
1071 
1072 #ifdef USE_GUILE
1073 SCM water_chain_from_shelx_ins_scm(int imol);
1078 SCM water_chain_scm(int imol);
1079 #endif
1080 
1081 #ifdef USE_PYTHON
1082 /* return the chain id of the water chain from a shelx molecule. Raw interface.
1083 
1084 Return False if no chain or bad imol*/
1085 PyObject *water_chain_from_shelx_ins_py(int imol);
1087 PyObject *water_chain_py(int imol);
1088 #endif
1089 
1091 
1092 
1093 /* ----------------------------------------------------------------------- */
1094 /* glyco tools */
1095 /* ----------------------------------------------------------------------- */
1098 
1100 void
1101 print_glyco_tree(int imol, const std::string &chain_id, int resno, const std::string &ins_code);
1102 
1104 
1105 
1106 /* ----------------------------------------------------------------------- */
1107 /* variance map */
1108 /* ----------------------------------------------------------------------- */
1115 int make_variance_map(std::vector<int> map_molecule_number_vec);
1116 #ifdef USE_GUILE
1117 int make_variance_map_scm(SCM map_molecule_number_list);
1118 #endif
1119 #ifdef USE_PYTHON
1120 int make_variance_map_py(PyObject *map_molecule_number_list);
1121 #endif
1122 
1124 /* ----------------------------------------------------------------------- */
1125 /* spin search */
1126 /* ----------------------------------------------------------------------- */
1129 
1130 void spin_search_by_atom_vectors(int imol_map, int imol, const std::string &chain_id, int resno, const std::string &ins_code, const std::pair<std::string, std::string> &direction_atoms_list, const std::vector<std::string> &moving_atoms_list);
1131 #ifdef USE_GUILE
1132 void spin_search(int imol_map, int imol, const char *chain_id, int resno, const char *ins_code, SCM direction_atoms_list, SCM moving_atoms_list);
1143 void spin_N_scm(int imol, SCM residue_spec_scm, float angle);
1144 
1148 SCM CG_spin_search_scm(int imol_model, int imol_map);
1149 #endif
1150 
1151 #ifdef USE_PYTHON
1152 void spin_search_py(int imol_map, int imol, const char *chain_id, int resno, const char *ins_code, PyObject *direction_atoms_list, PyObject *moving_atoms_list);
1164 void spin_N_py(int imol, PyObject *residue_spec, float angle);
1165 
1167 PyObject *CG_spin_search_py(int imol_model, int imol_map);
1168 
1169 #endif
1170 
1172 
1173 
1174 /* ----------------------------------------------------------------------- */
1175 /* monomer lib */
1176 /* ----------------------------------------------------------------------- */
1177 std::vector<std::pair<std::string, std::string> > monomer_lib_3_letter_codes_matching(const std::string &search_string, short int allow_minimal_descriptions_flag);
1178 
1179 void on_monomer_lib_search_results_button_press (GtkButton *button, gpointer user_data);
1180 void on_monomer_lib_sbase_molecule_button_press (GtkButton *button, gpointer user_data);
1181 
1182 /* ----------------------------------------------------------------------- */
1183 /* mutate */
1184 /* ----------------------------------------------------------------------- */
1185 int mutate_internal(int ires, const char *chain_id,
1186  int imol, std::string &target_res_type);
1187 /* a function for multimutate to make a backup and set
1188  have_unsaved_changes_flag themselves */
1189 
1190 /* ----------------------------------------------------------------------- */
1191 /* ligands */
1192 /* ----------------------------------------------------------------------- */
1193 coot::graph_match_info_t
1194 overlap_ligands_internal(int imol_ligand, int imol_ref, const char *chain_id_ref,
1195  int resno_ref, bool apply_rtop_flag);
1196 
1197 
1198 /* ----------------------------------------------------------------------- */
1199 /* conformers (part of ligand search) */
1200 /* ----------------------------------------------------------------------- */
1201 
1202 #ifdef USE_GUILE
1203 
1210 
1212 SCM ligand_search_make_conformers_scm();
1213 #endif
1214 
1215 #ifdef USE_PYTHON
1216 PyObject *ligand_search_make_conformers_py();
1217 #endif
1218 
1219 std::vector<int> ligand_search_make_conformers_internal();
1220 
1222 
1223 /* ----------------------------------------------------------------------- */
1224 // animated ligand interactions
1225 /* ----------------------------------------------------------------------- */
1226 void add_animated_ligand_interaction(int imol, const coot::fle_ligand_bond_t &lb);
1227 
1228 
1229 /* ----------------------------------------------------------------------- */
1230 /* Cootaneer */
1231 /* ----------------------------------------------------------------------- */
1232 int cootaneer_internal(int imol_map, int imol_model, const coot::atom_spec_t &atom_spec);
1233 
1234 #ifdef USE_GUILE
1235 int cootaneer(int imol_map, int imol_model, SCM atom_in_fragment_atom_spec);
1244 #endif
1245 
1246 #ifdef USE_PYTHON
1247 int cootaneer_py(int imol_map, int imol_model, PyObject *atom_in_fragment_atom_spec);
1248 #endif
1249 
1251 
1252 /* ----------------------------------------------------------------------- */
1253 /* Sequence from Map */
1254 /* ----------------------------------------------------------------------- */
1255 
1263 std::string sequence_from_map(int imol, const std::string &chain_id,
1264  int resno_start, int resno_end, int imol_map);
1265 
1266 void apply_sequence_to_fragment(int imol, const std::string &chain_id, int resno_start, int resno_end,
1267  int imol_map, const std::string &file_name_for_sequences);
1268 
1269 void assign_sequence_to_active_fragment();
1270 
1272 
1273 /* ----------------------------------------------------------------------- */
1274 /* Generic Objects */
1275 /* ----------------------------------------------------------------------- */
1276 
1277 // return a clean name and a flag to say that this was something that
1278 // we were interested to make a graphics object from (rather than just
1279 // header info)
1280 std::pair<short int, std::string> is_interesting_dots_object_next_p(const std::vector<std::string> &vs);
1281 
1282 /* ----------------------------------------------------------------------- */
1283 /* Generic Functions */
1284 /* ----------------------------------------------------------------------- */
1285 #ifdef USE_GUILE
1286 SCM generic_string_vector_to_list_internal(const std::vector<std::string> &v);
1287 SCM generic_int_vector_to_list_internal(const std::vector<int> &v);
1288 std::vector<std::string> generic_list_to_string_vector_internal(SCM l);
1289 SCM rtop_to_scm(const clipper::RTop_orth &rtop);
1290 SCM inverse_rtop_scm(SCM rtop_scm);
1291 // expects an expr of length 5, ie: (list chain-id res-no ins-cod atom-name alt-conf)
1292 coot::atom_spec_t atom_spec_from_scm_expression(SCM expr);
1293 SCM atom_spec_to_scm(const coot::atom_spec_t &spec);
1294 #endif /* USE_GUILE */
1295 
1296 #ifdef USE_PYTHON
1297 PyObject *generic_string_vector_to_list_internal_py(const std::vector<std::string>&v);
1298 PyObject *generic_int_vector_to_list_internal_py(const std::vector<int> &v);
1299 std::vector<std::string> generic_list_to_string_vector_internal_py(PyObject *l);
1300 PyObject *rtop_to_python(const clipper::RTop_orth &rtop);
1301 PyObject *inverse_rtop_py(PyObject *rtop_py);
1302 coot::atom_spec_t atom_spec_from_python_expression(PyObject *expr);
1303 PyObject *atom_spec_to_py(const coot::atom_spec_t &spec);
1304 #endif // PYTHON
1305 
1306 void set_display_control_button_state(int imol, const std::string &button_type, int state);
1307 
1308 /* ----------------------------------------------------------------------- */
1309 /* Abstraction of New molecule by symmetry functions */
1310 /* ----------------------------------------------------------------------- */
1311 
1312 mmdb::Manager *new_molecule_by_symmetry_matrix_from_molecule(mmdb::Manager *mol,
1313  double m11, double m12, double m13,
1314  double m21, double m22, double m23,
1315  double m31, double m32, double m33,
1316  double tx, double ty, double tz,
1317  int pre_shift_to_origin_na,
1318  int pre_shift_to_origin_nb,
1319  int pre_shift_to_origin_nc);
1320 
1321 
1322 /* ----------------------------------------------------------------------- */
1323 /* LIBCURL/Download */
1324 /* ----------------------------------------------------------------------- */
1325 
1330  void get_coords_for_accession_code(const std::string &code);
1331 
1332 #ifdef USE_LIBCURL
1333 // return 0 on success.
1334 int coot_get_url(const char *url, const char *file_name);
1335 int coot_get_url_and_activate_curl_hook(const char *url, const char *file_name, short int do_hook_flag);
1336 #ifdef USE_GUILE
1337 // this handles URLs that are strings, not binaries.
1338 SCM coot_get_url_as_string(const char *url);
1339 // for the callback of the update binary progress bar. How much done
1340 // is the file that I am downloading?
1341 SCM curl_progress_info(const char *file_name);
1342 #endif /* USE_GUILE */
1343 #ifdef USE_PYTHON
1344 // this handles URLs that are strings, not binaries.
1345 PyObject *coot_get_url_as_string_py(const char *url);
1346 // for the callback of the update binary progress bar. How much done
1347 // is the file that I am downloading? Not absolutely required for python
1348 PyObject *curl_progress_info_py(const char *file_name);
1349 #endif /* USE_PYTHON */
1350 // internal use
1351 size_t write_coot_curl_data(void *buffer, size_t size, size_t nmemb, void *userp);
1352 // internal use
1353 size_t write_coot_curl_data_to_file(void *buffer, size_t size, size_t nmemb, void *userp);
1354 // internal use (strings, not binaries).
1355 std::string coot_get_url_as_string_internal(const char *url);
1356 void *wrapped_curl_easy_perform(void *data);
1357 void stop_curl_download(const char *file_name); // stop curling the to file_name;
1358 
1359 std::string get_drug_mdl_via_wikipedia_and_drugbank(std::string drugname);
1360 
1361 #endif /* USE_LIBCURL */
1362 
1363 
1364 /* ----------------------------------------------------------------------- */
1365 /* Functions for FLEV layout callbacks */
1366 /* ----------------------------------------------------------------------- */
1367 // orient the graphics somehow so that the interaction between
1368 // central_residue and neighbour_residue is perpendicular to screen z.
1369 void orient_view(int imol,
1370  const coot::residue_spec_t &central_residue_spec, // ligand typically
1371  const coot::residue_spec_t &neighbour_residue_spec);
1372 
1373 
1374 /* \brief return a list of chiral centre ids as determined from topological
1375  equivalence analysis based on the bond info (and element names). */
1376 std::vector<std::string>
1377 topological_equivalence_chiral_centres(const std::string &residue_type);
1378 
1379 
1380 
1381 
1382 /* ----------------------------------------------------------------------- */
1383 /* Pisa internal */
1384 /* ----------------------------------------------------------------------- */
1385 clipper::Coord_orth
1386 make_complementary_dotted_surfaces(int imol_1, int imol_2,
1387  std::vector<coot::residue_spec_t> &r1,
1388  std::vector<coot::residue_spec_t> &r2);
1389 #ifdef USE_GUILE
1390 std::vector<coot::residue_spec_t>
1391 residue_records_list_scm_to_residue_specs(SCM mol_1_residue_records,
1392  const std::string &chain_id);
1393 SCM symbol_value_from_record(SCM record_1, const std::string &symbol);
1394 #endif
1395 #ifdef USE_PYTHON
1396 std::vector<coot::residue_spec_t>
1397 residue_records_list_py_to_residue_specs(PyObject *mol_1_residue_records,
1398  const std::string &chain_id);
1399 //PyObject *symbol_value_from_record(PyObject *record_1, const std::string &symbol);
1400 #endif
1401 
1402 void
1403 add_generic_object_bond(int imol1, int imol2,
1404  const coot::atom_spec_t &atom_spec_1,
1405  const coot::atom_spec_t &atom_spec_2,
1406  int generic_object_number,
1407  const std::string &colour);
1408 
1409 void
1410 pisa_interfaces_display_only(int imol_1, int imol_2, clipper::Coord_orth centre_pt);
1411 std::string untangle_mmdb_chain_id_string(const std::string &mmdb_chain_id_in);
1412 
1413 
1414 /* ----------------------------------------------------------------------- */
1415 /* Return Rotamer score (don't touch the model) */
1416 /* ----------------------------------------------------------------------- */
1417 
1420 
1421 std::vector<coot::named_rotamer_score> score_rotamers(int imol,
1422  const char *chain_id,
1423  int res_no,
1424  const char *ins_code,
1425  const char *alt_conf,
1426  int imol_map,
1427  int clash_flag,
1428  float lowest_probability);
1429 
1430 #ifdef USE_GUILE
1431 //
1433 // The density fit score is for side-chain atoms.
1434 // return a list (possibly empty).
1435 //
1436 SCM score_rotamers_scm(int imol,
1437  const char *chain_id,
1438  int res_no,
1439  const char *ins_code,
1440  const char *alt_conf,
1441  int imol_map,
1442  int clash_flag,
1443  float lowest_probability);
1444 #endif
1445 
1446 #ifdef USE_PYTHON
1447 // return a list (possibly empty)
1448 PyObject *score_rotamers_py(int imol,
1449  const char *chain_id,
1450  int res_no,
1451  const char *ins_code,
1452  const char *alt_conf,
1453  int imol_map,
1454  int clash_flag,
1455  float lowest_probability);
1456 #endif
1457 
1459 
1460 /* ----------------------------------------------------------------------- */
1461 /* Use Cowtan's protein_db to discover loops */
1462 /* ----------------------------------------------------------------------- */
1464 /* \{ */
1466 // return in the first pair, the imol of the new molecule generated
1467 // from an atom selection of the imol_coords for the residue selection
1468 // of the loop and the molecule number of the consolidated solutions
1469 // (displayed in purple). and the second of the outer pair, there is
1470 // vector of molecule indices for each of the candidate loops.
1471 //
1472 // return -1 in the first of the pair on failure
1473 //
1474 std::pair<std::pair<int, int> , std::vector<int> >
1475 protein_db_loops(int imol_coords,
1476  const std::vector<coot::residue_spec_t> &residue_specs,
1477  int imol_map, int nfrags, bool preserve_residue_names);
1478 // so that we can create a "original loop" molecule from the atom
1479 // specs picked (i.e. the atom selection string should extend over the
1480 // range from the smallest residue number to the largest (in the same
1481 // chain)).
1482 std::string
1483 protein_db_loop_specs_to_atom_selection_string(const std::vector<coot::residue_spec_t> &specs);
1484 #ifdef USE_GUILE
1485 SCM protein_db_loops_scm(int imol_coords, SCM residues_specs, int imol_map, int nfrags, bool preserve_residue_names);
1486 #endif
1487 #ifdef USE_PYTHON
1488 PyObject *protein_db_loops_py(int imol_coords, PyObject *residues_specs, int imol_map, int nfrags, bool preserve_residue_names);
1489 #endif
1490 /* \} */
1491 
1492 
1493 /* ------------------------------------------------------------------------- */
1494 /* HOLE */
1495 /* ------------------------------------------------------------------------- */
1505 void hole(int imol,
1506  float start_x, float start_y, float start_z,
1507  float end_x, float end_y, float end_z,
1508  float colour_map_multiplier, float colour_map_offset,
1509  int n_runs, bool show_probe_radius_graph_flag,
1510  std::string export_surface_dots_file_name);
1511 
1512 
1513 // GUI stuff
1514 void probe_radius_graph_close_callback( GtkWidget *button,
1515  GtkWidget *dialog);
1516 void show_hole_probe_radius_graph(const std::vector<std::pair<clipper::Coord_orth, double> > &hole_path, double path_length);
1517 void show_hole_probe_radius_graph_basic(const std::vector<std::pair<clipper::Coord_orth, double> > &hole_path, double path_length);
1518 void show_hole_probe_radius_graph_goocanvas(const std::vector<std::pair<clipper::Coord_orth, double> > &hole_path, double path_length);
1519 
1520 
1521 /* ------------------------------------------------------------------------- */
1522 /* LINKs */
1523 /* ------------------------------------------------------------------------- */
1524 
1526 void
1527 make_link(int imol, coot::atom_spec_t &spec_1, coot::atom_spec_t &spec_2,
1528  const std::string &link_name, float length);
1529 #ifdef USE_GUILE
1530 void make_link_scm(int imol, SCM spec_1, SCM spec_2, const std::string&link_name, float length);
1531 // return a list of the links in the given molecule.
1532 // will return an empty list for non-valid (i.e. non-model) molecules
1533 //
1534 SCM link_info_scm(int imol);
1535 #endif
1536 #ifdef USE_PYTHON
1537 void make_link_py(int imol, PyObject *spec_1, PyObject *spec_2, const std::string&link_name, float length);
1538 // return a list of the links in the given molecule.
1539 // will return an empty list for non-valid (i.e. non-model) molecules
1540 //
1541 PyObject *link_info_py(int imol);
1542 #endif
1543 
1544 
1545 /* ------------------------------------------------------------------------- */
1546 /* Drag and drop */
1547 /* ------------------------------------------------------------------------- */
1548 
1550 // \{
1552 int handle_drag_and_drop_string(const std::string &uri);
1553 // \}
1554 
1555 
1556 /* ------------------------------------------------------------------------- */
1557 /* Map Contours */
1558 /* ------------------------------------------------------------------------- */
1559 
1562 #ifdef USE_PYTHON
1563 // \{
1565 PyObject *map_contours(int imol, float contour_level);
1566 // \}
1567 #endif // USE_PYTHON
1568 
1570 void set_radial_map_colouring_centre(int imol, float x, float y, float z);
1571 
1573 void set_radial_map_colouring_min_radius(int imol, float r);
1574 
1576 void set_radial_map_colouring_max_radius(int imol, float r);
1577 
1579 void set_radial_map_colouring_invert(int imol, int invert_state);
1580 
1584 void set_radial_map_colouring_saturation(int imol, float saturation);
1585 
1586 
1587 
1588 /* ------------------------------------------------------------------------- */
1589 /* correlation maps */
1590 /* ------------------------------------------------------------------------- */
1591 
1594 
1595 
1597 // functions, let's set it here (default is 1.5A)
1598 //
1599 void set_map_correlation_atom_radius(float r);
1600 
1601 // Don't count the grid points of residues_specs that are in grid
1602 // points of (potentially overlapping) neighbour_residue_spec.
1603 //
1604 #ifdef USE_GUILE
1605 // 0: all-atoms
1607 // 1: main-chain atoms if is standard amino-acid, else all atoms
1608 // 2: side-chain atoms if is standard amino-acid, else all atoms
1609 // 3: side-chain atoms-excluding CB if is standard amino-acid, else all atoms
1610 // 4: main-chain atoms if is standard amino-acid, else nothing
1611 // 5: side-chain atoms if is standard amino-acid, else nothing
1612 // 10: atom radius is dependent atom atom B-factor
1613 SCM map_to_model_correlation_scm(int imol,
1614  SCM residue_specs,
1615  SCM neighb_residue_specs,
1616  unsigned short int atom_mask_mode,
1617  int imol_map);
1618 SCM map_to_model_correlation_stats_scm(int imol,
1619  SCM residue_specs,
1620  SCM neighb_residue_specs,
1621  unsigned short int atom_mask_mode,
1622  int imol_map);
1623 #endif
1624 
1625 #ifdef USE_PYTHON
1626 PyObject *map_to_model_correlation_py(int imol,
1627  PyObject *residue_specs,
1628  PyObject *neighb_residue_specs,
1629  unsigned short int atom_mask_mode,
1630  int imol_map);
1631 PyObject *map_to_model_correlation_stats_py(int imol,
1632  PyObject *residue_specs,
1633  PyObject *neighb_residue_specs,
1634  unsigned short int atom_mask_mode,
1635  int imol_map);
1636 
1637 PyObject *
1638 map_to_model_correlation_stats_per_residue_range_py(int imol,
1639  const std::string &chain_id,
1640  int imol_map,
1641  unsigned int n_residue_per_residue_range,
1642  short int exclude_NOC_flag);
1643 
1644 #endif
1645 
1647 // 0: all-atoms
1648 // 1: main-chain atoms if is standard amino-acid, else all atoms
1649 // 2: side-chain atoms if is standard amino-acid, else all atoms
1650 // 3: side-chain atoms-excluding CB if is standard amino-acid, else all atoms
1651 // 4: main-chain atoms if is standard amino-acid, else nothing
1652 // 5: side-chain atoms if is standard amino-acid, else nothing
1653 // 10: atom radius is dependent atom atom B-factor
1654 float
1655 map_to_model_correlation(int imol,
1656  const std::vector<coot::residue_spec_t> &residue_specs,
1657  const std::vector<coot::residue_spec_t> &neigh_residue_specs,
1658  unsigned short int atom_mask_mode,
1659  int imol_map);
1660 
1664 // 0: all-atoms
1665 // 1: main-chain atoms if is standard amino-acid, else all atoms
1666 // 2: side-chain atoms if is standard amino-acid, else all atoms
1667 // 3: side-chain atoms-excluding CB if is standard amino-acid, else all atoms
1668 // 4: main-chain atoms if is standard amino-acid, else nothing
1669 // 5: side-chain atoms if is standard amino-acid, else nothing
1670 //
1671 coot::util::density_correlation_stats_info_t
1673  const std::vector<coot::residue_spec_t> &residue_specs,
1674  const std::vector<coot::residue_spec_t> &neigh_residue_specs,
1675  unsigned short int atom_mask_mode,
1676  int imol_map);
1677 #ifndef SWIG
1678 
1682 // 0: all-atoms
1683 // 1: main-chain atoms if is standard amino-acid, else all atoms
1684 // 2: side-chain atoms if is standard amino-acid, else all atoms
1685 // 3: side-chain atoms-excluding CB if is standard amino-acid, else all atoms
1686 // 4: main-chain atoms if is standard amino-acid, else nothing
1687 // 5: side-chain atoms if is standard amino-acid, else nothing
1688 //
1689 std::vector<std::pair<coot::residue_spec_t,float> >
1690 map_to_model_correlation_per_residue(int imol, const std::vector<coot::residue_spec_t> &specs,
1691  unsigned short int atom_mask_mode,
1692  int imol_map);
1693 
1695 std::map<coot::residue_spec_t, coot::util::density_stats_info_t>
1697  const std::vector<coot::residue_spec_t> &residue_specs,
1698  unsigned short int atom_mask_mode,
1699  float atom_radius_for_masking,
1700  int imol_map);
1701 
1706 std::pair<std::map<coot::residue_spec_t, coot::util::density_correlation_stats_info_t>,
1707  std::map<coot::residue_spec_t, coot::util::density_correlation_stats_info_t> >
1708 map_to_model_correlation_stats_per_residue_range(int imol, const std::string &chain_id, int imol_map,
1709  unsigned int n_residue_per_residue_range,
1710  short int exclude_NOC_flag);
1711 
1712 #endif // not for swigging.
1713 
1714 #ifdef USE_GUILE
1715 SCM
1717 map_to_model_correlation_per_residue_scm(int imol, SCM residue_specs,
1718  unsigned short int atom_mask_mode,
1719  int imol_map);
1720 
1722 SCM
1724  SCM residue_specs_scm,
1725  unsigned short int atom_mask_mode,
1726  float atom_radius_for_masking,
1727  int imol_map);
1728 
1729 SCM map_to_model_correlation_stats_per_residue_range_scm(int imol, const std::string &chain_id, int imol_map,
1730  unsigned int n_residue_per_residue_range,
1731  short int exclude_NOC_flag);
1732 
1733 
1737 // 0: all-atoms
1738 // 1: main-chain atoms if is standard amino-acid, else all atoms
1739 // 2: side-chain atoms if is standard amino-acid, else all atoms
1740 // 3: side-chain atoms-excluding CB if is standard amino-acid, else all atoms
1741 // 4: main-chain atoms if is standard amino-acid, else nothing
1742 // 5: side-chain atoms if is standard amino-acid, else nothing
1743 //
1744 SCM qq_plot_map_and_model_scm(int imol,
1745  SCM residue_specs_scm,
1746  SCM neigh_residue_specs_scm,
1747  unsigned short int atom_mask_mode,
1748  int imol_map);
1749 #endif
1750 
1751 #ifdef USE_PYTHON
1752 PyObject *map_to_model_correlation_per_residue_py(int imol, PyObject *residue_specs,
1753  unsigned short int atom_mask_mode,
1754  int imol_map);
1755 PyObject *qq_plot_map_and_model_py(int imol,
1756  PyObject *residue_specs_py,
1757  PyObject *neigh_residue_specs_py,
1758  unsigned short int atom_mask_mode,
1759  int imol_map);
1760 #endif
1761 
1762 #ifdef __cplusplus
1763 #ifdef USE_GUILE
1764 float density_score_residue_scm(int imol, SCM residue_spec, int imol_map);
1765 #endif
1766 #ifdef USE_PYTHON
1767 float density_score_residue_py(int imol, PyObject *residue_spec, int imol_map);
1768 #endif
1769 #endif
1770 
1772 float density_score_residue(int imol, const char *chain_id, int res_no, const char *ins_code, int imol_map);
1773 
1774 
1775 #ifdef USE_GUILE
1776 
1778 SCM map_mean_scm(int imol);
1779 SCM map_sigma_scm(int imol);
1781 SCM map_statistics_scm(int imol);
1782 #endif
1783 #ifdef USE_PYTHON
1784 
1786 PyObject *map_mean_py(int imol);
1787 PyObject *map_sigma_py(int imol);
1788 PyObject *map_statistics_py(int imol);
1789 #endif /*USE_PYTHON */
1790 
1791 
1793 
1794 /* ----------------------------------------------------------------------- */
1795 /* sequence (assignment) */
1796 /* ----------------------------------------------------------------------- */
1797 /* section Get Sequence */
1799 /* \{ */
1801 std::string get_sequence_as_fasta_for_chain(int imol, const std::string &chain_id);
1802 
1804 void write_sequence(int imol, const std::string &file_name);
1805 
1806 /* \} */
1807 
1808 
1809 /* ------------------------------------------------------------------------- */
1810 /* interesting positions list */
1811 /* ------------------------------------------------------------------------- */
1812 #ifdef USE_GUILE
1813 void register_interesting_positions_list_scm(SCM pos_list);
1814 #endif // USE_GUILE
1815 #ifdef USE_PYTHON
1816 void register_interesting_positions_list_py(PyObject *pos_list);
1817 #endif // USE_PYTHON
1818 
1819 /* ------------------------------------------------------------------------- */
1820 /* all-molecule atom overlaps */
1821 /* ------------------------------------------------------------------------- */
1822 #ifdef USE_PYTHON
1823 PyObject *molecule_atom_overlaps_py(int imol);
1824 #endif // USE_PYTHON
1825 #ifdef USE_GUILE
1826 SCM molecule_atom_overlaps_scm(int imol);
1827 #endif // USE_GUILE
1828 
1829 /* ------------------------------------------------------------------------- */
1830 /* prodrg import function */
1831 /* ------------------------------------------------------------------------- */
1832 //
1838 //
1839 void prodrg_import_function(std::string file_name, std::string comp_id);
1840 
1841 
1842 
1843 /* ------------------------------------------------------------------------- */
1844 /* SBase import function */
1845 /* ------------------------------------------------------------------------- */
1846 //
1852 //
1853 void sbase_import_function(std::string comp_id);
1854 
1855 /* ------------------------------------------------------------------------- */
1856 /* Alignment functions (now C++) */
1857 /* ------------------------------------------------------------------------- */
1858 
1867 std::pair<int, std::string>
1868 align_to_closest_chain(std::string target_seq, float match_fraction);
1869 
1870 #ifdef __cplusplus/* protection from use in callbacks.c, else compilation probs */
1871 #ifdef USE_PYTHON
1872 PyObject *align_to_closest_chain_py(std::string target_seq, float match_fraction);
1873 #endif /* USE_PYTHON */
1874 #ifdef USE_GUILE
1875 SCM align_to_closest_chain_scm(std::string target_seq, float match_fraction);
1876 #endif /* USE_GUILE */
1877 #endif /* c++ */
1878 
1879 
1880 #ifdef __cplusplus/* protection from use in callbacks.c, else compilation probs */
1881 #ifdef USE_GUILE
1882 SCM spherical_density_overlap(SCM i_scm, SCM j_scm);
1883 #endif // USE_GUILE
1884 #endif // __cplusplus
1885 
1886 void resolve_clashing_sidechains_by_deletion(int imol);
1887 
1888 void resolve_clashing_sidechains_by_rebuilding(int imol);
1889 
1890 /* ----------------------------------------------------------------------- */
1891 /* GUIL Utility Functions */
1892 /* ----------------------------------------------------------------------- */
1894 void simple_text_dialog(const std::string &dialog_title, const std::string &text,
1895  int geom_x, int geom_y);
1896 
1897 
1898 /* ----------------------------------------------------------------------- */
1899 /* Phenix Functions */
1900 /* ----------------------------------------------------------------------- */
1902 void graphics_to_phenix_geo_representation(int imol, int mode,
1903  const coot::phenix_geo_bonds &g);
1905 void graphics_to_phenix_geo_representation(int imol, int mode,
1906  const std::string &geo_file_name);
1907 
1908 /* ----------------------------------------------------------------------- */
1909 /* Client/Server */
1910 /* ----------------------------------------------------------------------- */
1912 #ifdef USE_PYTHON
1913 void set_python_draw_function(const std::string &command_string);
1914 #endif // USE_PYTHON
1915 
1916 
1917 /* ----------------------------------------------------------------------- */
1918 /* Pathology Plots */
1919 /* ----------------------------------------------------------------------- */
1920 #ifdef USE_PYTHON
1921 PyObject *pathology_data(const std::string &mtz_file_name,
1922  const std::string &fp_col,
1923  const std::string &sigfp_col);
1924 #endif // USE_PYTHON
1925 
1926 /* ----------------------------------------------------------------------- */
1927 /* Utility Functions */
1928 /* ----------------------------------------------------------------------- */
1929 
1932 // These functions are for storing the molecule number and (some other
1933 // number) as an int and used with GPOINTER_TO_INT and GINT_TO_POINTER.
1934 int encode_ints(int i1, int i2);
1935 std::pair<int, int> decode_ints(int i);
1936 
1938 void store_keyed_user_name(std::string key, std::string user_name, std::string passwd);
1939 
1940 #ifdef USE_GUILE
1941 std::vector<coot::residue_spec_t> scm_to_residue_specs(SCM s);
1942 // and that backwards is scm_residue() above.
1943 int key_sym_code_scm(SCM s_scm);
1944 #endif // USE_GUILE
1945 #ifdef USE_PYTHON
1946 std::vector<coot::residue_spec_t> py_to_residue_specs(PyObject *s);
1947 int key_sym_code_py(PyObject *po);
1948 #endif // USE_PYTHON
1949 #ifdef USE_GUILE
1950 #ifdef USE_PYTHON
1951 PyObject *scm_to_py(SCM s);
1952 SCM py_to_scm(PyObject *o);
1953 #endif // USE_GUILE
1954 #endif // USE_PYTHON
1955 
1956 #ifdef USE_GUILE
1957 clipper::Spacegroup scm_symop_strings_to_space_group(SCM symop_string_list);
1958 #endif
1959 
1960 #ifdef USE_PYTHON
1961 clipper::Spacegroup py_symop_strings_to_space_group(PyObject *symop_string_list);
1962 #endif
1963 
1964 #endif // CC_INTERFACE_HH
int serial_number_from_residue_specs(int imol, const std::string &chain_id, int res_no, const std::string &ins_code)
return the serial number of the specified residue
void set_radial_map_colouring_centre(int imol, float x, float y, float z)
radial map colouring centre
SCM residues_near_residues_scm(int imol, SCM residues_in, float radius)
return residues near the given residues
void go_to_map_molecule_centre(int imol_map)
Go to the centre of the molecule - for Cryo-EM Molecules.
*PyObject * atom_info_string_py(int imol, const char *chain_id, int resno, const char *ins_code, const char *atname, const char *altconf)
output atom info in a python list for use in scripting:
std::vector< int > auto_read_make_and_draw_maps(const char *filename)
read MTZ file filename and from it try to make maps
int sharpen_blur_map_with_resampling(int imol_map, float b_factor, float resample_factor)
make a sharpened or blurred map with resampling
int sharpen_blur_map(int imol_map, float b_factor)
make a sharpened or blurred map
SCM closest_atom_raw_scm()
return the specs of the closest atom to the centre of the screen
PyObject * get_bonds_representation(int imol)
return a Python object for the bonds
PyObject * closest_atom_simple_py()
return the spec of the closest displayed atom
std::string residue_name(int imol, const std::string &chain_id, int resno, const std::string &ins_code)
return the residue name of the specified residue
float b_factor_from_map(int imol_map)
b-factor from map
SCM CG_spin_search_scm(int imol_model, int imol_map)
Spin search the density based on possible positions of CG of a side-chain.
void write_sequence(int imol, const std::string &file_name)
write the sequence for imol as fasta
PyObject * water_chain_py(int imol)
return the chain id of the water chain. Raw interface
int rigid_body_fit_with_residue_ranges(int imol, const std::vector< coot::residue_range_t > &ranges)
return 0 on fail to refine (no sensible place to put atoms) and 1 on fitting happened.
void add_hydrogens_from_file(int imol, std::string pdb_with_Hs_file_name)
Add hydrogens to imol from the given pdb file.
*SCM set_monomer_restraints(const char *monomer_type, SCM restraints)
set the monomer restraints of the given monomer_type
int read_ccp4_map(const std::string &filename, int is_diff_map_flag)
read a CCP4 map or a CNS map (despite the name).
SCM residue_info(int imol, const char *chain_id, int resno, const char *ins_code)
Return a list of atom info for each atom in the specified residue.
void spin_N_scm(int imol, SCM residue_spec_scm, float angle)
Spin N and CB (and the rest of the side chain if extant)
str mtime for for attributes
Definition: cc-interface.hh:427
std::string get_sequence_as_fasta_for_chain(int imol, const std::string &chain_id)
get the sequence for chain_id in imol
void regularize_residues(int imol, const std::vector< coot::residue_spec_t > &residues)
regularize the given residues
void spin_search_py(int imol_map, int imol, const char *chain_id, int resno, const char *ins_code, PyObject *direction_atoms_list, PyObject *moving_atoms_list)
for the given residue, spin the atoms in moving_atom_list...
std::pair< std::map< coot::residue_spec_t, coot::util::density_correlation_stats_info_t >, std::map< coot::residue_spec_t, coot::util::density_correlation_stats_info_t > > map_to_model_correlation_stats_per_residue_range(int imol, const std::string &chain_id, int imol_map, unsigned int n_residue_per_residue_range, short int exclude_NOC_flag)
map to model density statistics, reported per residue, the middle residue of a range of residues ...
void store_keyed_user_name(std::string key, std::string user_name, std::string passwd)
store username and password for the database.
SCM score_rotamers_scm(int imol, const char *chain_id, int res_no, const char *ins_code, const char *alt_conf, int imol_map, int clash_flag, float lowest_probability)
return the scores of the rotamers for this residue.
std::string refmac_name(int imol)
the name for refmac
void b_factor_distribution_graph(int imol)
B-factor distribution histogram.
SCM water_chain_scm(int imol)
return the chain id of the water chain. Raw interface
SCM map_colour_components(int imol)
return the colour triple of the imolth map
SCM map_to_model_correlation_stats_per_residue_scm(int imol, SCM residue_specs_scm, unsigned short int atom_mask_mode, float atom_radius_for_masking, int imol_map)
map to model stats
std::pair< int, std::string > align_to_closest_chain(std::string target_seq, float match_fraction)
align sequence to closest chain (compare across all chains in all molecules).
void label_closest_atoms_in_neighbour_residues_scm(int imol, SCM residue_spec_scm, float radius)
label the closest atoms in the residues that neighbour residue_spec
int morph_fit_by_secondary_structure_elements(int imol, const std::string &chain_id)
morph transformation are based primarily on rigid body refinement of the secondary structure elements...
int merge_fragments(int imol)
each fragment is presumed to be in its own chain.
int add_molecule(SCM molecule_expression, const char *name)
generate a molecule from an s-expression
PyObject * get_environment_distances_representation_py(int imol, PyObject *residue_spec_py)
return a Python object for the representation of bump and hydrogen bonds of
void spin_N_py(int imol, PyObject *residue_spec, float angle)
Spin N and CB (and the rest of the side chain if extant)
PyObject * map_contours(int imol, float contour_level)
return two lists: a list of vertices and a list of indices for connection
void print_glyco_tree(int imol, const std::string &chain_id, int resno, const std::string &ins_code)
print the glycosylation tree that contains the specified residue
SCM multi_residue_torsion_fit_scm(int imol, SCM residues_specs_scm, int n_trials)
fit residues
float density_score_residue(int imol, const char *chain_id, int res_no, const char *ins_code, int imol_map)
simple density score for given residue (over-ridden by scripting function)
PyObject * map_colour_components_py(int imol)
return the colour triple of the imolth map
pisa internal function
Definition: cc-interface.hh:71
int handle_drag_and_drop_string(const std::string &uri)
handle the string that get when a file or URL is dropped.
SCM find_blobs_scm(int imol_model, int imol_map, float cut_off_density_level)
find blobs
void prodrg_import_function(std::string file_name, std::string comp_id)
import given mdl file into prodrg or other 3d generation program
void set_radial_map_colouring_invert(int imol, int invert_state)
radial map colouring inverted colour map
SCM dictionaries_read()
return a list of all the dictionaries read
PyObject * map_mean_py(int imol)
return sigma for the given map. Return Python False if not a valid map molecule number.
alias path
Definition: cc-interface.hh:58
std::pair< std::pair< int, int >, std::vector< int > > protein_db_loops(int imol_coords, const std::vector< coot::residue_spec_t > &residue_specs, int imol_map, int nfrags, bool preserve_residue_names)
Cowtan&#39;s protein_db loops.
void sbase_import_function(std::string comp_id)
import molecule from CCP4 SRS (or SBase, as it used to be called).
int analyse_map_point_density_change(const std::vector< int > &map_number_list)
test function for analysis of multiple map
SCM map_to_model_correlation_scm(int imol, SCM residue_specs, SCM neighb_residue_specs, unsigned short int atom_mask_mode, int imol_map)
atom-mask-mode is as follows:
int encode_ints(int i1, int i2)
encoding of ints
std::map< coot::residue_spec_t, coot::util::density_stats_info_t > map_to_model_correlation_stats_per_residue(int imol, const std::vector< coot::residue_spec_t > &residue_specs, unsigned short int atom_mask_mode, float atom_radius_for_masking, int imol_map)
map to model density statistics, reported per residue
SCM map_to_model_correlation_per_residue_scm(int imol, SCM residue_specs, unsigned short int atom_mask_mode, int imol_map)
map to model correlation
std::vector< int > auto_read_make_and_draw_maps_from_mtz(const char *filename)
set the flag to do a difference map (too) on auto-read MTZ
PyObject * active_residue_py()
Return a list of [imol, chain-id, resno, ins-code, atom-name, alt-conf] for atom that is closest to t...
*SCM get_symmetry(int imol)
return the symmetry of the imolth molecule
float map_to_model_correlation(int imol, const std::vector< coot::residue_spec_t > &residue_specs, const std::vector< coot::residue_spec_t > &neigh_residue_specs, unsigned short int atom_mask_mode, int imol_map)
atom-mask-mode is as follows:
void set_radial_map_colouring_min_radius(int imol, float r)
radial map colouring min
void simple_text_dialog(const std::string &dialog_title, const std::string &text, int geom_x, int geom_y)
make a simple text dialog.
void spin_search(int imol_map, int imol, const char *chain_id, int resno, const char *ins_code, SCM direction_atoms_list, SCM moving_atoms_list)
for the given residue, spin the atoms in moving_atom_list around the bond defined by direction_atoms_...
void set_python_draw_function(const std::string &command_string)
client/server functions
PyObject * residue_info_py(int imol, const char *chain_id, int resno, const char *ins_code)
Return a list of atom info for each atom in the specified residue:
void set_map_correlation_atom_radius(float r)
The atom radius is not passed as a parameter to correlation.
void set_radial_map_colouring_max_radius(int imol, float r)
radial map colouring max
PyObject * CG_spin_search_py(int imol_model, int imol_map)
Spin search the density based on possible positions of CG of a side-chain.
PyObject * get_intermediate_atoms_bonds_representation()
return a Python object for the intermediate atoms bonds
PyObject * closest_atom_py(int imol)
return closest atom in imolth molecule
int handle_read_ccp4_map(const std::string &filename, int is_diff_map_flag)
same function as above - old name for the function. Deleted from the API at some stage ...
void multi_sharpen_blur_map_scm(int imol_map, SCM b_factors_list)
make many sharpened or blurred maps
void get_coords_for_accession_code(const std::string &code)
if possible, read in the new coords getting coords via web.
PyObject * closest_atom_raw_py()
return the specs of the closest atom to the centre of the screen
SCM residues_near_residue(int imol, SCM residue_in_scm, float radius)
return residues near residue
SCM all_residues_with_serial_numbers_scm(int imol)
a utility to return the specs of all the residues, each spec prefixed by the serial number ...
SCM closest_atom_simple_scm()
return the specs of the closest displayed atom
SCM closest_atom(int imol)
return the specs of the closest atom in imolth molecule
int morph_fit_residues(int imol, const std::vector< coot::residue_spec_t > &residue_specs, float transformation_averaging_radius)
morph the given residues.
int flip_hand(int imol_map)
Flip the hand of the map.
std::string resname_from_serial_number(int imol, const char *chain_id, int serial_num)
return the rename from a residue serial number
PyObject * multi_residue_torsion_fit_py(int imol, PyObject *residues_specs_py, int n_trials)
fit residues
trivial helper function for file attributes
Definition: cc-interface.hh:439
void execute_refmac_real(std::string pdb_in_filename, std::string pdb_out_filename, std::string mtz_in_filename, std::string mtz_out_filename, std::string cif_lib_filename, std::string fobs_col_name, std::string sigfobs_col_name, std::string r_free_col_name, short int have_sensible_free_r_flag, short int make_molecules_flag, std::string refmac_count_string, int swap_map_colours_post_refmac_flag, int imol_refmac_map, int diff_map_flag, int phase_combine_flag, std::string phib_string, std::string fom_string, std::string ccp4i_project_dir)
if swap_map_colours_post_refmac_flag is not 1 thenn imol_refmac_map is ignored.
void label_closest_atoms_in_neighbour_residues_py(int imol, PyObject *residue_spec_py, float radius)
label the closest atoms in the residues that neighbour residue_spec
SCM active_residue()
return specs of the atom close to screen centre
void set_rotation_centre(float x, float y, float z)
set the rotation centre
SCM residues_near_position_scm(int imol, SCM pos, float radius)
residues near residue
int clashes_with_symmetry(int imol, const char *chain_id, int res_no, const char *ins_code, float clash_dist)
return 1 if this residue clashes with the symmetry-related atoms of the same molecule.
int morph_fit_chain(int imol, std::string chain_id, float transformation_averaging_radius)
Morph the given chain.
int get_continue_updating_refinement_atoms_state()
return the continue-updating-refinement-atoms state
std::vector< std::pair< coot::residue_spec_t, float > > map_to_model_correlation_per_residue(int imol, const std::vector< coot::residue_spec_t > &specs, unsigned short int atom_mask_mode, int imol_map)
map to model density correlation, reported per residue
void hole(int imol, float start_x, float start_y, float start_z, float end_x, float end_y, float end_z, float colour_map_multiplier, float colour_map_offset, int n_runs, bool show_probe_radius_graph_flag, std::string export_surface_dots_file_name)
starting piont and end point, colour map multiplier and shall the probe radius graph be shown (dummy ...
int clear_and_update_molecule(int molecule_number, SCM molecule_expression)
update a molecule from a s-expression
SCM water_chain_from_shelx_ins_scm(int imol)
return the chain id of the water chain from a shelx molecule. Raw interface
void multi_sharpen_blur_map_py(int imol_map, PyObject *b_factors_list)
make many sharpened or blurred maps
void hydrogenate_region(float radius)
find the active residue, find the near residues (within radius) create a new molecule, run reduce on that, import hydrogens from the result and apply them to the molecule of the active residue.
SCM chain_fragments_scm(int imol, short int screen_output_also)
chain fragments
std::string mtz_file_name(int imol)
presumes that imol_Refinement_Map has been set
void graphics_to_phenix_geo_representation(int imol, int mode, const coot::phenix_geo_bonds &g)
phenix GEO bonds representation
PyObject * get_dictionary_radii()
return a Python object for the radii of the atoms in the dictionary
coot::util::density_correlation_stats_info_t map_to_model_correlation_stats(int imol, const std::vector< coot::residue_spec_t > &residue_specs, const std::vector< coot::residue_spec_t > &neigh_residue_specs, unsigned short int atom_mask_mode, int imol_map)
map to model density correlation stats
SCM qq_plot_map_and_model_scm(int imol, SCM residue_specs_scm, SCM neigh_residue_specs_scm, unsigned short int atom_mask_mode, int imol_map)
QQ plot of the model density correlation, reported per residue.
SCM refine_zone_with_full_residue_spec_scm(int imol, const char *chain_id, int resno1, const char *inscode_1, int resno2, const char *inscode_2, const char *altconf)
Refine the given residue range.
void set_radial_map_colouring_saturation(int imol, float saturation)
radial map colouring saturation
SCM map_statistics_scm(int imol)
return either scheme false on non-a-map or list (mean, standard-deviation, skew, kurtosis) ...
PyObject * molecule_to_pdb_string_py(int imol)
Return the molecule as a PDB string.
SCM map_mean_scm(int imol)
return sigma for the given map. Return scheme False if not a valid map molecule number.
void make_link(int imol, coot::atom_spec_t &spec_1, coot::atom_spec_t &spec_2, const std::string &link_name, float length)
make a link between the specified atoms
PyObject * residues_near_position_py(int imol, PyObject *pos_in, float radius)
Return residue specs for residues that have atoms that are closer than radius Angstroems to the given...