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

Error for experiments without syringe concentration #42

Open bas-rustenburg opened 9 years ago

bas-rustenburg commented 9 years ago

See :

EXPERIMENT

Source filename: /home/bas/Git/choderalab/host-guest/SAMPL4-CB7/itc/data/02042015/20150204a15.itc
Number of injections: 11
Target temperature: 298.1 K
Equilibration time before first injection: 300.0 s
Syringe concentration: 0.000 mM
Cell concentration: 0.029 mM
Cell volume: 0.203 ml
Reference power: 5.000 ucal/s

INJECTIONS

       injection              volume (uL)             duration (s)      collection time (s)            time step (s)      evolved heat (ucal)
               1                    0.200                    0.400                   60.000                    1.000                    0.019
               2                    3.000                    6.000                  120.000                    0.500                    0.068
               3                    3.000                    6.000                  120.000                    0.500                    0.112
               4                    3.000                    6.000                  120.000                    0.500                    0.134
               5                    3.000                    6.000                  120.000                    0.500                    0.061
               6                    3.000                    6.000                  120.000                    0.500                    0.014
               7                    3.000                    6.000                  120.000                    0.500                    0.080
               8                    3.000                    6.000                  120.000                    0.500                    0.079
               9                    3.000                    6.000                  120.000                    0.500                    0.036
              10                    3.000                    6.000                  120.000                    0.500                    0.073
              11                    3.000                    6.000                  120.000                    0.500                    0.045

ERROR::bitc_util:L152
math domain error
ERROR::bitc_util:L153
Traceback (most recent call last):
  File "bitc_util.py", line 150, in <module>
    model = Model(experiment, instrument)
  File "/home/bas/anaconda/lib/python2.7/site-packages/bitc-0.0.0-py2.7.egg/bitc/models.py", line 220, in __init__
    self.Ls = pymc.Lognormal('Ls', mu=log(Ls_stated / ureg.micromolar), tau=1.0/log(1.0+(dLs/Ls_stated)**2), value=Ls_stated / ureg.micromolar)
ValueError: math domain error

Traceback (most recent call last):
  File "bitc_util.py", line 154, in <module>
    raise Exception("MCMC model could not me constructed!\n" + str(e))
Exception: MCMC model could not me constructed!
math domain error

Is likely easily fixed by an if statement.

bas-rustenburg commented 9 years ago

Also leads to some errors with units (cal / mole vs cal). I suppose the model is just not adequate for this type of experiment. I have made a new model in a separate branch that can deal with calibrations which might be useful. I'm also working on a class where you can combine multiple .itc files and construct one model from that.