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

# FoldMason

> [FoldMason](https://github.com/steineggerlab/foldmason) is a multiple protein-structure alignment tool from the [Steinegger Lab](https://steineggerlab.com/) at Seoul National University. It produces a structural multiple-sequence alignment over an arbitrary set of [PDB](https://www.rcsb.org/) inputs and returns the alignment in both the amino-acid alphabet and the [3Di structural alphabet](https://www.nature.com/articles/s41587-023-01773-0) shared with [Foldseek](https://bio-pro.mintlify.app/tools/structure-alignment/foldseek). A separate tool in the same toolkit scores an existing MSA against its structures using a per-column [LDDT](https://doi.org/10.1093/bioinformatics/btt473) metric.

<div class="page-hero"><img class="page-hero-banner" src="https://proto-bio.github.io/proto-assets/images/tool/foldmason/hero.png" alt="FoldMason" /><div class="tool-org-badges page-hero-badges"><a href="/docs/tools/organizations/steinegger-lab" class="tool-org-badge" style={{background: "#2E86C1"}} title="Steinegger Lab"><img src="https://mintcdn.com/bio-pro/UeudeF7pW-Dj-pIN/assets/images/cached/5e3c631c9751.png?fit=max&auto=format&n=UeudeF7pW-Dj-pIN&q=85&s=5b9aab8b7ad1af8d3310a125bc9e540c" alt="" class="tool-org-badge-logo" width="200" height="200" data-path="assets/images/cached/5e3c631c9751.png" /> Steinegger Lab</a></div></div>

<Note>
  **License:** FoldMason has a GPL-3.0 license. Please refer to [the license](https://github.com/steineggerlab/foldmason/blob/master/LICENSE.md) for full terms.
</Note>

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

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

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

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

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

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

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

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

<div class="tool-tab-bar">
  <span class="tool-tab-wrap"><label for="github-foldmason" 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-foldmason" 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-foldmason" 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-foldmason" 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-foldmason" 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-foldmason" 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-foldmason" 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-foldmason" 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-foldmason" 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-foldmason" 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-foldmason" 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-foldmason" 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-foldmason" 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-foldmason" 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/steineggerlab/foldmason" target="_blank" class="tab-panel github-panel" data-tab="github-foldmason">
  <div class="gh-card-wrap">
    <img src="https://opengraph.githubassets.com/1/steineggerlab/foldmason" class="gh-card-img img-fallback" alt="steineggerlab/foldmason" />

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

    <span class="website-url">search.foldseek.com</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.1126/science.ads6733" target="_blank" class="tab-panel paper-panel" data-tab="paper-foldmason">
  <div class="paper-info">
    <div class="paper-title">Multiple protein structure alignment at scale with FoldMason</div>
    <div class="paper-meta">Cameron L. M. Gilchrist, Milot Mirdita and Martin Steinegger</div>
    <div class="paper-meta paper-venue">Science (2026)</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-foldmason">
  <div class="cite-code-wrap">
    ```bibtex theme={null}
    @article{gilchrist2026foldmason,
      title={Multiple protein structure alignment at scale with {F}old{M}ason},
      author={Gilchrist, Cameron L. M. and Mirdita, Milot and Steinegger, Martin},
      journal={Science},
      volume={391},
      number={6784},
      pages={485--488},
      year={2026},
      publisher={American Association for the Advancement of Science},
      doi={10.1126/science.ads6733}
    }
    ```
  </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_alignment/foldmason" target="_blank" class="tab-panel source-panel" data-tab="source-foldmason">
  <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\_alignment/foldmason</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_alignment/foldmason/examples/example.ipynb" target="_blank" class="tab-panel notebook-panel" data-tab="notebook-foldmason">
  <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-foldmason">
  <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: 18 commits"><img noZoom class="entity-contributor-avatar" src="https://avatars.githubusercontent.com/u/21143637?v=4&s=64" alt="" loading="lazy" /><span class="entity-contributor-login">bviggiano</span></a><a class="entity-contributor" href="https://github.com/dguo8412" target="_blank" rel="noopener" title="dguo8412: 6 commits"><img noZoom class="entity-contributor-avatar" src="https://avatars.githubusercontent.com/u/46211285?v=4&s=64" alt="" loading="lazy" /><span class="entity-contributor-login">dguo8412</span></a><a class="entity-contributor" href="https://github.com/leba01" target="_blank" rel="noopener" title="leba01: 1 commit"><img noZoom class="entity-contributor-avatar" src="https://avatars.githubusercontent.com/u/124846286?v=4&s=64" alt="" loading="lazy" /><span class="entity-contributor-login">leba01</span></a></span></div>

| Function                    | Description                                                                    |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| --------------------------- | ------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `run_foldmason_msa()`       | Multiple structure alignment via FoldMason — remote (server) or local (CLI)    | <a href="#api-run-foldmason-msa" 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_alignment/foldmason/foldmason_msa.py#L247" 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_foldmason_score_msa()` | Score a structural MSA with average + per-column LDDT using FoldMason msa2lddt | <a href="#api-run-foldmason-score-msa" 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_alignment/foldmason/foldmason_score_msa.py#L202" 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

[FoldMason](https://github.com/steineggerlab/foldmason) ([Gilchrist, Mirdita & Steinegger, 2026](https://doi.org/10.1126/science.ads6733)) is a progressive multiple-structure alignment method that scales to hundreds of thousands of protein structures. Each input structure is first encoded as a string over the [3Di alphabet](https://www.nature.com/articles/s41587-023-01773-0), the structural alphabet introduced with Foldseek that represents the local backbone geometry of each residue as a discrete letter. FoldMason then aligns the 3Di strings alongside their amino-acid sequences through a progressive procedure that follows a structural guide tree, using [Foldseek](https://bio-pro.mintlify.app/tools/structure-alignment/foldseek) and [TM-align](https://bio-pro.mintlify.app/tools/structure-alignment/tmalign) as the pairwise structural aligners at each merge step. An optional iterative refinement procedure can re-align the result to maximise its LDDT score. The output is a column-by-column alignment expressed in both alphabets together with the Newick guide tree.

Alignment quality is summarised with the [Local Distance Difference Test (lDDT)](https://academic.oup.com/bioinformatics/article-abstract/29/21/2722/195896) ([Mariani et al., 2013](https://doi.org/10.1093/bioinformatics/btt473)), a superposition-free metric that scores local atomic-distance agreement between two structures. FoldMason's `msa2lddt` computes LDDT on each pairwise sub-alignment, maps the per-residue scores back to MSA columns, and averages across pairs to produce one column-wise score and one overall average. The reference implementation is released as open source by the [Steinegger Lab](https://steineggerlab.com/) at [steineggerlab/foldmason](https://github.com/steineggerlab/foldmason). The same group operates a public web service at [search.foldseek.com/foldmason](https://search.foldseek.com/foldmason) that the remote execution mode of this toolkit targets.

### Learning Resources

* [steineggerlab/foldmason](https://github.com/steineggerlab/foldmason) (Steinegger Lab, Seoul National University) - official repository, command-line interface for `easy-msa`, `structuremsa`, `refinemsa`, and `msa2lddt`, and the FASTA output format that this toolkit parses.
* [search.foldseek.com/foldmason](https://search.foldseek.com/foldmason) (Steinegger Lab) - the public web service that the remote execution mode targets, useful for a single browser-based alignment before scripting against the tool.

## Tools

<a name="api-run-foldmason-msa" />

<div class="tool-section-card">
  ### FoldMason MSA (`foldmason-msa`)

  Aligns two or more PDB structures and returns the amino-acid and 3Di MSAs as FASTA strings together with the Newick guide tree, the alignment length, and the number of sequences aligned. The tool executes against the public Steinegger Lab web service in `remote` mode and against the bundled `foldmason easy-msa` program in `local` mode.

  #### 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_alignment/foldmason/foldmason_msa.py#L49" 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: FoldmasonMSAInput">
      <ParamField path="structures" type="List[Structure]" required>
        Structures to align (≥2). Accepts `Structure` objects, file paths, or raw PDB/CIF content strings per item; each is normalised to a `Structure`.

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

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

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

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

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

      <ParamField path="structure_ids" type="array">
        Optional IDs per structure (default: `'structure_0'`, `'structure_1'`, ...). Length must match `structures`. IDs become the FASTA record headers and Newick leaf labels in the output.
      </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_alignment/foldmason/foldmason_msa.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="Config: FoldmasonMSAConfig">
      <ParamField path="search_mode" type="enum" default="remote">
        'remote' (default) hits the public FoldMason server; 'local' runs the FoldMason CLI.

        Available options: `remote`, `local`
      </ParamField>

      <ParamField path="poll_interval_seconds" type="number" default="5.0">
        Remote-only — delay between status polls.
      </ParamField>

      <ParamField path="timeout_seconds" type="number" default="600.0">
        Remote-only — max wall-clock time.
      </ParamField>

      <ParamField path="gap_open" type="integer" default="10">
        Local-only — gap open cost.
      </ParamField>

      <ParamField path="gap_extend" type="integer" default="1">
        Local-only — gap extension cost.
      </ParamField>

      <ParamField path="refine_iters" type="integer" default="0">
        Local-only — number of alignment-refinement iterations. 0 = no refinement.
      </ParamField>

      <ParamField path="precluster" type="boolean" default="False">
        Local-only — pre-cluster structures before MSA construction. Recommended for large datasets (>1k structures).
      </ParamField>

      <ParamField path="guide_tree_newick" type="string">
        Local-only — Newick guide tree to use instead of computing one. Leaf labels must match `structure_ids`.
      </ParamField>

      <ParamField path="num_threads" type="integer" default="4">
        Local-only — CPU threads.
      </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_alignment/foldmason/foldmason_msa.py#L177" 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: FoldmasonMSAOutput">
      <ResponseField name="ticket_id" type="string" required>
        Remote job ticket ID; empty in local mode.
      </ResponseField>

      <ResponseField name="aa_msa_fasta" type="string" required>
        Amino-acid alphabet MSA in FASTA format.
      </ResponseField>

      <ResponseField name="three_di_msa_fasta" type="string" required>
        3Di alphabet MSA in FASTA format.
      </ResponseField>

      <ResponseField name="newick_tree" type="string" required>
        Newick guide tree.
      </ResponseField>

      <ResponseField name="num_sequences" type="integer" required>
        Number of sequences in the alignment.
      </ResponseField>

      <ResponseField name="alignment_length" type="integer" required>
        Number of MSA columns.
      </ResponseField>

      <ResponseField name="result_url" type="string" required>
        Remote result-archive URL; empty in local mode.
      </ResponseField>
    </Accordion>
  </div>

  #### Applications

  This tool is appropriate for aligning a fold family retrieved from a Foldseek search, for comparing designed scaffolds against their target backbone, or for assembling a multi-structure template ensemble for downstream template-based modelling. It also applies to AlphaFold predictions across an evolutionary set, where the alignment can identify residues that are structurally conserved as well as loops that vary in conformation.

  #### Usage Tips

  * **`foldmason-msa` supports both remote (`search_mode="remote"`, the default) and local (`search_mode="local"`) execution.** Remote mode targets the Steinegger Lab web service. Local mode runs the bundled FoldMason program and accepts the full set of alignment parameters.
  * **The Steinegger Lab web service does not accept alignment parameters.** The configuration fields `gap_open`, `gap_extend`, `refine_iters`, `precluster`, and `guide_tree_newick` therefore require `search_mode="local"`.
  * **`refine_iters` controls how many iterative LDDT-maximising refinement passes run after the initial progressive alignment.** Each pass adds runtime, and the default of `0` is appropriate for most workflows. Increase it only when an alignment shows poor quality in difficult regions.
  * **The remote service has no authentication and no published rate limit.** `search.foldseek.com/foldmason` is a free public academic resource. High-throughput or batch workloads should be performed in `local` mode to avoid overloading the shared service.

  <a name="api-run-foldmason-score-msa" />
</div>

<div class="tool-section-card tool-section-card--score">
  ### FoldMason Score MSA (`foldmason-score-msa`)

  Accepts a precomputed amino-acid MSA in FASTA format together with the underlying PDB structures, and returns the average MSA-wide LDDT score, the per-column LDDT scores, the number of columns considered, and the total alignment length.

  #### 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_alignment/foldmason/foldmason_score_msa.py#L35" 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: FoldmasonScoreMSAInput">
      <ParamField path="structures" type="List[Structure]" required>
        Structures (≥2). Accepts `Structure` objects, file paths, or raw PDB/CIF content strings per item; each is normalised to a `Structure`. Order must match the rows of `msa`.

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

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

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

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

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

      <ParamField path="structure_ids" type="array">
        Optional IDs per structure (default: `'structure_0'`, ...). Must match the FASTA record headers in `msa` so msa2lddt can resolve each row to its structure.
      </ParamField>

      <ParamField path="msa" type="MSA" required>
        Amino-acid MSA, typically from `foldmason-msa`. Accepts an `MSA` object or a raw FASTA string.

        <Expandable title="MSA">
          <ParamField path="aligned_sequences" type="List[string]" required>
            Aligned sequences with `-` characters indicating gaps. All sequences must have the same length.
          </ParamField>

          <ParamField path="sequence_ids" type="List[string]" required>
            Identifiers for each sequence. Auto-generated as `seq_0`, `seq_1`, ... if not provided.
          </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_alignment/foldmason/foldmason_score_msa.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="Config: FoldmasonScoreMSAConfig">
      <ParamField path="pair_threshold" type="number" default="0.0">
        Minimum fraction of pair sub-alignments with LDDT information required to score a column (0-1). 0.0 (default) keeps all columns.
      </ParamField>

      <ParamField path="only_scoring_cols" type="boolean" default="False">
        If True, normalise the average LDDT by the number of scoring columns rather than total alignment length.
      </ParamField>

      <ParamField path="guide_tree_newick" type="string">
        Newick guide tree to score against; leaf labels must match `structure_ids`. None lets foldmason recompute the tree internally.
      </ParamField>

      <ParamField path="num_threads" type="integer" default="4">
        CPU threads.
      </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_alignment/foldmason/foldmason_score_msa.py#L128" 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: FoldmasonScoreMSAOutput">
      <ResponseField name="average_lddt" type="number" required>
        Average MSA LDDT score (0-1) across all scored columns.
      </ResponseField>

      <ResponseField name="columns_considered" type="integer" required>
        Number of columns that had enough pairwise information to be scored.
      </ResponseField>

      <ResponseField name="alignment_length" type="integer" required>
        Total number of MSA columns.
      </ResponseField>

      <ResponseField name="column_scores" type="List[number]">
        Per-column LDDT scores, length equal to `alignment_length`.
      </ResponseField>
    </Accordion>
  </div>

  #### Applications

  This tool is appropriate for assigning a structural quality score to an MSA produced elsewhere, for identifying low-LDDT columns that should be masked or treated as variable loops before downstream analysis, or for comparing two candidate alignments of the same structures using a single summary score.

  #### Usage Tips

  * **FASTA record headers must match `structure_ids`.** `msa2lddt` resolves each MSA row to its corresponding structure by matching the header against the supplied identifiers. Headers that do not correspond to a supplied structure are not scored, which can produce a misleadingly high score derived from a partial alignment.
  * **`only_scoring_cols=True` normalises the average LDDT by the number of scored columns rather than by the total alignment length.** Use this option when comparing alignments with different gap content. Leaving it `False` (the default) includes gap columns in the denominator.
  * **This tool runs only in local mode.** The public web service does not provide an `msa2lddt` endpoint, so every `foldmason-score-msa` call requires the local FoldMason program.
</div>

## Toolkit Notes

These apply to every FoldMason tool in this toolkit (`foldmason-msa`, `foldmason-score-msa`).

* **FoldMason runs on CPU only.** Neither the remote service nor the local program uses a GPU. Local-mode runtime grows with both the number of structures and their lengths, since each progressive merge step performs a pairwise structural alignment.
* **Inputs are normalised to PDB before alignment.** Each `structures` entry may be a `Structure`, a file path, or raw PDB/CIF text; every entry is serialised to PDB and written to disk as `{structure_id}.pdb` before FoldMason runs.

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