Skip to content

config #

Common configuration models.

Modules:

  • femto

    A comprehensive toolkit for predicting free energies

Classes:

  • FEP

    Configure modifying a system to be scalable by FEP lambdas.

  • Edge

    Defines a basic edge in a free energy network.

  • Network

    Defines a basic free energy network.

Attributes:

DEFAULT_INITIAL_TEMPERATURE module-attribute #

DEFAULT_INITIAL_TEMPERATURE = 50.0 * kelvin

The default temperature to begin annealing from during equilibration

LigandReferenceMethod module-attribute #

LigandReferenceMethod = Literal['chen', 'baumann']

The method to use when automatically selecting ligand atoms to use in alignment restraints.

FEP pydantic-model #

Bases: BaseModel

Configure modifying a system to be scalable by FEP lambdas.

Fields:

scale_vdw pydantic-field #

scale_vdw: bool = True

Whether to scale the vdW non-bonded interactions.

scale_charges pydantic-field #

scale_charges: bool = True

Whether to scale the electrostatic non-bonded interactions.

ligands_can_interact pydantic-field #

ligands_can_interact: bool = False

Whether ligands are allowed to interact with each other.

model_dump_yaml #

model_dump_yaml(
    output_path: Path | None = None, **kwargs
) -> str

Dump the model to a YAML representation.

Parameters:

  • output_path (Path | None, default: None ) –

    The (optional) path to save the YAML representation to.

Returns:

  • str

    The YAML representation.

Source code in femto/md/utils/models.py
def model_dump_yaml(self, output_path: pathlib.Path | None = None, **kwargs) -> str:
    """Dump the model to a YAML representation.

    Args:
        output_path: The (optional) path to save the YAML representation to.

    Returns:
        The YAML representation.
    """

    model_yaml = yaml.safe_dump(self.model_dump(), **kwargs)

    if output_path is not None:
        output_path.parent.mkdir(exist_ok=True, parents=True)
        output_path.write_text(model_yaml)

    return model_yaml

Edge pydantic-model #

Bases: BaseModel

Defines a basic edge in a free energy network.

Fields:

ligand_1 pydantic-field #

ligand_1: str

The name of the first ligand.

ligand_2 pydantic-field #

ligand_2: str | None

The name of the second ligand. This should be None if running an ABFE calculation.

ligand_1_metadata pydantic-field #

ligand_1_metadata: dict[str, Any]

Any additional metadata about ligand 1.

ligand_2_metadata pydantic-field #

ligand_2_metadata: dict[str, Any]

Any additional metadata about ligand 2.

model_dump_yaml #

model_dump_yaml(
    output_path: Path | None = None, **kwargs
) -> str

Dump the model to a YAML representation.

Parameters:

  • output_path (Path | None, default: None ) –

    The (optional) path to save the YAML representation to.

Returns:

  • str

    The YAML representation.

Source code in femto/md/utils/models.py
def model_dump_yaml(self, output_path: pathlib.Path | None = None, **kwargs) -> str:
    """Dump the model to a YAML representation.

    Args:
        output_path: The (optional) path to save the YAML representation to.

    Returns:
        The YAML representation.
    """

    model_yaml = yaml.safe_dump(self.model_dump(), **kwargs)

    if output_path is not None:
        output_path.parent.mkdir(exist_ok=True, parents=True)
        output_path.write_text(model_yaml)

    return model_yaml

Network pydantic-model #

Bases: BaseModel

Defines a basic free energy network.

Fields:

receptor pydantic-field #

receptor: str | None = None

The name of the receptor. If None, the receptor will be identified from the input directory structure

edges pydantic-field #

edges: list[Edge]

The edges in the free energy network.

receptor_metadata pydantic-field #

receptor_metadata: dict[str, Any]

Any additional metadata about the receptor.

model_dump_yaml #

model_dump_yaml(
    output_path: Path | None = None, **kwargs
) -> str

Dump the model to a YAML representation.

Parameters:

  • output_path (Path | None, default: None ) –

    The (optional) path to save the YAML representation to.

Returns:

  • str

    The YAML representation.

Source code in femto/md/utils/models.py
def model_dump_yaml(self, output_path: pathlib.Path | None = None, **kwargs) -> str:
    """Dump the model to a YAML representation.

    Args:
        output_path: The (optional) path to save the YAML representation to.

    Returns:
        The YAML representation.
    """

    model_yaml = yaml.safe_dump(self.model_dump(), **kwargs)

    if output_path is not None:
        output_path.parent.mkdir(exist_ok=True, parents=True)
        output_path.write_text(model_yaml)

    return model_yaml