Jupyter Notebook is available at : Single Docking¶
Single Docking Workflow with DockSuiteX¶
In [ ]:
Copied!
import sys
import os
sys.path.insert(0, os.path.abspath('..'))
from docksuitex import Protein, Ligand, GridCalculator, VinaDocking, AD4Docking
from docksuitex.utils import fetch_pdb, fetch_sdf, parse_vina_log, parse_ad4_dlg, view_molecule
import sys
import os
sys.path.insert(0, os.path.abspath('..'))
from docksuitex import Protein, Ligand, GridCalculator, VinaDocking, AD4Docking
from docksuitex.utils import fetch_pdb, fetch_sdf, parse_vina_log, parse_ad4_dlg, view_molecule
Fetch and prepare Protein¶
In [ ]:
Copied!
# Fetch the protein structure
protein_path = fetch_pdb(pdbid = "1HVR")
# Visualize the downloaded protein structure
view_molecule(protein_path)
# Fetch the protein structure
protein_path = fetch_pdb(pdbid = "1HVR")
# Visualize the downloaded protein structure
view_molecule(protein_path)
In [ ]:
Copied!
# Prepare the protein
# This cleans the PDB, removes water/heterogens, and adds hydrogens/charges
prot = Protein(
input = protein_path,
#Default parameters
fix_pdb=True,
remove_heterogens=True,
remove_water=True,
add_hydrogens=True,
add_charges=True,
preserve_charge_types=None, #eg: ["Zn", "Fe"]
)
prepared_prot_path = prot.prepare()
# Visualize the prepared protein structure
prot.view_molecule()
# Prepare the protein
# This cleans the PDB, removes water/heterogens, and adds hydrogens/charges
prot = Protein(
input = protein_path,
#Default parameters
fix_pdb=True,
remove_heterogens=True,
remove_water=True,
add_hydrogens=True,
add_charges=True,
preserve_charge_types=None, #eg: ["Zn", "Fe"]
)
prepared_prot_path = prot.prepare()
# Visualize the prepared protein structure
prot.view_molecule()
Find Binding Pockets¶
In [ ]:
Copied!
# Predict binding pockets using P2Rank or define a blind docking box
# Identify binding pockets on the protein surface using P2Rank
gc = GridCalculator(receptor=prepared_prot_path, mode="p2rank") # mode can be "p2rank" or "blind"
pockets = gc.run()
# Predict binding pockets using P2Rank or define a blind docking box
# Identify binding pockets on the protein surface using P2Rank
gc = GridCalculator(receptor=prepared_prot_path, mode="p2rank") # mode can be "p2rank" or "blind"
pockets = gc.run()
Fetch and prepare Ligand¶
In [ ]:
Copied!
# Fetch the ligand structure
ligand_path = fetch_sdf(molecule_id="2244")
# Visualize the downloaded ligand structure
view_molecule(ligand_path)
# Fetch the ligand structure
ligand_path = fetch_sdf(molecule_id="2244")
# Visualize the downloaded ligand structure
view_molecule(ligand_path)
In [ ]:
Copied!
# Prepare the ligand
# This minimizes the structure, removes water and adds hydrogens/charges
lig = Ligand(
input=ligand_path,
#Default parameters
minimize=None, #Options: "mmff94", "mmff94s", "uff", "gaff"
remove_water=True,
add_hydrogens=True,
add_charges=True,
preserve_charge_types=None #eg: ["Zn", "Fe"]
)
prepared_lig_path = lig.prepare()
# Visualize the prepared ligand structure
lig.view_molecule()
# Prepare the ligand
# This minimizes the structure, removes water and adds hydrogens/charges
lig = Ligand(
input=ligand_path,
#Default parameters
minimize=None, #Options: "mmff94", "mmff94s", "uff", "gaff"
remove_water=True,
add_hydrogens=True,
add_charges=True,
preserve_charge_types=None #eg: ["Zn", "Fe"]
)
prepared_lig_path = lig.prepare()
# Visualize the prepared ligand structure
lig.view_molecule()
Perform protein ligand docking at the first pocket¶
Using AutoDock Vina¶
In [ ]:
Copied!
# Configure the docking engine with receptor, ligand, and grid parameters
vina = VinaDocking(
receptor=prepared_prot_path,
ligand=prepared_lig_path,
grid_center=pockets[0]['center'], #First pocket center
grid_size=pockets[0]['grid_size'], #Grid Size of first pocket center
# Default Parameters
exhaustiveness=8,
num_modes=9,
verbosity=1,
seed=42, # Random seed for reproducibility
)
# Configure the docking engine with receptor, ligand, and grid parameters
vina = VinaDocking(
receptor=prepared_prot_path,
ligand=prepared_lig_path,
grid_center=pockets[0]['center'], #First pocket center
grid_size=pockets[0]['grid_size'], #Grid Size of first pocket center
# Default Parameters
exhaustiveness=8,
num_modes=9,
verbosity=1,
seed=42, # Random seed for reproducibility
)
In [ ]:
Copied!
# Visualize grid box for Vina
vina.view_grid_box()
# Visualize grid box for Vina
vina.view_grid_box()
In [ ]:
Copied!
# Run docking and save results
vina.run(save_to=f"vina_results")
vina.parse_results()
# Run docking and save results
vina.run(save_to=f"vina_results")
vina.parse_results()
In [ ]:
Copied!
#Interactively view the docked poses
vina.view_docked_poses()
#Interactively view the docked poses
vina.view_docked_poses()
In [ ]:
Copied!
# Compute interaction fingerprints and identify types of contacts
vina.interaction_profile()
# Compute interaction fingerprints and identify types of contacts
vina.interaction_profile()
In [ ]:
Copied!
vina.view_interactions()
vina.view_interactions()
Using AutoDock4¶
In [ ]:
Copied!
# Configure the docking engine with receptor, ligand, and grid parameters
ad4 = AD4Docking(
receptor=prepared_prot_path,
ligand=prepared_lig_path,
grid_center=pockets[0]['center'], #First pocket center
grid_size=pockets[0]['grid_size'], #Grid Size of first pocket center
#Default Parameters
spacing=0.375,
dielectric=-0.1465,
smooth=0.5,
ga_pop_size=150,
ga_num_evals=2500000,
ga_num_generations=27000,
ga_elitism=1,
ga_mutation_rate=0.02,
ga_crossover_rate=0.8,
ga_run=10,
rmstol=2.0,
seed=(27,6), # Random seed for reproducibility
)
# Configure the docking engine with receptor, ligand, and grid parameters
ad4 = AD4Docking(
receptor=prepared_prot_path,
ligand=prepared_lig_path,
grid_center=pockets[0]['center'], #First pocket center
grid_size=pockets[0]['grid_size'], #Grid Size of first pocket center
#Default Parameters
spacing=0.375,
dielectric=-0.1465,
smooth=0.5,
ga_pop_size=150,
ga_num_evals=2500000,
ga_num_generations=27000,
ga_elitism=1,
ga_mutation_rate=0.02,
ga_crossover_rate=0.8,
ga_run=10,
rmstol=2.0,
seed=(27,6), # Random seed for reproducibility
)
In [ ]:
Copied!
# Visualize grid box for AD4
ad4.view_grid_box()
# Visualize grid box for AD4
ad4.view_grid_box()
In [ ]:
Copied!
# Run docking and save results
ad4.run(save_to="ad4_results")
ad4.parse_results()
# Run docking and save results
ad4.run(save_to="ad4_results")
ad4.parse_results()
In [ ]:
Copied!
#Interactively view the docked poses
ad4.view_docked_poses()
#Interactively view the docked poses
ad4.view_docked_poses()
In [ ]:
Copied!
# Compute interaction fingerprints and identify types of contacts
ad4.interaction_profile()
# Compute interaction fingerprints and identify types of contacts
ad4.interaction_profile()
In [ ]:
Copied!
ad4.view_interactions()
ad4.view_interactions()