Skip to content

Instantly share code, notes, and snippets.

@leelasd
Created November 22, 2017 04:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leelasd/55f9d5ccd61d0ba69efd9108c37d259e to your computer and use it in GitHub Desktop.
Save leelasd/55f9d5ccd61d0ba69efd9108c37d259e to your computer and use it in GitHub Desktop.
Collect SOS data from BOSS FEP simulation
## Useful to collect data from SOS simulations
import pandas as pd
import numpy as np
import os
def col_dat():
com1="grep 'DelSOS (' *sum* |sed 's/)//g'|awk '{print $4,$6,$8,$10}'>resDeltaSOS"
com2="grep 'DeltaG (' *sum* |sed 's/)//g'|awk '{print $4,$6,$8,$10}'>resDeltaG"
os.system(com1)
os.system(com2)
return None
col_dat()
colnames=['Ri','Rf','DG','stdDG']
delsos=pd.read_csv('resDeltaSOS',header=None,delim_whitespace=True,dtype=np.float64)
delG=pd.read_csv('resDeltaG',header=None,delim_whitespace=True,dtype=np.float64)
delsos.columns=colnames
delG.columns=colnames
delsos=delsos[delsos.Rf!=1.0]
delG=delG[delG.Rf==1.0]
fin= pd.concat([delsos,delG],axis=0)
print(fin.describe())
fin['COV_SQ'] = fin['stdDG']*fin['stdDG']
fin.to_csv('DeltaG_SOS',index=False)
print ('Change in Free Energy is %3.3f +- %3.3f'%(np.sum(fin.DG),np.sqrt(np.sum(fin.stdDG**2))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment