Skip to content

BatchLigand API#

docksuitex.batch_docking.batch_ligand.BatchLigand #

Handles batch ligand preparation in parallel.

This module supports only single-molecule SDF and MOL2 files. For other formats or multi-molecule libraries, use the Format Converter utility first.

__init__ #

__init__(
    inputs: Union[List[Union[str, Path]], str, Path],
    minimize: Optional[str] = None,
    remove_water: bool = True,
    add_hydrogens: bool = True,
    ph: float = 7.4,
    add_charges: bool = True,
    preserve_charge_types: Optional[list[str]] = None,
)

Initialize the batch processor and preparation parameters.

Parameters:

Name Type Description Default
inputs Union[List[Union[str, Path]], str, Path]

List or directory of single-molecule ligand files (SDF/MOL2).

required
minimize Optional[str]

Forcefield for energy minimization. Defaults to None.

None
remove_water bool

Remove water molecules. Defaults to True.

True
add_hydrogens bool

Add polar hydrogens. Defaults to True.

True
ph float

Custom pH for Open Babel hydrogen addition. Defaults to 7.4.

7.4
add_charges bool

Assign Gasteiger charges. Defaults to True.

True
preserve_charge_types Optional[list[str]]

Atom types to preserve charges for.

None

prepare_all #

prepare_all(
    save_to: Union[str, Path],
    cpu: int = (os.cpu_count() or 2) - 1,
) -> List[Dict[str, Union[str, Path, bool]]]

Prepare all ligands in batch and save PDBQT files to the specified folder.

Parameters:

Name Type Description Default
save_to str | Path

Directory to save all prepared PDBQT files.

required
cpu int

Total number of CPU cores to use. Defaults to os.cpu_count() - 1. Each worker uses 1 CPU.

(cpu_count() or 2) - 1

Returns:

Type Description
List[Dict[str, Union[str, Path, bool]]]

list[dict]: Result dictionary for each ligand file.