gufe.components.solvatedpdbcomponent

Classes

ProteinMembraneComponent(rdkit, box_vectors)

Solvated PDB component with an explicit membrane and periodic box.

SolvatedPDBComponent(rdkit, box_vectors[, name])

PDB component with explicit solvent and box vectors.

class gufe.components.solvatedpdbcomponent.SolvatedPDBComponent(rdkit: rdkit.Chem.rdchem.Mol, box_vectors: Quantity, name: str = '')

PDB component with explicit solvent and box vectors.

This class represents an explicit component structure that is associated with explicit box vectors. Unlike ProteinComponent, instances of this class always have box vectors, which are treated as part of the component’s identity (affecting equality and hashing).

Notes

  • box_vectors must be an OpenFF quantity with units.

  • Construction will fail if box vectors cannot be determined.

Parameters:
  • rdkit (rdkit.Chem.Mol) – RDKit representation of the solvated Component.

  • box_vectors (openff.units.Quantity) – Periodic box vectors with units of length, compatible with nanometers. Must be a (3, 3) array in reduced form. Reduced form is a canonical representation of the unit cell and removes ambiguity in periodic boundary conditions (see https://docs.openmm.org/latest/userguide/theory/05_other_features.html).

  • name (str, optional) – Name of the component.

Raises:
  • TypeError – If box_vectors is not an OpenFF Quantity.

  • ValueError – If box_vectors are not valid box vectors.

property density: Quantity

Estimated system density in g/L.

validate(*, min_density: Quantity = <Quantity(0.7, 'gram / milliliter')>)

Run heuristic validation checks on the solvated system.

Parameters:

min_density (openff.units.Quantity) – Minimum acceptable density. Default: 0.7 g/ml

Raises:

ComponentValidationError – If the density is lower than the minimum density.

classmethod from_pdb_file(pdb_file: PathLike | TextIO, name: str = '', *, box_vectors=None, infer_box_vectors: bool = False, box_padding: Quantity = <Quantity(0.2, 'nanometer')>)

Create a SolvatedPDBComponent from a PDB file.

classmethod from_pdbx_file(pdbx_file: str, name: str = '', *, box_vectors=None, infer_box_vectors: bool = False, box_padding: Quantity = <Quantity(0.2, 'nanometer')>)

Create a SolvatedPDBComponent from a PDBx/mmCIF file.

classmethod from_rdkit(rdkit: rdkit.Chem.rdchem.Mol, name: str = '')

Create a Component, copying from an RDKit Mol

property name: str
property smiles: str
to_openmm_positions() Quantity

serialize the positions to openmm.unit.Quantity

Note

Currently only one frame/model is given

Returns:

Quantity containing protein atom positions

Return type:

omm_unit.Quantity

to_openmm_topology() Topology

Convert to an openmm Topology object

Returns:

resulting topology obj.

Return type:

openmm.app.Topology

to_pdb_file(out_path: str | bytes | PathLike[str] | PathLike[bytes] | TextIOBase) str

serialize protein to pdb file.

Parameters:

out_path (Union[str, bytes, PathLike[str], PathLike[bytes], io.TextIOBase]) – provide path or any string based stream (e.g. FileIO ) to the resulting file

Returns:

string path to the resulting pdb.

Return type:

str

to_pdbx_file(out_path: str | bytes | PathLike[str] | PathLike[bytes] | TextIOBase) str

serialize protein to pdbx file.

Parameters:

out_path (Union[str, bytes, PathLike[str], PathLike[bytes], io.TextIOBase]) – provide path or FileIO to the resulting file

Returns:

string path to the resulting pdbx.

Return type:

str

to_rdkit() rdkit.Chem.rdchem.Mol

Return an RDKit copied representation of this molecule

property total_charge

Net formal charge for the Component, if defined.

class gufe.components.solvatedpdbcomponent.ProteinMembraneComponent(rdkit: rdkit.Chem.rdchem.Mol, box_vectors: Quantity, name: str = '')

Solvated PDB component with an explicit membrane and periodic box.

Subclass of SolvatedPDBComponent representing a protein embedded in an explicit membrane (e.g., lipid bilayer). This type serves as a semantic marker enabling membrane-specific simulation behavior. Code elsewhere may use this distinction (e.g., via isinstance checks) to enable membrane-specific behavior such as selecting a membrane-aware barostat or simulation protocol.

Extends parent validation with a heuristic minimum water-count check.

Notes

  • All requirements and guarantees of SolvatedPDBComponent apply.

  • The membrane distinction is conveyed solely through the component type.

  • Validation includes density and minimum water-count checks.

Parameters:
  • rdkit (rdkit.Chem.Mol) – RDKit representation of the solvated Component.

  • box_vectors (openff.units.Quantity) – Periodic box vectors with units of length, compatible with nanometers. Must be a (3, 3) array in reduced form. Reduced form is a canonical representation of the unit cell and removes ambiguity in periodic boundary conditions (see https://docs.openmm.org/latest/userguide/theory/05_other_features.html).

  • name (str, optional) – Name of the component.

Raises:
  • TypeError – If box_vectors is not an OpenFF Quantity.

  • ValueError – If box_vectors are not valid box vectors.

property n_waters: int

Number of detected water molecules.

validate(*, min_waters: int = 50, min_density: Quantity = <Quantity(0.7, 'gram / milliliter')>)

Run heuristic validation checks on the solvated system.

Parameters:
  • min_waters (int) – Minimum number of water molecules. Default: 50

  • min_density (openff.units.Quantity) – Minimum acceptable density. Default: 0.7 g/ml

Raises:

ComponentValidationError – If one or more validation checks fail. All detected validation errors are aggregated and reported together.

property density: Quantity

Estimated system density in g/L.

classmethod from_pdb_file(pdb_file: PathLike | TextIO, name: str = '', *, box_vectors=None, infer_box_vectors: bool = False, box_padding: Quantity = <Quantity(0.2, 'nanometer')>)

Create a SolvatedPDBComponent from a PDB file.

classmethod from_pdbx_file(pdbx_file: str, name: str = '', *, box_vectors=None, infer_box_vectors: bool = False, box_padding: Quantity = <Quantity(0.2, 'nanometer')>)

Create a SolvatedPDBComponent from a PDBx/mmCIF file.

classmethod from_rdkit(rdkit: rdkit.Chem.rdchem.Mol, name: str = '')

Create a Component, copying from an RDKit Mol

property name: str
property smiles: str
to_openmm_positions() Quantity

serialize the positions to openmm.unit.Quantity

Note

Currently only one frame/model is given

Returns:

Quantity containing protein atom positions

Return type:

omm_unit.Quantity

to_openmm_topology() Topology

Convert to an openmm Topology object

Returns:

resulting topology obj.

Return type:

openmm.app.Topology

to_pdb_file(out_path: str | bytes | PathLike[str] | PathLike[bytes] | TextIOBase) str

serialize protein to pdb file.

Parameters:

out_path (Union[str, bytes, PathLike[str], PathLike[bytes], io.TextIOBase]) – provide path or any string based stream (e.g. FileIO ) to the resulting file

Returns:

string path to the resulting pdb.

Return type:

str

to_pdbx_file(out_path: str | bytes | PathLike[str] | PathLike[bytes] | TextIOBase) str

serialize protein to pdbx file.

Parameters:

out_path (Union[str, bytes, PathLike[str], PathLike[bytes], io.TextIOBase]) – provide path or FileIO to the resulting file

Returns:

string path to the resulting pdbx.

Return type:

str

to_rdkit() rdkit.Chem.rdchem.Mol

Return an RDKit copied representation of this molecule

property total_charge

Net formal charge for the Component, if defined.