Molecular structure drawing
MolecularGraph.ballstick — Methodballstick(mol::UndirectedGraph; radii=0.3, bonddiameter=0.1)Represent mol as a ball-and-stick model in three dimensions. mol should have 3d atom positions represented in Angstroms. 3D SDF files can be downloaded from sites such as PubChem.
radii optionally specifies the radii of the balls, in Angstroms. bonddiameter optionally specifies the radii of the sticks, in Angstroms.
This function requires that you load one of the backends of the Makie/GLMakie/CairoMakie family.
MolecularGraph.spacefilling — Methodspacefilling(mol::MolGraph; radii="van der Waals")Represent mol as a space-filling (Calotte) model in three dimensions. mol should have 3d atom positions represented in Angstroms. (3D SDF files can be downloaded from sites such as PubChem.) The two supported options for radii are "van der Waals" and "covalent"; the former are available only for main-group elements, and the latter are available for all.
This function requires that you load one of the backends of the Makie/GLMakie/CairoMakie family.
MolecularGraph.stick — Methodstick(mol::UndirectedGraph; size=0.3)Represent mol as a stick model in three dimensions. mol should have 3d atom positions represented in Angstroms. 3D SDF files can be downloaded from sites such as PubChem.
size optionally specifies the width of the sticks, in Angstroms.
This function requires that you load one of the backends of the Makie/GLMakie/CairoMakie family.
MolecularGraph.wire — Methodwire(mol::UndirectedGraph; size=0.1)Represent mol as a wire-frame model in three dimensions. mol should have 3d atom positions represented in Angstroms. 3D SDF files can be downloaded from sites such as PubChem.
size optionally specifies the width of the bonds, in Angstroms.
This function requires that you load one of the backends of the Makie/GLMakie/CairoMakie family.
MolecularGraph.drawpng — Functiondrawpng(io::IO, mol::SimpleMolGraph, width::Int, height::Int; kwargs...)Generate molecular structure image as a PNG format.
width and height specifies the size of the image in px.
MolecularGraph.drawsvg — Methoddrawsvg(mol::SimpleMolGraph) -> StringGenerate molecular structure image as a SVG format string.
width and height specifies the size of the image (width and height attribute of svg tag).
MolecularGraph.html_fixed_size — Methodhtml_fixed_size(mol::SimpleMolGraph, width, height) -> HTML{String}Generate fixed-size HTML wrapper for the SVG element.
The width and height args can be numeric values (converted to px) or CSS strings like 100%.
MolecularGraph.html_grid — Methodhtml_grid(mols, cols::Int, rowheight) -> HTML{String}Generate grid layout HTML wrapper for the SVG elements.
cols - number of columns in the grid. rowheight - numeric value (converted to px) or CSS string like 100%.