> ## Documentation Index
> Fetch the complete documentation index at: https://proto.evodesign.org/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# pDockQ2

> [pDockQ2](https://gitlab.com/ElofssonLab/afm-benchmark) is an interface-quality score for cofolded protein complexes developed by the [Elofsson Lab](https://www.bioinfo.se/) at SciLifeLab and Stockholm University. It combines per-residue pLDDT and the Predicted Aligned Error (PAE) matrix into a single estimate of the per-interface DockQ score in the range 0 to 1, with higher values indicating more reliably predicted interfaces. This toolkit re-implements the published scoring formula in pure Python and exposes it through a single registered tool that returns the overall pDockQ2 score together with a per-interface breakdown.

<div class="page-hero">
  <img class="page-hero-banner" src="https://proto-bio.github.io/proto-assets/images/tool/pdockq2/hero.png" alt="pDockQ2" />
</div>

<Note>
  **License:** pDockQ2 has an AGPL-3.0 license and may require explicit attribution when utilized. Please refer to [the license](https://gitlab.com/ElofssonLab/afm-benchmark/-/blob/main/LICENSE) for full terms.
</Note>

<p class="entity-disclaimer">This toolkit is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them.</p>

<hr class="entity-rule" />

<input type="radio" name="tab-pdockq2" id="none-pdockq2" class="tab-radio-input" />

<input type="radio" name="tab-pdockq2" id="paper-pdockq2" class="tab-radio-input" defaultChecked />

<input type="radio" name="tab-pdockq2" id="cite-pdockq2" class="tab-radio-input" />

<input type="radio" name="tab-pdockq2" id="source-pdockq2" class="tab-radio-input" />

<input type="radio" name="tab-pdockq2" id="notebook-pdockq2" class="tab-radio-input" />

<input type="radio" name="tab-pdockq2" id="proto-pdockq2" class="tab-radio-input" />

<div class="tool-tab-bar">
  <span class="tool-tab-wrap"><label for="paper-pdockq2" class="tool-tab tab-open badge-paper"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" /><polyline points="14 2 14 8 20 8" /><line x1="16" y1="13" x2="8" y2="13" /><line x1="16" y1="17" x2="8" y2="17" /><polyline points="10 9 9 9 8 9" /></svg> Publication</label><label for="none-pdockq2" class="tool-tab tab-close badge-paper"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" /><polyline points="14 2 14 8 20 8" /><line x1="16" y1="13" x2="8" y2="13" /><line x1="16" y1="17" x2="8" y2="17" /><polyline points="10 9 9 9 8 9" /></svg> Publication</label></span> <span class="tool-tab-wrap"><label for="cite-pdockq2" class="tool-tab tab-open badge-cite"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 21c3 0 7-1 7-8V5c0-1.25-.756-2.017-2-2H4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2 1 0 1 0 1 1v1c0 1-1 2-2 2s-1 .008-1 1.031V20c0 1 0 1 1 1z" /><path d="M15 21c3 0 7-1 7-8V5c0-1.25-.757-2.017-2-2h-4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2h.75c0 2.25.25 4-2.75 4v3c0 1 0 1 1 1z" /></svg> Cite</label><label for="none-pdockq2" class="tool-tab tab-close badge-cite"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 21c3 0 7-1 7-8V5c0-1.25-.756-2.017-2-2H4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2 1 0 1 0 1 1v1c0 1-1 2-2 2s-1 .008-1 1.031V20c0 1 0 1 1 1z" /><path d="M15 21c3 0 7-1 7-8V5c0-1.25-.757-2.017-2-2h-4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2h.75c0 2.25.25 4-2.75 4v3c0 1 0 1 1 1z" /></svg> Cite</label></span> <span class="tool-tab-wrap"><label for="source-pdockq2" class="tool-tab tab-open badge-source"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="16 18 22 12 16 6" /><polyline points="8 6 2 12 8 18" /></svg> Tool Source</label><label for="none-pdockq2" class="tool-tab tab-close badge-source"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="16 18 22 12 16 6" /><polyline points="8 6 2 12 8 18" /></svg> Tool Source</label></span> <span class="tool-tab-wrap"><label for="notebook-pdockq2" class="tool-tab tab-open badge-notebook"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z" /><path d="M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z" /></svg> Open as Notebook</label><label for="none-pdockq2" class="tool-tab tab-close badge-notebook"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z" /><path d="M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z" /></svg> Open as Notebook</label></span> <span class="tool-tab-wrap"><label for="proto-pdockq2" class="tool-tab tab-open badge-local"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="4 17 10 11 4 5" /><line x1="12" y1="19" x2="20" y2="19" /></svg> Run Locally</label><label for="none-pdockq2" class="tool-tab tab-close badge-local"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="4 17 10 11 4 5" /><line x1="12" y1="19" x2="20" y2="19" /></svg> Run Locally</label></span>
</div>

<a href="https://doi.org/10.1093/bioinformatics/btad424" target="_blank" class="tab-panel paper-panel" data-tab="paper-pdockq2">
  <div class="paper-info">
    <div class="paper-title">Evaluation of AlphaFold-Multimer prediction on multi-chain protein complexes</div>
    <div class="paper-meta">Wensi Zhu, Aditi Shenoy, ... Arne Elofsson</div>
    <div class="paper-meta paper-venue">Bioinformatics (2023)</div>
  </div>

  <span class="panel-goto-btn pub-goto-btn"><span><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" /><polyline points="14 2 14 8 20 8" /><line x1="16" y1="13" x2="8" y2="13" /><line x1="16" y1="17" x2="8" y2="17" /><polyline points="10 9 9 9 8 9" /></svg> Read paper</span></span>
</a>

<div class="tab-panel cite-panel" data-tab="cite-pdockq2">
  <div class="cite-code-wrap">
    ```bibtex theme={null}
    @article{zhu_2023_pdockq2,
      title={Evaluation of AlphaFold-Multimer prediction on multi-chain protein complexes},
      author={Zhu, Wensi and Shenoy, Aditi and Kundrotas, Petras and Elofsson, Arne},
      journal={Bioinformatics},
      volume={39},
      number={7},
      pages={btad424},
      year={2023},
      doi={10.1093/bioinformatics/btad424},
    }

    @article{bryant_2022_pdockq,
      title={Improved prediction of protein-protein interactions using AlphaFold2},
      author={Bryant, Patrick and Pozzati, Gabriele and Elofsson, Arne},
      journal={Nature Communications},
      volume={13},
      number={1},
      pages={1265},
      year={2022},
      doi={10.1038/s41467-022-28865-w},
    }
    ```
  </div>

  <span class="panel-goto-btn cite-copy-btn"><span><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 21c3 0 7-1 7-8V5c0-1.25-.756-2.017-2-2H4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2 1 0 1 0 1 1v1c0 1-1 2-2 2s-1 .008-1 1.031V20c0 1 0 1 1 1z" /><path d="M15 21c3 0 7-1 7-8V5c0-1.25-.757-2.017-2-2h-4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2h.75c0 2.25.25 4-2.75 4v3c0 1 0 1 1 1z" /></svg> Copy citation</span></span>
</div>

<a href="https://github.com/evo-design/proto-tools/tree/47e34afa5ea240a3b406e323dc38aa5dc85f223e/proto_tools/tools/structure_scoring/pdockq2" target="_blank" class="tab-panel source-panel" data-tab="source-pdockq2">
  <div class="source-info">
    <img src="https://github.com/evo-design.png?size=40" class="source-avatar" width="36" height="36" />

    <span class="source-path">evo-design/proto-tools<span class="source-subpath">/proto\_tools/tools/structure\_scoring/pdockq2</span></span>
  </div>

  <span class="panel-goto-btn source-goto-btn"><span><svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor"><path d="M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0024 12c0-6.63-5.37-12-12-12z" /></svg> View source</span></span>
</a>

<a href="https://github.com/evo-design/proto-tools/blob/47e34afa5ea240a3b406e323dc38aa5dc85f223e/proto_tools/tools/structure_scoring/pdockq2/examples/example.ipynb" target="_blank" class="tab-panel notebook-panel" data-tab="notebook-pdockq2">
  <div class="notebook-info">
    <span class="notebook-icon">
      <svg width="40" height="40" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
        <path d="M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z" />

        <path d="M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z" />
      </svg>
    </span>

    <span class="notebook-label">Open Notebook</span>
  </div>

  <span class="panel-goto-btn notebook-goto-btn"><span><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z" /><path d="M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z" /></svg> Open notebook</span></span>
</a>

<div class="tab-panel proto-panel run-local-panel" data-tab="proto-pdockq2">
  <a href="https://github.com/evo-design/proto-tools" target="_blank" class="run-local-preview">
    <img noZoom src="https://opengraph.githubassets.com/1/evo-design/proto-tools" alt="proto-tools on GitHub" />
  </a>

  <div class="run-local-install">
    <span class="run-local-label">Run locally with proto-tools</span>

    <div class="run-local-code">
      ```bash theme={null}
      pip install git+https://github.com/evo-design/proto-tools.git
      ```
    </div>
  </div>
</div>

<div class="entity-contributors"><span class="entity-contributors-label">Toolkit contributors</span><span class="entity-contributors-people"><a class="entity-contributor" href="https://github.com/bviggiano" target="_blank" rel="noopener" title="bviggiano: 12 commits"><img noZoom class="entity-contributor-avatar" src="https://avatars.githubusercontent.com/u/21143637?v=4&s=64" alt="" loading="lazy" /><span class="entity-contributor-login">bviggiano</span></a><a class="entity-contributor" href="https://github.com/dguo8412" target="_blank" rel="noopener" title="dguo8412: 6 commits"><img noZoom class="entity-contributor-avatar" src="https://avatars.githubusercontent.com/u/46211285?v=4&s=64" alt="" loading="lazy" /><span class="entity-contributor-login">dguo8412</span></a><a class="entity-contributor" href="https://github.com/leba01" target="_blank" rel="noopener" title="leba01: 1 commit"><img noZoom class="entity-contributor-avatar" src="https://avatars.githubusercontent.com/u/124846286?v=4&s=64" alt="" loading="lazy" /><span class="entity-contributor-login">leba01</span></a></span></div>

| Function        | Description                                                                                          |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| --------------- | ---------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `run_pdockq2()` | Score a cofolded protein complex with pDockQ2 (Zhu 2023), using pLDDT + PAE to summarize interfac... | <a href="#api-run-pdockq2" class="func-table-btn func-api-btn"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20" /></svg> Docs</a> <a href="https://github.com/evo-design/proto-tools/blob/47e34afa5ea240a3b406e323dc38aa5dc85f223e/proto_tools/tools/structure_scoring/pdockq2/pdockq2.py#L262" target="_blank" class="func-table-btn func-source-btn"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="16 18 22 12 16 6" /><polyline points="8 6 2 12 8 18" /></svg> Source</a> |

## Background

DockQ ([Basu and Wallner, 2016](https://doi.org/10.1371/journal.pone.0161879)) is a continuous interface-quality measure for protein-protein docking models that combines the CAPRI quality indicators (fraction of native contacts, interface RMSD, and ligand RMSD) into a single score in the range 0 to 1. The published thresholds approximate the CAPRI quality classes of Acceptable (DockQ ≥ 0.23), Medium (DockQ ≥ 0.49), and High (DockQ ≥ 0.80). DockQ requires a known reference complex and cannot be computed when only the predicted structure is available.

pDockQ ([Bryant, Pozzati, and Elofsson, 2022](https://doi.org/10.1038/s41467-022-28865-w)) was introduced as a predicted version of DockQ that uses only AlphaFold2 outputs, with no reference complex required. It estimates DockQ for a dimer from the mean pLDDT of interface residues together with the logarithm of the number of interface contacts, calibrated against ground-truth DockQ values on a benchmark of heterodimers.

pDockQ2 ([Zhu, Shenoy, Kundrotas, and Elofsson, 2023](https://doi.org/10.1093/bioinformatics/btad424)) generalises pDockQ to larger multi-chain complexes and replaces the contact-count term with the Predicted Aligned Error (PAE) matrix, which captures pairwise residue-position uncertainty across chains. For each interface, the score combines the contact-weighted mean interface pLDDT with the mean of `1 / (1 + (PAE / 10)²)` over interface residue pairs, then passes the product through a logistic sigmoid whose parameters were fit against ground-truth DockQ values on the AlphaFold-Multimer benchmark. The published analysis demonstrates that pDockQ2 estimates DockQ for each interface in a multimer rather than only for a single dimer.

### Learning Resources

* [ElofssonLab/afm-benchmark](https://gitlab.com/ElofssonLab/afm-benchmark) (Elofsson Lab, Stockholm University). Reference implementation of pDockQ2 and the benchmark data from the original publication.
* [bjornwallner/DockQ](https://github.com/bjornwallner/DockQ) (Wallner Lab, Linköping University). Reference implementation of the underlying DockQ measure that pDockQ2 estimates.

## Tools

<a name="api-run-pdockq2" />

<div class="tool-section-card">
  ### pDockQ2 Interface Quality (`pdockq2`)

  Scores the per-interface quality of a cofolded protein complex by computing pDockQ2 for each chain pair and aggregating the per-chain scores into a single overall score. The tool takes a `Structure` with per-residue pLDDT in the B-factor column and the PAE matrix attached at `structure.metrics["pae"]`, identifies CA-CA contacts between every pair of chains within a configurable distance cutoff, applies the published sigmoid, and returns the overall score together with a per-chain interface breakdown.

  #### API Reference

  <div class="api-model-section api-input-section">
    <a href="https://github.com/evo-design/proto-tools/blob/47e34afa5ea240a3b406e323dc38aa5dc85f223e/proto_tools/tools/structure_scoring/pdockq2/pdockq2.py#L129" target="_blank" class="func-table-btn func-source-btn api-model-source"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="16 18 22 12 16 6" /><polyline points="8 6 2 12 8 18" /></svg> Source</a>

    <Accordion title="Input: PDockQ2Input">
      <ParamField path="structure" type="Structure" required>
        Cofolded complex with per-residue pLDDT in the B-factor column (`b_factor_type` must be `PLDDT` or `NORMALIZED_PLDDT`) and the PAE matrix attached at `structure.metrics['pae']` as a square `list[list[float]]` whose dimension matches the structure's total residue count.

        <Expandable title="Structure">
          <ParamField path="structure" type="string" required>
            Raw structure content in PDB or CIF format.
          </ParamField>

          <ParamField path="structure_format" type="string">
            Format of the content string (auto-detected if omitted).
          </ParamField>

          <ParamField path="b_factor_type" type="BFactorType" default="unspecified">
            What the B-factor column represents.
          </ParamField>

          <ParamField path="source" type="string">
            Optional source identifier (filepath or tool name).
          </ParamField>

          <ParamField path="metrics" type="Metrics">
            Associated metrics (e.g., pLDDT, pTM scores, per-chain lists, pairwise matrices). None values are stripped at construction.
          </ParamField>
        </Expandable>
      </ParamField>

      <ParamField path="binder_chain" type="SingleChainSelection" required>
        Single-character chain ID of the binder (e.g. VHH).

        <Expandable title="SingleChainSelection">
          <ParamField path="chain" type="string" required>
            The selected chain ID.
          </ParamField>
        </Expandable>
      </ParamField>

      <ParamField path="target_chains" type="ChainSelection" required>
        Target chain IDs (single character each).

        <Expandable title="ChainSelection">
          <ParamField path="chains" type="List[string]" required>
            Chain IDs in the selection.
          </ParamField>
        </Expandable>
      </ParamField>
    </Accordion>
  </div>

  <div class="api-model-section api-config-section">
    <a href="https://github.com/evo-design/proto-tools/blob/47e34afa5ea240a3b406e323dc38aa5dc85f223e/proto_tools/tools/structure_scoring/pdockq2/pdockq2.py#L187" target="_blank" class="func-table-btn func-source-btn api-model-source"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="16 18 22 12 16 6" /><polyline points="8 6 2 12 8 18" /></svg> Source</a>

    <Accordion title="Config: PDockQ2Config">
      <ParamField path="distance_cutoff" type="number" default="10.0">
        CA-CA distance cutoff in Å for interface residue detection. Defaults to 10.0, matching germinal's `pDockQ.pDockQ2` wrapper default.
      </ParamField>

      <ParamField path="verbose" type="integer" default="0">
        Verbosity level (0=quiet, 1=info, 2=debug, 3=raw subprocess stderr). `True` is coerced to `1` and `False` to `0`.
      </ParamField>

      <ParamField path="device" type="string" default="cpu">
        Device to run the tool on.
      </ParamField>

      <ParamField path="timeout" type="integer" default="3600">
        Maximum execution time in seconds. `None` waits indefinitely.
      </ParamField>

      <ParamField path="seed" type="integer">
        Random seed. When set, tools run reproducibly up to small GPU float noise (see `BaseToolOutput.approx_equal`), and the seed participates in cache keys. When None, cacheable seed-sensitive tools skip cache until seeded.
      </ParamField>
    </Accordion>
  </div>

  <div class="api-model-section api-output-section">
    <a href="https://github.com/evo-design/proto-tools/blob/47e34afa5ea240a3b406e323dc38aa5dc85f223e/proto_tools/tools/structure_scoring/pdockq2/pdockq2.py#L204" target="_blank" class="func-table-btn func-source-btn api-model-source"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="16 18 22 12 16 6" /><polyline points="8 6 2 12 8 18" /></svg> Source</a>

    <Accordion title="Output: PDockQ2Output">
      <ResponseField name="metrics" type="PDockQ2Metrics" required>
        Scalar pDockQ2 metrics plus per-chain interface breakdown.

        <Expandable title="PDockQ2Metrics">
          <ResponseField name="interfaces" type="List[InterfacePDockQ2]">
            Per-target-chain breakdown kept as a Pydantic field so it stays out of metric iteration.
          </ResponseField>

          <ResponseField name="primary_metric" type="string">
            Name of the metric that best summarizes the result overall (e.g. `"avg_plddt"` for AlphaFold2). Used by downstream UI and reporting to pick a headline value.
          </ResponseField>

          <ResponseField name="metric_type" type="string">
            Concrete Metrics subclass tag; enables typed reconstruction after a serialization round-trip.
          </ResponseField>
        </Expandable>
      </ResponseField>

      **Metrics**

      | Metric                   | Type  | Range        | Availability |
      | ------------------------ | ----- | ------------ | ------------ |
      | `pdockq2`                | float | 0.0 to 1.0   | always       |
      | `avg_interface_plddt`    | float | 0.0 to 100.0 | always       |
      | `avg_interface_pae`      | float | 0.0 to 1.0   | always       |
      | `num_interface_contacts` | int   | ≥ 0.0        | always       |
    </Accordion>
  </div>

  #### Applications

  This tool is appropriate for filtering and ranking cofolded complexes from structure-prediction tools such as AlphaFold-Multimer, AlphaFold 3, Chai-1, Boltz-2, and Protenix. Representative applications include gating candidate protein binders from a design pipeline by predicted interface quality, ranking the most promising poses in a multi-chain prediction ensemble, and screening large sets of predicted complexes before committing to more expensive downstream analyses.

  #### Usage Tips

  * **The PAE matrix is required and must be attached at `structure.metrics["pae"]` as a square `list[list[float]]` whose dimension matches the total residue count of the structure.** The input is rejected when the matrix is missing, not square, or of the wrong dimension.
  * **Per-residue pLDDT must be supplied via the B-factor column.** Structure predictors in proto-tools return the correct `b_factor_type` automatically, and `Structure.from_file()` auto-detects it for AlphaFold DB and ModelArchive files. For manually provided structures from other sources, pass `b_factor_type=BFactorType.PLDDT` (raw 0 to 100) or `BFactorType.NORMALIZED_PLDDT` (0 to 1) explicitly. The input is rejected when `b_factor_type` is any other value, since the published sigmoid was fit on a 0 to 100 pLDDT scale.
  * **A pDockQ2 score above 0.23 corresponds to the "Acceptable" DockQ quality class.** The thresholds derive from the underlying DockQ measure ([Basu and Wallner, 2016](https://doi.org/10.1371/journal.pone.0161879)): scores above 0.49 correspond to "Medium" quality and scores above 0.80 to "High" quality. Scores below 0.23 typically reflect either low interface pLDDT or high cross-chain PAE.
  * **The overall score is the mean of `pmidockq` over target chains that contact the binder chain.** When no target chain in `target_chains` is within the distance cutoff of `binder_chain`, the overall score is set to `0.0`, `num_interface_contacts` is reported as `0`, and a warning is logged. Verify the chain identifiers and the cutoff before interpreting an all-zero result as a poor interface.
  * **`distance_cutoff` controls the CA-CA contact distance used to define interface residues.** The wrapper default of `10.0` Å is more permissive than the `8.0` Å default used by the Elofsson Lab reference implementation against which the published sigmoid was calibrated. The qualitative DockQ-quality interpretation still applies at `10.0` Å, but quantitative scores will not exactly match the published values. Set `distance_cutoff=8.0` for scores that match the original pDockQ2 calibration. The PAE normalisation distance inside the sigmoid is independently fixed at 10 Å per the published formula and is not affected by this setting.
  * **The interface pLDDT is contact-pair weighted, not residue-deduplicated.** A residue that contacts `k` cross-chain partners contributes its pLDDT `k` times to the interface mean. This matches the published pDockQ2 definition and is preserved by the wrapper.
  * **The per-chain breakdown is available on `result.metrics.interfaces`.** Each `InterfacePDockQ2` entry exposes `chain_id`, `neighbor_chains`, `if_plddt` (0 to 100 pLDDT scale), `norm_pae` (0 to 1 normalised confidence, higher is more confident), and `pmidockq` (0 to 1 DockQ-scale prediction) for one chain. Inspect this list when debugging multi-chain targets or when the overall mean masks variation across interfaces.
</div>

## Toolkit Notes

These apply to every pDockQ2 tool in this toolkit (`pdockq2`).

* **Outputs are returned as typed metric objects.** Each `PDockQ2Metrics` result carries the overall `pdockq2` score (0 to 1), `avg_interface_plddt` (0 to 100 pLDDT scale), `avg_interface_pae` (0 to 1 normalised confidence), and `num_interface_contacts` (integer count) together with a per-chain `interfaces` breakdown. The headline `primary_metric` is `pdockq2`, and results can be exported to JSON through the standard export method.
* **The tool implementation runs entirely in-process and uses CPU only.** The scoring formula is re-implemented in pure Python with numpy, and no standalone environment or separate program is invoked. Per-call runtime is sub-second for typical complex sizes and scales quadratically with the total residue count because of the all-against-all CA-CA distance computation.

<Tip>
  **Example notebook:** See the [full working example](https://github.com/evo-design/proto-tools/blob/47e34afa5ea240a3b406e323dc38aa5dc85f223e/proto_tools/tools/structure_scoring/pdockq2/examples/example.ipynb) for a copy-paste-ready walkthrough.
</Tip>

## Infrastructure Guides

The following guides cover how to run tools efficiently and at scale.

<CardGroup cols={2}>
  <Card title="Tool Persistence" icon="repeat" href="/docs/tools/guides/tool-persistence">Keep a tool's model warm across calls instead of reloading it every invocation.</Card>
  <Card title="Device Management" icon="cpu" href="/docs/tools/guides/device-management">How GPUs are allocated to tools and how to target specific devices.</Card>
  <Card title="Parallel Execution" icon="layers" href="/docs/tools/guides/parallel-execution">Fan a batch of inputs out across multiple GPUs.</Card>
</CardGroup>
