| SMI2GIF Information |
|
New Features
The program now supports PNG as an output type. PNG images are generated with antialiasing (alpha layer). PNG images also support the linewidth option.
The default output depends on the base program name of the request. Whether used as a CGI or HTTP server, the base URL request name (either smi2gif or smi2png) sets the default output format. The output=... option, if provided, always takes precedence over the base URL name.
For PNG output, the linewidth of images can be controlled. The default linewidth depends on the size of the smaller dimension (width or height) of the generated image as follows:
0 - 80 pixels: thin
81 - 350 pixels: normal
351 - 700 pixels: thick
701 - 1200 pixels: reallythick
The Internet standard for specifying options in a URL query is built HTTP Services and is based on name=value syntax. Multiple options are separated by the ampersand character (&) and the URL is separated from the options by the question mark (?). An example of standard URL syntax is smi2gif?option1=true&option2=false
Syntax for specifying SMILES is smiles=<SMILES string> and illustrated at /dayhttp/smi2gif?smiles=Oc1ccccc1.
Several characters in the SMILES and TDT character sets, such as square an angle brackets ('[', ']', '<', '>') have special meaning to a browser when they apeear in a URL. In older software versions, strings were transitted through a browser in a general way, by encoded all characters into 2-digit hexidecimal format. For example, the hexidecimal form of cyclohexylketone (O=C1CCCCC1) is 4f3d4331434343434331 and is illustrated at /dayhttp/smi2gif?4f3d4331434343434331. For backwards compatibility, 2-digit hexidecimal format is supported.
While the old mechanism works fine, it is not the industry standard. So, the Internet standard protocol for URL-encoding was implemented as mandated by RFC 1738. Basically, this protocol involves encoding special URL characters to a character triplet consisting of the percent character (%) followed by the two hexadecimal digits (from "0123456789ABCDEF") which form the hexadecimal value of the character. SMILES characters that are not special URL characters are not encoded. For example, the URL-encoding of "O=C1CCCCC1" is "O%3DC1CCCCC1". The equal sign (=) is a special URL character (for use in option=value syntax) and therefore has been encoded (percent sign (%) plus hexidecimal value (3D)). The standard URL-encoding is illustrated at /dayhttp/smi2gif?smiles=O%3DC1CCCCC1.
Note: A programer routine called du_bin2url and a user application by the same name are provided in Contrib for encoding URLs according to the Internet standard. The routine and program should be used to standardize hyperlinks in HTTP Toolkit programs and in the location field of a browser. The routine is located at $DY_ROOT/contrib/src/libdu/http/ and the program at $DY_ROOT/contrib/src/applics/http/.
Syntax for specifying XSMILES (Kekule form) is xsmiles=true syntax and illustrated at /dayhttp/smi2gif?xsmiles=true&smiles=Oc1ccccc1.
Syntax for specifying a schematic representation (skeleton frame, no hydrogen atoms or aromatic bonds) is schematic=true and illustrated at /dayhttp/smi2gif?schematic=true&smiles=Oc1ccccc1. This options overrides the "hydrogens" option and disables automatic orientation based on the aspect ratio.
Syntax for specifying the rise and run of a GIF image is width=pixels and height=pixels and illustrated at /dayhttp/smi2gif?width=300&height=300&smiles=O%3DC1CCCCC1. The default width and height is 400 and 300, respectively.
Note: Orientation depends on the aspect ratio of the width and height. If the width is greater than the height, the major dimension is oriented along the X-axis. Otherwise, the major dimension is oriented along the Y-axis. Structures are automatically scaled to fit within the image.
Syntax for specifying a the number of pixels per angstrom is scale=pixels/Angstrom and illustrated at /dayhttp/smi2gif?scale=50&smiles=Oc1ccccc1. The default pixel/Angstroms is 100. This option overrides the "width" and "height" options, which are implicitly set by multiplying pixels/Angstrom by the major and minor axis dimensions. The minimum and maximum image sizes are 96x64 and 1600x1200.
Syntax for specifying an reaction (with atom-mapping) is reaction=true and illustrated by a keto-enol tautamer at /dayhttp/smi2gif?reaction=true&width=640&height=480&smiles=%5BO%3A1%5D%3D%5BC%3A2%5D1%5BC%3A3%5D(%5BH%3A4%5D)(%5BH%5D)CCCC1%3E%5BH%2B%5D%3E%5BH%3A4%5D%5BO%3A1%5D%5BC%3A2%5D1%3D%5BC%3A3%5D(%5BH%5D)CCCC1>.
Syntax for specifying a generic reaction (with SMARTS expressions) is smirks=true and illustrated by the following oxygen or nitrogen pattern at /dayhttp/smi2gif?smirks=true&width=640&height=480&smiles=%5BO%2CNH%3A1%5D%3D%5BC%3A2%5D1%5BC%3A3%5D(%5BH%3A4%5D)(%5BH%5D)CCCC1%3E%5BH%2B%5D%3E%5BH%3A4%5D%5BO%2CNH%3A1%5D%5BC%3A2%5D1%3D%5BC%3A3%5D(%5BH%5D)CCCC1>. This option will also display most regular SMARTS, with the exception of SMARTS containing bond expressions.
Syntax for specifying the foreground and background is colormode=scheme where scheme is one of the following:
The color on paper scheme is illustrated at /dayhttp/smi2gif?colormode=COP&smiles=O%3DC1CCCCC1. Paper background is transparent. The default scheme is color on black (COB).
Syntax for specifying horizontal alignment is fromto=true and illustrated by alignment of cyclohexylketone at /dayhttp/smi2gif?fromto=true&smiles=O%3DC1CC(%5B*-1%5D)CC(%5B*-2%5D)C1. This option aligns the image along the horizon by intersecting the X axis with -1 and -2 charged wildcard atoms ([*-1] and [*-2]). This option has the side effect of replacing the atoms with the text "from" and "to". This option overrides the "orient" option.
Syntax for showing aliphatic hydrogens and carbons is hydrogens=true and illustrated at /dayhttp/smi2gif?hydrogens=true&smiles=O%3DC1CCCCC1. The default value is false.
Syntax for specifying TDT input is tdt=$SMI<SMILES>|. For example, cyclohexylketone in TDT form ("$SMI<O=C1CCCCC1>|") is illustrated at /dayhttp/smi2gif?tdt=%24SMI%3CO%3DC1CCCCC1%3E%7C.
Note: Remember that a TDT string contains special URL characters (i.e. '<', '>', '|') and should be encoded as described in the section URL-Encoding.
Note: ISM will be used from TDT's containing both ISM and $SMI. Tuples following ISM relate to the ISM and should be sized according to the total number of atoms and bonds, H atoms included. TDT's from Daylight conversion programs will depict nearly identical to the original format. The order of values in the tuples should match the canonical-isomeric stream order.
The query may be any legal SMARTS expression. The atom colors will be two-tone with the query highlighted on the SMILES or TDT structure in a manner appropriate to the background colormode. For example, cyclohexanone highlighted by the ketone query is illustrated at /dayhttp/smi2gif?smiles=O%3DC1CCCCC1&highlight=O%3DC. The matching for the highlighting is controlled by the nonexhaustive=true|false feature. The default (false) gives complete or exhaustive matching.
Syntax for specifying 2D layout is tdt=$SMI<SMILES>2D<x,y coordinates>|. Coordinates are specified in a TDT as a "2D" data in a comma-spearated list of decimal values. For example, the chair conformation of cyclohexylketone ("$SMI<O=C1CCCCC1>2D<-.75,1.5,0,1,1,0,2,.5,3,0,2,1,1,.5>|") is illustrated at /dayhttp/smi2gif?tdt=%24SMI%3CO%3DC1CCCCC1%3E2D%3C-.75%2C1.5%2C0%2C1%2C1%2C0%2C2%2C.5%2C3%2C0%2C2%2C1%2C1%2C.5%3E%7C.
Note: Automatic orientation of the image is not performed when a 2D layout is specified. To orient a 2D layout, see the "orient" option. Coordinates for the ISM field are specified as "2DI" and must follow the ISM field. Atom visibilities and bondstyles are specified as "VIS" and "BST" data items. All value lists related to ISM must be sized according to the total number of atoms and bonds, including H atoms, and ordered as in the canonical-isomeric streams.
Syntax for specifying automatic orientation of 2D layout is orient=true. Use this option when you specify a 2D layout and you want to allow orientation of the image based on the aspect ratio of the width and height. For example, orientation of the chair conformation of cyclohexylketone is illustrated at /dayhttp/smi2gif?orient=true&width=300&height=300&tdt=%24SMI%3CO%3DC1CCCCC1%3E2D%3C-.75%2C1.5%2C0%2C1%2C1%2C0%2C2%2C.5%2C3%2C0%2C2%2C1%2C1%2C.5%3E%7C.
Note: Orientation depends on the aspect ratio, as described in the "Width & Height" section. This option is overridden by the "fromto" option.
Syntax for specifying atom color is numcolors=<number of colors>&tdt=$SMI<SMILES>ALAB<atom color values>|. Atom colors are specified in a TDT as "ALAB" data in a comma-separated list of decimal values between 0.0 and 1.0, inclusive. As ALAB values increase from 0.0 to 1.0, color varies from red, red-orange, orange, orange-yellow, yellow, yellow-green, green, green-blue,light blue, blue, to white/black. The highest color is always the opposite of the background color. The numcolors option indicates the number of different colors to use across the range. For example, decanol with a red oxygen (ALAB value 0.0) and a white carbon (ALAB value 1.0) and 10 colors ("numcolors=10&tdt=$SMI<OCCCCCCCCCC>ALAB<0.0,.1,.2,.3,.4,.5,.6,.7,.8,.9,1.0>|") is illustrated at /dayhttp/smi2gif?numcolors=10&tdt=%24SMI%3COCCCCCCCCCC%3EALAB%3C0.0%2C.1%2C.2%2C.3%2C.4%2C.5%2C.6%2C.7%2C.8%2C.9%2C1.0%3E%7C. The default number of colors is 10. When ALAB data contains an omission (i.e., empty or white space between commas), the atom color will be cyan. The CPK color scheme is used when the option is not specified.
Syntax for not hiding implicit hydrogens on chiral centers is hide_chi_h=false and illustrated at /dayhttp/smi2gif?hide_chi_h=false&smiles=C%5BC%40%40H%5D(N)C(%3DO)O. The default value is true.
Syntax for scaling the length of bonds to hydrogen ranging from 0.67 (67%) to 1.00 (100%) is hlen_pct=<scalar value> and illustrated at /dayhttp/smi2gif?hlen_pct=0.75&smiles=C%5BC%40%40H%5D(N)C(%3DO)O. The default value is 1.00. This option sets the "hide_chi_h" option to false.
Syntax for pre-v4.83 bond style rendition is old_style=true and illustrated at /dayhttp/smi2gif?old_style=true&smiles=C%5BC%40%40H%5D(N)C(%3DO)O. The default value is false. This option sets the "hide_chi_h" option to false and the "hlen_pct" options to 1.0.
Option names can be abbreviated to the unique number of charaters for as follows:
| Option | Abbreviation |
| colormode | c |
| fromto | f |
| height | he |
| hide_chi_h | hi |
| hlen_pct | hl |
| hydrogens | hy |
| numcolors | linew |
| linewidth | n |
| old_style | ol |
| orient | or |
| output | ou |
| reaction | r |
| scale | sca |
| schematic | sch |
| smiles | smil |
| smirks | smir |
| tdt | t |
| width | w |
| xsmiles | x |
Option values 'true' and 'false' may be abbreviated 't' and 'f' and are case-insensitive.
info@daylight.com | Daylight Chemical Information Systems, Inc. | smi2gif v4.94 |