Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfixes, a few extra features #46

Merged
merged 15 commits into from
Aug 12, 2024
67 changes: 43 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@

## Installation

Clone the repository, then install the necessary libraries with `pip`:
With `pip`:

```
pip install DockQ
```

Or, if you want the latest commit: clone the repository and run `pip` within the repo directory:

```
git clone https://github.com/bjornwallner/DockQ/
Expand Down Expand Up @@ -47,44 +53,47 @@ Total DockQ over 3 native interfaces: 0.653 with BAC:ABC model:native mapping
Native chains: A, B
Model chains: B, A
DockQ: 0.994
irms: 0.000
Lrms: 0.000
iRMSD: 0.000
LRMSD: 0.000
fnat: 0.983
fnonnat: 0.008
clashes: 0.000
F1: 0.987
DockQ_F1: 0.996
clashes: 0
Native chains: A, C
Model chains: B, C
DockQ: 0.511
irms: 1.237
Lrms: 6.864
iRMSD: 1.237
LRMSD: 6.864
fnat: 0.333
fnonnat: 0.000
clashes: 0.000
F1: 0.500
DockQ_F1: 0.567
clashes: 0
Native chains: B, C
Model chains: A, C
DockQ: 0.453
irms: 2.104
Lrms: 8.131
iRMSD: 2.104
LRMSD: 8.131
fnat: 0.500
fnonnat: 0.107
clashes: 0.000
F1: 0.641
DockQ_F1: 0.500
F1: 0.641
clashes: 0
```

A more compact output option is available with the flag `--short`:

```
$ DockQ examples/1A2K_r_l_b.model.pdb examples/1A2K_r_l_b.pdb --short

DockQ 0.994 DockQ_F1 0.996 Fnat 0.983 iRMS 0.000 LRMS 0.000 Fnonnat 0.008 clashes 0 mapping BA:AB examples/1A2K_r_l_b.model.pdb B A -> examples/1A2K_r_l_b.pdb A B
DockQ 0.511 DockQ_F1 0.567 Fnat 0.333 iRMS 1.237 LRMS 6.864 Fnonnat 0.000 clashes 0 mapping BC:AC examples/1A2K_r_l_b.model.pdb B C -> examples/1A2K_r_l_b.pdb A C
DockQ 0.453 DockQ_F1 0.500 Fnat 0.500 iRMS 2.104 LRMS 8.131 Fnonnat 0.107 clashes 0 mapping AC:BC examples/1A2K_r_l_b.model.pdb A C -> examples/1A2K_r_l_b.pdb B C
Total DockQ over 3 native interfaces: 0.653 with BAC:ABC model:native mapping
DockQ 0.994 iRMSD 0.000 LRMSD 0.000 fnat 0.983 fnonnat 0.008 F1 0.987 clashes 0 mapping BA:AB examples/1A2K_r_l_b.model.pdb B A -> examples/1A2K_r_l_b.pdb A B
DockQ 0.511 iRMSD 1.237 LRMSD 6.864 fnat 0.333 fnonnat 0.000 F1 0.500 clashes 0 mapping BC:AC examples/1A2K_r_l_b.model.pdb B C -> examples/1A2K_r_l_b.pdb A C
DockQ 0.453 iRMSD 2.104 LRMSD 8.131 fnat 0.500 fnonnat 0.107 F1 0.641 clashes 0 mapping AC:BC examples/1A2K_r_l_b.model.pdb A C -> examples/1A2K_r_l_b.pdb B C
```

A dictionary containing the complete results data can be dumped in JSON format with the `--json filename.json` flag:

```
$ DockQ examples/1A2K_r_l_b.model.pdb examples/1A2K_r_l_b.pdb --json filename.json
```

## Model/Native chain mapping
Expand Down Expand Up @@ -156,10 +165,10 @@ Small molecules in PDB or mmCIF files can be scored and the mapping optimized in
$ DockQ examples/1HHO_hem.cif examples/2HHB_hem.cif --small_molecule --mapping :ABEFG --short

Total DockQ-small_molecules over 4 native interfaces: 0.659 with ABDCF:ABEFG model:native mapping
DockQ 0.950 irms 0.455 Lrms 1.451 fnat 0.964 fnonnat 0.070 clashes 0.000 F1 0.946 DockQ_F1 0.945 mapping AB:AB examples/1HHO_hem.cif A B -> examples/2HHB_hem.cif A B
Lrms 0.585 mapping AD:AE (HEM) examples/1HHO_hem.cif A D -> examples/2HHB_hem.cif A E
Lrms 28.096 mapping BC:BF (PO4) examples/1HHO_hem.cif B C -> examples/2HHB_hem.cif B F
Lrms 1.311 mapping BF:BG (HEM) examples/1HHO_hem.cif B F -> examples/2HHB_hem.cif B G
DockQ 0.950 iRMSD 0.455 LRMSD 1.451 fnat 0.964 fnonnat 0.070 clashes 0.000 F1 0.946 DockQ_F1 0.945 mapping AB:AB examples/1HHO_hem.cif A B -> examples/2HHB_hem.cif A B
LRMSD 0.585 mapping AD:AE (HEM) examples/1HHO_hem.cif A D -> examples/2HHB_hem.cif A E
LRMSD 28.096 mapping BC:BF (PO4) examples/1HHO_hem.cif B C -> examples/2HHB_hem.cif B F
LRMSD 1.311 mapping BF:BG (HEM) examples/1HHO_hem.cif B F -> examples/2HHB_hem.cif B G
```

Only LRMSD is reported for small molecules.
Expand All @@ -170,7 +179,7 @@ Only LRMSD is reported for small molecules.

Interfaces involving nucleic acids are seamlessly scored along with protein interfaces. The DockQ score is calculated for protein-NA or NA-NA interfaces in the same way as for protein-protein interfaces (two DockQ scores are reported for double helix chains).

**Other uses**
## Other uses

Run DockQ with `-h/--help` to see a list of the available flags:

Expand Down Expand Up @@ -218,8 +227,8 @@ run_on_all_native_interfaces(model, native, chain_map=chain_map)

({('A', 'B'): {'DockQ_F1': 0.9437927182141027,
'DockQ': 0.9425398964102757,
'irms': 0.3753064373774967,
'Lrms': 0.5535111803522507,
'iRMSD': 0.3753064373774967,
'LRMSD': 0.5535111803522507,
'fnat': 0.8907563025210085,
'nat_correct': 106,
'nat_total': 119,
Expand All @@ -241,6 +250,16 @@ run_on_all_native_interfaces(model, native, chain_map=chain_map)

See issue [#33](https://github.com/bjornwallner/DockQ/issues/33) if you want to merge multiple chains (e.g. heavy and light antibody chains) into a single receptor or ligand

## Legend of outputs

* `DockQ`: DockQ score as defined in the [original DockQ paper](https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0161879)
* `iRMSD`: RMSD of interfacial residues
* `LRMSD`: Ligand RMSD
* `fnat`: Fraction of retrieved native contacts (same as Recall or TPR)
* `fnonnat`: Fraction of predicted contacts that are not native (same as FPR)
* `F1`: Harmonic mean of the precision and recall in predicted interfacial contacts
* `clashes`: number of clashing interfacial residues in model (distance between residues below 2Å)

## Citing DockQ v2

If you use DockQ v2, please cite the preprint: https://doi.org/10.1101/2024.05.28.596225
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
[build-system]
requires = ["setuptools>=68", "cython", "numpy ~= 1.21",]
requires = ["setuptools>=68", "cython", "numpy < 2.0"]
build-backend = "setuptools.build_meta"

[project]
name = "dockq"
version = "2.1"
version = "2.1.2"
authors = [
{ name="Claudio Mirabello", email="[email protected]" },
{ name="Bjorn Wallner", email="[email protected]" },
]
description = "A Quality Measure for Protein, Nucleic Acids and Small Ligand Docking Models"
readme = "README.md"
requires-python = ">=3.9"
requires-python = ">=3.8"
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
]
dependencies = ["biopython >= 1.79", "networkx", "parallelbar"]
dependencies = ["numpy < 2.0", "biopython >= 1.79", "networkx", "parallelbar"]

[project.urls]
Homepage = "https://github.com/bjornwallner/DockQ"
Expand Down
12 changes: 8 additions & 4 deletions run_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ set -euo pipefail

rm -f test .coverage

PYTHON=${1:-"python"}

if command -v coverage &> /dev/null; then
binary="coverage run --parallel-mode -m DockQ.DockQ "
else
binary="DockQ"
binary="$PYTHON -m DockQ.DockQ"
fi

$binary examples/1A2K_r_l_b.model.pdb examples/1A2K_r_l_b.pdb > test
Expand Down Expand Up @@ -49,9 +51,11 @@ diff <(grep -v "*" test) <(grep -v "*" testdata/6q2n_peptide.dockq)
$binary examples/1HHO_hem.cif examples/2HHB_hem.cif --small_molecule --mapping :ABEFG > test

# Test that cython version behaves the same as nocython
python src/DockQ/DockQ.py examples/1A2K_r_l_b.model.pdb examples/1A2K_r_l_b.pdb > test
$PYTHON src/DockQ/DockQ.py examples/1A2K_r_l_b.model.pdb examples/1A2K_r_l_b.pdb > test
diff <(grep -v "*" test) <(grep -v "*" testdata/1A2K.dockq)
python src/DockQ/DockQ.py examples/1A2K_r_l_b.model.pdb examples/1A2K_r_l_b.pdb --no_align > test
$PYTHON src/DockQ/DockQ.py examples/1A2K_r_l_b.model.pdb examples/1A2K_r_l_b.pdb --no_align > test
diff <(grep -v "*" test) <(grep -v "*" testdata/1A2K.dockq)

coverage combine
if command -v coverage &> /dev/null; then
coverage combine
fi
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = DockQ
version = 2.1
version = 2.1.2

[options]
package_dir =
Expand All @@ -10,7 +10,7 @@ install_requires =
setuptools
cython
parallelbar
numpy~=1.21
numpy<2.0
biopython>=1.79
networkx

Expand Down
Loading
Loading