class openfe.setup.chemicalsystem_generator.EasyChemicalSystemGenerator(solvent: SolventComponent | None = None, protein: ProteinComponent | None = None, cofactors: Iterable[SmallMoleculeComponent] | None = None, do_vacuum: bool = False)#

Generate consistent chemical systems given a SmallMoleculeComponent.

This class aids preparation of ChemicalSystem instances for free energy simulations. Construct an instance of the class with all the components except the SmallMoleculeComponent that will be mutated, and then call the instance on each mutation target to prepare systems in vacuum, solvent, and with protein.

This class is a easy generator class, for generating chemical systems with a focus on a given SmallMoleculeComponent. Depending on which parameters are given, the following systems will be generated in order:

vacuum -> solvent -> protein

Parameters:
  • solvent (SolventComponent, optional) – if a SolventComponent is given, solvated chemical systems will be generated, by default None

  • protein (ProteinComponent, optional) – if a ProteinComponent is given, complex chemical systems will be generated, by default None

  • cofactors (Iterable[SmallMoleculeComponent], optional) – any cofactors in the system. will be put in any systems containing the protein

  • do_vacuum (bool, optional) – if true a chemical system in vacuum is returned, by default False

Raises:

ValueError – If neither a solvent nor protein is provided and do_vacuum is false.

__call__(component: SmallMoleculeComponent) Iterable[ChemicalSystem]#

Generate systems around the given SmallMoleculeComponent.

Parameters:

component (SmallMoleculeComponent) – The molecule for the system generation.

Returns:

Generator for systems with the given environments. Returns a vacuum system first in self.do_vacuum is true, then a solvated system without protein, then finally a solvated system with protein if the protein component is set.

Return type:

Iterable[ChemicalSystem]