Molecule viewer
| Document kind | chemistry |
| Drawn from | a file — it can also be previewed in the file manager |
| Formats that open here | MDL Molfile (.mol) · SDF (.sdf, .sd) · SMILES (.smi, .smiles) · MDL reaction (.rxn) |
| Refuses to draw below | 200px wide |
What it draws
The structure itself — atoms, bonds, wedges, charges, stereo labels — laid out and drawn by RDKit, the cheminformatics toolkit the field actually uses. Not a picture of a structure this app invented a layout for: the depiction is the toolkit's own, so a molecule looks here as it looks anywhere else RDKit draws it.
A reaction is drawn whole — reactants, arrow, products — rather than as a list of molecules.
Ampicillin from the bundled PubChem records, with the SMARTS query C(=O)N highlighting both amide bonds: the side chain, and the four-membered β-lactam that makes it a penicillin. The bar above carries every depiction choice; the readings across the top are computed from the structure on screen.
What opens in it
Four formats are read directly, chosen from the file's contents rather than its name, so a mislabelled file still opens as what it is:
| Format | What it holds |
|---|---|
MDL Molfile (.mol) | one structure, with 2D coordinates |
SDF (.sdf, .sd) | many structures separated by $$$$, each able to carry tagged data |
SMILES (.smi) | one structure per line, its name after the whitespace |
MDL reaction (.rxn) | reactants and products, with the counts line saying which is which |
An SDF and a SMILES file are containers: the viewer splits them and gives you a Structure picker over the records. A record the file names is shown by that name; a record it does not name is shown by its position, never by a label invented to fill the gap.
Eight more are read by conversion, record by record, into those four: Tripos MOL2, XYZ
coordinates (bonds perceived from the distances), ChemDraw CDXML, Chemical Markup Language
(CML), Ketcher KET, InChI, AutoDock PDBQT docking poses (each pose a record, its score as a
data field) and HELM peptides. A record the reader cannot read is kept rather than dropped, with
the reason in its Not read field, so the numbering still matches the file. A MOL2 that writes its
element types in capitals (CL, BR), which RDKit's own MOL2 reader refuses, is read with the
element title-cased, and the record names the types it changed.
What this computes
The depiction is RDKit's own, so a molecule looks here as it looks anywhere else RDKit draws it, with its bond lines drawn at the ACS 1996 proportion of the bond length, so the lines keep their weight against the atom labels at any size. The readings across the top are computed from the structure on screen, by the same toolkit, and they change when you change the record — twelve of them, each named the way it is cited:
- Average mass and monoisotopic mass — the second is the one that matters for mass spectrometry, and they are reported separately rather than merged into a single "molecular weight".
- cLogP (Crippen) — calculated octanol/water partition coefficient by the Crippen atom-contribution method, i.e. an estimate of lipophilicity, not a measurement.
- TPSA (N and O only) — topological polar surface area, in the definition that counts nitrogen and oxygen contributions, which is the convention most published cut-offs were derived under.
- H-bond donors and H-bond acceptors.
- Rotatable bonds, rings and aromatic rings counted separately.
- Fraction sp³ carbon, the saturation measure used as a complexity/developability proxy.
- Stereocentres (atom stereocentres).
- Labute ASA, the approximate accessible surface area from Labute's atom contributions.
Also computed for anything that opens: an InChI and its key, even though an InChI cannot be read as an input here.
A reaction has no descriptors, and that is a real answer rather than a blank. The readings are
omitted for a .rxn rather than being computed over its reactants as though the reaction were one
molecule.
Structure perception is computed too, and it is what makes the drawing checkable: aromaticity (with a Kekulé view available), explicit versus implicit hydrogens, stereo labels, formal charges, and an optional CoordGen layout when the coordinates in the file are poor or absent. Each is a switch, because each is an interpretation of the file rather than a fact in it.
Reading it
- A record that names itself can be opened at its source. Everything drawn and calculated here
happens on your own machine. When the record declares a database id of its own — a PubChem CID, a
ChEBI id, or the CID an
.smifile writes beside the molecule — that compound's page can be opened from the canvas, on that exact compound rather than on a search. A molecule that declares no id has no page to open, and says so instead: its structure is never sent anywhere to find one. - Hydrogens are a choice, and the default matters. As written draws the hydrogens the file itself carries — a record downloaded from PubChem writes every one of them out, a SMILES string writes none. Explicit adds them all; Implicit strips them back into the atoms they belong to. The default is implicit, and that is not a style preference: the properties beside the drawing are defined against the implicit form, and a structure carrying explicit hydrogens reports a higher rotatable-bond count because a hydroxyl oxygen holding a hydrogen is no longer a terminal atom.
- Kekulé or aromatic. An aromatic ring can be drawn as a circle or as alternating single and double bonds. Neither is more correct; the second is what you want when checking a tautomer or comparing against a figure drawn that way.
- Stereo labels annotate every stereocentre and double bond with its R/S or E/Z assignment, beside the wedges rather than instead of them.
- Atom numbers put an index on every atom, so a substructure match or a reported position can be found on the drawing.
- CoordGen layout re-lays the molecule out with Schrödinger's CoordGen instead of RDKit's own algorithm. Usually cleaner for fused ring systems — steroids, tetracyclines — and it discards the coordinates the file shipped, which is sometimes exactly what you want and sometimes not.
- Highlight SMARTS marks every match of a substructure query.
C(=O)Nfinds amide bonds,[OH]hydroxyls,c1ccccc1a benzene ring. A pattern RDKit cannot parse says so; a valid pattern that matches nothing reports no match, which is an answer rather than a failure.
Controls
| Control | What it does |
|---|---|
| Structure | Which record of the file to draw. Disabled, with that reason, on a single-structure file. |
| Hydrogens | As written · Explicit · Implicit. |
| Kekulé | Aromatic rings as alternating bonds instead of a circle. |
| Stereo labels | R/S and E/Z annotations on the drawing. |
| Atom numbers | An index on every atom. |
| CoordGen layout | Re-lay out with CoordGen, discarding the file's coordinates. |
| Zoom | Re-draw between 0.5× and 4×. RDKit lays the structure out again at that size rather than stretching a picture, so bond lengths and labels stay in proportion; the view scrolls once the drawing is larger than it. |
| Rotate | Turn the whole depiction, in 15° steps. |
| Highlight SMARTS | Highlight every match of a substructure query. |
All of them survive into the read-only preview: each changes how the structure is read, and none writes to the file. On a reaction, the ones that have no meaning there — Hydrogens, Stereo labels and CoordGen layout — are shown greyed with the reason rather than hidden, so a control that exists for molecules never looks as though it has gone missing.
A structure from the bundled SMILES list. A .smi carries no coordinates at all, so this layout is entirely RDKit's — and the quaternary nitrogen with no counter-ion is what the +1 net charge on the bar is reading.
When a query cannot be read
A SMARTS is a query language, not a SMILES, and they look alike enough to be mixed up. Type something RDKit cannot parse and the viewer says so, with the difference spelled out — it does not quietly highlight nothing, which would read as "this molecule has no amides" rather than "that was not a pattern".
C(=O is missing its closing bracket. The structure keeps drawing, the bar reads unreadable, and the message names the difference between the two languages.
What it tells you about the molecule
Two sets of numbers, kept deliberately apart.
Computed from the structure, by RDKit: molecular formula in Hill order, net charge, atom and bond counts, average and monoisotopic mass, cLogP, TPSA, hydrogen-bond donors and acceptors, rotatable bonds, rings, aromatic rings, fraction of sp³ carbon, stereocentres — with unspecified ones called out, because a stereocentre with no configuration means the record describes a mixture — canonical SMILES, and InChI with its key.
Declared by the file, verbatim: every > <TAG> data field an SDF record carries, and the extra
columns of a SMILES line.
They are not merged, and that is the point: two readouts of the same quantity can legitimately differ. A database's topological polar surface area counts sulfur; RDKit's default counts nitrogen and oxygen only, so ampicillin reads 112.7 Ų here and 138.0 Ų there — about 25 Ų per divalent sulfur, and both are right under their own definition. Merging the tables would make one of the two silently win, and you would have no way to tell which number you were looking at.
Reactions
A .rxn draws as a reaction: components in a row with the arrow between them, using the layout the
file declares.
ATP + H₂O = ADP + phosphate + H⁺, the phosphoryl transfer behind every ligation and kinase step, drawn from the reaction file Rhea publishes for it.
One thing worth knowing, because it is common in biochemistry and it used to break the drawing: a reaction whose participants include a bare ion — a lone proton, most often — carries a component with no size at all, and a layout engine given such a component cannot work out a scale for the rest. When that happens the reaction is re-read from its components' own structures and laid out fresh, so the drawing fills the canvas instead of collapsing to a smudge. Nothing chemical is lost: the participants, their charges and any atom mapping all survive.
What you can take out of it
Two scopes, and the Export list keeps them apart: the one record you are looking at, and the whole file. That distinction matters most here: an SDF is a concatenation, often of thousands of structures, and a reader who has paged to structure 417 wants 417, while one who annotated a library wants the library back.
The record on screen:
| What you get | What is in it |
|---|---|
| MDL Molfile | This record's connection table, copied from the file exactly as written — atoms, bonds and coordinates. Data fields are not part of a molfile, so an SDF record's tagged data is dropped, and the file says so |
| SMILES | The canonical SMILES computed for the depiction on screen. No coordinates, so the two-dimensional layout is not in it |
| InChI | The IUPAC identifier, with its InChIKey on the second line — the hash to search a database with |
| Data fields | The tagged data this record carries, in the order the file writes them |
The canonical forms are the ones computed for the drawing, not recomputed on the way out, so what you export and what you are looking at cannot be different molecules. Where the toolkit refused to sanitise a record — an inconsistent valence, charge or aromaticity — no canonical form is offered for it, and the reason is given rather than an empty file. The record's own connection table is still available in that case, because the file being unreadable to a toolkit does not make it unwritable.
A reaction file is not offered as a molfile: a reaction is not a molecule, and giving it a .mol
extension would misname it.
The whole file:
| What you get | What is in it |
|---|---|
| Whole file as SDF | Every record, named, with its own data fields and, added to each, its canonical SMILES and its descriptors under RDKit's own names: average and exact molecular weight, Crippen logP, TPSA, hydrogen-bond donors and acceptors, rotatable bonds, rings, aromatic rings, heavy atoms and fraction sp3 carbon. The values are the ones the Small molecule panel reports |
| Whole file as SDF V3000 | The same, in the extended connection table, which has no 999-atom limit |
| Whole file as SMILES | One record a line, canonical SMILES then its name. No coordinates and no data fields |
| Whole file as CXSMILES | One record a line, the canonical SMILES with the coordinates and enhanced stereo carried in its extension block, then its name. No data fields |
The file is written the way RDKit's own SD writer writes it, checked byte for byte against that writer over several thousand drugs and screening compounds. Two things it refuses, as that writer does: a record the toolkit cannot read is left out, and a data field whose value contains a blank line is dropped from its record, because a blank line is what ends a field in SDF. A reaction file offers none of these: it holds one reaction, not a library.
Where it appears
As a stage tab, and in the file manager preview. Both use the same renderer, so a structure reads the same way whichever door you came through. In the preview the box is the drawing only — the controls and the property rows are drawn by the host around it.
Performance and limits
- RDKit is loaded on the first structure file you open, never at startup, and once per session.
- Files over 64 MB are refused rather than loaded, with the size stated. An SDF splits cleanly on
its
$$$$lines, so filtering a large collection down first is straightforward. - A structure RDKit cannot sanitise — inconsistent valences, charges or aromaticity — is refused with that reason rather than drawn as a guess.
Provenance of correctness
Reading, layout and drawing are RDKit's, used as a library rather than reimplemented. The structures the viewer reads are checked against the databases that published them: for the bundled molecules, the InChI, InChIKey, molecular formula, net charge, monoisotopic mass, average mass and heavy-atom count computed here reproduce PubChem's own published values exactly, for every one. Where a number differs — topological polar surface area, hydrogen-bond acceptor counts — the difference is a difference of definition, and the readout says which definition it is using.
Related
A molecule in a project is usually the reagent the rest of the project is about. The bundled example is exactly that: the four selection agents whose resistance genes are annotated on the plasmids in the sequence starters, the inducer for the lac promoter those maps carry, and the ATP that drives the ligation the assembly tools simulate.