draw_mol: Plot 2D structure based on SMILES string

Description Usage Arguments Value Examples

View source: R/molecule_figures_rdkit.R

Description

Plot 2D structure based on SMILES string

Usage

1
draw_mol(smiles, filepath = NA, plot = TRUE, size = 600)

Arguments

plot

logical, if TRUE the molecule will be directly plot

size

size of the figure, default is 600

filenpath

path to file

Value

a png figure of the molecule, either saved to disk or directly plot

Examples

1
2
3
4
5
6
7
8
#You need to set anaconda environment prior to running RDKit code
reticulate::use_condaenv(condaenv = "my-rdkit-env", conda = "/Users/lrichter/miniconda3/bin/conda")

#draws molecule directly into plot pane
draw_mol("C[C@]1([C@H]2C[C@H]3[C@H](C(=O)C(=C([C@]3(C(=O)C2=C(C4=C1C=CC=C4O)O)O)O)C(=O)N)N(C)C)O")

in order to crop the white space around pictures ImageMagick can be used.
the command in windows is >magick mogrify -trim *.png

LarsRichter82/larspack documentation built on May 29, 2019, 12:03 p.m.