Dear all,

Yesterday I checked in an implementation of the BRICS molecular
fragmentation algorithm that came out of Matthias Rarey's group last
year (http://dx.doi.org/10.1002/cmdc.200800178).

The code is in: $RDBASE/rdkit/Chem/BRICS.py

One particularly useful feature of this implementation is that it
allows you to build molecules (as well as fragment them) using the
BRICS rules:

[1]>>> from rdkit import Chem

[2]>>> from rdkit.Chem import BRICS

[3]>>> base = Chem.MolFromSmiles("n1cncnc1OCC(C1CC1)OC1CNC1")

[4]>>> catalog = BRICS.BRICSDecompose(base)

[5]>>> print catalog
set(['[3*]OCC(O[3*])C1CC1', '[4*]CC([4*])C1CC1', '[3*]Oc1ncncn1',
'[14*]c1ncncn1', '[3*]OCC([4*])C1CC1', '[3*]OC(C[4*])C1CC1',
'[3*]OC1CNC1', '[15*]C1CNC1'])

[6]>>> catalog = [Chem.MolFromSmiles(x) for x in catalog]

[7]>>> ms = BRICS.BRICSBuild(catalog)

[8]>>> ms
Out[8] <generator object at 0x984da2c>

[9]>>> ms = list(ms)

[10]>>> len(ms)
Out[10] 19

[11]>>> for m in ms[:5]: print Chem.MolToSmiles(m)
   ....:
n1cnc(OCC(OC(COc2ncncn2)C2CC2)C2CC2)nc1
n1cnc(OCC(OC(COC2CNC2)C2CC2)C2CC2)nc1
C1CC1C(OC(C1CC1)COC1CNC1)COC1CNC1
n1cnc(OC(COC(COC2CNC2)C2CC2)C2CC2)nc1
C1CC1C(OCC(OC1CNC1)C1CC1)COC1CNC1


I'm very grateful that my employer continues to support the RDKit by
allowing me to publish code that I've developed at work as
contributions to the open-source version.

-greg

Reply via email to