In [1]:
%matplotlib inline
import pymc
import seaborn
import numpy
import glob
import matplotlib as mpl
import matplotlib.pyplot as plt
from chemistry.charmm import CharmmParameterSet
import TorsionFitModel
import TorsionScanSet

In [2]:
param = CharmmParameterSet('../../charmm_ff/top_all36_cgenff.rtf', '../../charmm_ff/par_all36_cgenff.prm')
stream = '../../structures/Pyrrol/pyrrol.str'
structure = '../../structures/Pyrrol/pyrrol.psf'
scan = glob.glob('../../structures/Pyrrol/torsion-scan/*.log')
pyrrol = TorsionScanSet.read_scan_logfile(scan, structure)
pyrrol_opt = pyrrol.extract_geom_opt()


#create pymc model
model = TorsionFitModel.TorsionFitModel(param, stream, pyrrol_opt)
mcmc = pymc.MCMC(model.pymc_parameters)


loading ../../structures/Pyrrol/torsion-scan/PRL.scan2.neg.log
loading ../../structures/Pyrrol/torsion-scan/PRL.scan2.pos.log
loading ../../structures/Pyrrol/torsion-scan/PRL.scan3.neg.log
loading ../../structures/Pyrrol/torsion-scan/PRL.scan3.pos.log
loading ../../structures/Pyrrol/torsion-scan/PRL.scan4.neg.log
loading ../../structures/Pyrrol/torsion-scan/PRL.scan4.pos.log
loading ../../structures/Pyrrol/torsion-scan/PRL.scan5.neg.log
loading ../../structures/Pyrrol/torsion-scan/PRL.scan5.pos.log

In [5]:
# import database
db = pymc.database.sqlite.load('pyrrol.database')

In [14]:
plt.plot(pyrrol_opt.qm_energy), plt.plot(pyrrol_opt.mm_energy)


Out[14]:
([<matplotlib.lines.Line2D at 0x149fca090>],
 [<matplotlib.lines.Line2D at 0x149fca390>])

In [59]:
seaborn.tsplot(db.trace('mm_energy')[:], err_style='unit_traces'), plt.plot(pyrrol_opt.qm_energy, color='r')


Out[59]:
(<matplotlib.axes._subplots.AxesSubplot at 0x218b68f50>,
 [<matplotlib.lines.Line2D at 0x218d29350>])

In [64]:
plt.hist(db.trace('PRL1_offset')[:]) 
#seaborn.rugplot(db.trace('PRL1_offset')[:])


Out[64]:
(array([  873.,   931.,   970.,  1083.,  1084.,  1110.,  1064.,   966.,
          986.,   933.]),
 array([ -9.99011600e+00,  -7.99213170e+00,  -5.99414740e+00,
         -3.99616310e+00,  -1.99817880e+00,  -1.94500000e-04,
          1.99778980e+00,   3.99577410e+00,   5.99375840e+00,
          7.99174270e+00,   9.98972700e+00]),
 <a list of 10 Patch objects>)

In [18]:
plt.plot(db.trace('log_sigma')[:])


Out[18]:
[<matplotlib.lines.Line2D at 0x16d2430d0>]

In [19]:
plt.hist(db.trace('sigma')[:])


Out[19]:
(array([    7.,     0.,     0.,     0.,    74.,  1420.,  2312.,  1573.,
         1682.,  2932.]),
 array([ 0.01     ,  0.1089944,  0.2079888,  0.3069832,  0.4059776,
         0.504972 ,  0.6039664,  0.7029608,  0.8019552,  0.9009496,
         0.999944 ]),
 <a list of 10 Patch objects>)

In [39]:
plt.plot(db.trace('CG251O_NG3C51_CG321_HGA2_multiplicity_bitstring')[:])


Out[39]:
[<matplotlib.lines.Line2D at 0x198f27290>]

In [53]:
plt.hist(db.trace('CG251O_NG3C51_CG2R51_CG2R51_multiplicity_bitstring')[:], bins=15)


Out[53]:
(array([ 2810.,  2534.,  1462.,   698.,   803.,   254.,   221.,    43.,
          569.,   103.,   283.,    42.,   135.,    21.,    22.]),
 array([  0.        ,   0.93333333,   1.86666667,   2.8       ,
          3.73333333,   4.66666667,   5.6       ,   6.53333333,
          7.46666667,   8.4       ,   9.33333333,  10.26666667,
         11.2       ,  12.13333333,  13.06666667,  14.        ]),
 <a list of 15 Patch objects>)

In [57]:
plt.hist(db.CG251O_NG3C51_CG2R51_HGR52_multiplicity_bitstring[:], alpha=.3, bins=23)
seaborn.rugplot(db.trace('CG251O_NG3C51_CG2R51_HGR52_multiplicity_bitstring')[:])


Out[57]:
<matplotlib.axes._subplots.AxesSubplot at 0x1e8f2ef50>

In [23]:
plt.hist(db.CG251O_NG3C51_CG321_CG321_multiplicity_bitstring[:], alpha=.3)
seaborn.rugplot(db.trace('CG251O_NG3C51_CG321_CG321_multiplicity_bitstring')[:])


Out[23]:
<matplotlib.axes._subplots.AxesSubplot at 0x16be35790>

In [ ]: