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

# PyRosetta

> [PyRosetta](https://www.pyrosetta.org/) is the Python interface to the [Rosetta](https://github.com/RosettaCommons/rosetta) molecular modelling suite from the [RosettaCommons](https://rosettacommons.org/) consortium. This toolkit exposes five physics-based operations: Spatial Aggregation Propensity (SAP) scoring, Solvent Accessible Surface Area (SASA) computation, full Rosetta energy scoring, FastRelax structural minimisation, and interface analysis of two-chain complexes through `InterfaceAnalyzerMover`. The scoring tools and the interface analyzer can run FastRelax first via an opt-in `pre_relax_structures` preprocess.

<div class="page-hero"><img class="page-hero-banner" src="https://proto-bio.github.io/proto-assets/images/tool/pyrosetta/hero.png" alt="PyRosetta" /><div class="tool-org-badges page-hero-badges"><a href="/docs/tools/organizations/rosettacommons" class="tool-org-badge tool-org-badge-light" style={{background: "#F58A34"}} title="RosettaCommons"><img src="https://mintcdn.com/bio-pro/_UGa2jUMKeVPCbLk/assets/images/cached/58cbc725561f.png?fit=max&auto=format&n=_UGa2jUMKeVPCbLk&q=85&s=c676498b6a5bb2b3f1c8767ff838d898" alt="" class="tool-org-badge-logo" width="200" height="200" data-path="assets/images/cached/58cbc725561f.png" /> RosettaCommons</a></div></div>

<Note>
  **License:** PyRosetta is licensed under Custom (PyRosetta Software License) and has restrictions around commercial use and may require explicit attribution when utilized. Please refer to [the license](https://www.pyrosetta.org/home/licensing-pyrosetta) for full terms.
</Note>

<p class="entity-disclaimer">Proto is not affiliated with RosettaCommons. 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-pyrosetta" id="none-pyrosetta" class="tab-radio-input" />

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

<input type="radio" name="tab-pyrosetta" id="website-pyrosetta" class="tab-radio-input" />

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

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

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

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

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

<div class="tool-tab-bar">
  <span class="tool-tab-wrap"><label for="github-pyrosetta" 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-pyrosetta" 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="website-pyrosetta" class="tool-tab tab-open badge-website"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10" /><path d="M2 12h20M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z" /></svg> Website</label><label for="none-pyrosetta" class="tool-tab tab-close badge-website"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10" /><path d="M2 12h20M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z" /></svg> Website</label></span> <span class="tool-tab-wrap"><label for="paper-pyrosetta" 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-pyrosetta" 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-pyrosetta" 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-pyrosetta" 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-pyrosetta" 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-pyrosetta" 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-pyrosetta" 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-pyrosetta" 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-pyrosetta" 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-pyrosetta" 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/RosettaCommons/rosetta" target="_blank" class="tab-panel github-panel" data-tab="github-pyrosetta">
  <div class="gh-card-wrap">
    <img src="https://opengraph.githubassets.com/1/RosettaCommons/rosetta" class="gh-card-img img-fallback" alt="RosettaCommons/rosetta" />

    <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> RosettaCommons/rosetta</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://www.pyrosetta.org/" target="_blank" class="tab-panel website-panel" data-tab="website-pyrosetta">
  <div class="website-info">
    <img src="https://www.google.com/s2/favicons?domain=pyrosetta.org&sz=32" class="website-favicon" width="24" height="24" />

    <span class="website-url">pyrosetta.org</span>
  </div>

  <span class="panel-goto-btn website-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"><circle cx="12" cy="12" r="10" /><path d="M2 12h20M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z" /></svg> Visit website</span></span>
</a>

<a href="https://doi.org/10.1093/bioinformatics/btq007" target="_blank" class="tab-panel paper-panel" data-tab="paper-pyrosetta">
  <div class="paper-info">
    <div class="paper-title">PyRosetta: a script-based interface for implementing molecular modeling algorithms using Rosetta</div>
    <div class="paper-meta">Sidhartha Chaudhury, Sergey Lyskov and Jeffrey J Gray</div>
    <div class="paper-meta paper-venue">Bioinformatics (2010)</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-pyrosetta">
  <div class="cite-code-wrap">
    ```bibtex theme={null}
    @article{chaudhury2010pyrosetta,
      title={PyRosetta: a script-based interface for implementing molecular modeling algorithms using Rosetta},
      author={Chaudhury, Sidhartha and Lyskov, Sergey and Gray, Jeffrey J},
      journal={Bioinformatics},
      volume={26},
      number={5},
      pages={689--691},
      year={2010},
      publisher={Oxford University Press},
      doi={10.1093/bioinformatics/btq007}
    }
    ```
  </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/pyrosetta" target="_blank" class="tab-panel source-panel" data-tab="source-pyrosetta">
  <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/pyrosetta</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/pyrosetta/examples/example.ipynb" target="_blank" class="tab-panel notebook-panel" data-tab="notebook-pyrosetta">
  <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-pyrosetta">
  <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: 27 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: 14 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/brianhie" target="_blank" rel="noopener" title="brianhie: 1 commit"><img noZoom class="entity-contributor-avatar" src="https://avatars.githubusercontent.com/u/6365340?v=4&s=64" alt="" loading="lazy" /><span class="entity-contributor-login">brianhie</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_pyrosetta_energy()`             | Compute Rosetta energy scores for protein structures (with optional FastRelax preprocess via conf... | <a href="#api-run-pyrosetta-energy" 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/pyrosetta/pyrosetta_energy.py#L263" 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>                         |
| `run_pyrosetta_interface_analyzer()` | Compute interface-quality metrics for a two-chain complex via Rosetta's InterfaceAnalyzerMover + ... | <a href="#api-run-pyrosetta-interface-analyzer" 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/pyrosetta/pyrosetta_interface_analyzer.py#L378" 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> |
| `run_pyrosetta_relax()`              | Run PyRosetta FastRelax on a structure and return the relaxed Structure plus its total score         | <a href="#api-run-pyrosetta-relax" 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/pyrosetta/pyrosetta_relax.py#L274" 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>                           |
| `run_pyrosetta_sap()`                | Compute Spatial Aggregation Propensity (SAP) scores for protein structures using PyRosetta           | <a href="#api-run-pyrosetta-sap" 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/pyrosetta/pyrosetta_sap.py#L230" 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>                               |
| `run_pyrosetta_sasa()`               | Compute Solvent Accessible Surface Area (SASA) for protein structures using PyRosetta                | <a href="#api-run-pyrosetta-sasa" 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/pyrosetta/pyrosetta_sasa.py#L238" 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

The Rosetta molecular modelling suite ([Alford et al., 2017](https://doi.org/10.1021/acs.jctc.7b00125)) provides an all-atom energy function that combines van der Waals interactions, hydrogen bonding, electrostatics, and an implicit solvation model into a single score reported in Rosetta Energy Units (REU). The current community-standard energy function, REF2015, is parametrised against small-molecule and X-ray crystal structure data and is the default score function used by every tool in this toolkit. PyRosetta ([Chaudhury, Lyskov, and Gray, 2010](https://doi.org/10.1093/bioinformatics/btq007)) exposes the Rosetta sampling and scoring functions through a Python interface, which this toolkit invokes to compute per-residue and overall energies together with a breakdown by score term.

Spatial Aggregation Propensity (SAP) ([Chennamsetty, Voynov, Kayser, Helk, and Trout, 2009](https://doi.org/10.1073/pnas.0904191106)) quantifies how much hydrophobic surface area is exposed on a protein. SAP combines per-residue hydrophobicity with local solvent exposure within a sphere around each surface atom and aggregates the contributions across the protein, with higher values corresponding to greater aggregation risk. The published method was originally developed for therapeutic antibody engineering and has become a standard developability filter in protein design.

Solvent Accessible Surface Area (SASA) measures the surface area of a protein that is accessible to a spherical solvent probe (1.4 Å for water by default). Per-residue SASA values distinguish buried residues that contribute to the hydrophobic core from solvent-exposed residues that interact with the surroundings. Rosetta's FastRelax protocol performs many rounds of side-chain repacking and energy minimisation while gradually ramping the repulsive weight in the score function, which finds a low-energy conformation near the input structure and resolves the steric clashes that would otherwise dominate the energy. The `InterfaceAnalyzerMover` extracts a set of structural descriptors that characterise the binding interface of a two-chain complex, including binding-energy difference (`dG_separated`), interface buried SASA (`dSASA_int`), hydrogen bond count (`hbonds_int`), packing statistic (`packstat`), and shape complementarity (`sc_value`), and is widely used as the basis for filter cascades in binder-design pipelines.

### Learning Resources

* [PyRosetta documentation](https://www.pyrosetta.org/) (Gray Lab, Johns Hopkins University). Tutorials, API reference, and installation guidance for the underlying Python interface.
* [RosettaCommons documentation](https://www.rosettacommons.org/docs/latest/Home) (RosettaCommons). Reference manual for the Rosetta scoring functions, movers, and protocols invoked by this toolkit.
* [FastRelax mover reference](https://www.rosettacommons.org/docs/latest/scripting_documentation/RosettaScripts/Movers/movers_pages/FastRelaxMover) (RosettaCommons). Documentation of the FastRelax protocol exposed as `pyrosetta-relax`.

## Tools

<a name="api-run-pyrosetta-energy" />

<div class="tool-section-card tool-section-card--energy">
  ### PyRosetta Energy Score (`pyrosetta-energy`)

  Scores one or more protein structures with a Rosetta score function and returns the total energy, a per-term breakdown (fa\_atr, fa\_rep, fa\_sol, hbond\_\*, etc.), and a per-residue energy contribution. The full pose is always scored regardless of any chain selection. By default the input structure is scored as given. Set `pre_relax_structures=True` to run FastRelax first.

  #### 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/pyrosetta/pyrosetta_energy.py#L112" 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: PyRosettaEnergyInput">
      <ParamField path="inputs" type="List[ScoringStructureInput]" required>
        Protein structures to score, each with optional chain selection. Accepts bare Structure objects, PDB file paths, or PDB content strings for convenience.

        <Expandable title="ScoringStructureInput">
          <ParamField path="chains_to_score" type="ChainSelection">
            Chains to include in scoring. `None` means include every chain. Accepts shorthand `"A"` or `["A", "B"]` at construction.
          </ParamField>

          <ParamField path="structure" type="Structure" required>
            Protein structure (file path, PDB string, `Structure`, or `Structure.model_dump` dict).
          </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/pyrosetta/pyrosetta_energy.py#L137" 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: PyRosettaEnergyConfig">
      <ParamField path="scorefxn" type="string" default="ref2015">
        Rosetta score function name. `ref2015` is the current community standard.
      </ParamField>

      <ParamField path="pre_relax_structures" type="boolean" default="False">
        If `True`, run `pyrosetta-relax` on each input structure before scoring (the actual settings come from :attr:`relax_config`). Default `False` — energy is reported on the input structure as-given. Set to `True` for raw predicted structures with steric clashes that would otherwise inflate `fa_rep`.
      </ParamField>

      <ParamField path="relax_config" type="PyRosettaRelaxConfig">
        Settings used when `pre_relax_structures=True`. Ignored otherwise.

        <Expandable title="PyRosettaRelaxConfig">
          <ParamField path="scorefxn" type="string" default="ref2015">
            Rosetta score function name. `ref2015` is the current community standard.
          </ParamField>

          <ParamField path="relax_cycles" type="integer" default="1">
            Number of FastRelax repeats. Germinal uses `1` for speed in cofolding filter pipelines; raise for better convergence at the cost of runtime.
          </ParamField>

          <ParamField path="constrain_to_start" type="boolean" default="True">
            When `True`, add a coordinate-constraint term to the relax score function and call `constrain_relax_to_start_coords(True)` on the FastRelax mover so atoms stay near their input positions. Recommended for filter use cases where large geometric deviations would defeat the purpose.
          </ParamField>

          <ParamField path="max_iter" type="integer">
            Maximum minimizer iterations per relax cycle. `None` uses PyRosetta's default (2500). Upstream BindCraft uses 200 for faster turnaround in binder-design pipelines.
          </ParamField>

          <ParamField path="disable_jumps" type="boolean" default="False">
            Lock inter-chain rigid-body DOFs so chains cannot translate or rotate relative to each other during relax.
          </ParamField>

          <ParamField path="min_type" type="string">
            Optional minimizer type forwarded to `FastRelax.min_type`. BindCraft uses `"lbfgs_armijo_nonmonotone"`.
          </ParamField>

          <ParamField path="align_to_start" type="boolean" default="False">
            If `True`, align the relaxed pose back to the input pose after FastRelax. BindCraft does this before saving its relaxed PDBs so coordinates remain in the original frame.
          </ParamField>

          <ParamField path="copy_b_factors_from_start" type="boolean" default="False">
            If `True`, copy the input pose's per-residue B-factors onto the relaxed pose. BindCraft uses this to preserve AF2 pLDDT values after relaxation.
          </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>
        </Expandable>
      </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/pyrosetta/pyrosetta_energy.py#L182" 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: PyRosettaEnergyOutput">
      <ResponseField name="results" type="List[PyRosettaEnergyMetrics]">
        Energy scores, one per input structure. Each entry carries `total_energy` as a specced metric plus `energy_terms` and `per_residue` as declared non-metric fields.

        <Expandable title="PyRosettaEnergyMetrics">
          <ResponseField name="energy_terms" type="Dict[string, number]" required>
            Breakdown by score term (fa\_atr, fa\_rep, etc.). Always the whole-pose terms. Declared as a real field (not a metric) because it's a named-term breakdown, not a scalar quantity.
          </ResponseField>

          <ResponseField name="per_residue" type="List[ResidueEnergy]" required>
            Per-residue energy breakdown, filtered to the selected chains when `chains_to_score` is set. Declared as a real field because each entry carries chain/residue identifiers alongside the energy value.
          </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** (one set per `results` item)

      | Metric         | Type  | Range     | Availability |
      | -------------- | ----- | --------- | ------------ |
      | `total_energy` | float | unbounded | always       |
    </Accordion>
  </div>

  #### Applications

  This tool is appropriate for relative energy comparison across variants of the same protein. Representative applications include ranking sequence designs by predicted stability after a relax pass, identifying problematic residues through their per-residue energy contributions, and quantifying the energy cost of mutations or conformational changes.

  #### Usage Tips

  * **Compare REU values only across variants of the same protein with the same score function.** Rosetta energies are not absolute thermodynamic quantities and do not transfer across proteins of different sizes or across different score function settings. Switching `scorefxn` from `ref2015` to `beta_nov16` produces a different scale and the values are not comparable.
  * **Run with `pre_relax_structures=True` when scoring raw predicted complexes.** Predicted structures from AlphaFold, Chai, Boltz, and similar tools commonly carry steric clashes that produce extremely high `fa_rep` values and dominate the total energy. Relaxing first resolves these clashes so the other energy terms become interpretable.
  * **Chain selection filters the per-residue breakdown only.** When `chains_to_score` is set on a `ScoringStructureInput`, `total_energy` and `energy_terms` are still computed on the full pose. Each per-residue energy reflects that residue's contribution within the full complex, including pair interactions with the unselected chains. Score a chain in isolation by extracting it into its own `Structure` first.

  <a name="api-run-pyrosetta-interface-analyzer" />
</div>

<div class="tool-section-card">
  ### PyRosetta Interface Analyzer (`pyrosetta-interface-analyzer`)

  Runs Rosetta's `InterfaceAnalyzerMover` on a complex and returns seven always-on interface descriptors together with an optional eighth (`delta_unsat_hbonds`, available when DAlphaBall is installed). The interface is defined by the `target_chains` and `binder_chain` fields on each `InterfaceStructureInput` (multiple target chains score the binder against all of them, binder-vs-rest) and is validated at input construction.

  #### 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/pyrosetta/pyrosetta_interface_analyzer.py#L207" 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: PyRosettaInterfaceAnalyzerInput">
      <ParamField path="inputs" type="List[InterfaceStructureInput]" required>
        Complexes to analyze, each paired with the `target_chains` and `binder_chain` labels that define its interface. A bare `Structure` / path / content string / dict is wrapped into a single-element list with default chains `["A"]` / `"B"`.

        <Expandable title="InterfaceStructureInput">
          <ParamField path="structure" type="Structure" required>
            The complex to analyze. Accepts a `Structure` object, a file path, or a PDB/CIF content string.
          </ParamField>

          <ParamField path="target_chains" type="List[string]">
            Target-side chain label(s); multiple chains score the binder against all of them (binder-vs-rest). Default `["A"]`.
          </ParamField>

          <ParamField path="binder_chain" type="string" default="B">
            Binder-side chain label. Default `"B"`.
          </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/pyrosetta/pyrosetta_interface_analyzer.py#L233" 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: PyRosettaInterfaceAnalyzerConfig">
      <ParamField path="scorefxn" type="string" default="ref2015">
        Rosetta score function name. `ref2015` is the current community standard.
      </ParamField>

      <ParamField path="pre_relax_structures" type="boolean" default="False">
        If `True`, run `pyrosetta-relax` on each input structure before analyzing (settings come from :attr:`relax_config`). Default `False` — the interface is analyzed on the input structure as-given. Set to `True` for raw predicted complexes with steric clashes that would otherwise distort `interface_dG` and related energy-based metrics.
      </ParamField>

      <ParamField path="relax_config" type="PyRosettaRelaxConfig">
        Settings used when `pre_relax_structures=True`. Ignored otherwise.

        <Expandable title="PyRosettaRelaxConfig">
          <ParamField path="scorefxn" type="string" default="ref2015">
            Rosetta score function name. `ref2015` is the current community standard.
          </ParamField>

          <ParamField path="relax_cycles" type="integer" default="1">
            Number of FastRelax repeats. Germinal uses `1` for speed in cofolding filter pipelines; raise for better convergence at the cost of runtime.
          </ParamField>

          <ParamField path="constrain_to_start" type="boolean" default="True">
            When `True`, add a coordinate-constraint term to the relax score function and call `constrain_relax_to_start_coords(True)` on the FastRelax mover so atoms stay near their input positions. Recommended for filter use cases where large geometric deviations would defeat the purpose.
          </ParamField>

          <ParamField path="max_iter" type="integer">
            Maximum minimizer iterations per relax cycle. `None` uses PyRosetta's default (2500). Upstream BindCraft uses 200 for faster turnaround in binder-design pipelines.
          </ParamField>

          <ParamField path="disable_jumps" type="boolean" default="False">
            Lock inter-chain rigid-body DOFs so chains cannot translate or rotate relative to each other during relax.
          </ParamField>

          <ParamField path="min_type" type="string">
            Optional minimizer type forwarded to `FastRelax.min_type`. BindCraft uses `"lbfgs_armijo_nonmonotone"`.
          </ParamField>

          <ParamField path="align_to_start" type="boolean" default="False">
            If `True`, align the relaxed pose back to the input pose after FastRelax. BindCraft does this before saving its relaxed PDBs so coordinates remain in the original frame.
          </ParamField>

          <ParamField path="copy_b_factors_from_start" type="boolean" default="False">
            If `True`, copy the input pose's per-residue B-factors onto the relaxed pose. BindCraft uses this to preserve AF2 pLDDT values after relaxation.
          </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>
        </Expandable>
      </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/pyrosetta/pyrosetta_interface_analyzer.py#L301" 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: PyRosettaInterfaceAnalyzerOutput">
      <ResponseField name="results" type="List[PyRosettaInterfaceAnalyzerMetrics]">
        Interface-analysis metrics, one per input structure.

        <Expandable title="PyRosettaInterfaceAnalyzerMetrics">
          <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** (one set per `results` item)

      | Metric                     | Type  | Range        | Availability |
      | -------------------------- | ----- | ------------ | ------------ |
      | `interface_sc`             | float | 0.0 to 1.0   | always       |
      | `interface_hbonds`         | int   | ≥ 0.0        | always       |
      | `interface_dG`             | float | unbounded    | always       |
      | `interface_dSASA`          | float | ≥ 0.0        | always       |
      | `interface_packstat`       | float | 0.0 to 1.0   | always       |
      | `interface_hydrophobicity` | float | 0.0 to 100.0 | always       |
      | `surface_hydrophobicity`   | float | 0.0 to 1.0   | always       |
      | `delta_unsat_hbonds`       | int   | ≥ 0.0        | optional     |
    </Accordion>
  </div>

  #### Applications

  This tool is appropriate for filtering and ranking designed protein binders against a target. Representative applications include gating candidate binders on shape complementarity and hydrogen bond count, ranking by predicted binding-energy difference, and identifying poses with excessive interface-buried hydrophobic surface area.

  #### Usage Tips

  * **The seven always-on metrics span well-defined ranges.** `interface_sc` is in 0 to 1 (higher is better fit), `interface_packstat` is in 0 to 1 (higher is better packing), `interface_hydrophobicity` is in 0 to 100 (percent apolar plus aromatic interface residues), `surface_hydrophobicity` is in 0 to 1 (apolar plus aromatic fraction of the binder surface), `interface_hbonds` is an integer count, `interface_dSASA` is in Å², and `interface_dG` is in REU (more negative indicates more favourable binding).
  * **`delta_unsat_hbonds` requires DAlphaBall and is reported as `None` when the SASA dependency is unavailable.** The Rosetta `BuriedUnsatHbonds` filter uses DAlphaBall for accurate buried-surface SASA. The standalone environment installs DAlphaBall when possible. When the metric is `None`, the rest of the seven always-on metrics are still produced normally.
  * **Relax raw predicted complexes before reading the energy-derived metrics.** `interface_dG` and `interface_packstat` are sensitive to steric clashes in unrelaxed structures. Set `pre_relax_structures=True` on the configuration to run FastRelax first, or call `pyrosetta-relax` explicitly and pass the relaxed structure back in.
  * **Chain labels follow the input format.** PDB stores chain IDs as a single character, while mmCIF accepts multi-character labels. The tool transparently shortens multi-character labels to single characters when dispatching to PyRosetta and restores the originals in the output.

  <a name="api-run-pyrosetta-relax" />
</div>

<div class="tool-section-card tool-section-card--relax">
  ### PyRosetta FastRelax (`pyrosetta-relax`)

  Runs Rosetta's FastRelax protocol on one or more input structures and returns the relaxed coordinates as a `Structure` together with the total Rosetta energy. The returned structure preserves the original chain labels and source format so that it composes directly into any of the other tools in this toolkit or into geometric `Structure` methods.

  #### 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/pyrosetta/pyrosetta_relax.py#L95" 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: PyRosettaRelaxInput">
      <ParamField path="inputs" type="List[ScoringStructureInput]" required>
        Protein structures to relax. Accepts bare `Structure` objects, PDB file paths, or PDB content strings for convenience.

        <Expandable title="ScoringStructureInput">
          <ParamField path="chains_to_score" type="ChainSelection">
            Chains to include in scoring. `None` means include every chain. Accepts shorthand `"A"` or `["A", "B"]` at construction.
          </ParamField>

          <ParamField path="structure" type="Structure" required>
            Protein structure (file path, PDB string, `Structure`, or `Structure.model_dump` dict).
          </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/pyrosetta/pyrosetta_relax.py#L120" 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: PyRosettaRelaxConfig">
      <ParamField path="scorefxn" type="string" default="ref2015">
        Rosetta score function name. `ref2015` is the current community standard.
      </ParamField>

      <ParamField path="relax_cycles" type="integer" default="1">
        Number of FastRelax repeats. Germinal uses `1` for speed in cofolding filter pipelines; raise for better convergence at the cost of runtime.
      </ParamField>

      <ParamField path="constrain_to_start" type="boolean" default="True">
        When `True`, add a coordinate-constraint term to the relax score function and call `constrain_relax_to_start_coords(True)` on the FastRelax mover so atoms stay near their input positions. Recommended for filter use cases where large geometric deviations would defeat the purpose.
      </ParamField>

      <ParamField path="max_iter" type="integer">
        Maximum minimizer iterations per relax cycle. `None` uses PyRosetta's default (2500). Upstream BindCraft uses 200 for faster turnaround in binder-design pipelines.
      </ParamField>

      <ParamField path="disable_jumps" type="boolean" default="False">
        Lock inter-chain rigid-body DOFs so chains cannot translate or rotate relative to each other during relax.
      </ParamField>

      <ParamField path="min_type" type="string">
        Optional minimizer type forwarded to `FastRelax.min_type`. BindCraft uses `"lbfgs_armijo_nonmonotone"`.
      </ParamField>

      <ParamField path="align_to_start" type="boolean" default="False">
        If `True`, align the relaxed pose back to the input pose after FastRelax. BindCraft does this before saving its relaxed PDBs so coordinates remain in the original frame.
      </ParamField>

      <ParamField path="copy_b_factors_from_start" type="boolean" default="False">
        If `True`, copy the input pose's per-residue B-factors onto the relaxed pose. BindCraft uses this to preserve AF2 pLDDT values after relaxation.
      </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/pyrosetta/pyrosetta_relax.py#L201" 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: PyRosettaRelaxOutput">
      <ResponseField name="results" type="List[PyRosettaRelaxMetrics]">
        One entry per input structure, in input order. Each carries `total_score` as a specced metric plus `relax` (a :class:`RelaxResult`) carrying the relaxed `Structure`.

        <Expandable title="PyRosettaRelaxMetrics">
          <ResponseField name="relax" type="RelaxResult" required>
            Relaxed structure and run metadata. Declared as a real field (not a metric) because it carries structured data, not a scalar.
          </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** (one set per `results` item)

      | Metric        | Type  | Range     | Availability |
      | ------------- | ----- | --------- | ------------ |
      | `total_score` | float | unbounded | always       |
    </Accordion>
  </div>

  #### Applications

  This tool is appropriate as a preprocessing step before downstream energy scoring, interface analysis, or geometric filtering of raw predicted structures. Representative applications include resolving steric clashes in cofolded complexes before binder-design filter cascades, generating a relaxed reference pose before screening sequence variants, and producing a stable starting point for further structural analyses.

  #### Usage Tips

  * **`relax_cycles` defaults to `1` and accepts integer values from 1 to 15.** A single FastRelax cycle matches the default used by the Germinal binder-design pipeline and is appropriate for most filter-cascade applications. Increase to 5 to 15 for higher-quality convergence at proportional runtime cost.
  * **`constrain_to_start=True` (the default) prevents FastRelax from drastically altering the structure.** This adds a coordinate-constraint term to the relax score function so atoms stay near their input positions. Set to `False` for unconstrained minimisation when the goal is to find the nearest energy minimum.
  * **Additional FastRelax controls are available on `PyRosettaRelaxConfig`.** Pass `disable_jumps=True` to lock the inter-chain rigid-body degrees of freedom during relaxation, `align_to_start=True` to superpose the relaxed pose back onto the starting pose after relaxation, or `copy_b_factors_from_start=True` to copy the per-residue B-factor values from the input.

  <a name="api-run-pyrosetta-sap" />
</div>

<div class="tool-section-card">
  ### PyRosetta SAP Score (`pyrosetta-sap`)

  Scores one or more protein structures with the Spatial Aggregation Propensity protocol from Rosetta's `core.pack.guidance_scoreterms.sap` module and returns the overall SAP score together with a per-residue SAP contribution breakdown. Higher values indicate greater predicted aggregation risk.

  #### 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/pyrosetta/pyrosetta_sap.py#L93" 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: PyRosettaSAPInput">
      <ParamField path="inputs" type="List[ScoringStructureInput]" required>
        Protein structures to score, each with optional chain selection. Accepts bare Structure objects, PDB file paths, or PDB content strings for convenience.

        <Expandable title="ScoringStructureInput">
          <ParamField path="chains_to_score" type="ChainSelection">
            Chains to include in scoring. `None` means include every chain. Accepts shorthand `"A"` or `["A", "B"]` at construction.
          </ParamField>

          <ParamField path="structure" type="Structure" required>
            Protein structure (file path, PDB string, `Structure`, or `Structure.model_dump` dict).
          </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/pyrosetta/pyrosetta_sap.py#L118" 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: PyRosettaSAPConfig">
      <ParamField path="pre_relax_structures" type="boolean" default="False">
        If `True`, run `pyrosetta-relax` on each input structure before scoring. Default `False`.
      </ParamField>

      <ParamField path="relax_config" type="PyRosettaRelaxConfig">
        Settings used when `pre_relax_structures=True`. Ignored otherwise.

        <Expandable title="PyRosettaRelaxConfig">
          <ParamField path="scorefxn" type="string" default="ref2015">
            Rosetta score function name. `ref2015` is the current community standard.
          </ParamField>

          <ParamField path="relax_cycles" type="integer" default="1">
            Number of FastRelax repeats. Germinal uses `1` for speed in cofolding filter pipelines; raise for better convergence at the cost of runtime.
          </ParamField>

          <ParamField path="constrain_to_start" type="boolean" default="True">
            When `True`, add a coordinate-constraint term to the relax score function and call `constrain_relax_to_start_coords(True)` on the FastRelax mover so atoms stay near their input positions. Recommended for filter use cases where large geometric deviations would defeat the purpose.
          </ParamField>

          <ParamField path="max_iter" type="integer">
            Maximum minimizer iterations per relax cycle. `None` uses PyRosetta's default (2500). Upstream BindCraft uses 200 for faster turnaround in binder-design pipelines.
          </ParamField>

          <ParamField path="disable_jumps" type="boolean" default="False">
            Lock inter-chain rigid-body DOFs so chains cannot translate or rotate relative to each other during relax.
          </ParamField>

          <ParamField path="min_type" type="string">
            Optional minimizer type forwarded to `FastRelax.min_type`. BindCraft uses `"lbfgs_armijo_nonmonotone"`.
          </ParamField>

          <ParamField path="align_to_start" type="boolean" default="False">
            If `True`, align the relaxed pose back to the input pose after FastRelax. BindCraft does this before saving its relaxed PDBs so coordinates remain in the original frame.
          </ParamField>

          <ParamField path="copy_b_factors_from_start" type="boolean" default="False">
            If `True`, copy the input pose's per-residue B-factors onto the relaxed pose. BindCraft uses this to preserve AF2 pLDDT values after relaxation.
          </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>
        </Expandable>
      </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/pyrosetta/pyrosetta_sap.py#L151" 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: PyRosettaSAPOutput">
      <ResponseField name="results" type="List[PyRosettaSAPMetrics]">
        SAP scores with per-residue breakdown, one per input structure.

        <Expandable title="PyRosettaSAPMetrics">
          <ResponseField name="per_residue" type="List[ResidueSAP]" required>
            Per-residue SAP contributions. Declared as a real field (not a metric) because each entry carries chain/residue identifiers alongside the score.
          </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** (one set per `results` item)

      | Metric      | Type  | Range | Availability |
      | ----------- | ----- | ----- | ------------ |
      | `sap_score` | float | ≥ 0.0 | always       |
    </Accordion>
  </div>

  #### Applications

  This tool is appropriate for developability assessment during therapeutic protein and antibody engineering, where surface aggregation propensity is a critical liability. Representative applications include ranking antibody variants by predicted aggregation risk, identifying surface mutations that reduce SAP without affecting binding, and screening computationally designed proteins for developability before experimental characterisation.

  #### Usage Tips

  * **SAP is size-dependent and only meaningfully compared across variants of the same protein.** Larger proteins naturally have higher absolute SAP values because more total surface area contributes. Comparisons across different proteins or different chain compositions are not informative.
  * **`chains_to_score` controls which residues contribute to the score.** Setting `chains_to_score=["A"]` on a `ScoringStructureInput` restricts the SAP sum to residues of chain A. The full structure is still loaded so the surrounding context informs the burial calculation, but only the selected chain's atoms contribute to the score.

  <a name="api-run-pyrosetta-sasa" />
</div>

<div class="tool-section-card">
  ### PyRosetta SASA (`pyrosetta-sasa`)

  Computes total and per-residue Solvent Accessible Surface Area using Rosetta's `SasaCalc` module with a configurable probe radius. Returns the total SASA in Å² together with a per-residue breakdown of chain, 1-indexed residue index, three-letter residue name, and SASA value.

  #### 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/pyrosetta/pyrosetta_sasa.py#L94" 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: PyRosettaSASAInput">
      <ParamField path="inputs" type="List[ScoringStructureInput]" required>
        Protein structures to analyze, each with optional chain selection. Accepts bare Structure objects, PDB file paths, or PDB content strings for convenience.

        <Expandable title="ScoringStructureInput">
          <ParamField path="chains_to_score" type="ChainSelection">
            Chains to include in scoring. `None` means include every chain. Accepts shorthand `"A"` or `["A", "B"]` at construction.
          </ParamField>

          <ParamField path="structure" type="Structure" required>
            Protein structure (file path, PDB string, `Structure`, or `Structure.model_dump` dict).
          </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/pyrosetta/pyrosetta_sasa.py#L119" 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: PyRosettaSASAConfig">
      <ParamField path="probe_radius" type="number" default="1.4">
        Radius of the solvent probe sphere in Angstroms. Standard water probe is 1.4 A.
      </ParamField>

      <ParamField path="pre_relax_structures" type="boolean" default="False">
        If `True`, run `pyrosetta-relax` on each input structure before scoring. Default `False`.
      </ParamField>

      <ParamField path="relax_config" type="PyRosettaRelaxConfig">
        Settings used when `pre_relax_structures=True`. Ignored otherwise.

        <Expandable title="PyRosettaRelaxConfig">
          <ParamField path="scorefxn" type="string" default="ref2015">
            Rosetta score function name. `ref2015` is the current community standard.
          </ParamField>

          <ParamField path="relax_cycles" type="integer" default="1">
            Number of FastRelax repeats. Germinal uses `1` for speed in cofolding filter pipelines; raise for better convergence at the cost of runtime.
          </ParamField>

          <ParamField path="constrain_to_start" type="boolean" default="True">
            When `True`, add a coordinate-constraint term to the relax score function and call `constrain_relax_to_start_coords(True)` on the FastRelax mover so atoms stay near their input positions. Recommended for filter use cases where large geometric deviations would defeat the purpose.
          </ParamField>

          <ParamField path="max_iter" type="integer">
            Maximum minimizer iterations per relax cycle. `None` uses PyRosetta's default (2500). Upstream BindCraft uses 200 for faster turnaround in binder-design pipelines.
          </ParamField>

          <ParamField path="disable_jumps" type="boolean" default="False">
            Lock inter-chain rigid-body DOFs so chains cannot translate or rotate relative to each other during relax.
          </ParamField>

          <ParamField path="min_type" type="string">
            Optional minimizer type forwarded to `FastRelax.min_type`. BindCraft uses `"lbfgs_armijo_nonmonotone"`.
          </ParamField>

          <ParamField path="align_to_start" type="boolean" default="False">
            If `True`, align the relaxed pose back to the input pose after FastRelax. BindCraft does this before saving its relaxed PDBs so coordinates remain in the original frame.
          </ParamField>

          <ParamField path="copy_b_factors_from_start" type="boolean" default="False">
            If `True`, copy the input pose's per-residue B-factors onto the relaxed pose. BindCraft uses this to preserve AF2 pLDDT values after relaxation.
          </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>
        </Expandable>
      </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/pyrosetta/pyrosetta_sasa.py#L160" 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: PyRosettaSASAOutput">
      <ResponseField name="results" type="List[PyRosettaSASAMetrics]">
        SASA results, one per input structure.

        <Expandable title="PyRosettaSASAMetrics">
          <ResponseField name="per_residue" type="List[ResidueSASA]" required>
            Per-residue SASA breakdown. Declared as a real field (not a metric) because each entry carries chain/residue identifiers alongside the SASA value.
          </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** (one set per `results` item)

      | Metric       | Type  | Range | Availability |
      | ------------ | ----- | ----- | ------------ |
      | `total_sasa` | float | ≥ 0.0 | always       |
    </Accordion>
  </div>

  #### Applications

  This tool is appropriate for identifying buried and exposed residues, characterising hydrophobic surface patches, and computing a surface-area baseline for downstream developability or interaction analyses. Representative applications include flagging exposed hydrophobic residues as redesign candidates, summarising the surface-residue composition of a designed protein, and computing the buried surface area difference between bound and unbound states.

  #### Usage Tips

  * **`probe_radius` defaults to 1.4 Å.** This is the conventional water probe radius. Larger probe values are sometimes used to approximate the accessibility seen by larger solvent molecules or interaction partners.
  * **Per-residue SASA values near 0 indicate fully buried residues.** Values above approximately 100 Å² indicate significant solvent exposure for a typical residue. Combine with residue identity to identify exposed hydrophobic residues as aggregation hotspots.
  * **Total SASA scales with protein size.** Normalise by residue count or surface area when comparing across proteins of different sizes.
</div>

## Toolkit Notes

These apply to every PyRosetta tool in this toolkit (`pyrosetta-energy`, `pyrosetta-interface-analyzer`, `pyrosetta-relax`, `pyrosetta-sap`, `pyrosetta-sasa`).

* **Every tool accepts a list of inputs in a single call.** The scoring, relaxation, and SASA tools take a list of `ScoringStructureInput` entries, and the interface analyzer takes a list of `InterfaceStructureInput` entries. Each entry independently accepts a `Structure` object, a file path, a PDB or mmCIF content string, or a dict shorthand. A single bare input is automatically wrapped in a list. Results are returned in the same order as the inputs.
* **The four scoring and interface-analyzer tools share an opt-in `pre_relax_structures` preprocess that runs `pyrosetta-relax` first.** Set `pre_relax_structures=True` and optionally pass a `PyRosettaRelaxConfig` to relax every input structure before scoring. The framework's preprocess hook dispatches `pyrosetta-relax` and substitutes the relaxed structures, so there is exactly one FastRelax implementation in the codebase.
* **Per-residue output uses 1-indexed positions consistent with PDB numbering.** Residue indices in the per-residue energy and per-residue SASA breakdowns correspond directly to the residue numbers in the input structure.

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