forked from lijiext/lammps
some more whitespace cleanup
This commit is contained in:
parent
fd63b08f99
commit
28b634f20d
|
@ -15,16 +15,16 @@ for i in range(ntemps):
|
|||
logfn = '%s.%d' % (logfnprefix, i)
|
||||
with open(logfn, 'r') as of:
|
||||
lines = of.readlines()
|
||||
|
||||
|
||||
# extract relevant lines from logfile
|
||||
start = [lines.index(line) for line in lines if line.startswith(start_token)][0]
|
||||
lines = lines[(start+1) : ]
|
||||
stop = [lines.index(line) for line in lines if line.startswith(end_token)][0]
|
||||
lines = lines[:stop]
|
||||
|
||||
|
||||
# store the potential energies
|
||||
pe = [float(line.strip().split()[-1]) for line in lines]
|
||||
u_kn.append(pe)
|
||||
|
||||
|
||||
u_kn = np.array(u_kn)
|
||||
np.savetxt('ene.peptide', u_kn, fmt = '%5.5f')
|
||||
|
|
|
@ -351,7 +351,7 @@ def get_canonical_logw(enefn, frametuple_dict, temps, nprod, writefreq,
|
|||
u_kln = np.zeros([ntemps, ntemps, nframes], float)
|
||||
for k in range(ntemps):
|
||||
u_kln[k] = np.outer(beta_k, u_kn[k])
|
||||
|
||||
|
||||
# run pymbar and extract the free energies
|
||||
print("\nRunning pymbar...")
|
||||
mbar = pymbar.mbar.MBAR(u_kln, nframes_k, verbose = True)
|
||||
|
@ -368,7 +368,7 @@ def get_canonical_logw(enefn, frametuple_dict, temps, nprod, writefreq,
|
|||
denom = f_k - beta_k[k] * u_kn[k,n]
|
||||
for l in range(ntemps):
|
||||
logw[l][k,n] = num - logsumexp(denom) - log_nframes
|
||||
|
||||
|
||||
return logw
|
||||
|
||||
|
||||
|
@ -518,7 +518,7 @@ if __name__ == "__main__":
|
|||
|
||||
# open all replica files for reading
|
||||
infobjs = [readwrite(i, "rb") for i in intrajfns]
|
||||
|
||||
|
||||
# open all byteindex files
|
||||
byte_inds = dict( (i, np.loadtxt(fn)) for i, fn in enumerate(byteindfns) )
|
||||
|
||||
|
|
Loading…
Reference in New Issue