Using chemical terms expression that generate structures

ChemAxon fa971619eb

01-06-2010 16:13:16

A user asked:


How do I use a chemical terms expression that generates structures



In order to use chemical terms expressions that generate structures (such as major microspecies, tautomers, conformers etc.), you need to convert the structure to text so that it can be stored in the database. The way to do this is to use the molString() chemical terms expression. This takes 2 arguments, the molecule to convert and the format to use for the conversion. Generally speaking cxsmiles format is best if you don't care about coordinates, whilst mrv is best if you do.There is an optional 3rd argument that lets you optimise the cordinates function which can be useful in some cases. It takes the value of 2 or 3 which specifies whether you want 2D or 3D coordinates.


To use this specify the molString chemical terms expression and use the required chemical terms expression to generate the structure(s) for the first argument. Examples expressions are:


Major microspecies (cxsmiles format):


molString(majorMicrospecies('7.4'), 'cxsmiles')

Dominant tautomer (mrv format with 2D cleaning):


molString(dominantTautomer(), 'mrv', 2)

You must of course specify that the column type will be text. One thing to bear in mind is that mrv format is quite lengthy and the default column length will not be sufficient. You will need to increase this or specify an alternative column type (e.g. CLOB) depending on the database you are using.


Once complete you wil have a text colunm in your database. By default this will be displayed as text, but this can be changed to display as structure by changing the renderer type in the grid view (look at the column properties in the grid view and change the cell renderer property) or use a structure widget for the form view.  


Tim