chapter 9


Reactions and Transformations

The use of SMILES as a string representation of chemical structure makes possible much of what has been discussed in earlier chapters of this book. A chemical reaction could be represented as a collection of SMILES, some identified as reactants and some as products. It is possible to define a table to do this, or perhaps use some arrays of character data types, but a syntax extension of standard SMILES allows reaction to be expressed easily. SMIRKS is an extension of SMILES and SMARTS. It is used to represent chemical transformations. SMIRKS can also be used in a transformation function to combine SMILES reactants to produce SMILES products.


This chapter describes some of the aspects of SMIRKS and shows how it can be integrated into a relational database using new SQL functions. It discusses ways in which chemical transformations and reactions can be used to improve the robustness and usefulness of a chemical relational database. [view wordle] [hide wordle]

Page  
100
Select rxnsmiles from atable where matches(rxnsmiles,'CC(=O)O');
103
Select xform('C[N+](=O)[O-]', '[O:2]=[N+:1][O-:3]>>[O:2]=[N+0:1]=[O+0:3]');
Update rxntest Set smiles=xform(smiles,smirks) From std_smirks;
Create Table atable (smiles Text Check (is_std_smiles(smiles)));
Insert into atable Select make_std_smiles(smiles);
104
Create Table atable (smiles text, id integer);
Create Function standardize() Returns Trigger As $EOSQL$ 
  Declare 
    std_smiles Text; 
    smirks Text; 
    std Record; 
  Begin 
    For std In Select * from std_smirks Loop 
      std_smiles = xform(NEW.smiles, std.smirks); 
      If std_smiles != NEW.smiles Then 
        NEW.smiles = std_smiles; 
      End If; 
    End Loop; 
    Return NEW; 
  End; 
$EOSQL$ Language plpgsql; 
	   
Create Trigger standardize Before Insert Or Update On atable
   For Each Row Execute Procedure standardize(); 
105
Select xform(ARRAY['CC(=O)Cl','CNC'],
    '[C:2]([O,Cl:3])=[O:4].[N:6][H:99]>>[N:6][C:2]=[O:4].[*:3][H:99]');
select amine.smiles, acid.smiles, xform(ARRAY[amine.smiles,acid.smiles],          
    '[H:99][N:1].[C:2](=[O:4])[Cl:3]>>[N:1][C:2]=[O:4]') from 
  (select smiles from structure where matches(smiles,'C[NH1]') limit 10)  amine, 
  (select smiles from structure where matches(smiles,'C(=O)Cl') limit 10) acid;        
select amine.smiles, acid.smiles, xform(ARRAY[amine.smiles,acid.smiles], smirks) from 
  (select smiles from structure where matches(smiles,'C[NH1]') limit 10)  amine, 
  (select smiles from structure where matches(smiles,'C(=O)Cl') limit 10) acid,
  smirks_lib where smirks_lib.name='Schotten-Baumann';
       
106
select xform(ARRAY['CCC=O','CN','c1ccccc1C(=O)O','[C-]#[N+]C1=CCCCC1'], smirks)
 from smirks_lib where name='Ugi4CC';