Generate diamine ring systems using RDKit # RDKit

Somedays ago, I posted new way to represent chemical space using exit vector.
So, I want to generate set of diamine ring systems. It’s easy to generate molecule set using RDKit.
Let’s try it.
At first I defined ring systems.

from rdkit import Chem
from rdkit.Chem import AllChem
from rdkit.Chem import Draw
from rdkit.Chem.Draw import IPythonConsole

c5 = Chem.MolFromSmiles( 'C1CCCC1' )
c6 = Chem.MolFromSmiles( 'C1CCCCC1' )
c7 = Chem.MolFromSmiles( 'C1CCCCCC1' )
c45 = Chem.MolFromSmiles( 'C2CC1CCC1C2' )
c46 = Chem.MolFromSmiles( 'C2CCC1CCC1C2' )
c55 = Chem.MolFromSmiles( 'C1CC2CCCC2C1' )
c56 = Chem.MolFromSmiles( 'C2CCC1CCCC1C2' )
c66 = Chem.MolFromSmiles( 'C1CCC2CCCCC2C1' )
sp35 = Chem.MolFromSmiles( 'C1CC11CCCC1' )
sp36 =  Chem.MolFromSmiles( 'C1CC11CCCCC1' )
sp45 = Chem.MolFromSmiles( 'C1CCC11CCCC1' )
sp46 =  Chem.MolFromSmiles( 'C1CCC11CCCCC1' )
sp55 = Chem.MolFromSmiles( 'C1CCC11CCCC1' )
sp55 = Chem.MolFromSmiles( 'C1CCCC11CCCC1' )
sp65 = Chem.MolFromSmiles( 'C1CCCC11CCCCC1' )
sp66 =  Chem.MolFromSmiles( 'C1CCCCC11CCCCC1' )

ringsets = [
    c5, c6, c7,
    c45, c46, c55, c56, c66,
    sp35, sp36, sp45, sp46, sp55, sp65, sp66]
rxn = AllChem.ReactionFromSmarts( '[CH2&$(C(CC)(CC)):2]>>[NH:2]' )
monoamine = []

Then, I defined function that returns only unique mols.

def get_unipro( ps ):
    uniq = set( [ Chem.MolToSmiles( mol[0], isomericSmiles =True ) for mol in ps ] )
    mols = [ Chem.MolFromSmiles( smi ) for smi in uniq ]
    return mols

def get_unimol( mols ):
    uniq = set( [ Chem.MolToSmiles( mol, isomericSmiles =True ) for mol in mols ] )
    mols = [ Chem.MolFromSmiles( smi ) for smi in uniq ]
    return mols

OK, Ready. Run reaction!

for ring in ringsets:
    ps = rxn.RunReactants( (ring,) )
    res = get_unipro( ps )
    monoamine.extend( res )
diamine = []
for ring in monoamine:
    ps = rxn.RunReactants( (ring,) )
    res = get_unipro( ps )
    diamine.extend( res )
diamine = get_unimol( diamine )
Draw.MolsToGridImage( ringsets, molsPerRow = 5  )

frame

Draw.MolsToGridImage(diamine, molsPerRow= 5 )

diamine

It’s works fine.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s