sharpdock 1.0.0__tar.gz → 2.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- sharpdock-2.0.0/PKG-INFO +105 -0
- sharpdock-2.0.0/README.md +92 -0
- {sharpdock-1.0.0 → sharpdock-2.0.0}/pyproject.toml +1 -1
- {sharpdock-1.0.0 → sharpdock-2.0.0}/sharpdock/__init__.py +1 -1
- sharpdock-2.0.0/sharpdock/main.py +250 -0
- sharpdock-2.0.0/sharpdock.egg-info/PKG-INFO +105 -0
- sharpdock-1.0.0/PKG-INFO +0 -99
- sharpdock-1.0.0/README.md +0 -86
- sharpdock-1.0.0/sharpdock/main.py +0 -182
- sharpdock-1.0.0/sharpdock.egg-info/PKG-INFO +0 -99
- {sharpdock-1.0.0 → sharpdock-2.0.0}/LICENCE +0 -0
- {sharpdock-1.0.0 → sharpdock-2.0.0}/setup.cfg +0 -0
- {sharpdock-1.0.0 → sharpdock-2.0.0}/sharpdock.egg-info/SOURCES.txt +0 -0
- {sharpdock-1.0.0 → sharpdock-2.0.0}/sharpdock.egg-info/dependency_links.txt +0 -0
- {sharpdock-1.0.0 → sharpdock-2.0.0}/sharpdock.egg-info/entry_points.txt +0 -0
- {sharpdock-1.0.0 → sharpdock-2.0.0}/sharpdock.egg-info/requires.txt +0 -0
- {sharpdock-1.0.0 → sharpdock-2.0.0}/sharpdock.egg-info/top_level.txt +0 -0
sharpdock-2.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: sharpdock
|
|
3
|
+
Version: 2.0.0
|
|
4
|
+
Summary: Automated focused molecular docking pipeline for Autodock Vina
|
|
5
|
+
Author: alpha-horizon
|
|
6
|
+
Requires-Python: >=3.7
|
|
7
|
+
Description-Content-Type: text/markdown
|
|
8
|
+
License-File: LICENCE
|
|
9
|
+
Requires-Dist: numpy
|
|
10
|
+
Requires-Dist: biopython
|
|
11
|
+
Requires-Dist: tqdm
|
|
12
|
+
Dynamic: license-file
|
|
13
|
+
|
|
14
|
+
# SHARPDOCK v2.0.0
|
|
15
|
+
|
|
16
|
+
```text
|
|
17
|
+
====================================================
|
|
18
|
+
An Integrated Pipeline for Focused Molecular Docking
|
|
19
|
+
====================================================
|
|
20
|
+
```
|
|
21
|
+
**SHARPDOCK** is a high-throughput, automated pipeline for focused molecular docking. It handles the ranking of ligands based on binding affinities by automating grid box generation, receptor/ligand preparation, and parallelized docking execution using AutoDock Vina.
|
|
22
|
+
|
|
23
|
+
For more tools visit: https://github.com/alpha-horizon
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
## Features
|
|
27
|
+
|
|
28
|
+
- Automated Grid Box Calculation: No more manual coordinate entry; define sites by chain and residue ID.
|
|
29
|
+
|
|
30
|
+
- Parallel Ligand Preparation: Process large libraries of ligands in .sdf format.
|
|
31
|
+
|
|
32
|
+
- Vina Integration: Seamlessly communicates with AutoDock Vina for industry-standard accuracy.
|
|
33
|
+
|
|
34
|
+
- Formatted Reporting: Generates publication-ready CSVs and detailed log reports.
|
|
35
|
+
|
|
36
|
+
- Top-Hit Extraction: Automatically isolates the most promising leads for downstream analysis.
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
## Input Requirements
|
|
40
|
+
|
|
41
|
+
1. Receptor File (-r / --receptor)
|
|
42
|
+
|
|
43
|
+
Format: Standard .pdb file.
|
|
44
|
+
Note: It is recommended to remove water molecules, ions, and co-crystallized ligands from the PDB file before running the pipeline to prevent interference with the grid box calculation.
|
|
45
|
+
|
|
46
|
+
2. Ligand Files (-l / --ligands)
|
|
47
|
+
|
|
48
|
+
Format: .sdf (Structure Data File).
|
|
49
|
+
Note: You can input ligands in 2D or 3D structure.
|
|
50
|
+
|
|
51
|
+
3. Active Site Specification (-s / --sites)
|
|
52
|
+
|
|
53
|
+
The site string is the most critical input for Focused Docking. Use the following syntax:
|
|
54
|
+
|
|
55
|
+
Single Chain: "A:101 102 105"
|
|
56
|
+
|
|
57
|
+
Multiple Chains: "A:101 102; B:70 71"
|
|
58
|
+
|
|
59
|
+
Format: ChainID:ResidueID ResidueID; ChainID:ResidueID
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
## pip Installation
|
|
63
|
+
|
|
64
|
+
To install SHARPDOCK, you can use the command mentioned below.
|
|
65
|
+
|
|
66
|
+
pip install sharpdock
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
## Command Line Usage
|
|
70
|
+
|
|
71
|
+
This tool supports full argument-based execution for automation and pipelines:
|
|
72
|
+
|
|
73
|
+
sharpdock -r receptor.pdb -s "A:101 102; B:70" -l ./ligands -n 10
|
|
74
|
+
|
|
75
|
+
Options:
|
|
76
|
+
|
|
77
|
+
-r --receptor Path to receptor PDB file
|
|
78
|
+
-s --sites Active site residues (e.g., 'A:10 11; B:50')
|
|
79
|
+
-l --ligands Folder containing ligand .sdf files |ligands (default)|
|
|
80
|
+
-o --output Output directory name |sharpdock_results (default)|
|
|
81
|
+
-p --padding Grid box padding in Angstroms (Å) |5.0 (default)|
|
|
82
|
+
-e --exhaustiveness Vina search exhaustiveness |32 (default)|
|
|
83
|
+
-n --top_hits Number of top ligands to export |10 (default)|
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
## Directory Structure
|
|
87
|
+
|
|
88
|
+
- After execution, the output folder contains:
|
|
89
|
+
|
|
90
|
+
- top_hits/: The best-scoring docked poses.
|
|
91
|
+
|
|
92
|
+
- docking_results.csv: Comprehensive spreadsheet of all scores.
|
|
93
|
+
|
|
94
|
+
- binding_affinities.log: A human-readable summary of the run parameters and results.
|
|
95
|
+
|
|
96
|
+
- receptor.box.txt: The specific Vina configuration used for the grid.
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
## Contribution
|
|
100
|
+
|
|
101
|
+
For more tools or to report issues, visit the official GitHub repository:
|
|
102
|
+
|
|
103
|
+
GitHub: https://github.com/alpha-horizon
|
|
104
|
+
|
|
105
|
+
---
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# SHARPDOCK v2.0.0
|
|
2
|
+
|
|
3
|
+
```text
|
|
4
|
+
====================================================
|
|
5
|
+
An Integrated Pipeline for Focused Molecular Docking
|
|
6
|
+
====================================================
|
|
7
|
+
```
|
|
8
|
+
**SHARPDOCK** is a high-throughput, automated pipeline for focused molecular docking. It handles the ranking of ligands based on binding affinities by automating grid box generation, receptor/ligand preparation, and parallelized docking execution using AutoDock Vina.
|
|
9
|
+
|
|
10
|
+
For more tools visit: https://github.com/alpha-horizon
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
## Features
|
|
14
|
+
|
|
15
|
+
- Automated Grid Box Calculation: No more manual coordinate entry; define sites by chain and residue ID.
|
|
16
|
+
|
|
17
|
+
- Parallel Ligand Preparation: Process large libraries of ligands in .sdf format.
|
|
18
|
+
|
|
19
|
+
- Vina Integration: Seamlessly communicates with AutoDock Vina for industry-standard accuracy.
|
|
20
|
+
|
|
21
|
+
- Formatted Reporting: Generates publication-ready CSVs and detailed log reports.
|
|
22
|
+
|
|
23
|
+
- Top-Hit Extraction: Automatically isolates the most promising leads for downstream analysis.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
## Input Requirements
|
|
27
|
+
|
|
28
|
+
1. Receptor File (-r / --receptor)
|
|
29
|
+
|
|
30
|
+
Format: Standard .pdb file.
|
|
31
|
+
Note: It is recommended to remove water molecules, ions, and co-crystallized ligands from the PDB file before running the pipeline to prevent interference with the grid box calculation.
|
|
32
|
+
|
|
33
|
+
2. Ligand Files (-l / --ligands)
|
|
34
|
+
|
|
35
|
+
Format: .sdf (Structure Data File).
|
|
36
|
+
Note: You can input ligands in 2D or 3D structure.
|
|
37
|
+
|
|
38
|
+
3. Active Site Specification (-s / --sites)
|
|
39
|
+
|
|
40
|
+
The site string is the most critical input for Focused Docking. Use the following syntax:
|
|
41
|
+
|
|
42
|
+
Single Chain: "A:101 102 105"
|
|
43
|
+
|
|
44
|
+
Multiple Chains: "A:101 102; B:70 71"
|
|
45
|
+
|
|
46
|
+
Format: ChainID:ResidueID ResidueID; ChainID:ResidueID
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
## pip Installation
|
|
50
|
+
|
|
51
|
+
To install SHARPDOCK, you can use the command mentioned below.
|
|
52
|
+
|
|
53
|
+
pip install sharpdock
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
## Command Line Usage
|
|
57
|
+
|
|
58
|
+
This tool supports full argument-based execution for automation and pipelines:
|
|
59
|
+
|
|
60
|
+
sharpdock -r receptor.pdb -s "A:101 102; B:70" -l ./ligands -n 10
|
|
61
|
+
|
|
62
|
+
Options:
|
|
63
|
+
|
|
64
|
+
-r --receptor Path to receptor PDB file
|
|
65
|
+
-s --sites Active site residues (e.g., 'A:10 11; B:50')
|
|
66
|
+
-l --ligands Folder containing ligand .sdf files |ligands (default)|
|
|
67
|
+
-o --output Output directory name |sharpdock_results (default)|
|
|
68
|
+
-p --padding Grid box padding in Angstroms (Å) |5.0 (default)|
|
|
69
|
+
-e --exhaustiveness Vina search exhaustiveness |32 (default)|
|
|
70
|
+
-n --top_hits Number of top ligands to export |10 (default)|
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
## Directory Structure
|
|
74
|
+
|
|
75
|
+
- After execution, the output folder contains:
|
|
76
|
+
|
|
77
|
+
- top_hits/: The best-scoring docked poses.
|
|
78
|
+
|
|
79
|
+
- docking_results.csv: Comprehensive spreadsheet of all scores.
|
|
80
|
+
|
|
81
|
+
- binding_affinities.log: A human-readable summary of the run parameters and results.
|
|
82
|
+
|
|
83
|
+
- receptor.box.txt: The specific Vina configuration used for the grid.
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
## Contribution
|
|
87
|
+
|
|
88
|
+
For more tools or to report issues, visit the official GitHub repository:
|
|
89
|
+
|
|
90
|
+
GitHub: https://github.com/alpha-horizon
|
|
91
|
+
|
|
92
|
+
---
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
__version__ = "
|
|
1
|
+
__version__ = "2.0.0"
|
|
2
2
|
from .main import main
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import subprocess
|
|
3
|
+
import shutil
|
|
4
|
+
import csv
|
|
5
|
+
import argparse
|
|
6
|
+
import numpy as np
|
|
7
|
+
from Bio.PDB import PDBParser
|
|
8
|
+
from multiprocessing import Pool, cpu_count
|
|
9
|
+
from tqdm import tqdm
|
|
10
|
+
import sys
|
|
11
|
+
|
|
12
|
+
# ===============================
|
|
13
|
+
# HEADER
|
|
14
|
+
# ===============================
|
|
15
|
+
|
|
16
|
+
def print_header():
|
|
17
|
+
header = r"""
|
|
18
|
+
===========================================================
|
|
19
|
+
| |
|
|
20
|
+
| _____ _ _ _ |
|
|
21
|
+
| / ____| | | | | | |
|
|
22
|
+
| | (___ | |__ __ _ _ __ _ __ __| | ___ ___| | __ |
|
|
23
|
+
| \___ \| '_ \ / _` | '__| '_ \ / _` |/ _ \ / __| |/ / |
|
|
24
|
+
| ____) | | | | (_| | | | |_) | (_| | (_) | (__| < |
|
|
25
|
+
| |_____/|_| |_|\__,_|_| | .__/ \__,_|\___/ \___|_|\_\ |
|
|
26
|
+
| | | |
|
|
27
|
+
| |_| |
|
|
28
|
+
| [VERSION: 2.0.0] |
|
|
29
|
+
| |
|
|
30
|
+
| - An automated tool for focused molecular docking - |
|
|
31
|
+
| |
|
|
32
|
+
| GitHub: https://github.com/alpha-horizon/ |
|
|
33
|
+
| |
|
|
34
|
+
===========================================================
|
|
35
|
+
"""
|
|
36
|
+
print(header)
|
|
37
|
+
|
|
38
|
+
def compute_box(receptor_pdb, chain_res_map, padding):
|
|
39
|
+
"""Calculates the center and size of the grid box based on active site residues."""
|
|
40
|
+
parser = PDBParser(QUIET=True)
|
|
41
|
+
structure = parser.get_structure("rec", receptor_pdb)
|
|
42
|
+
coords = []
|
|
43
|
+
for model in structure:
|
|
44
|
+
for chain in model:
|
|
45
|
+
if chain.id not in chain_res_map: continue
|
|
46
|
+
for res in chain:
|
|
47
|
+
if res.id[1] not in chain_res_map[chain.id]: continue
|
|
48
|
+
for atom in res:
|
|
49
|
+
coords.append(atom.get_coord())
|
|
50
|
+
|
|
51
|
+
if not coords:
|
|
52
|
+
print(f"\nError: No coordinates found for residues {chain_res_map}!\n")
|
|
53
|
+
sys.exit(1)
|
|
54
|
+
|
|
55
|
+
coords = np.array(coords)
|
|
56
|
+
center = coords.mean(axis=0)
|
|
57
|
+
size = coords.max(axis=0) - coords.min(axis=0) + padding
|
|
58
|
+
return center, size
|
|
59
|
+
|
|
60
|
+
def process_ligand_task(args_tuple):
|
|
61
|
+
"""Worker function for parallel ligand preparation."""
|
|
62
|
+
f, ligand_dir, pdbqt_dir = args_tuple
|
|
63
|
+
base = os.path.splitext(f)[0]
|
|
64
|
+
sdf_input = os.path.join(ligand_dir, f)
|
|
65
|
+
sdf_h = os.path.join(ligand_dir, f"{base}_H.sdf")
|
|
66
|
+
pdbqt_out = os.path.join(pdbqt_dir, f"{base}.pdbqt")
|
|
67
|
+
|
|
68
|
+
try:
|
|
69
|
+
# Scrub/Optimize Ligand
|
|
70
|
+
subprocess.run(["scrub.py", sdf_input, "-o", sdf_h], capture_output=True, check=True)
|
|
71
|
+
# Convert to PDBQT
|
|
72
|
+
subprocess.run(["mk_prepare_ligand.py", "-i", sdf_h, "-o", pdbqt_out], capture_output=True, check=True)
|
|
73
|
+
if os.path.exists(sdf_h):
|
|
74
|
+
os.remove(sdf_h)
|
|
75
|
+
return True
|
|
76
|
+
except Exception:
|
|
77
|
+
return False
|
|
78
|
+
|
|
79
|
+
def main():
|
|
80
|
+
print_header()
|
|
81
|
+
|
|
82
|
+
formatter = lambda prog: argparse.HelpFormatter(prog, max_help_position=40)
|
|
83
|
+
parser = argparse.ArgumentParser(
|
|
84
|
+
description="[SHARPDOCK: AN INTEGRATED PIPELINE FOR FOCUSED MOLECULAR DOCKING]",
|
|
85
|
+
formatter_class=formatter
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
parser.add_argument("-v", "--version", action="version", version="sharpdock 1.0.0")
|
|
89
|
+
parser.add_argument("-r", "--receptor", required=True, help="Path to receptor PDB file")
|
|
90
|
+
parser.add_argument("-s", "--sites", required=True, help="Active sites (e.g., 'A:101 102; B:70')")
|
|
91
|
+
parser.add_argument("-l", "--ligands", default="ligands", help="Folder with ligands in .sdf format")
|
|
92
|
+
parser.add_argument("-o", "--output", default="sharpdock_results", help="Directory for output files")
|
|
93
|
+
parser.add_argument("-p", "--padding", type=float, default=5.0, help="Grid box padding in Å")
|
|
94
|
+
parser.add_argument("-e", "--exhaustiveness", type=int, default=32, help="Vina search exhaustiveness")
|
|
95
|
+
parser.add_argument("-n", "--top_hits", type=int, default=10, help="Number of top ligands to export")
|
|
96
|
+
|
|
97
|
+
args = parser.parse_args()
|
|
98
|
+
|
|
99
|
+
# Paths Setup
|
|
100
|
+
RECEPTOR_PDB = args.receptor
|
|
101
|
+
LIGAND_DIR = args.ligands
|
|
102
|
+
OUTPUT_DIR = args.output
|
|
103
|
+
top_n_count = args.top_hits
|
|
104
|
+
padding = args.padding
|
|
105
|
+
|
|
106
|
+
LIGAND_PDBQT_DIR = os.path.join(OUTPUT_DIR, "ligands_pdbqt")
|
|
107
|
+
RAW_OUTPUT = os.path.join(OUTPUT_DIR, "raw_output")
|
|
108
|
+
TOP_HITS_DIR = os.path.join(OUTPUT_DIR, "top_hits")
|
|
109
|
+
ALL_RESULTS_CSV = os.path.join(OUTPUT_DIR, "docking_results.csv")
|
|
110
|
+
AFFINITY_LOG = os.path.join(OUTPUT_DIR, "binding_affinities.log")
|
|
111
|
+
BOX_CONFIG = os.path.join(OUTPUT_DIR, "receptor.box.txt")
|
|
112
|
+
RECEPTOR_PDBQT = os.path.join(OUTPUT_DIR, "receptor.pdbqt")
|
|
113
|
+
|
|
114
|
+
os.makedirs(OUTPUT_DIR, exist_ok=True)
|
|
115
|
+
os.makedirs(LIGAND_PDBQT_DIR, exist_ok=True)
|
|
116
|
+
os.makedirs(RAW_OUTPUT, exist_ok=True)
|
|
117
|
+
os.makedirs(TOP_HITS_DIR, exist_ok=True)
|
|
118
|
+
|
|
119
|
+
# Parse Chain/Residue Mapping
|
|
120
|
+
CHAIN_RES_MAP = {}
|
|
121
|
+
try:
|
|
122
|
+
for block in args.sites.split(";"):
|
|
123
|
+
block = block.strip()
|
|
124
|
+
if not block: continue
|
|
125
|
+
ch, res = block.split(":")
|
|
126
|
+
CHAIN_RES_MAP[ch.strip()] = [int(r) for r in res.split()]
|
|
127
|
+
except Exception:
|
|
128
|
+
print("\nError: Sites format invalid. Use 'A:101 102; B:70'\n")
|
|
129
|
+
sys.exit(1)
|
|
130
|
+
|
|
131
|
+
# STEP 1 — Compute Grid Box
|
|
132
|
+
print("# Grid box calculation.\n")
|
|
133
|
+
parser_pdb = PDBParser(QUIET=True)
|
|
134
|
+
# Corrected: Use RECEPTOR_PDB here because RECEPTOR_PDBQT is not created yet
|
|
135
|
+
structure = parser_pdb.get_structure("rec", RECEPTOR_PDB)
|
|
136
|
+
|
|
137
|
+
coords = []
|
|
138
|
+
for model in structure:
|
|
139
|
+
for chain in model:
|
|
140
|
+
if chain.id not in CHAIN_RES_MAP: continue
|
|
141
|
+
for res in chain:
|
|
142
|
+
if res.id[1] not in CHAIN_RES_MAP[chain.id]: continue
|
|
143
|
+
for atom in res:
|
|
144
|
+
coords.append(atom.get_coord())
|
|
145
|
+
|
|
146
|
+
if not coords:
|
|
147
|
+
print("Error: No coordinates found for specified residues!\n")
|
|
148
|
+
sys.exit(1)
|
|
149
|
+
|
|
150
|
+
coords = np.array(coords)
|
|
151
|
+
center = coords.mean(axis=0)
|
|
152
|
+
size = coords.max(axis=0) - coords.min(axis=0) + padding
|
|
153
|
+
|
|
154
|
+
with open(BOX_CONFIG, "w") as f:
|
|
155
|
+
f.write(f"center_x = {center[0]:.3f}\ncenter_y = {center[1]:.3f}\ncenter_z = {center[2]:.3f}\n")
|
|
156
|
+
f.write(f"size_x = {size[0]:.3f}\nsize_y = {size[1]:.3f}\nsize_z = {size[2]:.3f}\n")
|
|
157
|
+
|
|
158
|
+
# STEP 2 — Prepare Receptor
|
|
159
|
+
print("# Receptor preparation.\n")
|
|
160
|
+
RECEPTOR_LOG = os.path.join(OUTPUT_DIR, "receptor_preparation.log")
|
|
161
|
+
rec_out_base = RECEPTOR_PDBQT.replace(".pdbqt", "")
|
|
162
|
+
|
|
163
|
+
with open(RECEPTOR_LOG, "w") as log_file:
|
|
164
|
+
subprocess.run(
|
|
165
|
+
[
|
|
166
|
+
"mk_prepare_receptor.py", "-i", RECEPTOR_PDB, "-o", rec_out_base,
|
|
167
|
+
"-p", "-v", "--box_center", f"{center[0]}", f"{center[1]}", f"{center[2]}",
|
|
168
|
+
"--box_size", f"{size[0]}", f"{size[1]}", f"{size[2]}",
|
|
169
|
+
"--default_altloc", "A", "--allow_bad_res", "-a"
|
|
170
|
+
],
|
|
171
|
+
stdout=log_file, stderr=log_file
|
|
172
|
+
)
|
|
173
|
+
|
|
174
|
+
# STEP 3 — Prepare Ligands (Parallel)
|
|
175
|
+
ligand_files = [f for f in os.listdir(LIGAND_DIR) if f.endswith(".sdf")]
|
|
176
|
+
print(f"# Preparing {len(ligand_files)} ligands.\n")
|
|
177
|
+
|
|
178
|
+
task_args = [(f, LIGAND_DIR, LIGAND_PDBQT_DIR) for f in ligand_files]
|
|
179
|
+
|
|
180
|
+
with Pool(cpu_count()) as pool:
|
|
181
|
+
list(tqdm(pool.imap_unordered(process_ligand_task, task_args), total=len(ligand_files), ascii=" ."))
|
|
182
|
+
|
|
183
|
+
# STEP 4 — Docking
|
|
184
|
+
print("\n# FOCUSED Molecular Docking started.\n")
|
|
185
|
+
results = []
|
|
186
|
+
pdbqt_ligands = [f for f in os.listdir(LIGAND_PDBQT_DIR) if f.endswith(".pdbqt")]
|
|
187
|
+
|
|
188
|
+
for lig_file in tqdm(pdbqt_ligands, desc="Autodock Vina - Molecular Docking Progress", ascii=" ."):
|
|
189
|
+
base = os.path.splitext(lig_file)[0]
|
|
190
|
+
out_path = os.path.join(RAW_OUTPUT, f"{base}_out.pdbqt")
|
|
191
|
+
subprocess.run([
|
|
192
|
+
"vina", "--receptor", RECEPTOR_PDBQT,
|
|
193
|
+
"--ligand", os.path.join(LIGAND_PDBQT_DIR, lig_file),
|
|
194
|
+
"--config", BOX_CONFIG, "--exhaustiveness", str(args.exhaustiveness),
|
|
195
|
+
"--out", out_path
|
|
196
|
+
], capture_output=True)
|
|
197
|
+
|
|
198
|
+
if os.path.exists(out_path):
|
|
199
|
+
with open(out_path) as f:
|
|
200
|
+
for line in f:
|
|
201
|
+
if "REMARK VINA RESULT:" in line:
|
|
202
|
+
results.append([base, float(line.split()[3])])
|
|
203
|
+
break
|
|
204
|
+
|
|
205
|
+
# Save and Sort Results
|
|
206
|
+
results.sort(key=lambda x: x[1])
|
|
207
|
+
|
|
208
|
+
# Write CSV
|
|
209
|
+
with open(ALL_RESULTS_CSV, "w", newline="") as f:
|
|
210
|
+
writer = csv.writer(f)
|
|
211
|
+
writer.writerow(["ligand", "binding_affinity (kcal/mol)"])
|
|
212
|
+
writer.writerows(results)
|
|
213
|
+
|
|
214
|
+
# STEP 5 — Create Binding Affinities Log File
|
|
215
|
+
with open(AFFINITY_LOG, "w") as f:
|
|
216
|
+
# Header Section
|
|
217
|
+
f.write("-" * 80 + "\n")
|
|
218
|
+
f.write("=====[ <SHARPDOCK> - AN INTEGRATED PIPELINE FOR FOCUSED MOLECULAR DOCKING ]=====\n")
|
|
219
|
+
f.write("-" * 80 + "\n")
|
|
220
|
+
f.write(f"Receptor: {args.receptor}\n")
|
|
221
|
+
f.write(f"Active Sites Selected: {args.sites}\n")
|
|
222
|
+
f.write(f"Total Ligands: {len(results)}\n")
|
|
223
|
+
f.write("-" * 80 + "\n\n")
|
|
224
|
+
|
|
225
|
+
# Table Header
|
|
226
|
+
f.write(f"{'Ligand Name':<45} | {'Affinity (kcal/mol)':<20}\n")
|
|
227
|
+
f.write("-" * 80 + "\n")
|
|
228
|
+
|
|
229
|
+
# Data Rows
|
|
230
|
+
for name, affinity in results:
|
|
231
|
+
f.write(f"{name:<45} | {affinity:<20.2f}\n")
|
|
232
|
+
|
|
233
|
+
# Footer
|
|
234
|
+
f.write("-" * 80 + "\n")
|
|
235
|
+
f.write("[ END OF REPORT ]\n")
|
|
236
|
+
f.write("-" * 80 + "\n")
|
|
237
|
+
|
|
238
|
+
# STEP 6 — Export Top Hits
|
|
239
|
+
print(f"\n# Exporting Top {top_n_count} hits to {TOP_HITS_DIR}")
|
|
240
|
+
|
|
241
|
+
for i, (name, affinity) in enumerate(results[:top_n_count]):
|
|
242
|
+
source_file = os.path.join(RAW_OUTPUT, f"{name}_out.pdbqt")
|
|
243
|
+
dest_file = os.path.join(TOP_HITS_DIR, f"{name}.pdbqt")
|
|
244
|
+
if os.path.exists(source_file):
|
|
245
|
+
shutil.copy(source_file, dest_file)
|
|
246
|
+
|
|
247
|
+
print(f"\n===== |SHARPDOCK| < FOCUSED MOLECULAR DOCKING Completed! > Check for the Results in: {OUTPUT_DIR} =====\n")
|
|
248
|
+
|
|
249
|
+
if __name__ == "__main__":
|
|
250
|
+
main()
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: sharpdock
|
|
3
|
+
Version: 2.0.0
|
|
4
|
+
Summary: Automated focused molecular docking pipeline for Autodock Vina
|
|
5
|
+
Author: alpha-horizon
|
|
6
|
+
Requires-Python: >=3.7
|
|
7
|
+
Description-Content-Type: text/markdown
|
|
8
|
+
License-File: LICENCE
|
|
9
|
+
Requires-Dist: numpy
|
|
10
|
+
Requires-Dist: biopython
|
|
11
|
+
Requires-Dist: tqdm
|
|
12
|
+
Dynamic: license-file
|
|
13
|
+
|
|
14
|
+
# SHARPDOCK v2.0.0
|
|
15
|
+
|
|
16
|
+
```text
|
|
17
|
+
====================================================
|
|
18
|
+
An Integrated Pipeline for Focused Molecular Docking
|
|
19
|
+
====================================================
|
|
20
|
+
```
|
|
21
|
+
**SHARPDOCK** is a high-throughput, automated pipeline for focused molecular docking. It handles the ranking of ligands based on binding affinities by automating grid box generation, receptor/ligand preparation, and parallelized docking execution using AutoDock Vina.
|
|
22
|
+
|
|
23
|
+
For more tools visit: https://github.com/alpha-horizon
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
## Features
|
|
27
|
+
|
|
28
|
+
- Automated Grid Box Calculation: No more manual coordinate entry; define sites by chain and residue ID.
|
|
29
|
+
|
|
30
|
+
- Parallel Ligand Preparation: Process large libraries of ligands in .sdf format.
|
|
31
|
+
|
|
32
|
+
- Vina Integration: Seamlessly communicates with AutoDock Vina for industry-standard accuracy.
|
|
33
|
+
|
|
34
|
+
- Formatted Reporting: Generates publication-ready CSVs and detailed log reports.
|
|
35
|
+
|
|
36
|
+
- Top-Hit Extraction: Automatically isolates the most promising leads for downstream analysis.
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
## Input Requirements
|
|
40
|
+
|
|
41
|
+
1. Receptor File (-r / --receptor)
|
|
42
|
+
|
|
43
|
+
Format: Standard .pdb file.
|
|
44
|
+
Note: It is recommended to remove water molecules, ions, and co-crystallized ligands from the PDB file before running the pipeline to prevent interference with the grid box calculation.
|
|
45
|
+
|
|
46
|
+
2. Ligand Files (-l / --ligands)
|
|
47
|
+
|
|
48
|
+
Format: .sdf (Structure Data File).
|
|
49
|
+
Note: You can input ligands in 2D or 3D structure.
|
|
50
|
+
|
|
51
|
+
3. Active Site Specification (-s / --sites)
|
|
52
|
+
|
|
53
|
+
The site string is the most critical input for Focused Docking. Use the following syntax:
|
|
54
|
+
|
|
55
|
+
Single Chain: "A:101 102 105"
|
|
56
|
+
|
|
57
|
+
Multiple Chains: "A:101 102; B:70 71"
|
|
58
|
+
|
|
59
|
+
Format: ChainID:ResidueID ResidueID; ChainID:ResidueID
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
## pip Installation
|
|
63
|
+
|
|
64
|
+
To install SHARPDOCK, you can use the command mentioned below.
|
|
65
|
+
|
|
66
|
+
pip install sharpdock
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
## Command Line Usage
|
|
70
|
+
|
|
71
|
+
This tool supports full argument-based execution for automation and pipelines:
|
|
72
|
+
|
|
73
|
+
sharpdock -r receptor.pdb -s "A:101 102; B:70" -l ./ligands -n 10
|
|
74
|
+
|
|
75
|
+
Options:
|
|
76
|
+
|
|
77
|
+
-r --receptor Path to receptor PDB file
|
|
78
|
+
-s --sites Active site residues (e.g., 'A:10 11; B:50')
|
|
79
|
+
-l --ligands Folder containing ligand .sdf files |ligands (default)|
|
|
80
|
+
-o --output Output directory name |sharpdock_results (default)|
|
|
81
|
+
-p --padding Grid box padding in Angstroms (Å) |5.0 (default)|
|
|
82
|
+
-e --exhaustiveness Vina search exhaustiveness |32 (default)|
|
|
83
|
+
-n --top_hits Number of top ligands to export |10 (default)|
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
## Directory Structure
|
|
87
|
+
|
|
88
|
+
- After execution, the output folder contains:
|
|
89
|
+
|
|
90
|
+
- top_hits/: The best-scoring docked poses.
|
|
91
|
+
|
|
92
|
+
- docking_results.csv: Comprehensive spreadsheet of all scores.
|
|
93
|
+
|
|
94
|
+
- binding_affinities.log: A human-readable summary of the run parameters and results.
|
|
95
|
+
|
|
96
|
+
- receptor.box.txt: The specific Vina configuration used for the grid.
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
## Contribution
|
|
100
|
+
|
|
101
|
+
For more tools or to report issues, visit the official GitHub repository:
|
|
102
|
+
|
|
103
|
+
GitHub: https://github.com/alpha-horizon
|
|
104
|
+
|
|
105
|
+
---
|
sharpdock-1.0.0/PKG-INFO
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: sharpdock
|
|
3
|
-
Version: 1.0.0
|
|
4
|
-
Summary: Automated focused molecular docking pipeline for Autodock Vina
|
|
5
|
-
Author: alpha-horizon
|
|
6
|
-
Requires-Python: >=3.7
|
|
7
|
-
Description-Content-Type: text/markdown
|
|
8
|
-
License-File: LICENCE
|
|
9
|
-
Requires-Dist: numpy
|
|
10
|
-
Requires-Dist: biopython
|
|
11
|
-
Requires-Dist: tqdm
|
|
12
|
-
Dynamic: license-file
|
|
13
|
-
|
|
14
|
-
# SHARPDOCK v1.0.0
|
|
15
|
-
|
|
16
|
-
```text
|
|
17
|
-
====================================================
|
|
18
|
-
An Integrated Pipeline for Focused Molecular Docking
|
|
19
|
-
====================================================
|
|
20
|
-
```
|
|
21
|
-
**SHARPDOCK** is a tool, designed for Automated Focused Molecular Docking. It handles the calculating grid box coordinates based on specific amino acid residues to parallelizing ligand preparation and executing AutoDock Vina.
|
|
22
|
-
|
|
23
|
-
For more tools visit: https://github.com/alpha-horizon
|
|
24
|
-
|
|
25
|
-
---
|
|
26
|
-
## Features
|
|
27
|
-
|
|
28
|
-
- Grid Calculation: Automatically centers and sizes the docking box based on a user-provided list of active site residues.
|
|
29
|
-
|
|
30
|
-
- Parallel Processing: Prepare multiple ligands simultaneously, Can handle ligands in 2D/3D format.
|
|
31
|
-
|
|
32
|
-
- Summary: Outputs a sorted CSV of binding affinities and organized docking poses.
|
|
33
|
-
|
|
34
|
-
---
|
|
35
|
-
## Input Requirements
|
|
36
|
-
1. Receptor (-r)
|
|
37
|
-
|
|
38
|
-
Format: .pdb
|
|
39
|
-
|
|
40
|
-
NOTE: Ensure the protein structure is clean (remove non-essential waters or ions).
|
|
41
|
-
|
|
42
|
-
2. Ligands (-l)
|
|
43
|
-
|
|
44
|
-
Format: .sdf (2D/3D)
|
|
45
|
-
|
|
46
|
-
NOTE: Place all ligand files in a single directory.
|
|
47
|
-
|
|
48
|
-
3. Active Site Specification (-s)
|
|
49
|
-
|
|
50
|
-
Use the following format:
|
|
51
|
-
|
|
52
|
-
"ChainID:ResidueID ResidueID; ChainID:ResidueID"
|
|
53
|
-
|
|
54
|
-
Example: "A:101 102 105; B:45" (This focuses the docking on residues 101, 102, and 105 of Chain A, and residue 45 of Chain B).
|
|
55
|
-
|
|
56
|
-
---
|
|
57
|
-
## pip Installation
|
|
58
|
-
|
|
59
|
-
To install SHARPDOCK, you can use the command mentioned below.
|
|
60
|
-
|
|
61
|
-
pip install sharpdock
|
|
62
|
-
|
|
63
|
-
---
|
|
64
|
-
## Command Line Usage
|
|
65
|
-
|
|
66
|
-
This tool supports full argument-based execution for automation and pipelines:
|
|
67
|
-
|
|
68
|
-
sharpdock --receptor receptor.pdb --sites "A:101 102; B:70" --ligands ./my_ligands --output results
|
|
69
|
-
|
|
70
|
-
Options:
|
|
71
|
-
|
|
72
|
-
-r --receptor Path to receptor PDB file
|
|
73
|
-
-s --sites Active site residues (e.g., 'A:10 11; B:50')
|
|
74
|
-
-l --ligands Folder containing ligand .sdf files |ligands (default)|
|
|
75
|
-
-o --output Output directory name |sharpdock_results (default)|
|
|
76
|
-
-p --padding Grid box padding in Angstroms (Å) |5.0 (default)|
|
|
77
|
-
-e --exhaustiveness Vina search exhaustiveness |32 (default)|
|
|
78
|
-
|
|
79
|
-
---
|
|
80
|
-
## Directory Structure
|
|
81
|
-
|
|
82
|
-
SHARPDOCK organizes your results automatically:
|
|
83
|
-
|
|
84
|
-
- final_results.csv: A ranked list of ligands and their best binding affinities (kcal/mol).
|
|
85
|
-
|
|
86
|
-
- docking_outputs/: Contains the .pdbqt files of the docked poses.
|
|
87
|
-
|
|
88
|
-
- ligands_pdbqt/: The prepared and optimized ligand files.
|
|
89
|
-
|
|
90
|
-
- box_config.txt: The exact grid coordinates used for the Vina run.
|
|
91
|
-
|
|
92
|
-
---
|
|
93
|
-
## Contribution
|
|
94
|
-
|
|
95
|
-
For more tools or to report issues, visit the official GitHub repository:
|
|
96
|
-
|
|
97
|
-
GitHub: https://github.com/alpha-horizon
|
|
98
|
-
|
|
99
|
-
---
|
sharpdock-1.0.0/README.md
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
# SHARPDOCK v1.0.0
|
|
2
|
-
|
|
3
|
-
```text
|
|
4
|
-
====================================================
|
|
5
|
-
An Integrated Pipeline for Focused Molecular Docking
|
|
6
|
-
====================================================
|
|
7
|
-
```
|
|
8
|
-
**SHARPDOCK** is a tool, designed for Automated Focused Molecular Docking. It handles the calculating grid box coordinates based on specific amino acid residues to parallelizing ligand preparation and executing AutoDock Vina.
|
|
9
|
-
|
|
10
|
-
For more tools visit: https://github.com/alpha-horizon
|
|
11
|
-
|
|
12
|
-
---
|
|
13
|
-
## Features
|
|
14
|
-
|
|
15
|
-
- Grid Calculation: Automatically centers and sizes the docking box based on a user-provided list of active site residues.
|
|
16
|
-
|
|
17
|
-
- Parallel Processing: Prepare multiple ligands simultaneously, Can handle ligands in 2D/3D format.
|
|
18
|
-
|
|
19
|
-
- Summary: Outputs a sorted CSV of binding affinities and organized docking poses.
|
|
20
|
-
|
|
21
|
-
---
|
|
22
|
-
## Input Requirements
|
|
23
|
-
1. Receptor (-r)
|
|
24
|
-
|
|
25
|
-
Format: .pdb
|
|
26
|
-
|
|
27
|
-
NOTE: Ensure the protein structure is clean (remove non-essential waters or ions).
|
|
28
|
-
|
|
29
|
-
2. Ligands (-l)
|
|
30
|
-
|
|
31
|
-
Format: .sdf (2D/3D)
|
|
32
|
-
|
|
33
|
-
NOTE: Place all ligand files in a single directory.
|
|
34
|
-
|
|
35
|
-
3. Active Site Specification (-s)
|
|
36
|
-
|
|
37
|
-
Use the following format:
|
|
38
|
-
|
|
39
|
-
"ChainID:ResidueID ResidueID; ChainID:ResidueID"
|
|
40
|
-
|
|
41
|
-
Example: "A:101 102 105; B:45" (This focuses the docking on residues 101, 102, and 105 of Chain A, and residue 45 of Chain B).
|
|
42
|
-
|
|
43
|
-
---
|
|
44
|
-
## pip Installation
|
|
45
|
-
|
|
46
|
-
To install SHARPDOCK, you can use the command mentioned below.
|
|
47
|
-
|
|
48
|
-
pip install sharpdock
|
|
49
|
-
|
|
50
|
-
---
|
|
51
|
-
## Command Line Usage
|
|
52
|
-
|
|
53
|
-
This tool supports full argument-based execution for automation and pipelines:
|
|
54
|
-
|
|
55
|
-
sharpdock --receptor receptor.pdb --sites "A:101 102; B:70" --ligands ./my_ligands --output results
|
|
56
|
-
|
|
57
|
-
Options:
|
|
58
|
-
|
|
59
|
-
-r --receptor Path to receptor PDB file
|
|
60
|
-
-s --sites Active site residues (e.g., 'A:10 11; B:50')
|
|
61
|
-
-l --ligands Folder containing ligand .sdf files |ligands (default)|
|
|
62
|
-
-o --output Output directory name |sharpdock_results (default)|
|
|
63
|
-
-p --padding Grid box padding in Angstroms (Å) |5.0 (default)|
|
|
64
|
-
-e --exhaustiveness Vina search exhaustiveness |32 (default)|
|
|
65
|
-
|
|
66
|
-
---
|
|
67
|
-
## Directory Structure
|
|
68
|
-
|
|
69
|
-
SHARPDOCK organizes your results automatically:
|
|
70
|
-
|
|
71
|
-
- final_results.csv: A ranked list of ligands and their best binding affinities (kcal/mol).
|
|
72
|
-
|
|
73
|
-
- docking_outputs/: Contains the .pdbqt files of the docked poses.
|
|
74
|
-
|
|
75
|
-
- ligands_pdbqt/: The prepared and optimized ligand files.
|
|
76
|
-
|
|
77
|
-
- box_config.txt: The exact grid coordinates used for the Vina run.
|
|
78
|
-
|
|
79
|
-
---
|
|
80
|
-
## Contribution
|
|
81
|
-
|
|
82
|
-
For more tools or to report issues, visit the official GitHub repository:
|
|
83
|
-
|
|
84
|
-
GitHub: https://github.com/alpha-horizon
|
|
85
|
-
|
|
86
|
-
---
|
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
import os
|
|
2
|
-
import subprocess
|
|
3
|
-
import shutil
|
|
4
|
-
import csv
|
|
5
|
-
import argparse
|
|
6
|
-
import numpy as np
|
|
7
|
-
from Bio.PDB import PDBParser
|
|
8
|
-
from multiprocessing import Pool, cpu_count
|
|
9
|
-
from tqdm import tqdm
|
|
10
|
-
import sys
|
|
11
|
-
|
|
12
|
-
# ===============================
|
|
13
|
-
# HEADER
|
|
14
|
-
# ===============================
|
|
15
|
-
|
|
16
|
-
def print_header():
|
|
17
|
-
header = r"""
|
|
18
|
-
===========================================================
|
|
19
|
-
| |
|
|
20
|
-
| _____ _ _ _ |
|
|
21
|
-
| / ____| | | | | | |
|
|
22
|
-
| | (___ | |__ __ _ _ __ _ __ __| | ___ ___| | __ |
|
|
23
|
-
| \___ \| '_ \ / _` | '__| '_ \ / _` |/ _ \ / __| |/ / |
|
|
24
|
-
| ____) | | | | (_| | | | |_) | (_| | (_) | (__| < |
|
|
25
|
-
| |_____/|_| |_|\__,_|_| | .__/ \__,_|\___/ \___|_|\_\ |
|
|
26
|
-
| | | |
|
|
27
|
-
| |_| |
|
|
28
|
-
| [VERSION: 1.0.0] |
|
|
29
|
-
| |
|
|
30
|
-
| - An automated tool for focused molecular docking - |
|
|
31
|
-
| |
|
|
32
|
-
| GitHub: https://github.com/alpha-horizon/ |
|
|
33
|
-
| |
|
|
34
|
-
===========================================================
|
|
35
|
-
"""
|
|
36
|
-
print(header)
|
|
37
|
-
|
|
38
|
-
def compute_box(receptor_pdb, chain_res_map, padding):
|
|
39
|
-
"""Calculates the center and size of the grid box based on active site residues."""
|
|
40
|
-
parser = PDBParser(QUIET=True)
|
|
41
|
-
structure = parser.get_structure("rec", receptor_pdb)
|
|
42
|
-
coords = []
|
|
43
|
-
|
|
44
|
-
for model in structure:
|
|
45
|
-
for chain in model:
|
|
46
|
-
if chain.id not in chain_res_map:
|
|
47
|
-
continue
|
|
48
|
-
for res in chain:
|
|
49
|
-
if res.id[1] not in chain_res_map[chain.id]:
|
|
50
|
-
continue
|
|
51
|
-
for atom in res:
|
|
52
|
-
coords.append(atom.get_coord())
|
|
53
|
-
|
|
54
|
-
if not coords:
|
|
55
|
-
print(f"Error: No residues found for {chain_res_map}. Check your PDB file.")
|
|
56
|
-
sys.exit(1)
|
|
57
|
-
|
|
58
|
-
coords = np.array(coords)
|
|
59
|
-
center = coords.mean(axis=0)
|
|
60
|
-
size = coords.max(axis=0) - coords.min(axis=0) + padding
|
|
61
|
-
return center, size
|
|
62
|
-
|
|
63
|
-
def process_ligand(args_tuple):
|
|
64
|
-
"""Worker function for parallel ligand preparation."""
|
|
65
|
-
f, ligand_dir, pdbqt_dir = args_tuple
|
|
66
|
-
base = os.path.splitext(f)[0]
|
|
67
|
-
sdf_input = os.path.join(ligand_dir, f)
|
|
68
|
-
sdf_h = os.path.join(ligand_dir, f"{base}_H.sdf")
|
|
69
|
-
pdbqt_out = os.path.join(pdbqt_dir, f"{base}.pdbqt")
|
|
70
|
-
|
|
71
|
-
try:
|
|
72
|
-
# Scrub/Optimize Ligand
|
|
73
|
-
subprocess.run(["scrub.py", sdf_input, "-o", sdf_h], capture_output=True, check=True)
|
|
74
|
-
# Convert to PDBQT
|
|
75
|
-
subprocess.run(["mk_prepare_ligand.py", "-i", sdf_h, "-o", pdbqt_out], capture_output=True, check=True)
|
|
76
|
-
|
|
77
|
-
if os.path.exists(sdf_h):
|
|
78
|
-
os.remove(sdf_h)
|
|
79
|
-
return f"{base}: Success"
|
|
80
|
-
except Exception as e:
|
|
81
|
-
return f"{base}: Failed - {str(e)}"
|
|
82
|
-
|
|
83
|
-
def main():
|
|
84
|
-
# 1. Call the header first
|
|
85
|
-
print_header()
|
|
86
|
-
|
|
87
|
-
# Create a formatter that allows more room for long argument names
|
|
88
|
-
formatter = lambda prog: argparse.HelpFormatter(prog, max_help_position=40)
|
|
89
|
-
|
|
90
|
-
parser = argparse.ArgumentParser(
|
|
91
|
-
description="[SharpDock: Automated Focused Molecular Docking]",
|
|
92
|
-
formatter_class=formatter
|
|
93
|
-
)
|
|
94
|
-
|
|
95
|
-
# Add Version Flag
|
|
96
|
-
parser.add_argument("-v", "--version", action="version", version="sharpdock 1.0.0")
|
|
97
|
-
|
|
98
|
-
# Arguments with improved help descriptions for better alignment
|
|
99
|
-
parser.add_argument("-r", "--receptor", required=True, help="Path to receptor PDB file")
|
|
100
|
-
parser.add_argument("-s", "--sites", required=True, help="Active sites (e.g., 'A:101 102; B:70')")
|
|
101
|
-
parser.add_argument("-l", "--ligands", default="ligands", help="Folder containing ligands in .sdf format")
|
|
102
|
-
parser.add_argument("-o", "--output", default="sharpdock_results", help="Directory for output files")
|
|
103
|
-
parser.add_argument("-p", "--padding", type=float, default=5.0, help="Grid box padding in Å")
|
|
104
|
-
parser.add_argument("-e", "--exhaustiveness", type=int, default=32, help="Vina search exhaustiveness")
|
|
105
|
-
|
|
106
|
-
args = parser.parse_args()
|
|
107
|
-
|
|
108
|
-
# Create Directories
|
|
109
|
-
os.makedirs(args.output, exist_ok=True)
|
|
110
|
-
pdbqt_lig_dir = os.path.join(args.output, "ligands_pdbqt")
|
|
111
|
-
raw_out_dir = os.path.join(args.output, "docking_outputs")
|
|
112
|
-
os.makedirs(pdbqt_lig_dir, exist_ok=True)
|
|
113
|
-
os.makedirs(raw_out_dir, exist_ok=True)
|
|
114
|
-
|
|
115
|
-
# Parse Chain/Residue Mapping
|
|
116
|
-
try:
|
|
117
|
-
chain_res_map = {}
|
|
118
|
-
for block in args.sites.split(";"):
|
|
119
|
-
ch, res = block.split(":")
|
|
120
|
-
chain_res_map[ch.strip()] = [int(r) for r in res.split()]
|
|
121
|
-
except Exception:
|
|
122
|
-
print("Error: Sites format invalid. Use 'A:101 102; B:70'")
|
|
123
|
-
sys.exit(1)
|
|
124
|
-
|
|
125
|
-
# 1. Compute Box
|
|
126
|
-
center, size = compute_box(args.receptor, chain_res_map, args.padding)
|
|
127
|
-
config_path = os.path.join(args.output, "box_config.txt")
|
|
128
|
-
with open(config_path, "w") as f:
|
|
129
|
-
f.write(f"center_x = {center[0]:.3f}\ncenter_y = {center[1]:.3f}\ncenter_z = {center[2]:.3f}\n")
|
|
130
|
-
f.write(f"size_x = {size[0]:.3f}\nsize_y = {size[1]:.3f}\nsize_z = {size[2]:.3f}\n")
|
|
131
|
-
|
|
132
|
-
# 2. Prepare Receptor
|
|
133
|
-
rec_pdbqt = os.path.join(args.output, "receptor.pdbqt")
|
|
134
|
-
print(f"[*] Preparing {args.receptor}...")
|
|
135
|
-
subprocess.run([
|
|
136
|
-
"mk_prepare_receptor.py", "-i", args.receptor, "-o", rec_pdbqt,
|
|
137
|
-
"--box_center", f"{center[0]}", f"{center[1]}", f"{center[2]}",
|
|
138
|
-
"--box_size", f"{size[0]}", f"{size[1]}", f"{size[2]}"
|
|
139
|
-
], check=True)
|
|
140
|
-
|
|
141
|
-
# 3. Parallel Ligand Preparation
|
|
142
|
-
lig_files = [f for f in os.listdir(args.ligands) if f.endswith(".sdf")]
|
|
143
|
-
print(f"[*] Preparing {len(lig_files)} ligands...")
|
|
144
|
-
prep_args = [(f, args.ligands, pdbqt_lig_dir) for f in lig_files]
|
|
145
|
-
with Pool(cpu_count()) as pool:
|
|
146
|
-
list(tqdm(pool.imap(process_ligand, prep_args), total=len(lig_files)))
|
|
147
|
-
|
|
148
|
-
# 4. Docking with Vina
|
|
149
|
-
print("[*] Starting Docking...")
|
|
150
|
-
results = []
|
|
151
|
-
pdbqt_ligs = [f for f in os.listdir(pdbqt_lig_dir) if f.endswith(".pdbqt")]
|
|
152
|
-
|
|
153
|
-
for lig_file in tqdm(pdbqt_ligs, desc="Docking progress"):
|
|
154
|
-
base = os.path.splitext(lig_file)[0]
|
|
155
|
-
lig_path = os.path.join(pdbqt_lig_dir, lig_file)
|
|
156
|
-
out_path = os.path.join(raw_out_dir, f"{base}_out.pdbqt")
|
|
157
|
-
|
|
158
|
-
subprocess.run([
|
|
159
|
-
"vina", "--receptor", rec_pdbqt, "--ligand", lig_path,
|
|
160
|
-
"--config", config_path, "--exhaustiveness", str(args.exhaustiveness),
|
|
161
|
-
"--out", out_path
|
|
162
|
-
], capture_output=True)
|
|
163
|
-
|
|
164
|
-
if os.path.exists(out_path):
|
|
165
|
-
with open(out_path) as f:
|
|
166
|
-
for line in f:
|
|
167
|
-
if "REMARK VINA RESULT:" in line:
|
|
168
|
-
affinity = float(line.split()[3])
|
|
169
|
-
results.append([base, affinity])
|
|
170
|
-
break
|
|
171
|
-
|
|
172
|
-
# 5. Export Results
|
|
173
|
-
results.sort(key=lambda x: x[1])
|
|
174
|
-
with open(os.path.join(args.output, "final_results.csv"), "w", newline="") as f:
|
|
175
|
-
writer = csv.writer(f)
|
|
176
|
-
writer.writerow(["Ligand", "Affinity_kcal_mol"])
|
|
177
|
-
writer.writerows(results)
|
|
178
|
-
|
|
179
|
-
print(f"\n[SUCCESS] Workflow completed. Results saved in: {args.output}")
|
|
180
|
-
|
|
181
|
-
if __name__ == "__main__":
|
|
182
|
-
main()
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: sharpdock
|
|
3
|
-
Version: 1.0.0
|
|
4
|
-
Summary: Automated focused molecular docking pipeline for Autodock Vina
|
|
5
|
-
Author: alpha-horizon
|
|
6
|
-
Requires-Python: >=3.7
|
|
7
|
-
Description-Content-Type: text/markdown
|
|
8
|
-
License-File: LICENCE
|
|
9
|
-
Requires-Dist: numpy
|
|
10
|
-
Requires-Dist: biopython
|
|
11
|
-
Requires-Dist: tqdm
|
|
12
|
-
Dynamic: license-file
|
|
13
|
-
|
|
14
|
-
# SHARPDOCK v1.0.0
|
|
15
|
-
|
|
16
|
-
```text
|
|
17
|
-
====================================================
|
|
18
|
-
An Integrated Pipeline for Focused Molecular Docking
|
|
19
|
-
====================================================
|
|
20
|
-
```
|
|
21
|
-
**SHARPDOCK** is a tool, designed for Automated Focused Molecular Docking. It handles the calculating grid box coordinates based on specific amino acid residues to parallelizing ligand preparation and executing AutoDock Vina.
|
|
22
|
-
|
|
23
|
-
For more tools visit: https://github.com/alpha-horizon
|
|
24
|
-
|
|
25
|
-
---
|
|
26
|
-
## Features
|
|
27
|
-
|
|
28
|
-
- Grid Calculation: Automatically centers and sizes the docking box based on a user-provided list of active site residues.
|
|
29
|
-
|
|
30
|
-
- Parallel Processing: Prepare multiple ligands simultaneously, Can handle ligands in 2D/3D format.
|
|
31
|
-
|
|
32
|
-
- Summary: Outputs a sorted CSV of binding affinities and organized docking poses.
|
|
33
|
-
|
|
34
|
-
---
|
|
35
|
-
## Input Requirements
|
|
36
|
-
1. Receptor (-r)
|
|
37
|
-
|
|
38
|
-
Format: .pdb
|
|
39
|
-
|
|
40
|
-
NOTE: Ensure the protein structure is clean (remove non-essential waters or ions).
|
|
41
|
-
|
|
42
|
-
2. Ligands (-l)
|
|
43
|
-
|
|
44
|
-
Format: .sdf (2D/3D)
|
|
45
|
-
|
|
46
|
-
NOTE: Place all ligand files in a single directory.
|
|
47
|
-
|
|
48
|
-
3. Active Site Specification (-s)
|
|
49
|
-
|
|
50
|
-
Use the following format:
|
|
51
|
-
|
|
52
|
-
"ChainID:ResidueID ResidueID; ChainID:ResidueID"
|
|
53
|
-
|
|
54
|
-
Example: "A:101 102 105; B:45" (This focuses the docking on residues 101, 102, and 105 of Chain A, and residue 45 of Chain B).
|
|
55
|
-
|
|
56
|
-
---
|
|
57
|
-
## pip Installation
|
|
58
|
-
|
|
59
|
-
To install SHARPDOCK, you can use the command mentioned below.
|
|
60
|
-
|
|
61
|
-
pip install sharpdock
|
|
62
|
-
|
|
63
|
-
---
|
|
64
|
-
## Command Line Usage
|
|
65
|
-
|
|
66
|
-
This tool supports full argument-based execution for automation and pipelines:
|
|
67
|
-
|
|
68
|
-
sharpdock --receptor receptor.pdb --sites "A:101 102; B:70" --ligands ./my_ligands --output results
|
|
69
|
-
|
|
70
|
-
Options:
|
|
71
|
-
|
|
72
|
-
-r --receptor Path to receptor PDB file
|
|
73
|
-
-s --sites Active site residues (e.g., 'A:10 11; B:50')
|
|
74
|
-
-l --ligands Folder containing ligand .sdf files |ligands (default)|
|
|
75
|
-
-o --output Output directory name |sharpdock_results (default)|
|
|
76
|
-
-p --padding Grid box padding in Angstroms (Å) |5.0 (default)|
|
|
77
|
-
-e --exhaustiveness Vina search exhaustiveness |32 (default)|
|
|
78
|
-
|
|
79
|
-
---
|
|
80
|
-
## Directory Structure
|
|
81
|
-
|
|
82
|
-
SHARPDOCK organizes your results automatically:
|
|
83
|
-
|
|
84
|
-
- final_results.csv: A ranked list of ligands and their best binding affinities (kcal/mol).
|
|
85
|
-
|
|
86
|
-
- docking_outputs/: Contains the .pdbqt files of the docked poses.
|
|
87
|
-
|
|
88
|
-
- ligands_pdbqt/: The prepared and optimized ligand files.
|
|
89
|
-
|
|
90
|
-
- box_config.txt: The exact grid coordinates used for the Vina run.
|
|
91
|
-
|
|
92
|
-
---
|
|
93
|
-
## Contribution
|
|
94
|
-
|
|
95
|
-
For more tools or to report issues, visit the official GitHub repository:
|
|
96
|
-
|
|
97
|
-
GitHub: https://github.com/alpha-horizon
|
|
98
|
-
|
|
99
|
-
---
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|