Skip to content

BatchProtein API#

docksuitex.batch_docking.batch_protein.BatchProtein #

Handles batch protein preparation with parallel processing.

__init__ #

__init__(
    inputs: Union[List[Union[str, Path]], str, Path],
    fix_pdb: bool = True,
    remove_heterogens: bool = True,
    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-model PDB files.

required
fix_pdb bool

Fix missing residues/atoms. Defaults to True.

True
remove_heterogens bool

Remove ligands/heterogens. Defaults to True.

True
remove_water bool

Remove water molecules. Defaults to True.

True
add_hydrogens bool

Add hydrogens using PDBFixer. Defaults to True.

True
ph float

Custom pH for adding missing hydrogens via PDBFixer. 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. Defaults to None.

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 proteins 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 protein file.