Skip to content

deeporigin.drug_discovery.complex

Module to support Drug Discovery workflows using Deep Origin

Attributes

DATA_DIRS module-attribute

DATA_DIRS = dict()

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

Functions

connect
connect() -> None

Connect instance of Complex to the databases on Deep Origin. This method uploads ligand and protein files if needed, and retrieves job IDs of tasks for all tools, if they exist.

Before running any tool, it is required to call this method.

from_dir classmethod
from_dir(directory: str) -> Complex

initialize an FEP class given some files in a directory

Parameters:

Name Type Description Default
directory str

directory containing ligand and protein files.

required

Protein file should be in PDB format. Ligand files should be in SDF format. Each SDF file should contain a single molecule. If your SDF files contain more than one molecule, use deeporigin.chemistry.split_sdf_file to split them into separate files.

get_csv_results_for
get_csv_results_for(tool: VALID_TOOLS)

Generic method to get CSV results for a particular tool and combine them as need be

Parameters:

Name Type Description Default
tool VALID_TOOLS

One of "Docking", "ABFE", "RBFE"

required
get_result_files_for
get_result_files_for(
    *,
    tool: VALID_TOOLS,
    ligand_ids: Optional[list[str]] = None
)

Retrieve result files for a specific computational tool used with this complex.

This method fetches data from the specified tool's database, filters for results associated with this complex, downloads any missing result files to the local storage directory, and returns paths to all result files.

Parameters:

Name Type Description Default
tool VALID_TOOLS

One of "Docking", "ABFE", "RBFE" - specifies which computational method's results to retrieve

required
ligand_ids Optional[list[str]]

Optional; list of ligand IDs to filter results. If None, results for all ligands in the complex will be retrieved.

None
get_status
get_status()

Returns status for all runs for all tools

get_status_for
get_status_for(tool: VALID_TOOLS) -> dict

Return status for jobs corresponding to a particular tool

Parameters:

Name Type Description Default
tool VALID_TOOLS

one of "Docking", "ABFE", "RBFE"

required
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