choderalab / bayesian-itc

Python tools for the analysis and modeling of isothermal titration calorimetry (ITC) experiments.
GNU General Public License v3.0
5 stars 10 forks source link

bitc_util.py not writing out all statistics #58

Open bas-rustenburg opened 9 years ago

bas-rustenburg commented 9 years ago

Some values not properly extracted, returns 0.

DeltaH:      -430.72 +-   274.65 cal/mol     [ -920.26,   157.12] 
H_0:       -0.00 +-     0.00 cal         [   -0.00,     0.00] 
Ls:         2.06 +-     0.20 mM           [    1.68,     2.48] 
sigma:   0.00000 +-  0.00000 ucal/s^(1/2) [ 0.00000,  0.00000] 
bas-rustenburg commented 9 years ago

H_0 and sigma are in units of calorie instead of microcalorie. Fixing it together with the newly implemented models in PR #57. Labeling in bitc_util.py is also inconsistent and wrong.

bas-rustenburg commented 9 years ago

FYI the calculation in models.py looks correct, but order of magnitude used is just troublesome. In my earlier efforts to clean up the unit system, the order of magnitude was changed.

bas-rustenburg commented 9 years ago

This looks better. Adding comments to the models code where order of magnitude conversions are taking place between units , e.g. in the expected_injection_heats functions that do not have explicit units on the inside.

DG:        -4.49 +-     0.08 kcal/mol     [   -4.65,    -4.34]
DH:       -11.07 +-     1.54 kcal/mol     [  -14.49,    -8.22]
DH0:       -0.05 +-     0.03 ucal         [   -0.10,     0.01]
Ls:         1.01 +-     0.10 uM           [    0.84,     1.23]
P0:         0.03 +-     0.00 uM           [    0.03,     0.04]
sigma:   0.02523 +-  0.00758 ucal/s^(1/2) [ 0.01528,  0.04342]
jchodera commented 9 years ago

This is looking good!

I think we should write a method to correctly output means and standard errors to correct sig figs.

We assume we only know the standard error to one sig fig, so we truncate it to this sig fig. This determines how many decimal places of the corresponding quantity to print. For example, this would become

DG:        -4.49  +-     0.08 kcal/mol      [   -4.65,    -4.34]
DH:       -11     +-     2    kcal/mol      [  -14.49,    -8.22]
DH0:       -0.05  +-     0.03 ucal          [   -0.10,     0.01]
Ls:         1.0   +-     0.1  uM            [    0.84,     1.23]
P0:         0.030 +-     0.001 uM           [    0.03,     0.04]
sigma:      0.025 +-     0.006 ucal/s^(1/2) [ 0.01528,  0.04342]
bas-rustenburg commented 9 years ago

We assume we only know the standard error to one sig fig, so we truncate it to this sig fig. This determines how many decimal places of the corresponding quantity to print.

Good to know. Are there any existing (python) tools to do smart-formatting like that? I could probably write something myself if necessary.

I think we should write a method to correctly output means and standard errors to correct sig figs.

Absolutely! Will see what I can do there. Maybe pymc.matplot already has some functionality.

jchodera commented 9 years ago

Maybe this? http://code.obs.carnegiescience.edu/carnegie-python-distribution/burns-python-scripts/modules/sigfig.py/view

bas-rustenburg commented 9 years ago

Great find, it works well as far as I can tell. Should I add it to the bayesian-itc repo? I might make a separate conda package for it sometime.

bas-rustenburg commented 9 years ago

Found this on pypi

https://pypi.python.org/pypi/sigfig/0.1

Has the same name, provides a similar functionality. Might be better to use this instead of the other script just to prevent confusion, though I prefer the documentation on the carpy one. Does the GPL allow redistribution under a different name?

jchodera commented 9 years ago

Sounds good!