Your mail was buried in my mailbox, sorry for this late answer... On Tue, 8 Aug 2006, Rob Schellhorn wrote: > Hi all, > > I'am working on a Bioclipse plug-in which allows for using libghemical and > making good progress. Now I have some questions however: > > 1) My first goal is to get MM calculations working. This is how I call > libghemical: > JNI_Wrapper *wrapper = ...; > model *m = new model(); > // ... > ParseModel(wrapper, m, in); // See description below > m->AddHydrogens(); > m->DoEnergy(); > // ... return; > > The wrapper objects reads from my Java model, which provides an array of > atoms and bonds. The idea is that the plug-in must handle all CDK > (http://almost.cubic.uni-koeln.de/cdk/cdk_top) supported formats. Those > formats might contains Hydrogen atoms and bonds containing Hydrogen atoms, so > my first assumption is to skip them, because they are handled by the > AddHydrogens method. Is this assumption correct or do I need to process them > otherwise? I would suggest that the H atoms are not added, unless the user specifically says to do so. So it's better to just use those H atoms that were originally there. > Second, the atom coordinates routine I took from the winlibghemical demo > application, which scales the coordinates. I think is is specific for that > input format, so what is the unit those coordinates must be? The unit of distance is nanometer (nm) in libghemical. The Ångström unit is quite often used, and then you need a conversion factor of 1/10 : 1 Ångström = 0.1 nm = 1*10^-10 m 1 nm = 10 Ångström = 1*10^-9 m > As I run a computation for 2-methylpropan-1-ol > ==> > http://svn.sourceforge.net/viewvc/bioclipse/branches/b1/bc_blueobelisk_data/data/chemical-structures/alcohols/2-methylpropan-1-ol.cml?view=markup > > The output is: > PrintToLog: Using default rules in AddHydrogens(). > creating bt1-terms: 14 terms, 0 errors. > creating bt2-terms: 25 terms, 0 errors. > creating bt3-terms: 30 terms, 0 errors. > creating nbt1-terms: PrintToLog: Calculating Energy (setup = allmm, engine > = tripos5.2 implementation ported from ghemical-1.00). > PrintToLog: Energy = 1932265.41311765 kJ/mol > > Which seems to be ok, but I like to verify the output (which has a positive > value?). Is it correct the energy of MM calculations is positive or is there > something going wrong? Looks good otherwise, except that the energy is very high. Perhaps you have a scaling problem with coordinates. Your molecule is either "too big" or "too small" by a factor of 10 (because of a missing nm/Å unit conversion). > 2) I like to read those calculated values from the model, but can't figure > out how I can access that data. Perhaps someone can point me in the right > direction? Please look at the example codes placed into subdir src/simple_test of the libghemical source tree. If something is missing there, please tell me and I'll add some new examples there ; this is probably better in the long run than just explaining the things here at the mailing list. Regards, Tommi