Input Formats¶
xyzrender reads bond connectivity directly from file where available (mol, SDF, MOL2, PDB, SMILES, CIF). The parser is selected by file extension.
XYZ¶
Standard XYZ files:
xyzrender molecule.xyz
extXYZ (with Lattice= header) is handled automatically — the unit cell box, ghost atoms, and axis arrows are enabled without any extra flags. See Crystal Structures.
QM Input Files¶
Render directly from computational chemistry input files. Coordinates and charge/multiplicity are extracted automatically.
xyzrender calc.com # Gaussian
xyzrender calc.gjf # Gaussian
xyzrender calc.inp # ORCA / CP2K / GAMESS
xyzrender calc.nw # NWChem
xyzrender calc.in # Q-Chem (or QE / ABINIT — auto-detected)
xyzrender calc.fdf # SIESTA
xyzrender calc.abi # ABINIT
xyzrender calc.coord # Turbomole (Bohr auto-detected)
For Turbomole and other codes that use Bohr units, conversion is auto-detected. Use --bohr to force conversion:
xyzrender calc.coord --bohr
Charge and multiplicity are extracted from the input file where possible (ORCA * xyz C M, Gaussian charge/mult line, NWChem charge directive, Q-Chem $molecule, Psi4 molecule {}). Override with -c / -m.
If coordinates are in an external file (e.g. ORCA * xyzfile 0 1 mol.xyz), the referenced file is read automatically.
QM Output¶
ORCA (.out), Gaussian (.log), Q-Chem (.out) — format is auto-detected from file content via cclib:
xyzrender calc.out
xyzrender calc.log
Use --charge and --multiplicity if needed for bond detection:
xyzrender calc.out -c -1 -m 2
See Transition States and NCI for transition state rendering from QM output.
Cheminformatics formats¶
xyzrender molecule.sdf # SDF — bonds from file
xyzrender molecule.mol # mol — bonds from file
xyzrender molecule.mol2 # MOL2 — Tripos aromatic bonds
xyzrender structure.pdb # PDB — ATOM/HETATM + CONECT records
PDB with CRYST1: if the PDB contains a CRYST1 record, the unit cell is parsed and crystal rendering is used automatically.
Multi-record SDF: use --mol-frame N to select a record (default: 0):
xyzrender multi.sdf --mol-frame 1
SMILES¶
Requires pip install 'xyzrender[smi]' (rdkit). Embeds a SMILES string into 3D using ETKDGv3 + MMFF94.
xyzrender --smi "C1CCCCC1" --hy -o cyclohexane.svg
An XYZ file of the optimised 3D geometry is automatically saved alongside the rendered image (e.g. cyclohexane.xyz).
CIF¶
Requires pip install 'xyzrender[cif]' (ase):
xyzrender structure.cif
Cube files¶
Cube files contain both molecular geometry and a 3D volumetric grid. Used for molecular orbitals (Molecular Orbitals), electron density and ESP (Electron Density and ESP), and NCI surfaces (NCI Surface).
xyzrender homo.cube --mo
xyzrender dens.cube --dens
xyzrender dens.cube --esp esp.cube
xyzrender dens.cube --nci-surf grad.cube
xyzrender sl2r.cub --nci-surf dg_inter.cub --iso 0.005
Periodic structures¶
VASP, Quantum ESPRESSO, SIESTA, ABINIT, and CP2K periodic input files are auto-detected — the unit cell, ghost atoms, and axis arrows are enabled automatically:
xyzrender NV63.vasp # VASP POSCAR/CONTCAR
xyzrender NV63.in # Quantum ESPRESSO pw.in
xyzrender calc.fdf # SIESTA FDF
xyzrender calc.abi # ABINIT
xyzrender calc.inp # CP2K (cell from &CELL block)
No extra dependencies or flags required. See Crystal Structures.
Re-detecting bonds¶
--rebuild discards file connectivity and re-runs xyzgraph distance-based detection:
xyzrender molecule.sdf --rebuild
Format-specific flags¶
Flag |
Description |
|---|---|
|
Embed a SMILES string into 3D (requires rdkit) |
|
Record index in multi-molecule SDF (default: 0) |
|
Ignore file connectivity; re-detect bonds with xyzgraph |
|
Molecular charge |
|
Spin multiplicity |
|
Input coordinates are in Bohr (force conversion to Angstrom) |