buildCDKdepictURL: Build URL for CDK Depict

Description Usage Arguments Value Author(s) See Also Examples

View source: R/StructurePlotting.R

Description

This builds a URL for the CDK Depict website for direct viewing or for retrieving svgs for renderSMILES.CDKdepict. Contains all the options in Version 0.2, reverting to default options if invalid entries are specified.

Usage

1
2
buildCDKdepictURL(smiles, style="bow",title=NULL, abbr="off", smarts=NULL,
suppressh=TRUE,showtitle=TRUE,zoom=2,annotate="none")

Arguments

smiles

A valid SMILES code or a CxSMILES for advanced plotting. The latter is not yet accessible in R and must be compiled manually or externally.

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.

title

(optional) title to display under structure.

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.

smarts

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

suppressh

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

showtitle

Default TRUE displays the title below the molecule. FALSE turns this off.

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.

annotate

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

reserved

If TRUE (default), encodes all URL reserved characters. See URLencode.

Value

Returns a URL for direct use in a browser, or for rendering in R.

Author(s)

Emma Schymanski (R wrapper, <emma.schymanski@uni.lu>), John Mayfield (CDK Depict)

See Also

renderSMILES.CDKdepict to use the resulting structure in plotting, renderSMILES.rcdk for alternative rendering.

Examples

1
2
3
4
5
6
7
8
buildCDKdepictURL("c1ccccc1")
buildCDKdepictURL("CN1C=NC2=C1C(=O)N(C(=O)N2C)C",style="cow",title="caffeine",
                  abbr="off",smarts="c1cncnc1",suppressh=FALSE,showtitle=TRUE,zoom=5,annotate="number")
buildCDKdepictURL("CCOCCOCCO",style="cow")
buildCDKdepictURL("CCOCCOCCO |Sg:n:3,4,5::ht|",style="cow", smarts="CCO")
buildCDKdepictURL("CCOCCOCCO |Sg:n:3,4,5::ht|",style="cow", smarts="CCO",title="PEGn")
buildCDKdepictURL("OS(=O)(=O)c1ccc(cc1)C([R1]C(=O)O)[R2]C(=O)O", style="cow",title="SPADCs",
abbr="off",suppressh=TRUE,showtitle=TRUE,zoom=5,annotate="number",smarts="C(=O)O")

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