shirtsgroup / InterMol

Conversion tool for molecular simulations
MIT License
187 stars 54 forks source link

Add an option to specify the output units #329

Open maaren opened 7 years ago

maaren commented 7 years ago

The ability to specify the output units, would help to troubleshoot amber related issues, as its output only has 4 digits after the decimal point. I would be easier to determine if a difference is due to lack of accuracy or a more fundamental issue.

mrshirts commented 7 years ago

Currently, the units are always in the energy of the input file. Is there a clear reason that one would want to have freedom to specify? I think you're saying that if you could specify kcal/mol, then you could see if the differences were due to rounding, but in kJ/mol (if GROMACS was the input), you can't tell visually if it's rounding?

maaren commented 7 years ago

Maybe an example helps. Eg pyrimidine (in kJ/mol):

Energy group summary

            type     input(gromacs)    output (amber)      diff (amber)

Not comparable energies: are likely not to be the same

    coulomb (SR)        63.13835519        0.00000000      -63.13835519
   coulomb total      -441.96473795     -441.94964400        0.01509395
      coulomb-14      -505.10309314     -505.08578560        0.01730754
          proper         0.02407067        0.02426720        0.00019653
        vdw (SR)        -0.65790812        0.00000000        0.65790812
       vdw total        32.17526326       32.17537840        0.00011514
          vdw-14        32.83317138       32.83310320       -0.00006818

Comparable energy terms: these should be very close

           angle         4.07600637        4.07605280        0.00004643
            bond         0.43761996        0.43764640        0.00002644
          bonded         4.53769701        4.53796640        0.00026939
        dihedral         0.02407067        0.02426720        0.00019653
       nonbonded      -409.78947469     -409.77426560        0.01520909
       potential      -405.25177769     -405.23629920        0.01547849

and in kcal/mol:

Energy group summary

            type     input(gromacs)    output (amber)      diff (amber)

Not comparable energies: are likely not to be the same

    coulomb (SR)        15.09042906        0.00000000      -15.09042906
   coulomb total      -105.63210754     -105.62850000        0.00360754
      coulomb-14      -120.72253660     -120.71840000        0.00413660
          proper         0.00575303        0.00580000        0.00004697
        vdw (SR)        -0.15724381        0.00000000        0.15724381
       vdw total         7.69007248        7.69010000        0.00002752
          vdw-14         7.84731629        7.84730000       -0.00001629

Comparable energy terms: these should be very close

           angle         0.97418890        0.97420000        0.00001110
            bond         0.10459368        0.10460000        0.00000632
          bonded         1.08453561        1.08460000        0.00006439
        dihedral         0.00575303        0.00580000        0.00004697
       nonbonded       -97.94203506      -97.93840000        0.00363506
       potential       -96.85749945      -96.85380000        0.00369945

You see immediately that the difference in dihedral energy is rounding, but the difference in coulomb-14 is probably a conversion issue.