Home   |   Products   |   Consulting Services   |   Contact us    

 

MODGRAPH PRODUCTS:

  Chemical Registration
  Reaction-based Libraries
  DocScan - NEW!
  NMRPredict Version 2
  NMRBenefit
  René
  Chemical Supplier Catalogue
  Daybase
  Database Integration
  Structure Drawing Control
  Imaging Suite
  Barcode Solutions

 

 

 

smi2image

smi2image.cgi - Web CGI to create images from SMILES

Description

smi2image.cgi is a CGI program that converts SMILES into images using the Daylight Depict Toolkit, for showing molecules in a web page. It can either create a drawing ``from scratch'' using Daylight's depict algorithm, or it can use X/Y coordinates supplied in the URL. Images can be GIF, PNG or JPEG format.

smi2image.cgi is designed to be used with the Apache web server (see http://www.apache.org/ ) but should work with any CGI-compliant web server.

smi2image.cgi is written in Perl, and uses the DayPerl2.pm module, which is freely available. (Contact Modgraph, http://www.modgraph.co.uk if you need the source code for DayPerl2.)


URL PARAMETERS

All parameters are specified in the URL, for example:

    http://my.server.com/cgi-bin/smi2image.cgi?smiles=CCO

smiles
The SMILES string of the molecule that is to be drawn. This is the only required parameter.

Note that SMILES must be properly ``quoted'' to eliminate characters that are disallowed or have special meaning in a URL. In particular, the following characters that are legal in a SMILES must be ``escaped'', or converted to the three-character %NN code:

    %   %25          /   %2F
    #   %23          <   %3C
    $   %24          >   %3E
    &   %26          [   %5B
    *   %2A          \   %5C
    +   %2B          ]   %5D
    -   %2D          |   %7C

coordinates
X/Y coordinate pairs for each atom in the SMILES. Coordinates are specified in SMILES order, two numbers per atom, and are separated by commas. For example:

    http://server.com/cgi-bin/smi2image.cgi?smiles=CO&coordinates=1.0,0.0,2.0,1.0

width
Image width in pixels (default: 300)

height
Image height in pixels (default: 200)

colorscheme
cob, cow, bow, wob, for color-on-black, color-on-white, etc. These are actually filenames in the colorscheme directory, for example ./colorscheme/blue_theme would be '-c blue_theme'. Other colorschemes can be created in a subdirectory called 'colorscheme' in the current directory. Colorscheme names must be lowercase. If no colorscheme is specified, or if the specified colorscheme can't be found, color-on-black is used.

highlightAtoms
Colors the atoms by highlighting the atoms indicated in the parameter's string. The string is in canonical-smiles order, and each character is a single number that corresponds to the colors in the colorscheme file (i.e. 0 = first color, 1 = second color, ...).

For example, the following would color the first two atoms (the N-C) using the second color in the color scheme, and the rest of the atoms in the cyclohexane using the first color in the color scheme:

    http://server.com/cgi-bin/smi2image.cgi?smiles=NC1CCCCC1&highlightAtoms=22111111

transparent yes | no
If ``transparent'' is ``yes'', uses a transparent background for GIF or PNG images (ignored for JPG images). This has the effect of drawing the atoms and bonds on top of the background color or texture of the web page. (Default: no)

(NOTE: Incredibly, Internet Explorer can't show transparent colors in PNG images. They are shown non-transparent. Other browsers such as Firefox will show the transparent images correctly.)


SEE ALSO

the Modgraph Imaging Suite main page

the mol2image main page

the dmol2image main page

the reg2image main page