MolX
MolX is an interactive protein-structure viewer for graphical terminals. It opens PDB files, renders a smooth protein ribbon as a high-resolution raster, and lets you rotate and zoom without leaving the command line. It also connects to the ESM Metagenomic Atlas to fetch existing predictions, display predicted aligned error (PAE), or fold a short amino-acid sequence with the public ESMFold service.
The viewer uses the repository's rstui runtime and automatically selects
Kitty graphics, iTerm2 images, Sixel, or an ANSI truecolor fallback.
Build and run
Install the molx command from this checkout:
PDB viewer
MolX reads the first model in a PDB file, keeps the primary alternate location,
shows ATOM and HETATM records, and constructs a gap-aware ribbon/cartoon
from the protein backbone. The ribbon uses backbone torsion angles to recognize
alpha helices and beta strands, smooths the path between C-alpha atoms, and
adds arrowheads to beta strands. Available representations are ribbon,
atoms, and combined; backbone remains accepted as an alias for ribbon.
Controls:
- Drag with the left mouse button, or use arrow keys /
h,j,k,l, to rotate. - Use the mouse wheel or
+/-to zoom. - Press
mto cycle molecular representations. - Press
cto cycle chain, element, and pLDDT/B-factor colors. - Press Space to toggle automatic rotation.
- Press
rto reset the camera andqor Escape to quit.
For ESMFold structures, --color auto selects the pLDDT palette used by the
Atlas: blue is high confidence and red is low confidence.
ESM Atlas
Download an existing prediction by MGnify protein identifier:
Fold one sequence using the public ESMFold endpoint:
Existing output files are preserved unless --force is passed. The public API
is rate-limited and intended for a small number of interactive predictions, not
bulk folding. MolX limits requests to 1,024 residues and uses a five-minute
request timeout. The Atlas data is distributed under CC BY 4.0; retain the
appropriate attribution when redistributing downloaded structures.
atlas fetch --view retrieves the entry's PAE matrix and displays it in a
right-hand heatmap next to the 3D ribbon. The live atlas fold endpoint returns
a PDB prediction but no PAE matrix, so its viewer panel reports PAE as
unavailable.
Official resources:
Current scope
This first version focuses on local PDB viewing and stable public ESM Atlas operations. mmCIF parsing, residue selection, surfaces, ligand bond inference, measurements, and sequence/structure search are natural next modules.