meld.runner.transform.restraints.meld.meld.MeldRestraintTransformer

class meld.runner.transform.restraints.meld.meld.MeldRestraintTransformer(param_manager, mapper, density_manager, builder_info, options, always_active_restraints, selectively_active_restraints)[source]

Bases: TransformerBase

Transformer to handle MELD restraints

__init__(param_manager, mapper, density_manager, builder_info, options, always_active_restraints, selectively_active_restraints)[source]

Initialize a Transformer

Parameters
  • param_manager (ParameterManager) – parameter manager to handle sampling of paramters

  • builder_info (dict) – information from the system builder / patcher

  • options (RunOptions) – the options for the runner

  • always_active_restraints (List[Restraint]) – these restraints are always active

  • selectively_active_collections – these restraints are selected by the MELD algorithm

Methods

__init__(param_manager, mapper, ...)

Initialize a Transformer

add_interactions(state, system, topology)

Add new interactions to the system.

finalize(state, system, topology)

Finalize the transformer.

update(state, simulation, alpha, timestep)

Update the system according to alpha and timestep.

Attributes

force

add_interactions(state, system, topology)[source]

Add new interactions to the system.

This may involve:

  • Adding new forces, e.g. for restraints

  • Replacing an existing force with another, e.g. softcore interactions

This method must return the modified system. If the transformer does not add interactions, it may simply return the passed values.

Parameters
  • state (IState) – the state of the system

  • system (System) – OpenMM system object to be modified

  • topology (Topology) – OpenMM topology object to be modified and/or used for indexing

Return type

System

update(state, simulation, alpha, timestep)[source]

Update the system according to alpha and timestep.

This method is called at the beginning of every stage. It should update forces and parameters as necessary.

Parameters
  • state (IState) – the state of the system

  • simulation (Simulation) – OpenMM simulation object to be modified

  • alpha (float) – current value of alpha, ranges from 0 to 1

  • stage – current stage of the simulation, starting from 0

Return type

None