Skip to content

Commit

Permalink
Merge pull request #1307 from jamesmkrieger/clustenm_fix
Browse files Browse the repository at this point in the history
clustenm fixes
  • Loading branch information
jamesmkrieger authored Dec 21, 2021
2 parents 8dc5642 + 63aa0ce commit fcba931
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions prody/dynamics/clustenm.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,9 @@ def __getitem__(self, index):

return super(ClustENM, self).__getitem__(index)

def getAtoms(self):

def getAtoms(self, selected=True):
'Returns atoms.'

return self._atoms
return super(ClustENM, self).getAtoms(selected)

def _isBuilt(self):

Expand Down Expand Up @@ -893,17 +891,17 @@ def run(self, cutoff=15., n_modes=3, gamma=1., n_confs=50, rmsd=1.0,
:type n_gens: int
:arg maxclust: Maximum number of clusters for each generation, default in None.
A tuple of int's can be given, e.g. (10, 30, 50) for subsequent generations.
A tuple of ints can be given, e.g. (10, 30, 50) for subsequent generations.
Warning: Either maxclust or RMSD threshold should be given! For large number of
generations and/or structures, specifying maxclust is more efficient.
:type maxclust: int or a tuple of int's
:type maxclust: int, tuple
:arg threshold: RMSD threshold to apply when forming clusters, default is None.
This parameter has been used in ClustENMv1, setting it to 75% of the maximum RMSD
value used for sampling. A tuple of floats can be given, e.g. (1.5, 2.0, 2.5)
for subsequent generations.
Warning: This threshold should be chosen carefully in ClustENMv2 for efficiency.
:type threshold: float or tuple of floats.
:type threshold: float, tuple
:arg solvent: Solvent model to be used. If it is set to 'imp' (default),
implicit solvent model will be used, whereas 'exp' stands for explicit solvent model.
Expand All @@ -921,7 +919,7 @@ def run(self, cutoff=15., n_modes=3, gamma=1., n_confs=50, rmsd=1.0,
:arg force_field: Implicit solvent force field is ('amber99sbildn.xml', 'amber99_obc.xml').
Explicit solvent force field is ('amber14-all.xml', 'amber14/tip3pfb.xml').
Experimental feature: Forcefields already implemented in OpenMM can be used.
:type force_field: a tuple of str
:type force_field: tuple
:arg tolerance: Energy tolerance to which the system should be minimized, default is 10.0 kJ/mole.
:type tolerance: float
Expand All @@ -941,12 +939,12 @@ def run(self, cutoff=15., n_modes=3, gamma=1., n_confs=50, rmsd=1.0,
:arg t_steps_i: Duration of MD simulation (number of time steps) for the starting structure
following the heating-up phase, default is 1000. Each time step is 2.0 fs.
Note: Default value reduces possible drift from the starting structure.
:type t_steps_i : int
:type t_steps_i: int
:arg t_steps_g: Duration of MD simulations (number of time steps) to run for each conformer
following the heating-up phase, default is 7500. Each time step is 2.0 fs.
A tuple of int's can be given, e.g. (3000, 5000, 7000) for subsequent generations.
:type t_steps_g: int or tuple of int's
A tuple of ints can be given, e.g. (3000, 5000, 7000) for subsequent generations.
:type t_steps_g: int, tuple
:arg outlier: Exclusion of conformers detected as outliers in each generation.
Default is True for implicit solvent. Outliers, if any, are detected by
Expand Down Expand Up @@ -985,7 +983,7 @@ def run(self, cutoff=15., n_modes=3, gamma=1., n_confs=50, rmsd=1.0,
self._targeted = kwargs.pop('targeted', False)
self._tmdk = kwargs.pop('tmdk', 15.)

if maxclust is None and threshold is None:
if maxclust is None and threshold is None and n_gens > 0:
raise ValueError('Either maxclust or threshold should be set!')

if maxclust is None:
Expand Down

0 comments on commit fcba931

Please sign in to comment.