Tasks.torsions_parametrization module¶
Description¶
This module defines the ParaMol.Objective_function.Tasks.task.TorsionsParametrization class used to perform parametrization of rotatable (soft) dihedrals.
-
class
ParaMol.Tasks.torsions_parametrization.TorsionsParametrization¶ Bases:
ParaMol.Tasks.task.TaskParaMol implementation of the algorithm that automatically identifies, scans and parametrizes soft torsions.
- Variables
dihedrals_to_optimize (list) – List containing the dihedrals types scanned so far for all bonds.
dihedral_types_scanned (list) – List containing the dihedrals types scanned so far for a given bond.
dihedrals_scanned (list) – List containing the dihedrals scanned so far for a given bond.
bond_symm_global (list) – List containing the symmetries of the bonds that were already scanned. If two or morebonds have exactly the same dihedrals types, they are considered to be of the sametype and, thus, scans are only performed at the first encounter with this bond type
bond_id (int) – Current bond id.
bonds_scanned (list of list of int) – List containing lists with the pairs of atoms that form bonds that were already scanned.
force_field_current (dict) – Current force field dictionary. Used for the intermediate optimizations.
force_field_original (dict) – Original force field dictionary. Only used if method=”SIMULTANEOUS” to recover the original FF parameters.
-
static
get_rotatable_bonds(rdkit_mol, methyl=True)¶ Method that determines the indices of the atoms which form rotatable (soft) bonds.
- Parameters
rdkit_mol – RDKit Molecule
methyl (bool) – If true, also includes rotatable bonds of methyl groups. Not implemented yet.
- Returns
rotatable_bonds (tuple of tuples) – Tuple of tuples containing the indexes of the atoms forming rotatable (soft) bonds.
-
static
get_rotatable_torsions(system, rotatable_bonds)¶ Method that determines the quartets that form rotatable (soft) torsions.
- Parameters
system (
ParaMol.System.system.ParaMolSystem) – Instance of ParaMol System.rotatable_bonds (tuple of tuples) – Tuple of tuples containing the indexes of the atoms forming rotatable (soft) bonds.
- Returns
rotatable_torsions (list of lists) – List of lists containing quartet of indices that correspond to rotatable (soft) torsions.
-
pdb_file= 'dihedral_scan.pdb'¶
-
run_task(settings, systems, parameter_space=None, objective_function=None, optimizer=None, interface=None, scan_settings=[- 180.0, 180.0, 10], torsions_to_freeze=None, ase_constraints=None, optimize_mm=False, optimize_mm_type='FREEZE_ATOMS', optimize_qm_before_scan=False, parametrization_type='SIMULTANEOUS', restart=False)¶ Method that can be used to perform automatic parametrization of the rotatable (soft) torsions using 1-D scans. “SIMULTANEOUS” is preferred as “SEQUENTIAL” is still being tested.
Notes
- This method only samples equivalent bonds - defined as bonds having exactly the same dihedral types - once. Furthermore, it has available two parametrization schemes:
“SEQUENTIAL”: parametrization of torsions of unique bonds is done sequentially, i.e., just one torsion is optimized at a time. Moreover, all other soft torsions are kept frozen during the 1D scan. This methodology
“SIMULTANEOUS”: parametrization of torsions of unique bonds is done concomitantly, i.e., all torsions are optimized at the same time. Moreover, all soft torsions are allowed to relax during the 1D scans.
- Parameters
settings (dict) – Dictionary containing global ParaMol settings.
systems (list of
ParaMol.System.system.ParaMolSystem) – List containing instances of ParaMol systems.parameter_space (
ParaMol.Parameter_space.parameter_space.ParameterSpace) – Instance of the parameter space.objective_function (
ParaMol.Objective_function.objective_function.ObjectiveFunction) – Instance of the objective function.optimizer (one of the optimizers defined in the subpackage
ParaMol.Optimizers) – Instance of the optimizer.interface (
ParaMol.Utils.interface.ParaMolInterface) – ParaMol system instance.scan_settings (list of list of float) – List of lists wherein each the most inner list should contain 3 floats defining the settings of the scan in the to be performed and in the following order: lower torsion angle, upper torsion angle, angle step (in degrees). Example: 1D-Scan [ [180.0,-180.0,-10.0] ].
torsions_to_freeze (list of list of int) – List of lists of wherein each inner list should contain 4 integers defining a torsion to be kept fixed (default is None)
ase_constraints (list of ASE constraints.) – List of ASE constraints to be applied during the scans (default is None)
optimize_mm (bool) – Flag that controls whether a MM geometry optimization is performed before every QM optimization (default is False).
optimize_mm_type (str) – Constraint to be used when performing MM optimization. Available options are ‘freeze_atoms’ or ‘freeze_dihedral’. ‘freeze_atoms’ is recommended.
optimize_qm_before_scan (bool) – Flag that controls whether a QM geometry optimization is performed before the scan (default is False).
parametrization_type (str) – Available options are “SIMULTANEOUS” (default) or “SEQUENTIAL”.
restart (bool) – Flag that controls whether or not to perform a restart.
- Returns
systems, parameter_space, objective_function, optimizer