Skip to content

deeporigin.drug_discovery.complex

Module to support Drug Discovery workflows using Deep Origin

Classes

Complex dataclass

class to represent a set of a protein and 1 or many ligands

Attributes

ligands property writable
ligands: list[Ligand]

Get the current ligands

protein instance-attribute
protein: Protein = protein

Functions

from_dir classmethod
from_dir(
    directory: str,
    *,
    _platform_clients: Optional[PlatformClients] = None
) -> Complex

Initialize a Complex from a directory containing protein and ligand files.

Parameters:

Name Type Description Default
directory str

Directory containing ligand and protein files.

required

The directory should contain: - Exactly one PDB file for the protein - One or more SDF files for the ligands. Each SDF file can contain one or more molecules.

Returns:

Name Type Description
Complex Complex

A new Complex instance initialized from the files in the directory.

Raises:

Type Description
ValueError

If no PDB file is found or if multiple PDB files are found.

prepare
prepare(
    ligand: Ligand,
    *,
    padding: float = 1.0,
    keep_waters: bool = False,
    is_lig_protonated: bool = True,
    is_protein_protonated: bool = True
) -> None

run system preparation on the protein and one ligand from the Complex

Parameters:

Name Type Description Default
ligand Ligand

The ligand to prepare.

required
padding float

Padding to add around the system. Defaults to 1.0.

1.0
keep_waters bool

Whether to keep water molecules. Defaults to False.

False
is_lig_protonated bool

Whether the ligand is already protonated. Defaults to True.

True
is_protein_protonated bool

Whether the protein is already protonated. Defaults to True.

True
show_ligands
show_ligands(
    *, view: str = "2d", limit: Optional[int] = None
)

Display ligands in the complex object.

Parameters:

Name Type Description Default
view str

Visualization type, either "2d" (default) or "3d". - "2d": Shows ligands in a table with 2D structure renderings - "3d": Shows 3D molecular structures using SDF files

'2d'
limit Optional[int]

Optional; maximum number of ligands to display. If None, all ligands will be shown.

None