> ## 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.

# DeepPBS Specificity

> DeepPBS (Deep Predictor of Binding Specificity) predicts the DNA base preferences of a protein directly from a protein-DNA complex structure. Given one or more PDB files, the `deeppbs-specificity` tool runs DeepPBS over each structure and returns a canonical DNA-only position probability matrix (PPM) in `A,C,G,T` order, alongside the true DNA sequence, residue masks, and per-base chain labels.

<div class="page-hero"><img class="page-hero-banner" src="https://proto-bio.github.io/proto-assets/images/tool/deeppbs_specificity/hero.png" alt="DeepPBS Specificity" /><div class="tool-org-badges page-hero-badges"><a href="/docs/tools/organizations/university-of-southern-california" class="tool-org-badge" style={{background: "#990000"}} title="University of Southern California"><img src="https://mintcdn.com/bio-pro/rW-ZVHoYhZw2v7T_/assets/images/cached/fe8211725e60.png?fit=max&auto=format&n=rW-ZVHoYhZw2v7T_&q=85&s=c66930648135f54afdf5912b79afb512" alt="" class="tool-org-badge-logo" width="330" height="339" data-path="assets/images/cached/fe8211725e60.png" /> USC</a></div></div>

<Note>
  **License:** DeepPBS Specificity is open source and free for academic and commercial use under a BSD-3-Clause license and may require explicit attribution when utilized. Please refer to [the license](https://github.com/timkartar/DeepPBS/blob/main/LICENSE.txt) for full terms.
</Note>

<p class="entity-disclaimer">Proto is not affiliated with University of Southern California. This toolkit is open source and builds on the implementation produced by this organization. Product names, logos, and trademarks are the property of their respective owners.</p>

<hr class="entity-rule" />

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

<input type="radio" name="tab-deeppbs-specificity" id="github-deeppbs-specificity" class="tab-radio-input" defaultChecked />

<input type="radio" name="tab-deeppbs-specificity" id="paper-deeppbs-specificity" class="tab-radio-input" />

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

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

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

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

<div class="tool-tab-bar">
  <span class="tool-tab-wrap"><label for="github-deeppbs-specificity" class="tool-tab tab-open badge-github"><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> GitHub</label><label for="none-deeppbs-specificity" class="tool-tab tab-close badge-github"><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> GitHub</label></span> <span class="tool-tab-wrap"><label for="paper-deeppbs-specificity" 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-deeppbs-specificity" 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-deeppbs-specificity" 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-deeppbs-specificity" 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-deeppbs-specificity" 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-deeppbs-specificity" 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-deeppbs-specificity" 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-deeppbs-specificity" 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-deeppbs-specificity" 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-deeppbs-specificity" 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://github.com/timkartar/DeepPBS" target="_blank" class="tab-panel github-panel" data-tab="github-deeppbs-specificity">
  <div class="gh-card-wrap">
    <img src="https://opengraph.githubassets.com/1/timkartar/DeepPBS" class="gh-card-img img-fallback" alt="timkartar/DeepPBS" />

    <div class="gh-card-fallback">
      <div class="gh-fallback-org"><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> timkartar/DeepPBS</div>
    </div>
  </div>

  <span class="panel-goto-btn gh-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 repo</span></span>
</a>

<a href="https://doi.org/10.1038/s41592-024-02372-w" target="_blank" class="tab-panel paper-panel" data-tab="paper-deeppbs-specificity">
  <div class="paper-info">
    <div class="paper-title">Geometric deep learning of protein--DNA binding specificity</div>
    <div class="paper-meta">Raktim Mitra, Jinsen Li, ... Remo Rohs</div>
    <div class="paper-meta paper-venue">Nature Methods (2024)</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-deeppbs-specificity">
  <div class="cite-code-wrap">
    ```bibtex theme={null}
    @article{mitra2024deeppbs,
      title={Geometric deep learning of protein--DNA binding specificity},
      author={Mitra, Raktim and Li, Jinsen and Sagendorf, Jared M and Jiang, Yibei and Cohen, Ari S and Chiu, Tsu-Pei and Glasscock, Cameron J and Rohs, Remo},
      journal={Nature Methods},
      volume={21},
      number={9},
      pages={1674--1683},
      year={2024},
      publisher={Nature Publishing Group},
      doi={10.1038/s41592-024-02372-w}
    }

    @article{lu20033dna,
      title={3DNA: a software package for the analysis, rebuilding and visualization of three-dimensional nucleic acid structures},
      author={Lu, Xiang-Jun and Olson, Wilma K},
      journal={Nucleic Acids Research},
      volume={31},
      number={17},
      pages={5108--5121},
      year={2003},
      publisher={Oxford University Press},
      doi={10.1093/nar/gkg680}
    }

    @article{lu20083dna,
      title={3DNA: a versatile, integrated software system for the analysis, rebuilding and visualization of three-dimensional nucleic-acid structures},
      author={Lu, Xiang-Jun and Olson, Wilma K},
      journal={Nature Protocols},
      volume={3},
      number={7},
      pages={1213--1227},
      year={2008},
      publisher={Nature Publishing Group},
      doi={10.1038/nprot.2008.104}
    }
    ```
  </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/sequence_scoring/deeppbs_specificity" target="_blank" class="tab-panel source-panel" data-tab="source-deeppbs-specificity">
  <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/sequence\_scoring/deeppbs\_specificity</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/sequence_scoring/deeppbs_specificity/examples/example.ipynb" target="_blank" class="tab-panel notebook-panel" data-tab="notebook-deeppbs-specificity">
  <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-deeppbs-specificity">
  <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: 7 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/adititm" target="_blank" rel="noopener" title="adititm: 3 commits"><img noZoom class="entity-contributor-avatar" src="https://avatars.githubusercontent.com/u/61667248?v=4&s=64" alt="" loading="lazy" /><span class="entity-contributor-login">adititm</span></a><a class="entity-contributor" href="https://github.com/dguo8412" target="_blank" rel="noopener" title="dguo8412: 2 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></span></div>

| Function                    | Description                                                                   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| --------------------------- | ----------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `run_deeppbs_specificity()` | Predict DNA specificity (PPM) from protein-DNA structures using DeepPBS (GPU) | <a href="#api-run-deeppbs-specificity" 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/sequence_scoring/deeppbs_specificity/deeppbs_specificity.py#L250" 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

Sequence-specific recognition of [DNA](https://en.wikipedia.org/wiki/DNA) by proteins underlies transcriptional regulation, and predicting a [protein](https://en.wikipedia.org/wiki/Protein)'s binding preference directly from a co-crystal structure is a long-standing goal. DeepPBS ([Mitra et al., 2024](https://doi.org/10.1038/s41592-024-02372-w)) applies [geometric deep learning](https://en.wikipedia.org/wiki/Graph_neural_network) over a graph representation of the protein-DNA interface to predict per-position base preferences that generalize across protein families, on experimental or predicted complex structures. The model consumes a processed representation of the complex built from [DSSR/X3DNA](https://en.wikipedia.org/wiki/Nucleic_acid_structure_determination) geometry, so the wrapper depends on a local DeepPBS repository and a local X3DNA install.

### Learning Resources

* [DeepPBS GitHub repository](https://github.com/timkartar/DeepPBS) - source code, processing scripts, and pretrained weights.
* [DeepPBS paper (Nature Methods, 2024)](https://doi.org/10.1038/s41592-024-02372-w) - the method, benchmarks, and applications.

## Tools

<a name="api-run-deeppbs-specificity" />

<div class="tool-section-card">
  ### DeepPBS Specificity (`deeppbs-specificity`)

  Runs DeepPBS preprocessing and prediction on each input protein-DNA structure and returns, per structure, a canonical DNA PPM (`L x 4`, `A,C,G,T` order), the true DNA sequence indices, residue and DNA masks, per-base chain labels, and the path to a canonical `.npz` artifact. When a required DeepPBS dependency (the X3DNA `x3dna-dssr`/`analyze` binaries) is missing, or preprocessing or prediction fails to produce output, the tool raises by default. Set `allow_fallback=True` to instead emit a conservative fallback result: a uniform PPM (`0.25` per base) derived from the DNA residues in the input PDB, flagged with `used_fallback=True` and a human-readable `fallback_reason`.

  #### API Reference

  <div class="api-model-section api-input-section">
    <a href="https://github.com/evo-design/proto-tools/blob/47e34afa5ea240a3b406e323dc38aa5dc85f223e/proto_tools/tools/sequence_scoring/deeppbs_specificity/deeppbs_specificity.py#L25" 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: DeepPBSSpecificityInput">
      <ParamField path="pdb_paths" type="List[string]" required>
        PDB paths for protein-DNA structures to score. A single path string is normalized to a one-element list. At least one path is required.
      </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/sequence_scoring/deeppbs_specificity/deeppbs_specificity.py#L56" 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: DeepPBSSpecificityConfig">
      <ParamField path="output_directory" type="string">
        Optional directory for canonical NPZ artifacts. A temporary directory is used when unset.
      </ParamField>

      <ParamField path="keep_intermediate" type="boolean" default="False">
        Keep intermediate process and predict files.
      </ParamField>

      <ParamField path="no_clean_protein" type="boolean" default="False">
        Pass --no\_cleanp to DeepPBS preprocessing to skip pdb2pqr-dependent protein cleaning.
      </ParamField>

      <ParamField path="allow_fallback" type="boolean" default="False">
        On missing DeepPBS deps/outputs, return a uniform fallback PPM instead of raising.
      </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="cuda">
        Device to run DeepPBS inference on (inherited).
      </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/sequence_scoring/deeppbs_specificity/deeppbs_specificity.py#L173" 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: DeepPBSSpecificityOutput">
      <ResponseField name="results" type="List[DeepPBSSpecificityResult]">
        Canonicalized results per input, index-aligned with `inputs.pdb_paths`.

        <Expandable title="DeepPBSSpecificityResult">
          <ResponseField name="input_name" type="string" required>
            Basename of the scored input structure.
          </ResponseField>

          <ResponseField name="source_method" type="string" required>
            Source method tag, always "deeppbs".
          </ResponseField>

          <ResponseField name="output_npz_path" type="string" required>
            Path to canonical NPZ output.
          </ResponseField>

          <ResponseField name="predicted_ppm" type="List[array]" required>
            Canonical DNA PPM in A,C,G,T order.
          </ResponseField>

          <ResponseField name="true_sequence" type="List[integer]" required>
            Canonical DNA truth indices in 0..3.
          </ResponseField>

          <ResponseField name="mask" type="List[integer]" required>
            Valid residue mask for canonical rows.
          </ResponseField>

          <ResponseField name="dna_mask" type="List[integer]" required>
            DNA residue mask for canonical rows.
          </ResponseField>

          <ResponseField name="chain_labels" type="List[integer]" required>
            Canonical chain IDs for canonical rows.
          </ResponseField>

          <ResponseField name="used_fallback" type="boolean">
            Whether canonical output came from fallback logic.
          </ResponseField>

          <ResponseField name="fallback_reason" type="string">
            Reason for fallback when used\_fallback is true.
          </ResponseField>
        </Expandable>
      </ResponseField>
    </Accordion>
  </div>

  #### Applications

  * Estimating the DNA base preference of a designed or natural protein-DNA complex.
  * Scoring protein-DNA designs for specificity against a target motif.
  * Generating canonical PPMs for downstream motif comparison.

  #### Usage Tips

  * **Inputs are full protein-DNA PDB structures.** Provide a clean co-crystal containing both DNA strands; missing strands or non-standard residues can trigger the fallback path.
  * **DeepPBS, X3DNA, and the weights are provisioned for you.** The standalone setup clones a pinned revision of the DeepPBS repository (which bundles the X3DNA/DSSR binaries, the process/predict configs, and the trained inference weights) into the managed weights cache and installs it, so no repository or X3DNA path is configured. Point `PROTO_DEEPPBS_SPECIFICITY_WEIGHTS_DIR` at an existing checkout to reuse it.
  * **Fallback is opt-in.** By default a missing dependency or failed run raises; pass `allow_fallback=True` to get a uniform fallback PPM instead. A `used_fallback=True` result carries a uniform PPM, not a real prediction.
</div>

## Toolkit Notes

* **The DeepPBS checkout is self-contained and auto-provisioned.** The standalone setup clones a pinned DeepPBS revision (bundling the X3DNA/DSSR binaries, configs, and inference weights) into the managed weights cache and installs it editable. The tool shells out to those local scripts and binaries, so it cannot run on `device='proto'`. If the clone cannot reach GitHub, the environment setup signals a clean test skip rather than a hard failure.
* **Failures raise by default.** When a dependency is missing or processing fails, the tool raises; set `allow_fallback=True` to instead return a uniform fallback PPM flagged with `used_fallback` so downstream code can filter or re-run.
* **Results are index-aligned with the input.** Each result corresponds to the input structure at the same position.

<Tip>
  **Example notebook:** See the [full working example](https://github.com/evo-design/proto-tools/blob/47e34afa5ea240a3b406e323dc38aa5dc85f223e/proto_tools/tools/sequence_scoring/deeppbs_specificity/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>
