Coot Scripting Interface  7000
c-interface-ligands-swig.hh
Go to the documentation of this file.
1 
2 
3 #ifndef C_INTERFACE_LIGANDS_SWIG_HH
4 #define C_INTERFACE_LIGANDS_SWIG_HH
5 
6 #ifdef USE_PYTHON
7 #include "Python.h"
8 #endif
9 
10 #include "probe-clash-score.hh"
11 #include "ligand-check.hh"
12 
17 // We don't need to SWIG this one...
18 #ifndef SWIG
19 std::pair<mmdb::Residue *, int>
20 new_molecule_sans_biggest_ligand(int imol);
21 #endif
22 
23 // return a new molecule number
24 int get_monomer_molecule_by_network_and_dict_gen(const std::string &text);
25 
26 
27 #ifdef USE_GUILE
28 // Create a new molecule, which is a copy of this molecule without the
29 // biggest hetgroup.
30 //
31 // return a list of the new molecule number and the spec of the removed residue
32 // (or scheme false).
33 //
34 SCM new_molecule_sans_biggest_ligand_scm(int imol);
35 void gui_ligand_metrics_scm(SCM ligand_spec, SCM ligand_metrics, double percentile_limit);
36 
37 #endif
38 
39 #ifdef USE_PYTHON
40 PyObject *new_molecule_sans_biggest_ligand_py(int imol);
41 void gui_ligand_metrics_py(PyObject *ligand_spec, PyObject *ligand_metrics, double percentile_limit);
42 #endif
43 
44 #ifdef USE_PYTHON
45 // this is not a ligands function (although it can be used for ligands)
46 // it doesn't belong here
47 PyObject *residues_distortions_py(int imol, PyObject *residue_spec_list);
48 PyObject *get_intermediate_atoms_distortions_py();
49 #endif
50 
51 #ifdef USE_GUILE
52 // this is not a ligands function (although it can be used for ligands)
53 // it doesn't belong here
54 SCM residues_distortions_scm(int imol, SCM residue_spec_list_scm);
55 #endif
56 
57 // This don't call graphics_draw(), so the caller needs to do so.
58 //
60 probe_clash_score(const std::string &dots_file_name);
61 
62 #ifdef USE_GUILE
63 // internal bumps scoring, sphere overlap
64 SCM ligand_atom_overlaps_scm(int imol, SCM ligand_spec, double neighb_radius);
65 #endif
66 
67 #ifdef USE_PYTHON
68 // internal bumps scoring, sphere overlap
69 PyObject *ligand_atom_overlaps_py(int imol, PyObject *ligand_spec, double neighb_radius);
70 #endif
71 
72 
73 
74 #ifdef USE_GUILE
75 bool
76 residues_torsions_match_scm(int imol_1, SCM res_1,
77  int imol_2, SCM res_2,
78  float tolerance); // in degrees
79 #endif // USE_GUILE
80 
81 #ifdef USE_PYTHON
82 bool
83 residues_torsions_match_py(int imol_1, PyObject *res_1,
84  int imol_2, PyObject *res_2,
85  float tolerance); // in degrees
86 #endif // USE_PYTHON
87 
88 #ifdef USE_GUILE
89 double kolmogorov_smirnov_scm(SCM l1, SCM l2);
90 double kolmogorov_smirnov_vs_normal_scm(SCM l1, double mean, double std_dev);
91 #endif
92 
93 #ifdef USE_GUILE
94 SCM kullback_liebler_scm(SCM l1, SCM l2);
95 #endif
96 
97 #ifdef USE_PYTHON
98 double kolmogorov_smirnov_py(PyObject *l1, PyObject *l2);
99 double kolmogorov_smirnov_vs_normal_py(PyObject *l1, double mean, double std_dev);
100 #endif
101 
102 #ifdef USE_PYTHON
103 PyObject *kullback_liebler_py(PyObject *l1, PyObject *l2);
104 #endif
105 
106 // Returning void ATM. We shoud return an interesting object at some
107 // stage. Perhaps a coot::geometry_distortion_info_container_t?
108 //
109 double
110 print_residue_distortions(int imol, std::string chain_id, int res_no, std::string ins_code);
111 void
112 display_residue_distortions(int imol, std::string chain_id, int res_no, std::string ins_code);
113 
114 void display_residue_hydrogen_bond_atom_status_using_dictionary(int imol, std::string chain_id, int res_no,
115  std::string ins_code);
116 void
117 write_dictionary_from_residue(int imol, std::string chain_id, int res_no, std::string ins_code, std::string cif_file_name);
118 void
119 add_dictionary_from_residue(int imol, std::string chain_id, int res_no, std::string ins_code);
120 
121 void
122 invert_chiral_centre(int imol, std::string chain_id, int res_no, std::string ins_code, std::string atom_name);
123 
124 // Read cif_dict_in, match the atoms there-in to those of the dictionary of reference_comp_id.
125 // Write a new dictionary to cif_dict_out.
126 //
127 // Return 1 if was successful in doing the atom matching and writing the cif file.
128 //
129 // e.g: match_residue_and_dictionary(0, "A", 1, "", "DRG-pyrogen.cif", "DRG-renamed.cif", "DRG", "LYS")
130 int
131 match_residue_and_dictionary(int imol, std::string chain_id, int res_no, std::string ins_code,
132  std::string cif_dict_in,
133  std::string cif_dict_out,
134  std::string cif_dict_comp_id, // comp-id in the input file
135  std::string reference_comp_id,
136  std::string output_comp_id,
137  std::string output_compound_name);
138 
139 // This is the GUI interface: User sits over on top of the residue
140 // they want to change and provides an output dictionary cif file
141 // name, a reference-comp-id and a compd-id for the new residue (type).
142 int
143 match_this_residue_and_dictionary(int imol, std::string chain_id, int res_no, std::string ins_code,
144  std::string cif_dict_out,
145  std::string reference_comp_id,
146  std::string output_comp_id);
147 
148 // return False if unknown
149 bool comprised_of_organic_set_p(const std::string &rn);
150 
151 // all-atom contact dots. This is not the place for this declaration (not a ligand function)
152 //
156 void coot_all_atom_contact_dots(int imol);
157 
159 void set_all_atom_contact_dots_ignore_water(short int state);
160 
161 #ifdef USE_PYTHON
162 void coot_contact_dots_for_ligand_py(int imol, PyObject *ligand_spec);
163 // change HE2 to HD1 and vice versa
164 void switch_HIS_protonation_py(int imol, PyObject *residue_spec);
165 #endif
166 
167 // this is not a ligand function - it does not belong here.
169 void coot_add_hydrogen_atoms(int imol);
170 
171 void coot_reduce(int imol);
172 
173 
174 
175 #ifdef USE_GUILE
176 void coot_contact_dots_for_ligand_scm(int imol, SCM residue_spec_scm);
177 // change HE2 to HD1 and vice versa
178 void switch_HIS_protonation_scm(int imol, SCM residue_spec_scm);
179 #endif
180 
181 
182 
183 // we want to read in the built-in database to convert these scores to percentiles
184 // return -1 (test for negative) on failure
185 // metric_name examples: density_correlation coot_diff_map_KS_2 mogul_z_worst bumps_1
186 // range: 0->100
187 //
188 // reverse order for mogul and bumps (for example) because low-is-good
189 //
190 double get_ligand_percentile(std::string metric_name, double metric_value, short int reverse_order);
191 
192 #ifdef USE_GUILE
193 // find all the residues that are linked to this reside (and those that are attached to those and so on)
194 // the attachment test is trivial: is an atom of a potential neighber within close_dist_max of
195 // an atom of the current residue?
196 SCM linked_residues_scm(SCM residue_centre, int imol, float close_dist_max);
197 #endif
198 #ifdef USE_PYTHON
199 // find all the residues that are linked to this reside (and those that are attached to those and so on)
200 // the attachment test is trivial: is an atom of a potential neighber within close_dist_max of
201 // an atom of the current residue?
202 PyObject *linked_residues_py(PyObject *residue_centre, int imol, float close_dist_max);
203 #endif
204 
207 
210 
213 
215 // int side_chain_flip_180_intermediate_atoms(); moved because button in gui, unlike JED flip
216 
217 // No here - this file is for swigging
218 // #include "ideal/simple-restraint.hh"
219 // coot::geometry_distortion_info_container_t get_ligand_distortion_summary_info(int imol, coot::residue_spec_t &rs);
220 
221 #ifdef USE_GUILE
222 SCM get_ligand_distortion_summary_info_scm(int imol, SCM residue_spec);
224 #endif
225 #ifdef USE_PYTHON
226 PyObject *get_ligand_distortion_summary_info_py(int imol, PyObject *residue_spec);
228 #endif
229 
230 double gsl_sf_erf_scm(double v);
231 
232 #endif // C_INTERFACE_LIGANDS_SWIG_HH
PyObject * get_ligand_distortion_summary_info_py(int imol, PyObject *residue_spec)
return the summary info for ligand distortion
void coot_all_atom_contact_dots(int imol)
calculate all-atom contact dots
void coot_add_hydrogen_atoms(int imol)
add Hydrogen atoms to the molecule
SCM get_ligand_distortion_summary_info_scm(int imol, SCM residue_spec)
side-chain 180 flip on the active atom
Coot Scripting Interface - Probe clash interface.
int reverse_jed_flip_intermediate_atoms()
JED-Flip the bond of the active atoms using reversed atom selection (wag the dog) ...
bool enhanced_ligand_coot_p()
is this an &quot;enhanced-ligand&quot; version?
probe clash score
Definition: probe-clash-score.hh:117
void set_all_atom_contact_dots_ignore_water(short int state)
set if all atom contact should ignore water-water interactions (default off)
int jed_flip_intermediate_atoms()
JED-Flip the bond of the active atoms.