InteractionProfiler API#
docksuitex.interaction_profiler.InteractionProfiler #
Protein–ligand interaction fingerprinting using ProLIF.
This module wraps ProLIF to analyse the non-covalent interactions between a protein and docked ligand poses produced by AutoDock Vina or AutoDock4.
The analysis workflow
- Converting the multi-model PDBQT output → SDF using Open Babel.
- Loading the protein with MDAnalysis / ProLIF.
- Loading all ligand poses from the SDF via
plf.sdf_supplier(). - Computing interaction fingerprints with ProLIF.
- Saving the resulting DataFrame, 2D/3D HTML, and barcode PNG.
Supported Input
- Protein: PDB (.pdb) — typically the
_prepared.pdbfrom Protein.prepare() - Ligand poses: multi-model PDBQT (.pdbqt) from Vina / AD4
Note
The intermediate SDF file is saved in prolif_intermediates/
inside the output directory.
__init__ #
__init__(
protein_pdb: Union[str, Path],
vina_output_pdbqt: Union[str, Path],
_cpu: int = (os.cpu_count() or 2) - 1,
)
Initialize an InteractionProfiler with input paths and settings.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
protein_pdb
|
str | Path
|
Path to the protein PDB file. This should be the original or prepared PDB (not PDBQT). |
required |
vina_output_pdbqt
|
str | Path
|
Path to the multi-model
|
required |
_cpu
|
int
|
Number of CPUs for ProLIF
fingerprint calculation. Defaults to |
(cpu_count() or 2) - 1
|
Raises:
| Type | Description |
|---|---|
FileNotFoundError
|
If either input file does not exist. |
ValueError
|
If file extensions are incorrect. |
run #
Run the ProLIF interaction fingerprint analysis.
Performs the full workflow: convert PDBQT → SDF → load structures → compute fingerprints → save CSV, 2D/3D HTML, and barcode.
Folder structure created inside save_to::
save_to/
├── prolif_intermediates/
│ ├── <protein>.pdb # copy of input protein
│ ├── <vina_output>.pdbqt # copy of input poses
│ └── ligands.sdf # converted ligand poses
├── prolif_interactions.csv
├── prolif_barcode.png
├── prolif_pose_1_interactions_2D.html
├── prolif_pose_1_interactions_3D.html
└── ...
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
save_to
|
str | Path
|
Directory where outputs will
be saved. Defaults to |
None
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
pandas.DataFrame: Interaction fingerprint table with one row |
DataFrame
|
per ligand pose and columns for each residue–interaction pair. |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If Open Babel conversion or ProLIF analysis fails. |
save_2d_view #
Save a 2D network diagram of the protein-ligand interactions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
save_path
|
Union[str, Path]
|
Path to save the 2D HTML file. |
required |
pose_idx
|
int
|
Pose index (1-based). Defaults to 1. |
1
|
save_3d_view #
Save an interactive 3D view of the protein-ligand complex interactions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
save_path
|
Union[str, Path]
|
Path to save the 3D HTML file. |
required |
pose_idx
|
int
|
Pose index (1-based). Defaults to 1. |
1
|
view_interactions #
Render an interactive viewer with Prev/Next buttons and a 2D/3D/Barcode toggle.
This method is designed for use in Jupyter Notebooks. It displays a widget with controls to switch between different ligand poses and different visualization modes (2D network, 3D complex, or the interaction barcode).