In [1]:
import matplotlib.pyplot as plt 
import numpy as np
from matplotlib.legend_handler import HandlerLine2D
import matplotlib.lines as mlines
from scipy.interpolate import interp1d
from scipy.interpolate import griddata

$RMSD_{KLDiv}=\sqrt{\frac{\sum_{i}\left(\left(F-\left<F\right>\right)-\left(F_{ref}-\left<F_{ref}\right>\right)\right)^2 e^{-\beta F_{ref,i}} }{\sum_{i} e^{-\beta F_{ref,i}}}}$

$RMSD_{CUT}=\sqrt{\frac{\sum_{i}\left(\left(F-\left<F\right>\right)-\left(F_{ref}-\left<F_{ref}\right>\right)\right)^2 \theta\left(\nu-F_{ref} \right) }{\sum_{i} \theta\left(\nu-F_{ref} \right)}}$


In [2]:
def RMSDall(var,var2,kt,nu):
    #where var = current , var2 = ref  
    
    #NOTE --> THESE ARE ALIGNED ON MIN F NOT AVERAGE! THERE ARE ARTIFICIAL HIGH ENERGY STRUCTURES 
    # YOU CAN EASILY IMPLEMENT AN ALIGNMENT BASED ON AVG BELOW NU BUT DID NOT ...
    val1=0
    val2=0
    val3=0

    RMSDKl=0
    RMSDCut=0
    refmean=np.mean(var2)
    newmean=np.mean(var)
    (a,b)=np.shape(var2)
    
    #heavyside mean: 
    for i in np.arange(a):
        for j in np.arange(b):
            if (var2[i,j] < nu):
                val1=val1+var2[i,j]
                val2=val2+1
                val3=val3+var[i,j] # for current mean 
                
    refmeanH=val1/val2
    newmeanH=val3/val2
    val1=0
    val2=0
    val3=0
    
    for i in np.arange(a):
        for j in np.arange(b):
            RMSDKl=RMSDKl+np.power((var[i,j]-newmean)-(var2[i,j]-refmean),2)*np.exp(-var2[i,j]/kt)
            val1=val1+np.exp(-var2[i,j]/kt)
       
            if (var2[i,j] < nu):
                RMSDCut=RMSDCut + np.power((var[i,j]-newmeanH)-(var2[i,j]-refmeanH),2)
                val2=val2+1
                
            
    RMSDKl=np.sqrt(RMSDKl/val1)
    RMSDCut=np.sqrt(RMSDCut/val2)
  
    return [RMSDKl,RMSDCut]

In [3]:
def RMSDallnomean(var,var2,kt,nu):
    #where var = current , var2 = ref  
    
    #NOTE --> THESE ARE ALIGNED ON MIN F NOT AVERAGE! THERE ARE ARTIFICIAL HIGH ENERGY STRUCTURES 
    # YOU CAN EASILY IMPLEMENT AN ALIGNMENT BASED ON AVG BELOW NU BUT DID NOT ...
    val1=0
    val2=0
    RMSDKl=0
    RMSDCut=0
    refmean=np.mean(var2)
    newmean=np.mean(var)
    (a,b)=np.shape(var2)
    for i in np.arange(a):
        for j in np.arange(b):
            RMSDKl=RMSDKl+np.power(var[i,j]-var2[i,j],2)*np.exp(-var2[i,j]/kt)
            val1=val1+np.exp(-var2[i,j]/kt)
       
            if (var2[i,j] < nu):
                RMSDCut=RMSDCut + np.power(var[i,j]-var2[i,j],2)
                val2=val2+1
                
            
    RMSDKl=np.sqrt(RMSDKl/val1)
    RMSDCut=np.sqrt(RMSDCut/val2)
  
    return [RMSDKl,RMSDCut]

In [141]:
kt=300.0*8.314e-3
nu=8.314e-3*300.0*8 #about 15 kJ/mol 
fill=1000.0
method='cubic'

fesdata2 = np.genfromtxt('ALA2/whamfes.dat',comments='#');

dim1=50
dim2=50
fesdata2 = fesdata2[:,0:3]
enertokcal=8.314e-3*300

#some post-processing to be compatible with contourf 
#X2=np.reshape(fesdata2[:,0],[dim1,dim2],order="F")  #order F was 20% faster than A/C
#Y2=np.reshape(fesdata2[:,1],[dim1,dim2],order="F") 
#Z2=np.reshape((fesdata2[:,2]-np.min(fesdata2[:,2]))/1.0,[dim1,dim2],order="F")  #convert to kcal/mol


gX, gY = np.mgrid[-3.0:3.0:50j, -3.0:3.0:50j ]

Z2new=griddata(fesdata2[:,:2],fesdata2[:,2],(gX, gY),method='cubic',fill_value=1000)

RMSD=np.array([])
RMSD2=np.array([])

#REMEMBER TO CHECK THIS IS FEEDING THE DATA IN THE FILESET THE WAY YOU EXPECT! 
files100= !ls ALA2/WTM-2/fes.dat.* | sort -n -t . -k 3

for name in files100:
    tempfes=np.genfromtxt(name,comments='#')
    tempfes = tempfes[:,0:3]
    #some post-processing to be compatible with contourf 
    #Z=np.reshape((tempfes[:,2]-np.min(tempfes[:,2]))/1.0,[dim1,dim2],order="F")  #convert to kcal/mol
    Z=griddata(tempfes[:,:2],tempfes[:,2],(gX, gY),method='cubic',fill_value=1000)
    var=RMSDall(Z,Z2new,kt,nu) 
    RMSD=np.append(RMSD,var[0])
    RMSD2=np.append(RMSD2,var[1])

In [142]:
%matplotlib inline 
fig = plt.figure(figsize=(10,5))
fig.subplots_adjust(left=None, bottom=None, right=None, top=None, wspace=None, hspace=0.5)
plt.rcParams.update({'font.size': 12})
 
axes = fig.add_subplot(121)
axes.grid()
axes.plot(np.arange(0,np.size(RMSD))*5,np.power(RMSD/kt,2)*np.arange(0,np.size(RMSD))*5,label='KLDIV',color='red',lw=2)
axes.plot(np.arange(0,np.size(RMSD2))*5,np.power(RMSD2/kt,2)*np.arange(0,np.size(RMSD2))*5,label='RMSDcut',color='blue',lw=2)


axes.set_xlabel('Simulation Time (ns)')
axes.set_ylabel('RMSD^2 * time ')

axes2 = fig.add_subplot(122)
axes2.grid()
axes2.plot(np.arange(0,np.size(RMSD))*5,RMSD/kt,label='KLDIV',color='red',lw=2)
axes2.plot(np.arange(0,np.size(RMSD2))*5,RMSD2/kt,label='RMSDcut',color='blue',lw=2)


axes2.set_xlabel('Simulation Time (ns)')
axes2.set_ylabel('RMSD (kT) ')

#axes.set_ylim([0,10])
#axes.set_xlim([0,500])
plt.rcParams.update({'font.size': 12})

plt.show()



In [4]:
# phi1 phi2


# phi psi theta zeta vbias phi psi  ctbest
#  0   1    2    3    4     5    6    7
data=np.genfromtxt('ALA2/PBMetad-2D/rewfile_new',comments='#')
#make 2D histogram then replace all zeros with 1e-100

In [ ]:
# read in CV1 CV2 pb.bias 
data=np.genfromtxt('ALA2/PBMetad-2D/rewfile_new',comments='#')
# 
# 
hist, xedges, yedges = np.histogram2d(data[0:stop,0],data[0:stop,1], \
                            bins=bins,normed=True,weights=np.exp(beta*(data[0:stop,4])

In [31]:
kt=300.0*8.314e-3
beta=1/kt
nu=8.314e-3*300.0*8 #about 15 kJ/mol 
fill=1000.0
bins=50
method='cubic'
points=100

RMSDCT1=np.array([])

fesdata2 = np.genfromtxt('ALA2/WTM-2/fes.dat.100',comments='#');
fesdata2 = fesdata2[:,0:3]
gX, gY = np.mgrid[-3.0:3.0:50j, -3.0:3.0:50j ]
Z2new=griddata(fesdata2[:,:2],fesdata2[:,2],(gX, gY),method=method,fill_value=1000)


for k in np.arange(np.shape(data)[0]/points,np.shape(data)[0],np.shape(data)[0]/points):
    stop=k.astype(int)
    hist, xedges, yedges = np.histogram2d(data[0:stop,0],data[0:stop,1], \
                                             bins=bins,normed=True,weights=np.exp(beta*(data[0:stop,4]-350-data[0:stop,5])))

    # this makes a very small prob = very high free-energy (40kT)
    hist[hist == 0 ] = 1e-100
    hist=(1/beta)*-1.0*np.log(hist)
    dum=np.reshape(hist,-1)
    val=0
    Zmake=np.zeros((2500,3))
    for i in np.nditer(np.r_[0.5 * (xedges[:-1] + xedges[1:])]):
        for j in np.nditer(np.r_[0.5 * (yedges[:-1] + yedges[1:])]):
            Zmake[val,:]=[i,j,dum[val]]
            val=val+1


    hist=griddata(Zmake[:,:2],Zmake[:,2],(gX, gY),method=method,fill_value=1000)
    var=RMSDall(hist,Z2new,kt,nu) 
    RMSDCT1=np.append(RMSDCT1,var[1])

In [32]:
%matplotlib inline 
fig = plt.figure(figsize=(10,5))
fig.subplots_adjust(left=None, bottom=None, right=None, top=None, wspace=None, hspace=0.5)
plt.rcParams.update({'font.size': 12})
plot=RMSDCT1
axes = fig.add_subplot(121)
axes.grid()
axes.plot(np.arange(0,np.size(plot))*10,np.power(plot/kt,2)*np.arange(0,np.size(plot))*10,label='CUT',color='blue',lw=2)

axes.set_xlabel('Simulation Time (ns)')
axes.set_ylabel('RMSD^2 * time ')

axes2 = fig.add_subplot(122)
axes2.grid()
axes2.plot(np.arange(0,np.size(plot))*10,plot/kt,label='CUT',color='blue',lw=2)


axes2.set_xlabel('Simulation Time (ns)')
axes2.set_ylabel('RMSD (kT) ')

#axes.set_ylim([0,10])
#axes.set_xlim([0,500])
plt.rcParams.update({'font.size': 12})

plt.show()



In [33]:
kt=300.0*8.314e-3
beta=1/kt
#nu=8.314e-3*300.0*6 #about 15 kJ/mol 
fill=1000.0
bins=50
method='cubic'
points=100 

RMSDCT2=np.array([])

fesdata2 = np.genfromtxt('ALA2/WTM-2/fes.dat.100',comments='#');
fesdata2 = fesdata2[:,0:3]
gX, gY = np.mgrid[-3.0:3.0:50j, -3.0:3.0:50j ]
Z2new=griddata(fesdata2[:,:2],fesdata2[:,2],(gX, gY),method=method,fill_value=1000)

# %reset_selective stop hist, xedges, yedges, dum, val, Zmake var 



for k in np.arange(np.shape(data)[0]/points,np.shape(data)[0],np.shape(data)[0]/points):
    stop=k.astype(int)
    hist, xedges, yedges = np.histogram2d(data[0:stop,0],data[0:stop,1], \
                                             bins=bins,normed=True,weights=np.exp(beta*(data[0:stop,4]-350-data[0:stop,5])))

    # this makes a very small prob = very high free-energy (40kT)
    hist[hist == 0 ] = 1e-100
    hist=(1/beta)*-1.0*np.log(hist)
    dum=np.reshape(hist,-1)
    val=0
    Zmake=np.zeros((2500,3))
    for i in np.nditer(np.r_[0.5 * (xedges[:-1] + xedges[1:])]):
        for j in np.nditer(np.r_[0.5 * (yedges[:-1] + yedges[1:])]):
            Zmake[val,:]=[i,j,dum[val]]
            val=val+1


    hist=griddata(Zmake[:,:2],Zmake[:,2],(gX, gY),method=method,fill_value=1000)
    var=RMSDall(hist,Z2new,kt,nu) 
    RMSDCT2=np.append(RMSDCT2,var[1])

In [34]:
kt=300.0*8.314e-3
beta=1/kt
#nu=8.314e-3*300.0*6 #about 15 kJ/mol 
fill=1000.0
bins=50
method='cubic'
points=100

RMSDCT3=np.array([])

fesdata2 = np.genfromtxt('ALA2/WTM-2/fes.dat.100',comments='#');
fesdata2 = fesdata2[:,0:3]
gX, gY = np.mgrid[-3.0:3.0:50j, -3.0:3.0:50j ]
Z2new=griddata(fesdata2[:,:2],fesdata2[:,2],(gX, gY),method=method,fill_value=1000)
#%reset_selective stop hist, xedges, yedges, dum, val, Zmake var 


for k in np.arange(np.shape(data)[0]/points,np.shape(data)[0],np.shape(data)[0]/points):
    stop=k.astype(int)
    #ctbest=0.5*(np.exp(data[0:stop,5]*beta/10.0)+np.exp(data[0:stop,6]*beta/10.0))
    #ctbest=np.log(ctbest)/beta
    #print np.size(ctbest)
    hist, xedges, yedges = np.histogram2d(data[0:stop,0],data[0:stop,1], \
                                             bins=bins,normed=True,weights=np.exp(beta*(data[0:stop,4]-350-data[0:stop,7])))

    # this makes a very small prob = very high free-energy (40kT)
    hist[hist == 0 ] = 1e-100
    hist=(1/beta)*-1.0*np.log(hist)
    dum=np.reshape(hist,-1)
    val=0
    Zmake=np.zeros((2500,3))
    for i in np.nditer(np.r_[0.5 * (xedges[:-1] + xedges[1:])]):
        for j in np.nditer(np.r_[0.5 * (yedges[:-1] + yedges[1:])]):
            Zmake[val,:]=[i,j,dum[val]]
            val=val+1


    hist=griddata(Zmake[:,:2],Zmake[:,2],(gX, gY),method=method,fill_value=1000)
    var=RMSDall(hist,Z2new,kt,nu) 
    RMSDCT3=np.append(RMSDCT3,var[1])

In [35]:
%matplotlib inline 
fig = plt.figure(figsize=(10,5))
fig.subplots_adjust(left=None, bottom=None, right=None, top=None, wspace=None, hspace=0.5)
plt.rcParams.update({'font.size': 12})

axes = fig.add_subplot(121)
axes.grid()
plot=RMSDCT1
axes.plot(np.arange(0,np.size(plot))*10,np.power(plot/kt,2)*np.arange(0,np.size(plot))*10,label='CT1',color='blue',lw=2)
plot=RMSDCT2
axes.plot(np.arange(0,np.size(plot))*10,np.power(plot/kt,2)*np.arange(0,np.size(plot))*10,label='CT2',color='red',lw=2)
plot=RMSDCT3
axes.plot(np.arange(0,np.size(plot))*10,np.power(plot/kt,2)*np.arange(0,np.size(plot))*10,label='CTbest',color='green',lw=2,ls='-.')

axes.set_xlabel('Simulation Time (ns)')
axes.set_ylabel('RMSD^2 * time ')

axes2 = fig.add_subplot(122)
axes2.grid()
plot=RMSDCT1
axes2.plot(np.arange(0,np.size(plot))*10,plot/kt,label='phiCT',color='blue',lw=2)
plot=RMSDCT2
axes2.plot(np.arange(0,np.size(plot))*10,plot/kt,label='psiCT',color='red',lw=2)
plot=RMSDCT3
axes2.plot(np.arange(0,np.size(plot))*10,plot/kt,label='CTbest',color='green',lw=2,ls='-.')

axes2.set_xlabel('Simulation Time (ns)')
axes2.set_ylabel('RMSD (kT) ')

#axes2.set_ylim([0,10])
axes2.set_xlim([0,1000])
axes.set_ylim([0,1000])


plt.rcParams.update({'font.size': 12})
plt.legend()
plt.show()



In [54]:
%matplotlib inline 
fig = plt.figure(figsize=(10,5))
fig.subplots_adjust(left=None, bottom=None, right=None, top=None, wspace=None, hspace=0.5)
plt.rcParams.update({'font.size': 12})

axes = fig.add_subplot(121)
axes.grid()
plot=data[::1000,6]-data[::1000,7]
axes.plot(np.arange(0,np.size(plot))*0.2,plot,label='CT1',color='blue',lw=2)
#plot=RMSDCT2
#axes.plot(np.arange(0,np.size(plot))*10,np.power(plot/kt,2)*np.arange(0,np.size(plot))*10,label='CT2',color='red',lw=2)
#plot=RMSDCT3
#axes.plot(np.arange(0,np.size(plot))*10,np.power(plot/kt,2)*np.arange(0,np.size(plot))*10,label='CTbest',color='green',lw=2)

axes.set_xlabel('Simulation Time (ns)')
axes.set_ylabel('RMSD^2 * time ')

axes2 = fig.add_subplot(122)
axes2.grid()
plot=RMSDCT1-RMSDCT2
#axes2.plot(np.arange(0,np.size(plot))*5,plot/kt,label='diff RMSD CT1/CT2',color='blue',lw=2)
plot=RMSDCT2-RMSDCT3
axes2.plot(np.arange(0,np.size(plot))*5,plot/kt,label='diff RMSD CT2/CTb',color='red',lw=2)
#plot=RMSDCT2
#axes2.plot(np.arange(0,np.size(plot))*5,plot/kt,label='CT2',color='red',lw=2)
#plot=RMSDCT3
#axes2.plot(np.arange(0,np.size(plot))*5,plot/kt,label='CTbest',color='green',lw=2,ls='-.')

axes2.set_xlabel('Simulation Time (ns)')
axes2.set_ylabel('RMSD (kT) ')

#axes2.set_ylim([0,10])
axes2.set_xlim([0,500])
#axes.set_xlim([0,500])
plt.rcParams.update({'font.size': 12})
plt.legend()
plt.show()



In [27]:
kt=300.0*8.314e-3
beta=1/kt
nu=8.314e-3*300.0*8 #about 15 kJ/mol 
fill=1000.0
bins=50
method='cubic'
points=10 

fesdata2 = np.genfromtxt('ALA2/WTM-2/fes.dat.100',comments='#');
fesdata2 = fesdata2[:,0:3]
gX, gY = np.mgrid[-3.0:3.0:50j, -3.0:3.0:50j ]
Z2new=griddata(fesdata2[:,:2],fesdata2[:,2],(gX, gY),method=method,fill_value=1000)

stop=np.size(data)
hist, xedges, yedges = np.histogram2d(data[0:stop,0],data[0:stop,1], \
                                             bins=bins,normed=True,weights=np.exp(beta*(data[0:stop,4]-data[0:stop,5])))

    # this makes a very small prob = very high free-energy (40kT)
hist[hist == 0 ] = 1e-100
hist=(1/beta)*-1.0*np.log(hist)
dum=np.reshape(hist,-1)
val=0
Zmake=np.zeros((2500,3))
for i in np.nditer(np.r_[0.5 * (xedges[:-1] + xedges[1:])]):
    for j in np.nditer(np.r_[0.5 * (yedges[:-1] + yedges[1:])]):
        Zmake[val,:]=[i,j,dum[val]]
        val=val+1

hist=griddata(Zmake[:,:2],Zmake[:,2],(gX, gY),method=method,fill_value=1000)

In [31]:
%matplotlib inline
#ang1wt1=np.transpose(ang1wt1)
#what spacing do you want?  
spacer=.05
lines=20 #this goes to kt 
levels=np.linspace(0,lines*spacer,num=(lines+1),endpoint=True)

fig=plt.figure(figsize=(10,8)) 
axes = fig.add_subplot(111)

#plt.contourf(xedges[1::], yedges[1::],np.transpose(np.abs(ang1wt1))/kt ,levels, cmap=plt.cm.bone,)
plt.contourf(gX,gY,np.abs(Z2new-hist)/kt,levels,cmap=plt.cm.bone,)
plt.colorbar()
plt.xlabel('$\Phi 1$')
plt.ylabel('$\Psi 2$')
plt.title('ALA2 FES, PBMetaD rew from ludovico code ')
#axes.set_ylim([.1,.5])

#axes.set_xlim([0.1,0.5])
plt.rcParams.update({'font.size': 18})
plt.show()



In [137]:
%matplotlib inline 
fig = plt.figure(figsize=(5,4))
fig.subplots_adjust(left=None, bottom=None, right=None, top=None, wspace=None, hspace=0.5)
plt.rcParams.update({'font.size': 12})

axes = fig.add_subplot(111)
axes.grid()
axes.plot(data[::100,0],data[::100,1],'.')

plt.xlabel('$\Phi 1$')
plt.ylabel('$\Psi 2$')


#axes.set_ylim([0,10])
#axes.set_xlim([0,500])
plt.rcParams.update({'font.size': 12})
plt.legend()
plt.show()



In [42]:
# phi1 phi2


#! FIELDS time phi psi theta zeta metad.bias     
#make 2D histogram then replace all zeros with 1e-100
data=np.genfromtxt('/Users/jpfaendt/Modeling/PBMetaD/props/PBMeta-props/2D_histos/ALA2/COLVAR_rerurn',comments='#')

In [43]:
kt=300.0*8.314e-3
beta=1/kt
nu=8.314e-3*300.0*8 #about 15 kJ/mol 
fill=1000.0
bins=50
method='cubic'
points=200 

RMSDCT1=np.array([])

fesdata2 = np.genfromtxt('ALA2/WTM-2/fes.dat.100',comments='#');
fesdata2 = fesdata2[:,0:3]
gX, gY = np.mgrid[-3.0:3.0:50j, -3.0:3.0:50j ]
Z2new=griddata(fesdata2[:,:2],fesdata2[:,2],(gX, gY),method=method,fill_value=1000)

for k in np.arange(np.shape(data)[0]/points,np.shape(data)[0],np.shape(data)[0]/points):
    stop=k.astype(int)
    hist, xedges, yedges = np.histogram2d(data[0:stop,1],data[0:stop,2], \
                                             bins=bins,normed=True,weights=np.exp(beta*(data[0:stop,5])))

    # this makes a very small prob = very high free-energy (40kT)
    hist[hist == 0 ] = 1e-100
    hist=(1/beta)*-1.0*np.log(hist)
    dum=np.reshape(hist,-1)
    val=0
    Zmake=np.zeros((2500,3))
    for i in np.nditer(np.r_[0.5 * (xedges[:-1] + xedges[1:])]):
        for j in np.nditer(np.r_[0.5 * (yedges[:-1] + yedges[1:])]):
            Zmake[val,:]=[i,j,dum[val]]
            val=val+1


    hist=griddata(Zmake[:,:2],Zmake[:,2],(gX, gY),method=method,fill_value=1000)
    var=RMSDallnomean(hist,Z2new,kt,nu) 
    print var 
    RMSDCT1=np.append(RMSDCT1,var[1])


[44.638115969381857, 229.75979788050913]
[31.397538726171447, 198.86986247836839]
[23.464469673458094, 169.21142613514434]
[22.716378602112286, 159.87231795138078]
[19.734904714922635, 145.164803030234]
[18.179875921928843, 137.22690698472263]
[17.960825244486298, 130.96601344902905]
[17.228576462425785, 127.46461004706218]
[16.137630939851682, 120.4777889912492]
[14.238185479672236, 115.87343315572723]
[12.956601658861324, 106.35969121015124]
[12.611368697916117, 103.05213125106124]
[12.504039695474031, 100.05464582647198]
[11.813585478131969, 94.126381985528127]
[11.264426811324853, 89.425468888519092]
[10.907350972378506, 86.862119235459005]
[10.484902712588147, 81.268163349875152]
[10.412007485340121, 81.119061888002676]
[9.6769831136823417, 75.160380467994955]
[9.6098531952552726, 71.493070108917607]
[9.5643956124912552, 71.638081006358632]
[9.1748607563725031, 68.695885202218278]
[9.1583543746884324, 68.69937228811402]
[9.1012739349667591, 68.685787508661932]
[8.6469739962299759, 62.988620168609714]
[8.6426990995640214, 62.991668975172971]
[8.5083388912315634, 61.083652217435684]
[8.4990524726564232, 61.077105835329903]
[8.4775144721184983, 61.079428424887098]
[8.4743022269094812, 61.080243880786661]
[8.4530620949456683, 61.080049694191246]
[8.3534082329644423, 61.678896573577433]
[8.1821076755066535, 57.450260745212915]
[8.0343008178685693, 56.059485587327821]
[7.856048298699438, 53.750141098460212]
[7.6119744747266136, 46.718978698007724]
[7.6114425450549179, 46.70991939072109]
[7.6890728223310933, 46.833103169387748]
[7.6697427361407815, 46.831230238830784]
[7.6123404345122587, 46.430754662162016]
[7.6116908155276288, 46.430859249699836]
[7.1163906624021154, 44.106408819826953]
[7.110137711792655, 44.103599046350809]
[7.0997449613700638, 44.098560209493961]
[7.0975632112047045, 44.101089530496061]
[7.0954682489610068, 44.115639956882291]
[7.0831033284071818, 44.109593411621141]
[6.8903496189975968, 42.467230047407256]
[6.6619934966821592, 35.963425478544849]
[6.6618711024427721, 35.966667113406082]
[6.4550558888216854, 34.229221706331373]
[6.3822086870659183, 33.585514383276923]
[6.2546435045870012, 32.570325620068175]
[6.2394158058908573, 32.583720635997892]
[6.2273821258325084, 32.582699346686653]
[6.2133482933036079, 32.580262241813067]
[6.2035849668851011, 32.556751371029463]
[6.1761233266815312, 32.554204256568497]
[6.1574119434781354, 32.557848677031153]
[6.1567943713529472, 32.555401632869575]
[6.0397358922786291, 30.206200350187949]
[6.013388902722717, 29.31662787444446]
[6.0042170365430261, 29.312228213594814]
[5.9958210663182037, 29.316428913875203]
[5.9356288415207539, 29.316838554059469]
[5.9190589870000938, 29.314856654686483]
[5.832401527078046, 29.992562600903621]
[5.8058771415387289, 29.990820620166879]
[5.8058692624760182, 29.988514733650746]
[5.8058110263332647, 29.988273694276995]
[5.8039964485226703, 29.98746494700746]
[5.7843193363952841, 29.94247052726244]
[5.7566298875080628, 29.993432353742207]
[5.5748035219875565, 30.332189967742867]
[5.741478126551379, 34.232997402105191]
[5.7002778617128644, 34.205859595419078]
[5.6392189538091735, 34.071041743130245]
[5.6393302539472225, 34.072475282179575]
[5.6392089885751009, 34.066810187963675]
[5.6392951057288512, 34.068066965839407]
[5.6394067479277261, 34.070061694939028]
[5.6393000384517977, 34.068208173841121]
[5.6226878784557641, 34.063575755665248]
[5.4868017316328617, 32.092389705790083]
[5.4868353671431755, 32.090566495970684]
[5.4713619839913266, 32.090551277052086]
[5.4713798838318786, 32.088243322274351]
[5.3547779557829678, 29.682660814654099]
[5.3543145407618677, 29.680135334527883]
[5.2878171387898316, 29.882628745023119]
[5.2879076552651956, 29.884979367888388]
[5.2877042329991797, 29.874545950879121]
[5.2502614272502619, 29.875331113317451]
[5.2493475615140177, 29.870025904718158]
[5.2487171818616147, 29.872003115570372]
[5.2487064684919815, 29.873312611690992]
[5.2249579843949663, 29.978322237237268]
[5.2250576281372894, 29.980589727167462]
[5.2251421733306795, 29.982567866412534]
[5.2206459135093617, 29.976806648039467]
[5.1235007311022178, 29.88161138938689]
[5.1232202884216056, 29.881250873982811]
[5.0416975768171861, 29.06903552113905]
[5.041617572627664, 29.068238786872865]
[5.0047069549024208, 29.064713198114504]
[5.0046640389611268, 29.06526037273105]
[5.0044846662788744, 29.06488400072147]
[4.9911915006040424, 29.064916297227079]
[4.989789878974781, 29.066718646156723]
[4.9859458299071759, 29.0654018217245]
[4.9859522500158571, 29.065910115547609]
[4.9848756181951064, 29.06774084363699]
[4.9691308512067689, 29.067799844260168]
[4.8769928700713061, 29.448267787669916]
[4.8769789351294017, 29.446862931513781]
[4.44532330398114, 21.23570711208756]
[4.2979763028865126, 21.089573995274058]
[4.1252970097130719, 21.040178772264472]
[4.1253081028045946, 21.040195395983414]
[4.1068223834825686, 21.040364022569566]
[4.1068821717131296, 21.040672194195302]
[4.1069157883202783, 21.040480771562923]
[4.1068582665256095, 21.04022639069316]
[4.1068634752844275, 21.039571721425489]
[4.1069287878056393, 21.039621986556565]
[4.0987033477434727, 21.032183862052154]
[4.0987548484531846, 21.033263869881381]
[4.0992911062119761, 21.048468266665086]
[4.0991393107127037, 21.052076728591551]
[4.0992063971188681, 21.052105249391289]
[4.0992282439905869, 21.053008088784999]
[4.0968590997129857, 21.05460353789363]
[4.0961683626996948, 21.054667769858469]
[4.0962322648391449, 21.05506998367569]
[3.9804495979248942, 21.44209987555222]
[3.9599294455453267, 21.337997358939599]
[3.9627961448247935, 21.339309370378786]
[3.9620372930737826, 21.33955045802216]
[3.800566598633679, 21.045616746790927]
[3.8005769592466101, 21.045834346242266]
[3.8006288605818068, 21.046955674815361]
[3.5585132957314265, 16.668160456560155]
[3.5584785110448607, 16.668430758211439]
[3.5579299397633539, 16.670588046910751]
[3.5495915101685447, 16.671753512406081]
[3.549531519749848, 16.670395985642216]
[3.2949811025915472, 3.540223836965402]
[3.2548460694797003, 3.5402178966819267]
[3.2531926677684839, 3.5463272801530219]
[3.164869594416821, 3.6428469435446793]
[3.1648664422704238, 3.641363186162994]
[3.1649397391739345, 3.6452168921283334]
[3.1649752926464521, 3.6455392815622276]
[3.1649640071684426, 3.6444436120902353]
[3.1650275774552079, 3.6434111450992575]
[3.1650996018927806, 3.6422519959331843]
[3.0380561783765931, 3.8342128371307544]
[3.0381457128594125, 3.832875874336346]
[3.0367414011018781, 3.8319877748944893]
[3.03678108438816, 3.8309251932567796]
[3.0175889867434771, 3.8277115167829603]
[3.0176043504573031, 3.8260943860729055]
[3.0175790141442125, 3.8246217509902087]
[3.0175588598406224, 3.8268248107711185]
[3.0167649161850103, 3.8050549065784027]
[3.0166387229907272, 3.7988039867686143]
[3.0149144104929544, 3.8070367033450911]
[3.0146620625907965, 3.8062097653525702]
[3.0146846634549496, 3.8089398263203291]
[3.0091852635433995, 3.8092088439519549]
[3.0092623984644598, 3.8137726543476118]
[3.0082147530799679, 3.8118914246542537]
[3.0005613159824751, 3.8109550510275532]
[2.958294565268452, 3.5247221559098869]
[2.9573455925608285, 3.5383234748706549]
[2.9573621844699094, 3.5386385836983112]
[2.9420359796683622, 3.538729970976243]
[2.9420674082284894, 3.538139044923033]
[2.9285301708523184, 3.5374296116145878]
[2.928594237325453, 3.5398112182752239]
[2.9286305658978411, 3.5404007029540541]
[2.9285958386376016, 3.5380684126995967]
[2.9200877896652595, 3.57969391334511]
[2.9200929039361592, 3.5802738381183445]
[2.9171400432881862, 3.5815796672574765]
[2.9171586183661558, 3.5828115507178344]
[2.9127944412135398, 3.5963733482280014]
[2.9128082689663279, 3.5953968232247853]
[2.9128422858413243, 3.5940305888858948]
[2.9120321610401572, 3.5934957071024765]
[2.9119865761932133, 3.592630668379003]
[2.8953752057898789, 3.506855031915403]
[2.8953399174813979, 3.5052358774115717]
[2.8953527466808335, 3.5045447455202114]
[2.895381234457338, 3.5024596008171867]
[2.8953948392022348, 3.5044380189411859]
[2.8953196780467865, 3.5038249422940182]
[2.8952382706111899, 3.5081816459578317]
[2.8894408640479718, 3.5071965410342463]
[2.8893386659488489, 3.5065521203344114]

In [46]:
%matplotlib inline 
fig = plt.figure(figsize=(10,5))
fig.subplots_adjust(left=None, bottom=None, right=None, top=None, wspace=None, hspace=0.5)
plt.rcParams.update({'font.size': 12})
plot=RMSDCT1
axes = fig.add_subplot(121)
axes.grid()
axes.plot(np.arange(0,np.size(plot))*5,np.power(plot/kt,2)*np.arange(0,np.size(plot))*5,label='CUT',color='blue',lw=2)

axes.set_xlabel('Simulation Time (ns)')
axes.set_ylabel('RMSD^2 * time ')

axes2 = fig.add_subplot(122)
axes2.grid()
axes2.plot(np.arange(0,np.size(plot))*5,plot/kt,label='CUT',color='blue',lw=2)


axes2.set_xlabel('Simulation Time (ns)')
axes2.set_ylabel('RMSD (kT) ')

#axes.set_ylim([0,60])
axes.set_xlim([0,200])
plt.rcParams.update({'font.size': 12})

plt.show()



In [7]:
%matplotlib inline
#ang1wt1=np.transpose(ang1wt1)
#what spacing do you want?  
spacer=1
lines=20 #this goes to kt 
levels=np.linspace(0,lines*spacer,num=(lines+1),endpoint=True)

fig=plt.figure(figsize=(10,8)) 
axes = fig.add_subplot(111)

#plt.contourf(xedges[1::], yedges[1::],np.transpose(np.abs(ang1wt1))/kt ,levels, cmap=plt.cm.bone,)
plt.contourf(gX,gY,np.abs(hist)/kt,levels,cmap=plt.cm.bone,)
plt.colorbar()
plt.xlabel('$\Phi 1$')
plt.ylabel('$\Psi 2$')
plt.title('ALA2 FES, PBMetaD rew from ludovico code ')
#axes.set_ylim([.1,.5])

#axes.set_xlim([0.1,0.5])
plt.rcParams.update({'font.size': 18})
plt.show()



In [58]:
# phi psi theta zeta vbias phi1 phi10 psi1 psi10
#  0   1    2    3    4     5    6     7  8   

%matplotlib inline
beta=1/8.314e-3/300
hist1, bins1 = np.histogram((data[:,4]-data[:,5]), bins=50,normed=True)
width = 0.7 * (bins1[1] - bins1[0])
center = (bins1[:-1] + bins1[1:]) / 2

fig = plt.figure(figsize=(6,4))


plt.bar(center, hist1, align='center', width=width)

plt.xlabel('$wt value$')


plt.show()



In [ ]: