Overlay Comparison
OverlayViewer draws several structures in one frame of reference ā conformers, optimization steps, reactant and product.
The ethanol example starts aligned on its CāCāO backbone (atoms 0ā2), keeping the hydrogen differences visible. Turn Align (Kabsch) off to see the original conformer coordinates. For another molecule, choose the indices of its shared backbone; leaving Fit on atoms empty fits all atoms, including hydrogens, so the backbone need not overlap exactly.
Coloring
color_by |
Colors |
|---|---|
structure (default) |
One color per structure |
colormap |
Along the sequence with overlay_colormap (viridis, plasma, coolwarm, jet, rainbow, grayscale) |
element |
Element colors |
A colormap suits an optimization path:
trajectory = read("optimization.xyz", index=":")
OverlayViewer(trajectory, color_by="colormap", overlay_colormap="viridis", all_visible=True)
Alignment
align_structures=True Kabsch-fits every structure onto the first. By default
atoms are first matched element by element, so different atom orders still
align; reorder_atoms=False pairs atoms by index. align_indices="0-5" fits on
a subset (for example a shared ring) and moves the whole structure with it.
The Align switch in the sidebar toggles between original and aligned
coordinates.
Which structures and atoms
- The first three structures are visible at the start;
all_visible=Trueshows all, andvisible_indices=[0, len(trajectory) - 1]picks them. Every structure can be toggled, recolored and faded in the sidebar. index_list=[0, 1, 2]keeps the same atoms in every structure;index_list=[[0, 1, 2], [4, 5, 6]]gives one list per structure.- Structures are labelled with
atoms.info["name"]when set.