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

# Rfam

> [Rfam](https://rfam.org) is a database of non-coding RNA families represented by curated sequence alignments, consensus secondary structures, and covariance models. The toolkit provides two retrieval tools: `rfam-family` returns a family record and its consensus annotations, with an optional seed alignment; `rfam-regions` returns annotated sequence regions with coordinates, strand, and taxonomic information.

<div class="page-hero"><img class="page-hero-banner" src="https://proto-bio.github.io/proto-assets/images/tool/rfam/hero.png" alt="Rfam" /><div class="tool-org-badges page-hero-badges"><a href="/docs/tools/organizations/embl-ebi" class="tool-org-badge" style={{background: "#007C82"}} title="EMBL-EBI"><img src="https://mintcdn.com/bio-pro/UeudeF7pW-Dj-pIN/assets/images/cached/d6be4d3bc893.png?fit=max&auto=format&n=UeudeF7pW-Dj-pIN&q=85&s=3f3eaae432293c6ed9a25a58e369baa3" alt="" class="tool-org-badge-logo" width="200" height="200" data-path="assets/images/cached/d6be4d3bc893.png" /> EMBL-EBI</a></div></div>

<Note>
  **License:** Rfam retrieves data from the Rfam database, distributed under CC0-1.0 (public domain; no attribution required). The client wrapper code is MIT-licensed. Please refer to [the data terms](https://docs.rfam.org/en/latest/#license) for full terms.
</Note>

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

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

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

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

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

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

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

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

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

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

    <span class="website-url">rfam.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/nar/gkae1023" target="_blank" class="tab-panel paper-panel" data-tab="paper-rfam">
  <div class="paper-info">
    <div class="paper-title">Rfam 15: RNA families database in 2025</div>
    <div class="paper-meta">Nancy Ontiveros-Palacios, Emma Cooke, ... Blake Sweeney</div>
    <div class="paper-meta paper-venue">Nucleic Acids Research (2025)</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-rfam">
  <div class="cite-code-wrap">
    ```bibtex theme={null}
    @article{ontiverospalacios2025rfam,
      title={Rfam 15: RNA families database in 2025},
      author={Ontiveros-Palacios, Nancy and Cooke, Emma and Nawrocki, Eric P and Triebel, Sandra and Marz, Manja and Rivas, Elena and Griffiths-Jones, Sam and Petrov, Anton I and Bateman, Alex and Sweeney, Blake},
      journal={Nucleic Acids Research},
      volume={53},
      number={D1},
      pages={D258--D267},
      year={2025},
      publisher={Oxford University Press},
      doi={10.1093/nar/gkae1023}
    }
    ```
  </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/4a31ebcb9f26ab307626b41e8059b612caf915b1/proto_tools/tools/database_retrieval/rfam" target="_blank" class="tab-panel source-panel" data-tab="source-rfam">
  <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/database\_retrieval/rfam</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/4a31ebcb9f26ab307626b41e8059b612caf915b1/proto_tools/tools/database_retrieval/rfam/examples/example.ipynb" target="_blank" class="tab-panel notebook-panel" data-tab="notebook-rfam">
  <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-rfam">
  <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: 1 commit"><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></span></div>

| Function | Description | |
| - | - | - |
| `run_rfam_family()` | Fetch an Rfam RNA family's curation record, consensus structure, and seed alignment | <a href="#api-run-rfam-family" 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/4a31ebcb9f26ab307626b41e8059b612caf915b1/proto_tools/tools/database_retrieval/rfam/rfam_family.py#L177" 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_rfam_regions()` | List where an Rfam RNA family is annotated in genomes, with coordinates and strand | <a href="#api-run-rfam-regions" 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/4a31ebcb9f26ab307626b41e8059b612caf915b1/proto_tools/tools/database_retrieval/rfam/rfam_regions.py#L253" 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

Rfam is developed at [EMBL-EBI](https://docs.rfam.org/en/latest/). An RNA family is a group of sequences believed to be evolutionarily related through similarity in sequence or secondary structure. Related families may be grouped into [clans](https://docs.rfam.org/en/latest/glossary.html#clan). The database and its release 15.0 updates are described in [*Rfam 15: RNA families database in 2025*](https://doi.org/10.1093/nar/gkae1023) by Ontiveros-Palacios et al., published in *Nucleic Acids Research*.

Each family has a manually curated **seed alignment**, a representative set of sequences annotated with a consensus secondary structure. Rfam uses this alignment to build a **covariance model**, a statistical model that scores both sequence and secondary structure similarity. [Infernal](https://eddylab.org/infernal/) searches these models against the Rfamseq sequence database to identify additional candidate homologues. A curator-defined gathering cutoff specifies the bit-score threshold for inclusion in the family. The [family-building documentation](https://docs.rfam.org/en/latest/building-families.html) describes this process and the sources of structural annotations.

The toolkit retrieves these existing records through the [Rfam API](https://docs.rfam.org/en/latest/api.html). `rfam-family` reads the family description as JSON and extracts the consensus structure (`#=GC SS_cons`) and reference annotation (`#=GC RF`) from the Stockholm seed alignment. `rfam-regions` parses the family's region table and separates strand orientation from the start and end coordinates. Both outputs report the Rfam release.

### Learning Resources

* [How Rfam families are built](https://docs.rfam.org/en/latest/building-families.html) (Rfam) - seed alignments, structural annotations, and covariance-model searches.
* [Rfam glossary](https://docs.rfam.org/en/latest/glossary.html) (Rfam) - definitions of families, clans, gathering cutoffs, and alignment formats.
* [Rfam API](https://docs.rfam.org/en/latest/api.html) (Rfam) - reference for family records, sequence regions, and alignments.
* [Infernal documentation](https://eddylab.org/infernal/) (Eddy lab) - the software used to build and search RNA covariance models.

## Tools

<a name="api-run-rfam-family" />

<div class="tool-section-card">
  ### Rfam Family (`rfam-family`)

  Retrieves a family by accession or family ID and returns its description, RNA type, curation information, sequence and species counts, clan membership when available, and the gathering cutoff for family membership. The output also contains the consensus secondary structure, reference annotation, and database release information. The complete Stockholm seed alignment can be included through configuration.

  #### API Reference

  <div class="api-model-section api-input-section">
    <a href="https://github.com/evo-design/proto-tools/blob/4a31ebcb9f26ab307626b41e8059b612caf915b1/proto_tools/tools/database_retrieval/rfam/rfam_family.py#L28" 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: RfamFamilyInput">
      <ParamField path="family" type="string" required>
        Rfam accession (e.g. 'RF01731') or family ID (e.g. 'TwoAYGGAY').
      </ParamField>
    </Accordion>
  </div>

  <div class="api-model-section api-config-section">
    <a href="https://github.com/evo-design/proto-tools/blob/4a31ebcb9f26ab307626b41e8059b612caf915b1/proto_tools/tools/database_retrieval/rfam/rfam_family.py#L36" 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: RfamFamilyConfig">
      <ParamField path="include_seed_alignment" type="boolean" default="False">
        Return the full Stockholm seed alignment, not only its consensus lines.
      </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/4a31ebcb9f26ab307626b41e8059b612caf915b1/proto_tools/tools/database_retrieval/rfam/rfam_family.py#L51" 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: RfamFamilyOutput">
      <ResponseField name="accession" type="string" required>
        Rfam accession.
      </ResponseField>

      <ResponseField name="rfam_id" type="string" required>
        Rfam family ID.
      </ResponseField>

      <ResponseField name="description" type="string" required>
        One-line family description.
      </ResponseField>

      <ResponseField name="rna_type" type="string" required>
        Rfam type annotation (e.g. 'Cis-reg', 'Gene; snRNA').
      </ResponseField>

      <ResponseField name="comment" type="string">
        Curator comment, when the family has one.
      </ResponseField>

      <ResponseField name="author" type="string" required>
        Family authors.
      </ResponseField>

      <ResponseField name="seed_source" type="string" required>
        Where the seed alignment came from.
      </ResponseField>

      <ResponseField name="structure_source" type="string">
        Where the consensus structure came from.
      </ResponseField>

      <ResponseField name="num_seed" type="integer" required>
        Sequences in the seed alignment.
      </ResponseField>

      <ResponseField name="num_full" type="integer" required>
        Annotated regions across all sequences.
      </ResponseField>

      <ResponseField name="num_species" type="integer" required>
        Species with at least one annotated region.
      </ResponseField>

      <ResponseField name="clan_accession" type="string">
        Accession of the clan the family belongs to.
      </ResponseField>

      <ResponseField name="clan_id" type="string">
        ID of the clan the family belongs to.
      </ResponseField>

      <ResponseField name="gathering_cutoff" type="number" required>
        Bit-score threshold for family membership.
      </ResponseField>

      <ResponseField name="rfam_release" type="string" required>
        Rfam release the record comes from.
      </ResponseField>

      <ResponseField name="consensus_structure" type="string" required>
        Consensus secondary structure (#=GC SS\_cons), WUSS notation.
      </ResponseField>

      <ResponseField name="consensus_sequence" type="string" required>
        Reference consensus sequence (#=GC RF), aligned with it.
      </ResponseField>

      <ResponseField name="seed_alignment" type="string">
        Full Stockholm seed alignment, when requested.
      </ResponseField>
    </Accordion>
  </div>

  #### Applications

  Family records provide context for interpreting RNA annotations. The consensus structure describes conserved pairing patterns across the alignment, while the curation fields identify the sources of the alignment and structure. These records support comparisons of representative family sequences and interpretation of model scores alongside the reported cutoffs. The seed alignment can also be used for further alignment or structural analysis.

  #### Usage Tips

  * **Families can be identified by accession or ID.** For example, `RF01731` and `TwoAYGGAY` identify the same [Rfam family](https://rfam.org/family/RF01731). The output reports both identifiers.
  * **Consensus annotations use alignment coordinates.** `consensus_structure` contains the Stockholm `SS_cons` annotation in [WUSS notation](https://docs.rfam.org/en/latest/glossary.html#wuss-format); `consensus_sequence` contains the `RF` reference annotation. These strings include alignment columns and should not be interpreted as an unaligned nucleotide sequence or genomic coordinates.
  * **Structural annotations have different sources.** Rfam includes both experimentally supported and computationally predicted structures. The `structure_source` field records provenance when available; the [Rfam documentation](https://docs.rfam.org/en/latest/building-families.html) explains why an underlying publication may be needed to establish the type of evidence.
  * **The seed alignment is optional in the output.** Set `include_seed_alignment=True` to retain it and enable `sto` export. The tool downloads the alignment to extract the consensus annotations even when this option is disabled. Family records can also be exported as JSON.

  <a name="api-run-rfam-regions" />
</div>

<div class="tool-section-card">
  ### Rfam Regions (`rfam-regions`)

  Retrieves the annotated sequence regions for a family, with optional filters for NCBI taxonomy ID, species name, or sequence accession. Each region contains a versioned sequence accession, Infernal bit score, start and end coordinates, strand, sequence description, species name, and taxonomy ID. The output includes the family identifiers, total and filtered region counts, and a flag indicating whether the returned list was truncated.

  #### API Reference

  <div class="api-model-section api-input-section">
    <a href="https://github.com/evo-design/proto-tools/blob/4a31ebcb9f26ab307626b41e8059b612caf915b1/proto_tools/tools/database_retrieval/rfam/rfam_regions.py#L61" 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: RfamRegionsInput">
      <ParamField path="taxid" type="integer">
        Keep only hits in this NCBI taxonomy ID.
      </ParamField>

      <ParamField path="species" type="string">
        Keep only hits whose species contains this text (case-insensitive).
      </ParamField>

      <ParamField path="sequence_accession" type="string">
        Keep only hits on this sequence accession. The version suffix is optional ('AM181176' matches 'AM181176.4').
      </ParamField>

      <ParamField path="family" type="string" required>
        Rfam accession (e.g. 'RF01731') or family ID (e.g. 'TwoAYGGAY').
      </ParamField>
    </Accordion>
  </div>

  <div class="api-model-section api-config-section">
    <a href="https://github.com/evo-design/proto-tools/blob/4a31ebcb9f26ab307626b41e8059b612caf915b1/proto_tools/tools/database_retrieval/rfam/rfam_regions.py#L98" 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: RfamRegionsConfig">
      <ParamField path="max_regions" type="integer" default="500">
        Most regions returned after filtering; the rest are counted, not listed.
      </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/4a31ebcb9f26ab307626b41e8059b612caf915b1/proto_tools/tools/database_retrieval/rfam/rfam_regions.py#L114" 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: RfamRegionsOutput">
      <ResponseField name="accession" type="string" required>
        Rfam accession of the family.
      </ResponseField>

      <ResponseField name="rfam_id" type="string" required>
        Rfam family ID.
      </ResponseField>

      <ResponseField name="rfam_release" type="string">
        Rfam release the regions were built from.
      </ResponseField>

      <ResponseField name="total_regions" type="integer" required>
        Regions the family has across all sequences.
      </ResponseField>

      <ResponseField name="matched_regions" type="integer" required>
        Regions left after the input filters.
      </ResponseField>

      <ResponseField name="truncated" type="boolean" required>
        Whether matched regions exceeded max\_regions.
      </ResponseField>

      <ResponseField name="regions" type="List[RfamRegion]">
        Matched regions, at most max\_regions of them.

        <Expandable title="RfamRegion">
          <ResponseField name="sequence_accession" type="string" required>
            Versioned accession of the sequence holding the hit.
          </ResponseField>

          <ResponseField name="bit_score" type="number" required>
            Infernal bit score of the hit.
          </ResponseField>

          <ResponseField name="start" type="integer" required>
            First position of the hit (1-indexed, inclusive, start \<= end).
          </ResponseField>

          <ResponseField name="end" type="integer" required>
            Last position of the hit (1-indexed, inclusive).
          </ResponseField>

          <ResponseField name="strand" type="enum" required>
            Strand of the hit on the sequence.
          </ResponseField>

          <ResponseField name="description" type="string" required>
            Description of the sequence holding the hit.
          </ResponseField>

          <ResponseField name="species" type="string" required>
            Species name of the sequence.
          </ResponseField>

          <ResponseField name="taxid" type="integer" required>
            NCBI taxonomy ID of the species.
          </ResponseField>
        </Expandable>
      </ResponseField>
    </Accordion>
  </div>

  #### Applications

  Region records locate candidate family members in the sequences represented by Rfam. Filtering by species or sequence accession supports examination of annotated loci in a particular organism or genome record. The accession, coordinates, and strand can be passed to [`ncbi-efetch`](https://bio-pro.mintlify.app/tools/database-retrieval/ncbi) to retrieve the corresponding nucleotide subsequence for comparative analysis. Taxonomic fields also support examination of a family's distribution within the Rfam dataset.

  #### Usage Tips

  * **Coordinates are 1-indexed and inclusive.** The tool normalizes each region to `start <= end` and reports orientation separately as `+` or `-`. These values correspond to `ncbi-efetch`'s `seq_start`, `seq_stop`, and `strand` inputs.
  * **Filters are applied after download.** `taxid` matches an exact taxonomy ID, `species` matches a case-insensitive substring, and `sequence_accession` accepts either a versioned or an unversioned accession. When several filters are provided, a region must satisfy all of them.
  * **The return limit applies after filtering.** `max_regions` defaults to 500. `total_regions` reports the family-wide count, `matched_regions` counts all regions satisfying the filters, and `truncated` indicates that some matching regions were omitted. The limit does not reduce the size of the download.
  * **Some families are too large for the endpoint.** The [Rfam API documentation](https://docs.rfam.org/en/latest/api.html#sequence-regions) states that the server can refuse region downloads for very large families. Local filters cannot bypass this restriction.
  * **Region tables can be exported.** JSON preserves the full output, including counts and release information; TSV and CSV contain the returned region rows.
</div>

## Toolkit Notes

These apply to every Rfam tool in this toolkit (`rfam-family`, `rfam-regions`).

* **Requires network access.** Both tools retrieve data from the Rfam website using HTTPS requests and execute in the current Python process.
* **Results depend on the Rfam release.** The tools query the live website rather than selecting a fixed database release. Retain the reported release information with exported results for provenance.

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


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.