Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
HBondFeatures.cc
Go to the documentation of this file.
1 // -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*-
2 // vi: set ts=2 noet:
3 //
4 // (c) Copyright Rosetta Commons Member Institutions.
5 // (c) This file is part of the Rosetta software suite and is made available under license.
6 // (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
7 // (c) For more information, see http://www.rosettacommons.org. Questions about this can be
8 // (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
9 
10 /// @file protocols/features/HBondFeatures.cc
11 /// @brief report HBond geometry and scores to features Statistics Scientific Benchmark
12 /// @author Matthew O'Meara
13 
14 // Unit Headers
16 
17 //External
18 #include <boost/uuid/uuid.hpp>
19 #include <boost/uuid/uuid_io.hpp>
20 
21 // Package Headers
23 
24 // Project Headers
25 #include <basic/database/sql_utils.hh>
26 #include <basic/Tracer.hh>
29 #include <core/id/AtomID_Map.hh>
31 #include <core/graph/Graph.hh>
32 #include <core/pose/Pose.hh>
33 #include <core/pose/util.hh>
34 #include <core/pose/util.tmpl.hh>
35 #include <core/pose/PDBInfo.hh>
36 #include <core/scoring/Energies.hh>
37 #include <core/scoring/sasa.hh>
48 #include <core/types.hh>
50 #include <basic/database/schema_generator/PrimaryKey.hh>
51 #include <basic/database/schema_generator/ForeignKey.hh>
52 #include <basic/database/schema_generator/Column.hh>
53 #include <basic/database/schema_generator/Schema.hh>
54 
55 
56 // Utility Headers
57 #include <numeric/xyzVector.hh>
58 #include <numeric/xyz.functions.hh>
59 #include <utility/tag/Tag.hh>
60 #include <utility/vector1.hh>
61 #include <utility/assert.hh>
62 #include <utility/sql_database/DatabaseSessionManager.hh>
63 #include <utility/vector0.hh>
64 
65 // External Headers
66 #include <cppdb/frontend.h>
67 
68 // Boost Headers
69 #include <boost/assign/list_of.hpp>
70 #include <boost/foreach.hpp>
71 #define foreach BOOST_FOREACH
72 
73 // C++ Headers
74 #include <cmath>
75 #include <utility/excn/Exceptions.hh>
76 #include <algorithm>
77 
78 
79 //Auto Headers
80 
81 
82 namespace protocols{
83 namespace features{
84 
85 using std::string;
86 using std::endl;
87 using std::sort;
88 using std::sqrt;
89 using std::stringstream;
90 using core::Size;
91 using core::Real;
92 using core::Vector;
97 using core::id::AtomID;
98 using core::pose::Pose;
101 using core::graph::Graph;
125 using numeric::xyzVector;
126 using numeric::dihedral_radians;
130 using utility::sql_database::sessionOP;
132 using cppdb::statement;
133 using utility::vector1;
134 using basic::Tracer;
135 using basic::database::insert_or_ignore;
136 
137 static Tracer TR("protocols.features.HBondFeatures");
138 
140  scfxn_(getScoreFunction())
141 {}
142 
144  ScoreFunctionOP scfxn) :
145  scfxn_(scfxn),
146  definition_type_(hbdef_ENERGY),
147  definition_threshold_(0)
148 {}
149 
152  scfxn_(src.scfxn_),
153  definition_type_(src.definition_type_),
154  definition_threshold_(src.definition_threshold_)
155 {}
156 
158 
159 string
160 HBondFeatures::type_name() const { return "HBondFeatures"; }
161 
162 void
164  sessionOP db_session
165 ) const {
167  write_hbond_sites_table_schema(db_session);
171  write_hbonds_table_schema(db_session);
175 }
176 
177 void
179  sessionOP db_session
180 ) const {
181  using namespace basic::database::schema_generator;
182  using boost::assign::list_of;
183 
184  Column chem_type("chem_type", new DbText(255));
185  Column label("label", new DbText(255));
186 
187  Columns primary_key_columns;
188  primary_key_columns.push_back(chem_type);
189  PrimaryKey primary_key(primary_key_columns);
190 
191  Schema table("hbond_chem_types", primary_key);
192  table.add_column(label);
193  table.write(db_session);
194 
195  //insert static values
196  string const t("hbond_chem_types");
197  std::vector< string > c;
198  c.push_back("chem_type");
199  c.push_back("label");
200  insert_or_ignore(t, c, list_of("'hbacc_NONE'")("'aNONE'"), db_session);
201  insert_or_ignore(t, c, list_of("'hbacc_PBA'")("'aPBA: bb'"), db_session);
202  insert_or_ignore(t, c, list_of("'hbacc_CXA'")("'aCXA: n,q'"), db_session);
203  insert_or_ignore(t, c, list_of("'hbacc_CXL'")("'aCXL: d,e'"), db_session);
204  insert_or_ignore(t, c, list_of("'hbacc_IMD'")("'aIMD: h'"), db_session);
205  insert_or_ignore(t, c, list_of("'hbacc_IME'")("'aIME: h'"), db_session);
206  insert_or_ignore(t, c, list_of("'hbacc_AHX'")("'aAHX: t'"), db_session);
207  insert_or_ignore(t, c, list_of("'hbacc_HXL'")("'aHXL: s,t'"), db_session);
208  insert_or_ignore(t, c, list_of("'hbacc_PCA_DNA'")("'aPCA_DNA: O{1,2}P'"), db_session);
209  insert_or_ignore(t, c, list_of("'hbacc_PES_DNA'")("'aPES_DNA: O{3,5}*'"), db_session);
210  insert_or_ignore(t, c, list_of("'hbacc_RRI_DNA'")("'aRRI_DNA: O4*'"), db_session);
211  insert_or_ignore(t, c, list_of("'hbacc_PCA_RNA'")("'aPCA_RNA: O{1,2}P'"), db_session);
212  insert_or_ignore(t, c, list_of("'hbacc_PES_RNA'")("'aPES_RNA: O{3,5}*'"), db_session);
213  insert_or_ignore(t, c, list_of("'hbacc_RRI_RNA'")("'aRRI_RNA: O4*'"), db_session);
214  insert_or_ignore(t, c, list_of("'hbacc_H2O'")("'aH2O'"), db_session);
215  insert_or_ignore(t, c, list_of("'hbacc_GENERIC_SP2BB'")("'aGEN: sp2 bb'"), db_session);
216  insert_or_ignore(t, c, list_of("'hbacc_GENERIC_SP2SC'")("'aGEN: sp2 sc'"), db_session);
217  insert_or_ignore(t, c, list_of("'hbacc_GENERIC_SP3BB'")("'aGEN: sp3 bb'"), db_session);
218  insert_or_ignore(t, c, list_of("'hbacc_GENERIC_SP3SC'")("'aGEN: sp3 sc'"), db_session);
219  insert_or_ignore(t, c, list_of("'hbacc_GENERIC_RINGBB'")("'aGEN: ring bb'"), db_session);
220  insert_or_ignore(t, c, list_of("'hbacc_GENERIC_RINGSC'")("'aGEN: ring sc'"), db_session);
221 
222  insert_or_ignore(t, c, list_of("'hbdon_NONE'")("'dNONE'"), db_session);
223  insert_or_ignore(t, c, list_of("'hbdon_PBA'")("'dPBA: bb'"), db_session);
224  insert_or_ignore(t, c, list_of("'hbdon_CXA'")("'dCXA: n,q'"), db_session);
225  insert_or_ignore(t, c, list_of("'hbdon_IMD'")("'dIMD: h'"), db_session);
226  insert_or_ignore(t, c, list_of("'hbdon_IME'")("'dIME: h'"), db_session);
227  insert_or_ignore(t, c, list_of("'hbdon_IND'")("'dIND: w'"), db_session);
228  insert_or_ignore(t, c, list_of("'hbdon_AMO'")("'dAMO: k'"), db_session);
229  insert_or_ignore(t, c, list_of("'hbdon_GDE'")("'dGDE: r'"), db_session);
230  insert_or_ignore(t, c, list_of("'hbdon_GDH'")("'dGDH: r'"), db_session);
231  insert_or_ignore(t, c, list_of("'hbdon_AHX'")("'dAHX: s,t'"), db_session);
232  insert_or_ignore(t, c, list_of("'hbdon_HXL'")("'dHXL: y'"), db_session);
233  insert_or_ignore(t, c, list_of("'hbdon_H2O'")("'dH2O'"), db_session);
234  insert_or_ignore(t, c, list_of("'hbdon_GENERIC_BB'")("'dGEN: bb'"), db_session);
235  insert_or_ignore(t, c, list_of("'hbdon_GENERIC_SC'")("'dGEN: sc'"), db_session);
236 }
237 
238 void
240  sessionOP db_session
241 ) const {
242  using namespace basic::database::schema_generator;
243 
244  Column struct_id("struct_id", new DbUUID());
245  Column site_id("site_id", new DbInteger());
246  Column resNum("resNum", new DbInteger());
247  Column atmNum("atmNum", new DbInteger());
248  Column is_donor("is_donor", new DbInteger());
249  Column chain("chain", new DbInteger());
250  Column resType("resType", new DbText());
251  Column atmType("atmType", new DbText());
252  Column HBChemType("HBChemType", new DbText(255));
253 
254  Columns primary_key_columns;
255  primary_key_columns.push_back(struct_id);
256  primary_key_columns.push_back(site_id);
257  PrimaryKey primary_key(primary_key_columns);
258 
259  Columns foreign_key_columns1;
260  foreign_key_columns1.push_back(struct_id);
261  foreign_key_columns1.push_back(resNum);
262  vector1< std::string > reference_columns1;
263  reference_columns1.push_back("struct_id");
264  reference_columns1.push_back("resNum");
265  ForeignKey foreign_key1(foreign_key_columns1, "residues", reference_columns1, true);
266 
267  Columns foreign_key_columns2;
268  foreign_key_columns2.push_back(HBChemType);
269  vector1< std::string > reference_columns2;
270  reference_columns2.push_back("chem_type");
271  ForeignKey foreign_key2(foreign_key_columns2, "hbond_chem_types", reference_columns2, true);
272 
273 
274  Schema table("hbond_sites", primary_key);
275  table.add_foreign_key(foreign_key1);
276  table.add_foreign_key(foreign_key2);
277 
278  table.add_column(atmNum);
279  table.add_column(is_donor);
280  table.add_column(chain);
281  table.add_column(resType);
282  table.add_column(atmType);
283 
284 
285  table.write(db_session);
286 }
287 
288 void
290  sessionOP db_session
291 ) const {
292  using namespace basic::database::schema_generator;
293 
294  Column struct_id("struct_id", new DbUUID());
295  Column site_id("site_id", new DbInteger());
296  Column chain("chain", new DbText(1));
297  Column resNum("resNum", new DbInteger());
298  Column iCode("iCode", new DbText(1));
299  Column heavy_atom_temperature("heavy_atom_temperature", new DbReal());
300  Column heavy_atom_occupancy("heavy_atom_occupancy", new DbReal());
301 
302 
303  Columns primary_key_columns;
304  primary_key_columns.push_back(struct_id);
305  primary_key_columns.push_back(site_id);
306  PrimaryKey primary_key(primary_key_columns);
307 
308  Columns foreign_key_columns;
309  foreign_key_columns.push_back(struct_id);
310  foreign_key_columns.push_back(site_id);
311  vector1< std::string > reference_columns;
312  reference_columns.push_back("struct_id");
313  reference_columns.push_back("site_id");
314  ForeignKey foreign_key(foreign_key_columns, "hbond_sites", reference_columns, true);
315 
316  Schema table("hbond_sites_pdb", primary_key);
317  table.add_foreign_key(foreign_key);
318  table.add_column(chain);
319  table.add_column(resNum);
320  table.add_column(iCode);
321  table.add_column(heavy_atom_temperature);
322  table.add_column(heavy_atom_occupancy);
323 
324  table.write(db_session);
325 }
326 
327 void
329  sessionOP db_session
330 ) const {
331  using namespace basic::database::schema_generator;
332 
333  Column struct_id("struct_id", new DbUUID());
334  Column site_id("site_id", new DbInteger());
335  Column sasa_r100("sasa_r100", new DbReal());
336  Column sasa_r140("sasa_r140", new DbReal());
337  Column sasa_r200("sasa_r200", new DbReal());
338  Column hbond_energy("hbond_energy", new DbReal());
339  Column num_hbonds("num_hbonds", new DbInteger());
340 
341  Columns primary_key_columns;
342  primary_key_columns.push_back(struct_id);
343  primary_key_columns.push_back(site_id);
344  PrimaryKey primary_key(primary_key_columns);
345 
346  Columns foreign_key_columns;
347  foreign_key_columns.push_back(struct_id);
348  foreign_key_columns.push_back(site_id);
349  vector1< std::string > reference_columns;
350  reference_columns.push_back("struct_id");
351  reference_columns.push_back("site_id");
352  ForeignKey foreign_key(foreign_key_columns, "hbond_sites", reference_columns, true);
353 
354  Schema table("hbond_site_environment", primary_key);
355  table.add_foreign_key(foreign_key);
356  table.add_column(sasa_r100);
357  table.add_column(sasa_r140);
358  table.add_column(sasa_r200);
359  table.add_column(hbond_energy);
360  table.add_column(num_hbonds);
361 
362  table.write(db_session);
363 }
364 
365 void
367  sessionOP db_session
368 ) const {
369  using namespace basic::database::schema_generator;
370 
371  Column struct_id("struct_id", new DbUUID());
372  Column site_id("site_id", new DbInteger());
373  Column atm_x("atm_x", new DbReal());
374  Column atm_y("atm_y", new DbReal());
375  Column atm_z("atm_z", new DbReal());
376  Column base_x("base_x", new DbReal());
377  Column base_y("base_y", new DbReal());
378  Column base_z("base_z", new DbReal());
379  Column bbase_x("bbase_x", new DbReal());
380  Column bbase_y("bbase_y", new DbReal());
381  Column bbase_z("bbase_z", new DbReal());
382  Column base2_x("base2_x", new DbReal());
383  Column base2_y("base2_y", new DbReal());
384  Column base2_z("base2_z", new DbReal());
385 
386  Columns primary_key_columns;
387  primary_key_columns.push_back(struct_id);
388  primary_key_columns.push_back(site_id);
389  PrimaryKey primary_key(primary_key_columns);
390 
391  Columns foreign_key_columns;
392  foreign_key_columns.push_back(struct_id);
393  foreign_key_columns.push_back(site_id);
394  vector1< std::string > reference_columns;
395  reference_columns.push_back("struct_id");
396  reference_columns.push_back("site_id");
397  ForeignKey foreign_key(foreign_key_columns, "hbond_sites", reference_columns, true);
398 
399  Schema table("hbond_site_atoms", primary_key);
400  table.add_foreign_key(foreign_key);
401  table.add_column(atm_x);
402  table.add_column(atm_y);
403  table.add_column(atm_z);
404  table.add_column(base_x);
405  table.add_column(base_y);
406  table.add_column(base_z);
407  table.add_column(bbase_x);
408  table.add_column(bbase_y);
409  table.add_column(bbase_z);
410  table.add_column(base2_x);
411  table.add_column(base2_y);
412  table.add_column(base2_z);
413 
414  table.write(db_session);
415 }
416 
417 void
419  sessionOP db_session
420 ) const {
421  using namespace basic::database::schema_generator;
422 
423  Column struct_id("struct_id", new DbUUID());
424  Column hbond_id("hbond_id", new DbInteger());
425  Column don_id("don_id", new DbInteger());
426  Column acc_id("acc_id", new DbInteger());
427  Column HBEvalType("HBEvalType", new DbInteger());
428  Column energy("energy", new DbReal());
429  Column envWeight("envWeight", new DbReal());
430  Column score_weight("score_weight", new DbReal());
431  Column donRank("donRank", new DbInteger());
432  Column accRank("accRank", new DbInteger());
433 
434  Columns primary_key_columns;
435  primary_key_columns.push_back(struct_id);
436  primary_key_columns.push_back(hbond_id);
437  PrimaryKey primary_key(primary_key_columns);
438 
439  Columns foreign_key_columns1;
440  foreign_key_columns1.push_back(struct_id);
441  foreign_key_columns1.push_back(don_id);
442  vector1< std::string > reference_columns1;
443  reference_columns1.push_back("struct_id");
444  reference_columns1.push_back("site_id");
445  ForeignKey foreign_key1(foreign_key_columns1, "hbond_sites", reference_columns1, true);
446 
447  Columns foreign_key_columns2;
448  foreign_key_columns2.push_back(struct_id);
449  foreign_key_columns2.push_back(acc_id);
450  vector1< std::string > reference_columns2;
451  reference_columns2.push_back("struct_id");
452  reference_columns2.push_back("site_id");
453  ForeignKey foreign_key2(foreign_key_columns2, "hbond_sites", reference_columns2, true);
454 
455  Schema table("hbonds", primary_key);
456  table.add_foreign_key(foreign_key1);
457  table.add_foreign_key(foreign_key2);
458  table.add_column(don_id);
459  table.add_column(acc_id);
460  table.add_column(HBEvalType);
461  table.add_column(energy);
462  table.add_column(envWeight);
463  table.add_column(score_weight);
464  table.add_column(donRank);
465  table.add_column(accRank);
466 
467  table.write(db_session);
468 }
469 
470 void
472  sessionOP db_session
473 ) const {
474  using namespace basic::database::schema_generator;
475 
476  Column struct_id("struct_id", new DbUUID());
477  Column hbond_id("hbond_id", new DbInteger());
478  Column don_acc_atrE("don_acc_atrE", new DbReal());
479  Column don_acc_repE("don_acc_repE", new DbReal());
480  Column don_acc_solv("don_acc_solv", new DbReal());
481  Column don_acc_base_atrE("don_acc_base_atrE", new DbReal());
482  Column don_acc_base_repE("don_acc_base_repE", new DbReal());
483  Column don_acc_base_solv("don_acc_base_solv", new DbReal());
484  Column h_acc_atrE("h_acc_atrE", new DbReal());
485  Column h_acc_repE("h_acc_repE", new DbReal());
486  Column h_acc_solv("h_acc_solv", new DbReal());
487  Column h_acc_base_atrE("h_acc_base_atrE", new DbReal());
488  Column h_acc_base_repE("h_acc_base_repE", new DbReal());
489  Column h_acc_base_solv("h_acc_base_solv", new DbReal());
490 
491  Columns primary_key_columns;
492  primary_key_columns.push_back(struct_id);
493  primary_key_columns.push_back(hbond_id);
494  PrimaryKey primary_key(primary_key_columns);
495 
496  Columns foreign_key_columns;
497  foreign_key_columns.push_back(struct_id);
498  foreign_key_columns.push_back(hbond_id);
499  vector1< std::string > reference_columns;
500  reference_columns.push_back("struct_id");
501  reference_columns.push_back("hbond_id");
502  ForeignKey foreign_key(foreign_key_columns, "hbonds", reference_columns, true);
503 
504  Schema table("hbond_lennard_jones", primary_key);
505  table.add_foreign_key(foreign_key);
506  table.add_column(don_acc_atrE);
507  table.add_column(don_acc_repE);
508  table.add_column(don_acc_solv);
509  table.add_column(don_acc_base_atrE);
510  table.add_column(don_acc_base_repE);
511  table.add_column(don_acc_base_solv);
512  table.add_column(h_acc_atrE);
513  table.add_column(h_acc_repE);
514  table.add_column(h_acc_solv);
515  table.add_column(h_acc_base_atrE);
516  table.add_column(h_acc_base_repE);
517  table.add_column(h_acc_base_solv);
518 
519  table.write(db_session);
520 }
521 
522 void
524  sessionOP db_session
525 ) const {
526  using namespace basic::database::schema_generator;
527 
528  Column struct_id("struct_id", new DbUUID());
529  Column hbond_id("hbond_id", new DbInteger());
530  Column AHdist("AHdist", new DbReal());
531  Column cosBAH("cosBAH", new DbReal());
532  Column cosAHD("cosAHD", new DbReal());
533  Column chi("chi", new DbReal());
534 
535  Columns primary_key_columns;
536  primary_key_columns.push_back(struct_id);
537  primary_key_columns.push_back(hbond_id);
538  PrimaryKey primary_key(primary_key_columns);
539 
540  Columns foreign_key_columns;
541  foreign_key_columns.push_back(struct_id);
542  foreign_key_columns.push_back(hbond_id);
543  vector1< std::string > reference_columns;
544  reference_columns.push_back("struct_id");
545  reference_columns.push_back("hbond_id");
546  ForeignKey foreign_key(foreign_key_columns, "hbonds", reference_columns, true);
547 
548  Schema table("hbond_geom_coords", primary_key);
549  table.add_foreign_key(foreign_key);
550  table.add_column(AHdist);
551  table.add_column(cosBAH);
552  table.add_column(cosAHD);
553  table.add_column(chi);
554 
555  table.write(db_session);
556 }
557 
558 void
560  sessionOP db_session
561 ) const {
562  using namespace basic::database::schema_generator;
563 
564  Column struct_id("struct_id", new DbUUID());
565  Column hbond_id("hbond_id", new DbInteger());
566  Column wrapping_count("wrapping_count", new DbInteger());
567 
568  Columns primary_key_columns;
569  primary_key_columns.push_back(struct_id);
570  primary_key_columns.push_back(hbond_id);
571  PrimaryKey primary_key(primary_key_columns);
572 
573  Columns foreign_key_columns;
574  foreign_key_columns.push_back(struct_id);
575  foreign_key_columns.push_back(hbond_id);
576  vector1< std::string > reference_columns;
577  reference_columns.push_back("struct_id");
578  reference_columns.push_back("hbond_id");
579  ForeignKey foreign_key(foreign_key_columns, "hbonds", reference_columns, true);
580 
581  Schema table("hbond_dehydrons", primary_key);
582  table.add_foreign_key(foreign_key);
583  table.add_column(wrapping_count);
584 
585  table.write(db_session);
586 }
587 
590  utility::vector1<std::string> dependencies;
591  dependencies.push_back("ResidueFeatures");
592  return dependencies;
593 }
594 
595 void
597  TagPtr const tag,
598  DataMap & data,
599  Filters_map const & /*filters*/,
600  Movers_map const & /*movers*/,
601  Pose const & /*pose*/
602 ) {
603  if(tag->hasOption("scorefxn")){
604  string const scorefxn_name(tag->getOption<string>("scorefxn"));
605  scfxn_ = data.get<ScoreFunction*>("scorefxns", scorefxn_name);
606  } else {
607  stringstream error_msg;
608  error_msg
609  << "The " << type_name() << " reporter requires a 'scorefxn' tag:" << endl
610  << endl
611  << " <feature name=" << type_name() <<" scorefxn=(name_of_score_function) />" << endl;
612  throw utility::excn::EXCN_RosettaScriptsOption(error_msg.str());
613  }
614 
615  string const definition_type(
616  tag->getOption<string>("definition_type", "energy"));
617  if(definition_type == "energy"){
619  } else if(definition_type == "AHdist"){
621  } else {
622  stringstream error_msg;
623  error_msg
624  << "The hbond definition type '" << definition_type << "' is not recognized." << endl
625  << "Available hbond definition types are:" << endl
626  << " 'energy' => A polar-polar contact is an hbond when energy is below the definition_threshold." << endl
627  << " 'AHdist' => A polar-polar contact is an hbond when the Acceptor-Hydrogen distance is less than the definition_threshold." << endl;
628  throw utility::excn::EXCN_RosettaScriptsOption(error_msg.str());
629  }
630 
632  tag->getOption<Real>("definition_threshold", 0);
633 
634 }
635 
636 Size
638  Pose const & pose,
639  vector1< bool > const & relevant_residues,
640  boost::uuids::uuid struct_id,
641  sessionOP db_session
642 ){
643  HBondSet hbond_set;
644 
645  // assert pose.update_residue_neighbors() has been called:
646  runtime_assert(
647  !pose.conformation().structure_moved() &&
649 
650 
652  hbond_set.setup_for_residue_pair_energies( pose, false, false );
653  } else if(definition_type_ == hbdef_AHDIST){
655  } else {
656  utility_exit_with_message("Unrecognized hbond definition type.");
657  }
658 
659  TR << "Number of hydrogen bonds found: " << hbond_set.nhbonds() << endl;
660 
661  Real const probe_radius_s(1.0), probe_radius_m(1.4), probe_radius_l(2.0);
662  AtomID_Map< Real > atom_sasa_s, atom_sasa_m, atom_sasa_l;
663  vector1< Real > residue_sasa_s, residue_sasa_m, residue_sasa_l;
664 
665  if(pose.is_fullatom()){
666  calc_per_atom_sasa(pose, atom_sasa_s, residue_sasa_s, probe_radius_s);
667  calc_per_atom_sasa(pose, atom_sasa_m, residue_sasa_m, probe_radius_m);
668  calc_per_atom_sasa(pose, atom_sasa_l, residue_sasa_l, probe_radius_l);
669  }
670 
671  AtomID_Map< vector1<HBondCOP> > site_partners;
672  initialize_atomid_map(site_partners, pose);
673 
674  AtomID_Map<Real>site_hbond_energies;
675  initialize_atomid_map(site_hbond_energies, pose);
676 
677  for (Size i = 1; i<= hbond_set.nhbonds(); i++) {
678  HBondCOP hbond(hbond_set.hbond(i));
679  if(!relevant_residues[hbond->don_res()] ||
680  !relevant_residues[hbond->acc_res()]) continue;
681 
682  site_partners(hbond->don_res(),hbond->don_hatm()).push_back(hbond);
683  site_hbond_energies(hbond->don_res(),hbond->don_hatm()) += hbond->energy()/2;
684 
685  site_partners(hbond->acc_res(),hbond->acc_atm()).push_back(hbond);
686  site_hbond_energies(hbond->acc_res(),hbond->acc_atm()) += hbond->energy()/2;
687 
688  }
689 
690  Size site_id(0);
691  AtomID_Map< Size > site_ids;
692  core::pose::initialize_atomid_map(site_ids, pose);
693  for( Size resNum =1; resNum <= pose.n_residue(); ++resNum ){
694  if(!relevant_residues[resNum]) continue;
695 
696  Residue const & res(pose.residue(resNum));
697  // donor sites
698  for ( AtomIndices::const_iterator
699  atmNum = res.Hpos_polar().begin(),
700  atmNume = res.Hpos_polar().end(); atmNum != atmNume; ++atmNum ) {
701 
702  site_id++;
703  insert_site_row(pose, struct_id, site_id, resNum, *atmNum, true /*is donor*/, db_session);
704  site_ids(resNum,*atmNum) = site_id;
705  insert_site_pdb_row(pose, resNum, *atmNum, res.atom_base(*atmNum), struct_id, site_id, db_session);
706  insert_site_environment_row(pose, resNum, *atmNum, struct_id, site_id, atom_sasa_s, atom_sasa_m, atom_sasa_l, site_partners, site_hbond_energies, db_session);
707  insert_site_atoms_row(pose, resNum, *atmNum, struct_id, site_id, db_session);
708 
709  vector1< HBondCOP >::iterator partners_begin( site_partners(resNum, *atmNum).begin());
710  vector1< HBondCOP >::iterator partners_end( site_partners(resNum, *atmNum).end() );
711 
712  sort(partners_begin, partners_end, HBond::hbond_energy_comparer);
713 
714  }
715  // acceptor sites
716  for( AtomIndices::const_iterator
717  atmNum = res.accpt_pos().begin(),
718  atmNume = res.accpt_pos().end(); atmNum != atmNume; ++atmNum ) {
719  site_id++;
720  insert_site_row(pose, struct_id, site_id, resNum, *atmNum, false /*is not donor*/, db_session);
721  site_ids(resNum,*atmNum) = site_id;
722  insert_site_pdb_row(pose, resNum, *atmNum, *atmNum, struct_id, site_id, db_session);
723  insert_site_environment_row(pose, resNum, *atmNum, struct_id, site_id, atom_sasa_s, atom_sasa_m, atom_sasa_l, site_partners, site_hbond_energies, db_session);
724  insert_site_atoms_row(pose, resNum, *atmNum, struct_id, site_id, db_session);
725 
726  sort(site_partners(resNum,*atmNum).begin(),
727  site_partners(resNum,*atmNum).end(),
729  }
730  }
731 
732  for (Size hbond_id = 1; hbond_id <= hbond_set.nhbonds(); hbond_id++) {
733  HBond const & hbond = hbond_set.hbond( hbond_id );
734  if(!relevant_residues[hbond.don_res()] ||
735  !relevant_residues[hbond.acc_res()]) continue;
736 
737  insert_hbond_row(hbond, struct_id, hbond_id, site_ids, site_partners, db_session);
738  insert_hbond_geom_coords(pose, hbond_set.hbond_options(), hbond, struct_id, hbond_id, db_session);
739  insert_hbond_lennard_jones_row(pose, hbond, struct_id, hbond_id, db_session);
740  insert_hbond_dehydron_row(pose, hbond, struct_id, hbond_id, db_session);
741  }
742  return 0;
743 }
744 
745 void
747  Pose const & pose,
748  boost::uuids::uuid struct_id,
749  Size site_id,
750  Size resNum,
751  Size atmNum,
752  bool is_donor,
753  sessionOP db_session
754 ){
755 
756 
757  Size chain( pose.chain(resNum) );
758  string const & resType( pose.residue_type(resNum).name() );
759  string atmType;
760 
761 
762  string HBChemType;
763  if (is_donor){
764  Size batmNum = pose.residue(resNum).atom_base( atmNum );
765  HBDonChemType hb_don_chem_type =
766  get_hb_don_chem_type( batmNum, pose.residue(resNum) );
767  HBChemType = HBondTypeManager::name_from_don_chem_type(hb_don_chem_type);
768  atmType = pose.residue(resNum).atom_type(batmNum).name();
769  } else {
770  HBAccChemType hb_acc_chem_type =
771  get_hb_acc_chem_type( atmNum, pose.residue(resNum) );
772  HBChemType = HBondTypeManager::name_from_acc_chem_type(hb_acc_chem_type);
773  atmType = pose.residue(resNum).atom_type(atmNum).name();
774  }
775 
776  std::string statement_string = "INSERT INTO hbond_sites (struct_id, site_id, resNum, HBChemType, atmNum, is_donor, chain, resType, atmType) VALUES (?,?,?,?,?,?,?,?,?);";
777  statement stmt(basic::database::safely_prepare_statement(statement_string,db_session));
778  stmt.bind(1,struct_id);
779  stmt.bind(2,site_id);
780  stmt.bind(3,resNum);
781  stmt.bind(4,HBChemType);
782  stmt.bind(5,atmNum);
783  stmt.bind(6,is_donor);
784  stmt.bind(7,chain);
785  stmt.bind(8,resType);
786  stmt.bind(9,atmType);
787  basic::database::safely_write_to_database(stmt);
788 
789 }
790 
791 void
793  Pose const & pose,
794  Size resNum,
795  Size,
796  Size heavy_atmNum,
797  boost::uuids::uuid struct_id,
798  Size site_id,
799  sessionOP db_session
800 ){
801  if(!pose.pdb_info()) return; //eg if this is a silent file structure
802 
803  string const pdb_chain(1,pose.pdb_info()->chain(resNum));
804  int const pdb_resNum( pose.pdb_info()->number(resNum) );
805  string const pdb_iCode(1,pose.pdb_info()->icode(resNum));
806  Real const pdb_heavy_atom_temperature(
807  pose.pdb_info()->temperature(resNum,heavy_atmNum) );
808  Real const pdb_heavy_atom_occupancy(
809  pose.pdb_info()->occupancy(resNum, heavy_atmNum) );
810 
811  std::string statement_string = "INSERT INTO hbond_sites_pdb (struct_id, site_id, chain, resNum, iCode, heavy_atom_temperature, heavy_atom_occupancy) VALUES (?,?,?,?,?,?,?);";
812  statement stmt(basic::database::safely_prepare_statement(statement_string,db_session));
813  stmt.bind(1,struct_id);
814  stmt.bind(2,site_id);
815  stmt.bind(3,pdb_chain);
816  stmt.bind(4,pdb_resNum);
817  stmt.bind(5,pdb_iCode);
818  stmt.bind(6,pdb_heavy_atom_temperature);
819  stmt.bind(7,pdb_heavy_atom_occupancy);
820  basic::database::safely_write_to_database(stmt);
821 }
822 
823 
824 void
826  Pose const & pose,
827  Size resNum,
828  Size atmNum,
829  boost::uuids::uuid struct_id,
830  Size site_id,
831  AtomID_Map< Real > const & atom_sasa_s,
832  AtomID_Map< Real > const & atom_sasa_m,
833  AtomID_Map< Real > const & atom_sasa_l,
834  AtomID_Map< vector1<HBondCOP> > const & site_partners,
835  AtomID_Map< Real > const & site_hbond_energies,
836  sessionOP db_session
837 ){
838 
839  Real const hbond_energy (site_hbond_energies(resNum, atmNum) );
840  Size const num_hbonds(site_partners(resNum,atmNum).size() );
841 
842  string stmt_string("INSERT INTO hbond_site_environment (struct_id, site_id, sasa_r100, sasa_r140, sasa_r200, hbond_energy, num_hbonds) VALUES (?,?,?,?,?,?,?);");
843  statement stmt(basic::database::safely_prepare_statement(stmt_string, db_session));
844 
845  stmt.bind(1, struct_id);
846  stmt.bind(2, site_id);
847 
848  if(pose.is_fullatom()){
849  stmt.bind(3, atom_sasa_s[AtomID(atmNum, resNum)]);
850  stmt.bind(4, atom_sasa_m[AtomID(atmNum, resNum)]);
851  stmt.bind(5, atom_sasa_l[AtomID(atmNum, resNum)]);
852  } else {
853  stmt.bind_null(3);
854  stmt.bind_null(4);
855  stmt.bind_null(5);
856  }
857 
858  stmt.bind(6, hbond_energy);
859  stmt.bind(7, num_hbonds);
860  basic::database::safely_write_to_database(stmt);
861 
862 }
863 
864 void
866  Pose const & pose,
867  Size resNum,
868  Size atmNum,
869  boost::uuids::uuid struct_id,
870  Size site_id,
871  sessionOP db_session
872 ){
873  Residue const & rsd( pose.residue(resNum) );
874 
875 
876  Real const atm_x( rsd.atom(atmNum).xyz().x() );
877  Real const atm_y( rsd.atom(atmNum).xyz().y() );
878  Real const atm_z( rsd.atom(atmNum).xyz().z() );
879  Real const base_x( rsd.atom(rsd.atom_base(atmNum)).xyz().x() );
880  Real const base_y( rsd.atom(rsd.atom_base(atmNum)).xyz().y() );
881  Real const base_z( rsd.atom(rsd.atom_base(atmNum)).xyz().z() );
882  Real const bbase_x( rsd.atom(rsd.atom_base(rsd.atom_base(atmNum))).xyz().x() );
883  Real const bbase_y( rsd.atom(rsd.atom_base(rsd.atom_base(atmNum))).xyz().y() );
884  Real const bbase_z( rsd.atom(rsd.atom_base(rsd.atom_base(atmNum))).xyz().z() );
885 
886  bool has_base2( rsd.abase2(atmNum) );
887  Real base2_x=0, base2_y=0, base2_z =0;
888  if( has_base2 ){
889  base2_x = rsd.atom(rsd.abase2(atmNum)).xyz().x();
890  base2_y = rsd.atom(rsd.abase2(atmNum)).xyz().y();
891  base2_z = rsd.atom(rsd.abase2(atmNum)).xyz().z();
892  }
893 
894 
895  statement stmt = (*db_session)
896  << "INSERT INTO hbond_site_atoms (struct_id, site_id, atm_x, atm_y, atm_z, base_x, base_y, base_z, bbase_x, bbase_y, bbase_z, base2_x, base2_y, base2_z) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?);"
897  << struct_id
898  << site_id
899  << atm_x << atm_y << atm_z
900  << base_x << base_y << base_z
901  << bbase_x << bbase_y << bbase_z;
902  if( has_base2 ){
903  stmt << base2_x << base2_y << base2_z;
904  } else {
905  stmt.bind_null();
906  stmt.bind_null();
907  stmt.bind_null();
908  }
909  basic::database::safely_write_to_database(stmt);
910 
911 }
912 
913 void
915  HBond const & hbond,
916  boost::uuids::uuid struct_id,
917  Size hbond_id,
918  AtomID_Map< Size > const & site_ids, // This is for ranking hbonds
919  AtomID_Map< vector1<HBondCOP> > const & site_partners,
920  sessionOP db_session
921 ){
922  ASSERT_ONLY( bool found_don_partner( false ); )
923 
924  //Zero if unique
925  //i in 1 through n if ith lowest energy hbond made with this site
926  Size donRank=0, accRank=0;
927  vector1< HBondCOP > don_partners(
928  site_partners(hbond.don_res(), hbond.don_hatm()));
929  if (don_partners.size() > 1){
930  donRank++;
931  }
932  foreach(HBondCOP candidate_hbond, don_partners){
933  if(hbond == *candidate_hbond){
934  ASSERT_ONLY( found_don_partner = true; )
935  break;
936  } else {
937  ++donRank;
938  }
939  }
940  assert(found_don_partner);
941 
942  ASSERT_ONLY( bool found_acc_partner(false); )
943  vector1< HBondCOP > acc_partners(
944  site_partners(hbond.acc_res(), hbond.acc_atm()));
945 
946  if (acc_partners.size() > 1){
947  accRank++;
948  }
949 
950  foreach(HBondCOP candidate_hbond, acc_partners){
951  if(hbond == *candidate_hbond){
952  ASSERT_ONLY( found_acc_partner = true; )
953  break;
954  } else {
955  ++accRank;
956  }
957  }
958  assert(found_acc_partner);
959 
960  Size const don_id( site_ids(hbond.don_res(), hbond.don_hatm()) );
961  Size const acc_id( site_ids(hbond.acc_res(), hbond.acc_atm()) );
962  Size const HBEvalType( hbond.eval_type() );
963  Real const energy( hbond.energy() );
964  Real const envWeight( hbond.weight() );
965  Real const score_weight(
966  hb_eval_type_weight(hbond.eval_type(), scfxn_->weights(), false /*intra_res*/ ));
967 
968  statement stmt = (*db_session)
969  << "INSERT INTO hbonds (struct_id, hbond_id, don_id, acc_id, HBEvalType, energy, envWeight, score_weight, donRank, accRank) VALUES (?,?,?,?,?,?,?,?,?,?);"
970  << struct_id
971  << hbond_id
972  << don_id
973  << acc_id
974  << HBEvalType
975  << energy
976  << envWeight
977  << score_weight
978  << donRank
979  << accRank;
980  basic::database::safely_write_to_database(stmt);
981 }
982 
983 void
985  Pose const & pose,
986  HBondOptions const & hbond_options,
987  HBond const & hbond,
988  boost::uuids::uuid struct_id,
989  Size hbond_id,
990  sessionOP db_session
991 ){
992  const Residue acc_res( pose.residue(hbond.acc_res()));
993  const Vector Axyz(acc_res.atom(hbond.acc_atm()).xyz());
994  const Vector Bxyz(acc_res.atom(acc_res.atom_base(hbond.acc_atm())).xyz());
995  const Vector B2xyz(acc_res.atom(acc_res.abase2(hbond.acc_atm())).xyz());
996  const Residue don_res( pose.residue(hbond.don_res()));
997  const Vector Hxyz(don_res.atom(hbond.don_hatm()).xyz());
998  const Vector Dxyz(don_res.atom(don_res.atom_base(hbond.don_hatm())).xyz());
999 
1000 
1001  // Paraphrase hb_energy_deriv (when called with atomic coordinates):
1002  Vector HDunit( Dxyz - Hxyz );
1003  Real const HDdist2( HDunit.length_squared() );
1004  Real const inv_HDdist = 1.0f / std::sqrt( HDdist2 );
1005  HDunit *= inv_HDdist;
1006  Vector BAunit;
1007  Vector PBxyz; // pseudo base atom
1008  Hybridization acc_hybrid( get_hbe_acc_hybrid( hbond.eval_type() ) );
1009  make_hbBasetoAcc_unitvector(hbond_options, acc_hybrid, Axyz, Bxyz, B2xyz, PBxyz, BAunit);
1010 
1011  // Paraphrase hb_energy_deriv (when called with coords/vectors)
1012  Vector AH = Hxyz - Axyz;
1013  Real const AHdist2( AH.length_squared() );
1014  Real const AHdist = std::sqrt(AHdist2);
1015  Real const inv_AHdist = 1.0f / AHdist;
1016  Vector AHunit = AH * inv_AHdist;
1017 
1018  Real const cosAHD = dot( AHunit, HDunit );
1019  Real const cosBAH = dot( BAunit, AHunit );
1020 
1021  float const chi(dihedral_radians(B2xyz, Bxyz, Axyz, Hxyz));
1022 
1023  statement stmt = (*db_session)
1024  << "INSERT INTO hbond_geom_coords VALUES (?,?,?,?,?,?);"
1025  << struct_id
1026  << hbond_id
1027  << AHdist
1028  << cosBAH
1029  << cosAHD
1030  << chi;
1031  basic::database::safely_write_to_database(stmt);
1032 
1033 }
1034 
1035 // right now this just reports the lennard jones values for hbond atoms
1036 void
1038  Pose const & pose,
1039  HBond const & hbond,
1040  boost::uuids::uuid struct_id,
1041  Size hbond_id,
1042  sessionOP db_session
1043 ){
1044 
1045  Residue const & don_res(pose.residue(hbond.don_res()));
1046  Residue const & acc_res(pose.residue(hbond.acc_res()));
1047  Size const don_hatmNum(hbond.don_hatm());
1048  Size const acc_atmNum(hbond.acc_atm());
1049  Size const don_datmNum(don_res.atom_base(don_hatmNum));
1050  Size const acc_batmNum(acc_res.atom_base(acc_atmNum));
1051 
1052  TableLookupEtableEnergy const etable_energy(
1053  *ScoringManager::get_instance()->etable(
1054  scfxn_->energy_method_options().etable_type() ),
1055  scfxn_->energy_method_options() );
1056 
1057  Real bb_dummy, dsq_dummy;
1058 
1059  Real don_acc_atrE, don_acc_repE, don_acc_solv;
1060  etable_energy.atom_pair_energy(
1061  don_res.atom(don_datmNum), acc_res.atom(acc_atmNum),
1062  /*weight*/ 1,
1063  don_acc_atrE, don_acc_repE, don_acc_solv,
1064  bb_dummy, dsq_dummy );
1065  don_acc_atrE *= (*scfxn_)[ fa_atr ];
1066  don_acc_repE *= (*scfxn_)[ fa_rep ];
1067  don_acc_solv *= (*scfxn_)[ fa_sol ];
1068 
1069  Real don_acc_base_atrE, don_acc_base_repE, don_acc_base_solv;
1070  etable_energy.atom_pair_energy(
1071  don_res.atom(don_datmNum), acc_res.atom(acc_batmNum),
1072  /*weight*/ 1,
1073  don_acc_base_atrE, don_acc_base_repE, don_acc_base_solv,
1074  bb_dummy, dsq_dummy );
1075  don_acc_base_atrE *= (*scfxn_)[ fa_atr ];
1076  don_acc_base_repE *= (*scfxn_)[ fa_rep ];
1077  don_acc_base_solv *= (*scfxn_)[ fa_sol ];
1078 
1079  Real h_acc_atrE, h_acc_repE, h_acc_solv;
1080  etable_energy.atom_pair_energy(
1081  don_res.atom(don_hatmNum), acc_res.atom(acc_atmNum),
1082  /*weight*/ 1,
1083  h_acc_atrE, h_acc_repE, h_acc_solv,
1084  bb_dummy, dsq_dummy );
1085  h_acc_atrE *= (*scfxn_)[ fa_atr ];
1086  h_acc_repE *= (*scfxn_)[ fa_rep ];
1087  h_acc_solv *= (*scfxn_)[ fa_sol ];
1088 
1089  Real h_acc_base_atrE, h_acc_base_repE, h_acc_base_solv;
1090  etable_energy.atom_pair_energy(
1091  don_res.atom(don_hatmNum), acc_res.atom(acc_batmNum),
1092  /*weight*/ 1,
1093  h_acc_base_atrE, h_acc_base_repE, h_acc_base_solv,
1094  bb_dummy, dsq_dummy );
1095  h_acc_base_atrE *= (*scfxn_)[ fa_atr ];
1096  h_acc_base_repE *= (*scfxn_)[ fa_rep ];
1097  h_acc_base_solv *= (*scfxn_)[ fa_sol ];
1098 
1099 
1100  statement stmt = (*db_session)
1101  << "INSERT INTO hbond_lennard_jones (struct_id, hbond_id, don_acc_atrE, don_acc_repE, don_acc_solv, don_acc_base_atrE, don_acc_base_repE, don_acc_base_solv, h_acc_atrE, h_acc_repE, h_acc_solv, h_acc_base_atrE, h_acc_base_repE, h_acc_base_solv) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?);"
1102  << struct_id
1103  << hbond_id
1104  << don_acc_atrE
1105  << don_acc_repE
1106  << don_acc_solv
1107  << don_acc_base_atrE
1108  << don_acc_base_repE
1109  << don_acc_base_solv
1110  << h_acc_atrE
1111  << h_acc_repE
1112  << h_acc_solv
1113  << h_acc_base_atrE
1114  << h_acc_base_repE
1115  << h_acc_base_solv;
1116  basic::database::safely_write_to_database(stmt);
1117 
1118 }
1119 
1120 // This follows the definition of the dehydron described in:
1121 //1. Fernández A, Scheraga H a. Insufficiently dehydrated hydrogen bonds as determinants of protein interactions. Proceedings of the National Academy of Sciences of the United States of America. 2003;100(1):113-8. Available at: http://www.pubmedcentral.nih.gov/articlerender.fcgi?artid=140898&tool=pmcentrez&rendertype=abstract.
1122 
1123 // The idea is that if the wrapping number is low, then the hydrogen
1124 // bond is "underwrapped". Underwrapped hydrogen bonds are 'sticky'
1125 // because, when they are wrapped, the hydrogen bond becomes harder to
1126 // break. I'm not sure how this makes them sticky, but it is at least
1127 // something that can be easily measured so why not?
1128 void
1130  Pose const & pose,
1131  HBond const & hbond,
1132  boost::uuids::uuid struct_id,
1133  Size hbond_id,
1134  sessionOP db_session
1135 ){
1136 
1137 
1138  Real const wrapping_radius(6.5);
1139  Size wrapping_count(0);
1140 
1141  Residue const & don_res(pose.residue(hbond.don_res()));
1142  Residue const & acc_res(pose.residue(hbond.acc_res()));
1143 
1144  Vector const & don_res_ca_xyz(don_res.xyz("CA"));
1145  Vector const & acc_res_ca_xyz(acc_res.xyz("CA"));
1146 
1147 
1148  TenANeighborGraph const & tenA(pose.energies().tenA_neighbor_graph());
1149 
1150  // For each neighboring residue to the donor
1152  ni = tenA.get_node(hbond.don_res())->const_edge_list_begin(),
1153  ni_end = tenA.get_node(hbond.don_res())->const_edge_list_end();
1154  ni != ni_end; ++ni){
1155  Residue const & nbr_res(pose.residue((*ni)->get_other_ind(hbond.don_res())));
1156 
1157  // sum all CH_n groups with in the wrapping radius of the c-alpha
1158  // atom of the donor residue.
1159  for(Size atm_i = 1; atm_i <= nbr_res.nheavyatoms(); ++atm_i){
1160  if(nbr_res.type().atom_type(atm_i).element() == "C" &&
1161  don_res_ca_xyz.distance(nbr_res.xyz(atm_i)) <= wrapping_radius){
1162  wrapping_count++;
1163  }
1164  }
1165  }
1166 
1167  // for each neighboring residue to the acceptor
1169  ni = tenA.get_node(hbond.don_res())->const_edge_list_begin(),
1170  ni_end = tenA.get_node(hbond.don_res())->const_edge_list_end();
1171  ni != ni_end; ++ni){
1172  Residue const & nbr_res(pose.residue((*ni)->get_other_ind(hbond.don_res())));
1173 
1174  // sum all CH_n groups with the wrapping radius of the c-alpha
1175  // atom of the acceptor but not within wrapping radius of the
1176  // c-alpha atom of the donor. This prevents double counting
1177  // wrapping non-polar groups that are in both wrapping spheres.
1178  for(Size atm_i = 1; atm_i <= nbr_res.nheavyatoms(); ++atm_i){
1179  if(nbr_res.type().atom_type(atm_i).element() == "C" &&
1180  don_res_ca_xyz.distance(nbr_res.xyz(atm_i)) > wrapping_radius &&
1181  acc_res_ca_xyz.distance(nbr_res.xyz(atm_i)) <= wrapping_radius){
1182  wrapping_count++;
1183  }
1184  }
1185  }
1186 
1187  statement stmt = (*db_session)
1188  << "INSERT INTO hbond_dehydrons (struct_id, hbond_id, wrapping_count) VALUES (?,?,?);"
1189  << struct_id
1190  << hbond_id
1191  << wrapping_count;
1192  basic::database::safely_write_to_database(stmt);
1193 
1194 }
1195 
1196 
1197 
1198 
1199 } // namesapce
1200 } // namespace