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

# CCD Lookup

> CCD Lookup wraps [`pdbeccdutils`](https://github.com/PDBeurope/ccdutils), the PDBe Python library for the [wwPDB Chemical Component Dictionary (CCD)](https://www.wwpdb.org/data/ccd). Given a CCD code (e.g. `ATP`) or a SMILES string, the `ccd-lookup` tool returns a `Ligands` collection of standard `Fragment` objects, plus a parallel list of `CcdEnrichment` records carrying formula, descriptors, parent component, [RDKit](https://www.rdkit.org/) physicochemical properties, optional UniChem cross-references, and PDB structures using the ligand. It runs on CPU and is fully offline by default.

<div class="page-hero"><img class="page-hero-banner" src="https://proto-bio.github.io/proto-assets/images/tool/ccd_lookup/hero.png" alt="CCD Lookup" /><div class="tool-org-badges page-hero-badges"><a href="/docs/tools/organizations/pdbe" class="tool-org-badge" style={{background: "#2C7C7C"}} title="PDBe"><img src="https://mintcdn.com/bio-pro/UeudeF7pW-Dj-pIN/assets/images/cached/1cde4b3519c2.png?fit=max&auto=format&n=UeudeF7pW-Dj-pIN&q=85&s=34b643a9cdfce89670b7c1fc5dcfa123" alt="" class="tool-org-badge-logo" width="200" height="200" data-path="assets/images/cached/1cde4b3519c2.png" /> PDBe</a> <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> <a href="/docs/tools/organizations/wwpdb" class="tool-org-badge" style={{background: "#2C3E50"}} title="wwPDB"><img src="https://mintcdn.com/bio-pro/UeudeF7pW-Dj-pIN/assets/images/cached/88a5b31e96bc.png?fit=max&auto=format&n=UeudeF7pW-Dj-pIN&q=85&s=2d9e4a666983b3ddf8d430eb1c9dc824" alt="" class="tool-org-badge-logo" width="200" height="200" data-path="assets/images/cached/88a5b31e96bc.png" /> wwPDB</a></div></div>

<Note>
  **License:** CCD Lookup retrieves data from the wwPDB Chemical Component Dictionary, distributed under CC0-1.0 (public domain; no attribution required). The client wrapper code is Apache-2.0-licensed. Please refer to [the data terms](https://www.wwpdb.org/about/usage-policies) for full terms.
</Note>

<p class="entity-disclaimer">Proto is not affiliated with PDBe, EMBL-EBI, and wwPDB. This toolkit is open source and builds on the implementations produced by these organizations. Product names, logos, and trademarks are the property of their respective owners.</p>

<hr class="entity-rule" />

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

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

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

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

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

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

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

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

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

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

    <span class="website-url">wwpdb.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.1186/s13321-023-00786-w" target="_blank" class="tab-panel paper-panel" data-tab="paper-ccd-lookup">
  <div class="paper-info">
    <div class="paper-title">PDBe CCDUtils: an RDKit-based toolkit for handling and analysing small molecules in the Protein Data Bank</div>
    <div class="paper-meta">Ibrahim Roshan Kunnakkattu, Preeti Choudhary, ... Sameer Velankar</div>
    <div class="paper-meta paper-venue">Journal of Cheminformatics (2023)</div>
  </div>

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

<div class="tab-panel cite-panel" data-tab="cite-ccd-lookup">
  <div class="cite-code-wrap">
    ```bibtex theme={null}
    @article{kunnakkattu2023pdbeccdutils,
      title={{PDBe} {CCDUtils}: an {RDKit}-based toolkit for handling and analysing small molecules in the {Protein Data Bank}},
      author={Kunnakkattu, Ibrahim Roshan and Choudhary, Preeti and Pravda, Lukas and Nadzirin, Nurul and Smart, Oliver S. and Yuan, Qi and Anyango, Stephen and Nair, Sreenath and Varadi, Mihaly and Velankar, Sameer},
      journal={Journal of Cheminformatics},
      volume={15},
      number={1},
      pages={117},
      year={2023},
      publisher={BioMed Central},
      doi={10.1186/s13321-023-00786-w}
    }
    ```
  </div>

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

<a href="https://github.com/evo-design/proto-tools/tree/47e34afa5ea240a3b406e323dc38aa5dc85f223e/proto_tools/tools/database_retrieval/ccd_lookup" target="_blank" class="tab-panel source-panel" data-tab="source-ccd-lookup">
  <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/ccd\_lookup</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/database_retrieval/ccd_lookup/examples/example.ipynb" target="_blank" class="tab-panel notebook-panel" data-tab="notebook-ccd-lookup">
  <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-ccd-lookup">
  <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: 15 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: 2 commits"><img noZoom class="entity-contributor-avatar" src="https://avatars.githubusercontent.com/u/46211285?v=4&s=64" alt="" loading="lazy" /><span class="entity-contributor-login">dguo8412</span></a><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_ccd_lookup()` | Rich result for wwPDB Chemical Component Dictionary entries via pdbeccdutils: returns Fragment ob... | <a href="#api-run-ccd-lookup" 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/database_retrieval/ccd_lookup/ccd_lookup.py#L325" 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 [wwPDB Chemical Component Dictionary (CCD)](https://www.wwpdb.org/data/ccd) is the dictionary of every chemical component observed in the [Protein Data Bank](https://www.rcsb.org/): small-molecule ligands, modified amino acids, ions, cofactors, nucleotides, and sugars. Each component has a 1- to 5-character identifier (for example `ATP` for adenosine triphosphate, `HEM` for heme, `MG` for magnesium ion, `SEP` for phosphoserine), and each entry stores atoms, bonds, formula, IUPAC name, descriptors (SMILES / InChI / InChIKey), release status, and, for modified residues, a parent component (for example `SEP` to `SER`).

Cross-references via [UniChem](https://www.ebi.ac.uk/unichem/) link CCD entries to external chemistry databases ([DrugBank](https://go.drugbank.com/), [ChEMBL](https://www.ebi.ac.uk/chembl/), [PubChem](https://pubchem.ncbi.nlm.nih.gov/), [ChEBI](https://www.ebi.ac.uk/chebi/)), so the same molecule can be looked up across resources. The tool reads a bundled copy of the CCD `components.cif` ([Kunnakkattu et al., 2023](https://doi.org/10.1186/s13321-023-00786-w)) loaded via [`pdbeccdutils.core.ccd_reader`](https://pdbeurope.github.io/ccdutils/). SMILES inputs are canonicalized with [RDKit](https://www.rdkit.org/) and matched against an index built over the bundled dictionary by canonical SMILES and InChIKey. Records and their provenance come directly from the wwPDB Chemical Component Dictionary, distributed by [PDBe](https://www.pdbe.org/).

### Learning Resources

* [PDBe CCDUtils documentation](https://pdbeurope.github.io/ccdutils/) (PDBe) - official documentation for the underlying library, covering the CCD reader, descriptors, and depiction.
* [Chemical Component Dictionary](https://www.wwpdb.org/data/ccd) (wwPDB) - the reference description of the CCD, its identifiers, and what each entry stores.
* [UniChem](https://www.ebi.ac.uk/unichem/) (EMBL-EBI) - the cross-reference service used to map CCD entries to external chemistry databases.

## Tools

<a name="api-run-ccd-lookup" />

<div class="tool-section-card tool-section-card--lookup">
  ### CCD Lookup (`ccd-lookup`)

  Enriches wwPDB Chemical Component Dictionary entries. Accepts CCD codes (such as `"ATP"`) or SMILES strings, in mixed batches, and returns a `CcdLookupOutput` containing a `Ligands` collection plus parallel `CcdEnrichment` records: formula, descriptors, parent component, RDKit physicochemical properties, optional UniChem cross-references, and optional PDB usage.

  #### API Reference

  <div class="api-model-section api-input-section">
    <a href="https://github.com/evo-design/proto-tools/blob/47e34afa5ea240a3b406e323dc38aa5dc85f223e/proto_tools/tools/database_retrieval/ccd_lookup/ccd_lookup.py#L154" 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: CcdLookupInput">
      <ParamField path="identifiers" type="List[string]" required>
        CCD codes (e.g. `"ATP"`) or SMILES strings. A single string is normalized to a list.
      </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/database_retrieval/ccd_lookup/ccd_lookup.py#L178" 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: CcdLookupConfig">
      <ParamField path="include_cross_references" type="boolean" default="False">
        Fetch UniChem cross-references (DrugBank/ChEMBL/PubChem/etc. IDs). Requires network. Default: False.
      </ParamField>

      <ParamField path="include_pdb_usage" type="boolean" default="False">
        Fetch PDB structures containing each ligand from the RCSB search API. Requires network. Default: False.
      </ParamField>

      <ParamField path="sanitize" type="boolean" default="True">
        Sanitize the parsed RDKit molecule. Disable only for CCD entries with unusual valences. Default: True.
      </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/database_retrieval/ccd_lookup/ccd_lookup.py#L206" 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: CcdLookupOutput">
      <ResponseField name="results" type="List[CcdLookupResult]">
        One entry per input identifier, in input order, each holding the resolved `Fragment` and its CCD-specific metadata (formula, descriptors, release status, optional network data).

        <Expandable title="CcdLookupResult">
          <ResponseField name="fragment" type="Fragment" required>
            The ligand built for this identifier, carrying the CCD code when one could be resolved to a usable structure. `fragment.ccd_code` is the single source of truth for which CCD entry this is.
          </ResponseField>

          <ResponseField name="formula" type="string">
            Chemical formula (e.g. `"C10 H16 N5 O13 P3"`).
          </ResponseField>

          <ResponseField name="formula_weight" type="number">
            Formula weight in Daltons.
          </ResponseField>

          <ResponseField name="inchi" type="string">
            InChI string as recorded in the CCD.
          </ResponseField>

          <ResponseField name="inchikey" type="string">
            InChIKey as recorded in the CCD.
          </ResponseField>

          <ResponseField name="released" type="boolean">
            True iff release status is `REL`.
          </ResponseField>

          <ResponseField name="release_status" type="string">
            Raw `pdbx_release_status` value.
          </ResponseField>

          <ResponseField name="parent_ccd_code" type="string">
            CCD code of the canonical parent (`mon_nstd_parent_comp_id`), if this component is a derivative.
          </ResponseField>

          <ResponseField name="physchem_properties" type="Dict[string, number]">
            Snake\_case RDKit descriptors (`molecular_weight`, `logp`, `tpsa`, `num_h_donors`, etc.).
          </ResponseField>

          <ResponseField name="cross_references" type="Dict[string, List[string]]">
            UniChem cross-references keyed by source database (e.g. `{"chembl": ["CHEMBL14249"], ...}`). Populated only when `include_cross_references=True`; requires network.
          </ResponseField>

          <ResponseField name="pdb_structures" type="array">
            PDB IDs of structures containing this ligand. Populated only when `include_pdb_usage=True`; requires network.
          </ResponseField>

          <ResponseField name="resolved_without_structure" type="boolean">
            True when the identifier matched a CCD entry whose structure could not be rebuilt. The CCD metadata below is populated, but `fragment.ccd_code` is None and the entry counts as unresolved.
          </ResponseField>

          <ResponseField name="warnings" type="List[string]">
            Non-fatal warnings emitted while reading the entry.
          </ResponseField>

          <ResponseField name="errors" type="List[string]">
            Errors that prevented full parsing.
          </ResponseField>
        </Expandable>
      </ResponseField>
    </Accordion>
  </div>

  #### Applications

  Use this for user-facing enrichment workflows such as notebooks, scripts, dashboards, and ligand reports. Resolve a CCD code or SMILES to a canonical `Fragment` with formula, descriptors, and physicochemical properties before structure prediction or docking, map a ligand to external chemistry databases via UniChem, or discover which experimental structures contain a ligand before structure-based work. The returned `Ligands` collection feeds directly into tools that take ligands as input, and PDB identifiers from `pdb_structures` pair naturally with the [PDB](https://bio-pro.mintlify.app/tools/database-retrieval/pdb) tool.

  #### Usage Tips

  * **For per-fragment SMILES-to-CCD lookups, use `proto_tools.entities.ligands.ccd_utils.map_smiles_to_ccd_code` instead.** It runs the same lookup in the current Python process, without the subprocess startup this tool incurs, so when you are not using the persistent tool context it can be much faster.
  * **A SMILES with no CCD match returns `ccd_code=None` rather than an error.** Check `enrichment.ccd_code is not None` before treating an entry as found. `result.num_unresolved` gives the batch-level count.
  * **`parent_ccd_code` is populated only when the CCD entry declares a canonical parent component.** Modified residues like `SEP` (phosphoserine, parent `SER`), `MSE` (selenomethionine, parent `MET`), or `PTR` (phosphotyrosine, parent `TYR`) carry a parent code. Most small-molecule ligands have no parent and return `None`.
  * **`pdb_structures` can be very large.** For common cofactors and ions (`HEM`, `ATP`, `NAG`, `MG`, `ZN`) the list runs to many thousands of PDB IDs. It may be helpful to process it in chunks rather than loading every entry at once when you pass it to a downstream step.
</div>

## Toolkit Notes

These apply to every CCD Lookup tool in this toolkit (`ccd-lookup`).

* **Offline by default.** The tool reads a bundled copy of the wwPDB CCD and runs fully offline. Only `include_cross_references` (UniChem) and `include_pdb_usage` (RCSB) require network access, and both default to off.
* **One-time data download.** First use downloads the roughly 70 MB compressed CCD bundle (`components.cif.gz`) to `$PROTO_MODEL_CACHE/ccd_lookup/` and decompresses it to a `components.cif` of roughly 500 MB, which grows as the dictionary grows. Subsequent runs reuse the decompressed file.

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