Evgueni, On Fri, Jun 19, 2009 at 1:10 PM, Evgueni Kolossov<ekolos...@gmail.com> wrote: > Thanks Greg, > > It probably does not matter because atoms and bond vectors already in > RingInfo, so either way will do but i prefer do it via the bonds - looking > more useful for my purpose. > I am actually completed fragmentation my way and just doing some testing. > I will try to do BRICKS as well but it will be much easier for me if you can > 'decode' for me couple of line from python like: > 'L1':('[#6:1,#7,#8,#0][C:2](=[O:3])','[*:1][C:2](=[O:3])-[1*]'), > "{L14}-;!...@{l14b}>>{L14p}.{L14bp}"
The refactoring I did of BRICS recently (it's in svn) is a bit easier to read. I'd recommend looking at that. The basic idea is to define atom environments using SMARTS: 'L1':'C([#0,#6,#7,#8])(=[O])', 'L3':'O-;!...@[#0,#6]', L1 is a C attached to a dummy, another C, an N, or an O that also has a double bond to an O L3 is an O with a non ring bond to either a C or a dummy And then define rules for recognizing pairs of those environments: ('1','3','-'), This is interpreted as L1 connected to L3 via a single bond. The corresponding bonds in the molecule one passes in to be decomposed will be broken and the attachment points marked by atom environment. So applying the rule described above to CCC(=O)OCC will yield a the molecule CCC(=O)[1*].[3*]OCC The details of how this is done are not particularly complex, the python code contains a series of text transformations that convert the input data into reaction SMARTS. ChemicalReactions constructed from these are then used to fragment molecules. -greg