Tag Archives: structure image

Standard InChIKey Lookup

In the previous version of the Chemical Identifier Resolver, only full length Standard InChIKeys were accepted as identifier part of the requested URL. Any successful request always returned the representation of a single structure record. However, the latter neglects some characteristics of Standard InChIKeys which specifically also were implemented for interlinking highly related (but not always exactly identical) chemical compounds.
For instance, the full-length Standard InChIKey ADVPTQAUNPRNPO-UHFFFAOYSA-N
represents 3-sulfino-alanine as well as its zwitterionic form (or in other words: both are regarded as the same chemical compound by Standard InChIKey):

Starting with the Beta 2 version of the Resolver we have changed the behavior of how a Standard InChIKey is looked up in the database. A request by Standard InChIKey returns now all structure records that have this key as their Standard InChIKey (previously only the first structure record for a Standard InChIKey was returned). For the request

http://cactus.nci.nih.gov/chemical/structure/InChIKey=ADVPTQAUNPRNPO-UHFFFAOYSA-N/smiles

the Resolver returns now the SMILES string for 3-sulfino-alanine and for its zwitterion:

NC(C[S](O)=O)C(O)=O
[NH3+]C(C[S]([O-])=O)C(O)=O

To access a specific structure record use the URL option structure_index:

http://cactus.nci.nih.gov/chemical/structure/InChIKey=ADVPTQAUNPRNPO-UHFFFAOYSA-N/smiles?structure_index=0

NC(C[S](O)=O)C(O)=O

http://cactus.nci.nih.gov/chemical/structure/InChIKey=ADVPTQAUNPRNPO-UHFFFAOYSA-N/smiles?structure_index=1

[NH3+]C(C[S]([O-])=O)C(O)=O
Likewise, this works for any other structure representation available from the Resolver, i.e. if the option structure_index is not being used

Note: be careful with the request for names. Both forms of 3-sulfino-alanine return more than one name and the request for names therefore returns a join list of both name lists:

http://cactus.nci.nih.gov/chemical/structure/InChIKey=ADVPTQAUNPRNPO-UHFFFAOYSA-N/names

If you want to separate both, please use the structure_index option again. For TwirlyMol always use the structure_index option (otherwise only the first structure is returned):

http://cactus.nci.nih.gov/chemical/structure/InChIKey=ADVPTQAUNPRNPO-UHFFFAOYSA-N/twirl?structure_index=0&div_id=NAME0

http://cactus.nci.nih.gov/chemical/structure/InChIKey=ADVPTQAUNPRNPO-UHFFFAOYSA-N/twirl?structure_index=1&div_id=NAME1

Create Structure Images from Standard InChIKeys

As you might already have found out, the Chemical Identifier Resolver allows to create a GIF image from a Standard InChIKey very easily:

http://cactus.nci.nih.gov/chemical/structure/InChIKey=BSYNRYMUTXBXSQ-UHFFFAOYSA-N/image

The same  can be done for any chemical structure identifier accepted by the Resolver:

http://cactus.nci.nih.gov/chemical/structure/morphine/image
http://cactus.nci.nih.gov/chemical/structure/InChI=InChI=1S/C6H6/c1-2-4-6-5-3-1/h1-6H/image
http://cactus.nci.nih.gov/chemical/structure/CC(=O)Oc1ccccc1C(O)=O/image

The images are all created by CACTVS. So far, the service returned always a 250×250 GIF image but for the generation of structure images you might of course ask for more control about how the structure image is to be created.  So we added a few (URL) options to the image method of the Resolver. For instance, the following image has just been created from the URL shown in the caption:

http://cactus.nci.nih.gov/chemical/structure/InChIKey=BSYNRYMUTXBXSQ-UHFFFAOYSA-N/image?footer=BSYNRYMUTXBXSQ-UHFFFAOYSA-N&width=500

http://cactus.nci.nih.gov/chemical/structure/InChIKey=BSYNRYMUTXBXSQ-UHFFFAOYSA-N/image?footer=BSYNRYMUTXBXSQ-UHFFFAOYSA-N&width=500

More options are:

Create a PNG image instead of GIF:

http://cactus.nci.nih.gov/chemical/structure/aspirin/image?format=png

Change width, height, linewidth and fontsize:

http://cactus.nci.nih.gov/chemical/structure/aspirin/image?width=500&height=500&linewidth=2&symbolfontsize=16

Add some background color:

http://cactus.nci.nih.gov/chemical/structure/aspirin/image?bgcolor=yellow

You can also use the html hex code color codes (the ‘#’ character has to be URL-escaped as ‘%23′ in this case):

ttp://cactus.nci.nih.gov/chemical/structure/aspirin/image?bgcolor=%23AADDEE

For an image with transparent background use ‘transparent’ as color name and switch off antialiasing:

http://cactus.nci.nih.gov/chemical/structure/aspirin/image?bgcolor=transparent&antialiasing=0

Show black atom labels instead of the default color scheme for the different atom element types:

http://cactus.nci.nih.gov/chemical/structure/aspirin/image?atomcolor=black

Control which hydrogen atoms are shown:

The default values is special, i.e. only hydrogen atoms in functional groups or defining stereochemistry are shown.

http://cactus.nci.nih.gov/chemical/structure/aspirin/image?hsymbol=special
http://cactus.nci.nih.gov/chemical/structure/aspirin/image?hsymbol=all

Control how carbon atoms are shown:
The default values is special, if all is used all carbon atoms are shown as atom symbol:

http://cactus.nci.nih.gov/chemical/structure/aspirin/image?csymbol=special
http://cactus.nci.nih.gov/chemical/structure/aspirin/image?csymbol=all
Change the colors for hydrogen atoms:
http://cactus.nci.nih.gov/chemical/structure/aspirin/image?hcolor=gray

Use another color for bonds:

http://cactus.nci.nih.gov/chemical/structure/aspirin/image?bondcolor=red

Show R/S stereo labels:

http://cactus.nci.nih.gov/chemical/structure/taxol/image?showstereo=0
http://cactus.nci.nih.gov/chemical/structure/taxol/image?showstereo=1

Add some text to the image:

http://cactus.nci.nih.gov/chemical/structure/aspirin/image?header="Aspirin on the top"
http://cactus.nci.nih.gov/chemical/structure/aspirin/image?footer="Aspirin on the bottom"

Add a frame:

http://cactus.nci.nih.gov/chemical/structure/aspirin/image?frame=1

There are more options and we will document them more exhaustively later. If you are familiar with all options CACTVS has available for controlling the GIF/PNG generation, try them – chances are good that they might work. Please also visit our GIF Generator at http://cactus.nci.nih.gov.