Rainbow mmCIF (VS Code Extension)


This extension provides enhanced syntax highlighting and visual aids for mmCIF (Macromolecular Crystallographic Information File) files, widely used in structural biology.
It is designed to make reading and editing complex mmCIF files effortless. Unlike standard syntax highlighters, this extension focuses on human-readable visualization of data blocks, inspired by Rainbow CSV.
Features
🌈 Rainbow Block Highlighting

All data items—whether in a loop_ or a single-item section—are treated as a unified Block.
- Category (e.g.,
_atom_site) and Item (e.g., .id) are clearly distinguished.
- Columns are automatically colored using a cycling rainbow palette to help you quickly align keys with their values.

ℹ️ Integrated Dictionary Hover

Gain instant access to the official PDBx/mmCIF dictionary metadata. Hover over any Category, Item, or data value to see its definition.
- Context-Aware: Dynamically displays documentation based on whether you hover over a Category, Item, or Value.
- Direct Links: Quick navigation to official wwPDB documentation for every tag.
For Category:

### _category_name
[Online Documentation](https://github.com/N283T/mmcif-rainbow-vscode/blob/HEAD/...)
---
Category Description...
For Item:

### _category_name.item_name
[Online Documentation](https://github.com/N283T/mmcif-rainbow-vscode/blob/HEAD/...)
---
Category : category_name
Attribute : attribute_name
---
Item Description...
For Value:

### _category_name.item_name
🔦 Interactive Highlighting

Highlight an entire column by placing your cursor on any part of it. This tracking makes it impossible to lose your place in dense data tables.


🧬 AlphaFold / ModelCIF Support

This extension provides specialized support for AlphaFold and other structure prediction model files that use the ModelCIF dictionary (mmcif_ma.dic).
Automatic Dictionary Detection
The extension automatically detects the dictionary type by reading _audit_conform.dict_name:
- PDBx/mmCIF (
mmcif_pdbx_v50.dic) - Standard experimental structures
- ModelCIF (
mmcif_ma.dic) - AlphaFold, ESMFold, and other predicted structures
pLDDT Confidence Coloring
For ModelCIF files, the B_iso_or_equiv column (which stores pLDDT scores in AlphaFold models) is automatically colored according to confidence levels:
| pLDDT Score |
Color |
Confidence |
| > 90 |
🔵 Dark Blue (#0053D6) |
Very high |
| 70-90 |
🩵 Light Blue (#65CBF3) |
Confident |
| 50-70 |
🟡 Yellow (#FFDB13) |
Low |
| < 50 |
🟠 Orange (#FF7D45) |
Very low |
This matches the standard AlphaFold color scheme, making it easy to visually assess model quality directly in your editor.
Installation
- Install from VS Code Marketplace
- Open any
.cif or .mmcif file. Highlighting and hover features will activate automatically.
- Or build from source:
npm install
npm run compile
Limitations
- File Size Limit: Due to VS Code's internal API limitations, extensions cannot access the content of files larger than approximately 50MB. For these massive files, rainbow coloring and hover features will be disabled.
Contributing
Issues and Pull Requests are welcome!