Skip to content

Commit

Permalink
ignore new headers in test
Browse files Browse the repository at this point in the history
  • Loading branch information
clami66 committed May 16, 2024
1 parent ac37693 commit 5d09aac
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 41 deletions.
18 changes: 9 additions & 9 deletions run_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ else
fi

$binary examples/1A2K_r_l_b.model.pdb examples/1A2K_r_l_b.pdb > test
diff test testdata/1A2K.dockq
diff <(grep -v "*" test) <(grep -v "*" testdata/1A2K.dockq)

$binary examples/1A2K_r_l_b.model.pdb examples/1A2K_r_l_b.pdb --no_align > test
diff test testdata/1A2K.dockq
diff <(grep -v "*" test) <(grep -v "*" testdata/1A2K.dockq)

# Multiple interfaces
$binary examples/dimer_dimer.model.pdb examples/dimer_dimer.pdb --short > test
diff test testdata/dimer_dimer.dockq

# Test on structures with slightly different sequences
$binary examples/model.pdb examples/native.pdb --allowed_mismatches 1 > test
diff test testdata/model.dockq
diff <(grep -v "*" test) <(grep -v "*" testdata/model.dockq)

# lowmem test
$binary examples/1EXB_r_l_b.model.pdb examples/1EXB_r_l_b.pdb --short > test
Expand All @@ -37,21 +37,21 @@ diff test testdata/1EXB_ABCDEFGH.BADCFEHG.dockq

# Test that cif parsing behaves same as pdb parsing
$binary examples/1EXB_r_l_b.model.pdb examples/1EXB_r_l_b.pdb --mapping DH:AE > test
diff test testdata/1EXB_DH.AE.dockq
diff <(grep -v "*" test) <(grep -v "*" testdata/1EXB_DH.AE.dockq)
$binary examples/1EXB_r_l_b.model.pdb examples/1EXB.cif.gz --mapping DH:AE > test
diff test testdata/1EXB_DH.AE_cif.dockq
diff <(grep -v "*" test) <(grep -v "*" testdata/1EXB_DH.AE_cif.dockq)

# Peptide measures
$binary examples/6qwn-assembly1.cif.gz examples/6qwn-assembly2.cif.gz --capri_peptide > test
diff test testdata/6q2n_peptide.dockq
diff <(grep -v "*" test) <(grep -v "*" testdata/6q2n_peptide.dockq)

# Small molecule test
$binary examples/1HHO_hem.cif examples/2HHB_hem.cif --small_molecule --mapping :ABEFG
$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
diff test testdata/1A2K.dockq
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
diff test testdata/1A2K.dockq
diff <(grep -v "*" test) <(grep -v "*" testdata/1A2K.dockq)

coverage combine
47 changes: 15 additions & 32 deletions src/DockQ/DockQ.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ def calc_sym_corrected_lrmsd(
sample_chains,
ref_chains,
alignments,
low_memory=False,
):
import networkx as nx
is_het_sample_0 = bool(sample_chains[0].is_het)
Expand Down Expand Up @@ -592,7 +591,6 @@ def run_on_chains(
model_chains,
native_chains,
alignments=tuple(alignments),
low_memory=low_memory,
)
return info

Expand Down Expand Up @@ -981,38 +979,23 @@ def print_results(info, short=False, verbose=False, capri_peptide=False, small_m

def print_header(verbose=False, capri_peptide=False, small_molecule=False):
reference = (
"* Ref: S. Basu and B. Wallner, DockQ: A quality measure for *\n"
"* protein-protein docking models *\n"
"* doi:10.1371/journal.pone.0161879 *\n"
"* Ref: Mirabello and Wallner, 'DockQ v2: Improved automatic *\n"
"* quality measure for protein multimers, nucleic acids *\n"
"* and small molecules' *\n"
"* *\n"
"* For comments, please email: [email protected] *"
)
if not capri_peptide:
header = (
"****************************************************************\n"
"* DockQ *\n"
"* Scoring function for protein-protein docking models *\n"
"* Statistics on CAPRI data: *\n"
"* 0.00 <= DockQ < 0.23 - Incorrect *\n"
"* 0.23 <= DockQ < 0.49 - Acceptable quality *\n"
"* 0.49 <= DockQ < 0.80 - Medium quality *\n"
"* DockQ >= 0.80 - High quality *"
)
elif not small_molecule:
header = (
"****************************************************************\n"
"* DockQ-CAPRI peptide *\n"
"* Do not trust any thing you read.... *\n"
"* OBS THE DEFINITION OF Fnat and iRMS are different for *\n"
"* peptides in CAPRI *\n"
"* *"
)
else:
header = (
"****************************************************************\n"
"* DockQ-small molecules *\n"
"* LRMSD is reported for small molecule ligands *\n"
"* DockQ is reported for macromolecules *"
)

header = (
"****************************************************************\n"
"* DockQ *\n"
"* Scoring function for biomolecular models *\n"
"* DockQ score legend (proteins and nucleic acids only): *\n"
"* 0.00 <= DockQ < 0.23 - Incorrect *\n"
"* 0.23 <= DockQ < 0.49 - Acceptable quality *\n"
"* 0.49 <= DockQ < 0.80 - Medium quality *\n"
"* DockQ >= 0.80 - High quality *"
)

if verbose:
notice = (
Expand Down

0 comments on commit 5d09aac

Please sign in to comment.