renderSMILES.rcdk: Render SMILES into 2D image for plotting via rcdk

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/StructurePlotting.R

Description

This function uses the rcdk to parse the smiles into a mol, with options to switch aromaticity detection on or off and to define desired coordinates, as well as depiction control. Compatible only with rdck above 3.4.1. Default parameters produce the same as renderSMILES.rcdk.default. Output requires that plot.new has been called, i.e. this is designed to be used directly during plotting. Users with rcdk<3.4.1 should use renderSMILES.rcdk.default or renderSMILES.CDKdepict to view latest CDK updates. As opposed to older versions, kekulise=FALSE now produces strange behaviour for some SMILES.

Usage

1
2
3
renderSMILES.rcdk(smiles, kekulise=TRUE, coords=c(0,0,100,100),
width=200, height=200, zoom=1.3,style="cow", annotate="off", abbr="on",suppressh=TRUE,
showTitle=FALSE, smaLimit=100, sma=NULL)

Arguments

smiles

A valid SMILES code for rendering (e.g. "c1ccccc1").

kekulise

If TRUE, performs CDK aromaticiy detection, which can lead to undesirable plotting results with older versions. Setting FALSE renders the SMILES code as is but will plot aromatic structures with undefined bond orders.

coords

This is used to control the size of the image within the plot. Values c(xmin,ymin,xmax,ymax).

width

Defines width of depiction object

height

Defines height of depiction object

zoom

Controls the size of the image, default 2, increasing to 5 results in a large structure in the web browser. Warnings at zoom>=10.

style

The plotting style, one of 5 options ("cow","cob","bow","wob","nob"), i.e. color on white, color on black, black on white, white on black, neon on black. The appearance of SMARTS and codeannotate options change with style.

annotate

(optional) Features to interpret the structure. Default "none", other options Atom Numbers, Atom Mapping, Color Map, Atom Value ("number", "mapidx", "colmap", "atomvalue") respectively.

abbr

Default "off", this controls whether the structure is displayed "as is" "off" or whether groups ("groups"), reagents ("reagents") or both reagents and groups ("on") are abbreviated.

suppressh

Default TRUE suppresses the display of Hs. FALSE does the oppposite.

showTitle

Default FALSE turns title display off (no title is included)

smaLimit

sets the limit for SMARTS patterns to highlight

sma

(optional) SMARTS codes can be entered to highlight parts of the molecule.

Details

More information about aromaticity: https://github.com/CDK-R/cdkr/issues/49

Value

Returns an image for use during plotting

Author(s)

Emma Schymanski <emma.schymanski@uni.lu>

See Also

view.molecule.2d renderSMILES.CDKdepict

Examples

1
2
3
4
5
6
smiles <- "OS(=O)(=O)c1ccc(cc1)C(CC(=O)O)CC(=O)O"
plot.new()
plot.window(xlim=c(0,200), ylim=c(0,100))
renderSMILES.rcdk(smiles,kekulise=FALSE)
renderSMILES.rcdk(smiles,kekulise=TRUE)
renderSMILES.rcdk(smiles,kekulise=TRUE, abbr="off")

schymane/RChemMass documentation built on Jan. 25, 2021, 5:45 a.m.