Chem.Recap

Package Chem :: Module Recap |
[hide private]
[frames] | no frames]

# Module Recap

source code

    Implementation of the RECAP algorithm from Lewell et al. JCICS *38* 511-522 (1998)

    The published algorithm is implemented more or less without
    modification. The results are returned as a hierarchy of nodes instead
    of just as a set of fragments. The hope is that this will allow a bit
    more flexibility in working with the results.

    For example:
    >>> m = Chem.MolFromSmiles('C1CC1Oc1ccccc1-c1ncc(OC)cc1')
    >>> res = Recap.RecapDecompose(m)
    >>> res
    <Chem.Recap.RecapHierarchyNode object at 0x00CDB5D0>
    >>> res.children.keys()
    ['[*]C1CC1', '[*]c1ccccc1-c1ncc(OC)cc1']
    >>> res.GetAllChildren().keys()
    ['[*]c1ccccc1[*]', '[*]c1ccc(OC)cn1', '[*]C1CC1', '[*]c1ccccc1-c1ncc(OC)cc1']

    To get the standard set of RECAP results, use GetLeaves():
    >>> leaves=res.GetLeaves()
    >>> leaves.keys()
    ['[*]c1ccccc1[*]', '[*]c1ccc(OC)cn1', '[*]C1CC1']
    >>> leaf = leaves['[*]C1CC1']
    >>> leaf.mol
    <Chem.rdchem.Mol object at 0x00CBE0F0>

Classes | [hide private]
| RecapHierarchyNode This class is used to hold the Recap hiearchy...

Functions | [hide private]
RecapDecompose(mol, allNodes=None, minFragmentSize=0) returns the recap decomposition for a molecule | source code

Variables | [hide private]
| reactionDefs = ``(``'``[#7:1;+0;D2,D3]!@C(!@=O)!@[#7:2;+0;D2,D3]>>[*``...``
| reactions = ``(`<Chem.rdChemReactions.ChemicalReaction object at `...``
| x = ``'``[#7:1;+0;D2,D3]-!@[S:2](=[O:3])=[O:4]>>[#7:1][*].[*][S:2]``...``

Variables Details | [hide private]

  ### reactionDefs Value:
      ('[#7:1;+0;D2,D3]!@C(!@=O)!@[#7:2;+0;D2,D3]>>[*][#7:1].[#7:2][*]',
       '[C:1](=!@[O:2])!@[#7:3;+0;!D1]>>[*][C:1]=[O:2].[*][#7:3]',
       '[C:1](=!@[O:2])!@[O:3;+0]>>[*][C:1]=[O:2].[O:3][*]',
       '[N;!D1;+0](-!@[*:1])-!@[*:2]>>[*][*:1].[*:2][*]',
       '[#7:1;R;D3;+0]-!@[*:2]>>[*][#7:1].[*:2][*]',
       '[#6:1]-!@[O;+0]-!@[#6:2]>>[#6:1][*].[*][#6:2]',
       '[C:1]=!@[C:2]>>[C:1][*].[*][C:2]',
       '[n:1;+0]-!@[C:2]>>[n:1][*].[C:2][*]',
      ...

  ### reactions Value:
      tuple([Reactions.ReactionFromSmarts(x) for x in reactionDefs])

  ### x Value:
      '[#7:1;+0;D2,D3]-!@[S:2](=[O:3])=[O:4]>>[#7:1][*].[*][S:2](=[O:3])=[O:
      4]'