Protein Structure Viewer
Operator: Abdulla Al Fahad. How tools are built and checked
A coordinate file is a list of atoms with positions, and nothing about it is visible until it is drawn. Desktop viewers do that well but need installing, and many online viewers want a database ID and fetch the structure for you, which is no help when the file is your own model, a docking result or an unpublished crystal structure.
This page draws a .pdb or mmCIF file that you choose from your computer. It never looks anything up: there is no PDB ID box, and the only thing downloaded is the viewer itself, NGL 2.5.0, which is served from this site and is about 1.3 MB.
You can switch between cartoon, ball and stick, surface and spacefill, colour by chain, residue type, position along the chain, B-factor, secondary structure or element, click two atoms to read the distance between them, pick residues from the sequence, and save a PNG at two to four times the size of the view.
Key features
- Four styles: cartoon, ball and stick, molecular surface and spacefill, with ligands and ions optional and water off by default
- Six colour schemes: chain, residue type, rainbow along the chain, B-factor, secondary structure and element
- Distance between any two clicked atoms, drawn as a labelled line and reported in ångströms with each atom's chain, residue and B-factor
- Sequence panel per chain: click a residue to highlight it in sticks and centre the view on it
- PNG export at 2, 3 or 4 times the view, with a white or black background
- Checks before loading: text only, a known extension, a size limit of 80 MB, 600,000 atoms and 100,000 residues (30,000 for C-alpha-only traces), with a warning above 200,000 atoms, 30,000 residues or 15,000 trace-only residues
File limits, colouring schemes and how distances are measured
Accepted extensions are .pdb and .ent for the Protein Data Bank format and .cif, .mmcif and .mcif for mmCIF. The file is read as text and must contain ATOM or HETATM records. Files with NUL bytes or many control characters are refused as binary. The sequence panel lists residues that NGL classifies as protein or nucleic acid, with one-letter codes, and shows X for anything it does not map. NGL needs a _chem_comp table to read an mmCIF, which files written by small scripts often lack; the page adds one, typing each residue name as peptide, DNA, RNA or non-polymer, before handing the file over.
B-factor is the column near the end of each ATOM line. In a crystal structure it measures how much an atom's position is smeared; in a predicted model it often holds a confidence score instead, with the scale reversed, so a colour ramp that reads as flexible in one file reads as confident in another. AlphaFold models store pLDDT (0 to 100, higher is more confident) in that column.
How it works
NGL parses the structure, builds the chosen representation on the GPU through WebGL, and reports which atom lies under the pointer when you click. The page keeps the last two atoms you clicked, computes the straight-line distance between their coordinates and asks NGL to draw a distance line between them. Surfaces are built only for structures up to 150,000 atoms; larger ones fall back to cartoon.
When this helps
- A student opens a homology model and colours by B-factor to see which loops the modelling program marked as low confidence.
- A chemist checks that a docked ligand sits 3.2 Å from a catalytic residue by clicking the two atoms, then saves a 4x PNG for a figure.
Opening a file
- Drop a PDB or mmCIF file, or load the simulated helices.
- Choose a style and a colour scheme, and decide whether to show ligands, ions and water.
- Click one atom, then a second, to measure; click a third to start a new pair.
- Click residues in the sequence panel to highlight and centre them.
- Pick a PNG size and download the image.
Example
Two 20-residue polyalanine helices, as the simulated example builds them
200 ATOM records, chains A and B, built from ideal alpha-helix geometry (phi -57, psi -47), chain B moved 10 Å sideways
Style: Cartoon, colour: By chainCounts and measurements
Atoms: 200, polymer residues: 40, chains: A, B
Click the alpha carbon of residue 10 in chain A, then in chain B: distance 10.00 Å
Within one helix: alpha carbon i to i+3 is 5.23 Å and i to i+4 is 6.40 Å; the carbonyl oxygen of residue i is 3.09 Å from the nitrogen of residue i+4Limits
A surface needs the whole structure rebuilt and can take seconds on a large protein; the 150,000-atom limit exists for that reason, and a cartoon is shown instead above it.
Clicking picks atoms from what is drawn. A cartoon hides the side chains, so to measure between side-chain atoms switch to ball and stick or spacefill first.
- With Show ligands and ions on, switch the protein to ball and stick when you need to see pocket residues beside a ligand; the ligand is already drawn in sticks.
- Use a black background and a rainbow along the chain to check that a chain is continuous: a jump in colour marks a gap in the numbering.
Common errors and how to fix them
- Choose a .pdb, .ent, .cif or .mmcif file.
- Rename a structure file that has another extension, such as .txt, to .pdb or .cif first; the extension tells the reader which format to use.
- No ATOM or HETATM records were found, so there is no structure to show.
- The file may hold only header records or be a different format, for example a PDBQT or an MTZ map. Export the coordinates as PDB or mmCIF.
- The file is 120 MB; the limit is 80 MB.
- Strip waters, other models or alternate locations in a structure editor, or load a single chain.
- More than 600,000 atoms; the viewer would not stay responsive.
- Large assemblies such as a whole virus capsid exceed what a browser viewer handles. Open an asymmetric unit or a biological subunit instead.
- The file has 120,000 residues with a C-alpha or phosphorus atom; above 100,000 the viewer froze the page.
- A trace this long is rarely a single real chain. Check that the file is not several copies stacked in one model, and open a smaller part.
- The file has 40,000 residues but only 40,000 atoms, so it is a C-alpha or phosphorus trace.
- Coarse models with one atom per residue draw slowly, so they are limited to 30,000 residues. Split the model by chain or open the all-atom version if you have it.
- That file looks binary (it has NUL bytes). Choose a plain-text PDB or mmCIF file.
- Compressed (.gz) and binary formats such as BinaryCIF or MMTF are not read. Unzip the file, or download the plain .pdb or .cif version.
- The viewer could not read this mmCIF: a category it needs is missing or malformed.
- Export the structure again with its _atom_site table and _entity and _struct_asym tables, or convert it to PDB with a structure editor.
Best practices
- Strip waters, alternate locations and unneeded models in a structure editor before loading a large file; the page then spends its limit on the chains you care about.
- For a long figure session, pick the style first and the colour scheme second: switching to a new style rebuilds the drawing, while recolouring does not need a new file.
Where the size limits come from
The limits were set by timing the page rather than by the library's maximum. An all-atom structure of 600,000 atoms and about 75,000 residues drew without a pause longer than about a third of a second, so that is the ceiling. A single-chain trace of 120,000 residues, by contrast, froze the page for roughly 12 seconds while it was drawn, which is why files with more than 100,000 C-alpha or phosphorus atoms are refused and anything above 30,000 residues or 200,000 atoms gets a warning. Sparse traces are slower still: a C-alpha-only chain paused the page for about half a second at 10,000 residues, a second at 30,000 and two seconds at 40,000, while an all-atom file with 40,000 residues did not pause it noticeably, so traces with fewer than three atoms per residue get a warning above 15,000 residues and are refused above 30,000. The timing was done with software WebGL, so a machine with a graphics card is usually faster.
Frequently asked questions
How are distances calculated?
As the straight-line distance between the x, y and z coordinates of the two atoms in the file, in ångströms. For the simulated helices, the alpha carbon of residue 10 in each chain is 10.00 Å apart because chain B is the same helix moved exactly 10 Å.
Can I load a structure by PDB ID?
No. The page reads files from your computer and never fetches structures, so a downloaded .pdb or .cif is needed. That also means the page works with models that are not in any database.
How do I read an AlphaFold model coloured by B-factor?
AlphaFold files put the per-residue pLDDT confidence score in the B-factor column, so colouring by B-factor shows confidence, not motion. NGL's ramp runs low to high, so the low-confidence loops are at one end of the scale and the confident core at the other; check the range against the values you see when you click atoms, because the page does not print a legend. A crystal structure uses the same column for atomic displacement, where a high value means a smeared, flexible atom.
Why will my script-written mmCIF not open?
NGL's reader fails on an mmCIF with no _chem_comp table, and minimal files written by a script usually lack one, so the page appends a table typing each residue name before loading. If the file still fails, the message says a required category is missing: the _atom_site loop must have coordinates and a residue-name column, and files with no atoms at all are refused earlier.