Skip to content

Commit

Permalink
suppressed logs
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmkrieger committed Feb 26, 2021
1 parent 621e1a1 commit dd6e367
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions prody/dynamics/comd.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def calcANMMC(initial, final, **kwargs):

cutoff = kwargs.pop('cutoff', 15.)
anm_cut = kwargs.pop('anm_cut', cutoff)
log = kwargs.pop('log', True)

N = kwargs.pop('N', 10000)
usePseudoatoms = kwargs.pop('usePseudoatoms', False)
Expand Down Expand Up @@ -113,8 +114,9 @@ def calcANMMC(initial, final, **kwargs):
step_count = 0
check_step_counts = [0]

# sys.stdout.write(' '*2 + 'rmsd' + ' '*2 + 'rand' + ' '*2 + 'ID' + ' '*3 + 'step' \
# + ' '*2 + 'accept_para' + ' '*5 + 'f' + '\n')
if log:
sys.stdout.write(' '*2 + 'rmsd' + ' '*2 + 'rand' + ' '*2 + 'ID' + ' '*3 + 'step'
+ ' '*2 + 'accept_para' + ' '*5 + 'f' + '\n')

# MC Loop
for k in range(N):
Expand Down Expand Up @@ -178,9 +180,11 @@ def calcANMMC(initial, final, **kwargs):
f = 1.

rmsd = calcRMSD(pdb_ca.getCoords(), initial_ca.getCoords())
# sys.stdout.write('{:6.2f}'.format(rmsd) + ' ' + '{:5.2f}'.format(rand) + \
# '{:4d}'.format(ID) + '{:7d}'.format(k) + ' '*2 + str(accepted) + ' '*2 + \
# '{:5.4e}'.format(accept_para) + ' '*2 + '{:5.4f}'.format(f) + '\n')

if log:
sys.stdout.write('{:6.2f}'.format(rmsd) + ' ' + '{:5.2f}'.format(rand) +
'{:4d}'.format(ID) + '{:7d}'.format(k) + ' '*2 + str(accepted) + ' '*2 +
'{:5.4e}'.format(accept_para) + ' '*2 + '{:5.4f}'.format(f) + '\n')

if rmsd > stepcutoff:
break
Expand Down Expand Up @@ -222,6 +226,7 @@ def __init__(self, title, **kwargs):
# 200 (like NAMD website) is too weak for such small conformational changes

def _sample(self, **kwargs):
log = kwargs.pop('log', False)

conf, conf2 = self._conformers[-2], self._conformers[-1]

Expand Down Expand Up @@ -251,7 +256,7 @@ def _sample(self, **kwargs):

if self._direction_mode == ONEWAY:
LOGGER.info('\nStarting cycle with structure A')
self._cg_ensA, _, _, _, _, _, rmsd = calcANMMC(cg, cgB,
self._cg_ensA, _, _, _, _, _, rmsd = calcANMMC(cg, cgB, log=log,
stepcutoff=rmsd,
n_modes=self._n_modes,
**kwargs)
Expand All @@ -260,15 +265,15 @@ def _sample(self, **kwargs):
elif self._direction_mode == ALTERNATING:
if self._direction == 1:
LOGGER.info('\nStarting cycle with structure A')
self._cg_ensA, _, _, _, _, _, rmsd = calcANMMC(cg, cgB,
self._cg_ensA, _, _, _, _, _, rmsd = calcANMMC(cg, cgB, log=log,
stepcutoff=rmsd,
n_modes=self._n_modes,
**kwargs)
cg_ens = self._cg_ensA

else:
LOGGER.info('\nStarting cycle with structure B')
self._cg_ensB, _, _, _, _, _, rmsd = calcANMMC(cgB, cg,
self._cg_ensB, _, _, _, _, _, rmsd = calcANMMC(cgB, cg, log=log,
stepcutoff=rmsd,
n_modes=self._n_modes,
**kwargs)
Expand All @@ -277,15 +282,15 @@ def _sample(self, **kwargs):
elif self._direction_mode == SERIAL:
if self._direction == 1:
LOGGER.info('\nStarting cycle with structure A')
self._cg_ensA, _, _, _, _, _, rmsd = calcANMMC(cg, cgB,
self._cg_ensA, _, _, _, _, _, rmsd = calcANMMC(cg, cgB, log=log,
stepcutoff=rmsd,
n_modes=self._n_modes,
**kwargs)
cg_ens = self._cg_ensA

else:
LOGGER.info('\nStarting cycle with structure B')
self._cg_ensB, _, _, _, _, _, rmsd = calcANMMC(cgB, cg,
self._cg_ensB, _, _, _, _, _, rmsd = calcANMMC(cgB, cg, log=log,
stepcutoff=rmsd,
n_modes=self._n_modes,
**kwargs)
Expand Down

0 comments on commit dd6e367

Please sign in to comment.