Chem.Pharm2D.Gobbi_Pharm2D

Package Chem :: Package Pharm2D :: Module Gobbi_Pharm2D |
[hide private]
[frames] | no frames]

# Source Code for Module Chem.Pharm2D.Gobbi_Pharm2D

     1  # $Id: Gobbi_Pharm2D.py 2 2006-05-06 22:54:39Z glandrum $
     2  #
     3  #  Copyright (C) 2003-2006 Greg Landrum and Rational Discovery LLC
     4  #
     5  #   @@ All Rights Reserved  @@
     6  #
     7  """ Definitions for 2D Pharmacophores from:
     8    Gobbi and Poppinger, Biotech. Bioeng. _61_ 47-54 (1998)
     9
    10  """
    11  import Chem
    12  import RDConfig
    13  import os,sys
    14  from Chem.Pharm2D.SigFactory import SigFactory
    15
    16  patts={
    17    'LH':('[$([C;H2,H1](!=*)[C;H2,H1][C;H2,H1][$([C;H1,H2,H3]);!$(C=*)]),$(C([C;H2,H3])([C;H2,H3])[C;H2,H3])]',
    18        'Hydrophobic group'),
    19    'HD':('[$([N;!H0;v3]),$([N;!H0;+1;v4]),$([O,S;H1;+0]),$([n;H1;+0])]',
    20          'Hydrogen bond donor'),
    21    'HA':('[$([O,S;H1;v2]-[!$(*=[O,N,P,S])]),$([O,S;H0;v2]),$([O,S;-]),$([N&v3;H1,H2]-[!$(*=[O,N,P,S])]),$([N;v3;H0]),$([n,o,s;+0]),F]',
    22          'Hydrogen bond acceptor'),
    23    'AR':('[$([a;D3](@*)(@*)*)]',
    24          'Aromatic Attachment Point'),
    25    'RR':('[$([A;D3](@*)(@*)*)]',
    26          'Aliphatic Attachment Point'),
    27    'X':('[!#1;!#6;!#7;!#8;!#9;!#16;!#17;!#35;!#53]',
    28         'Unusual Atom'),
    29    'BG':('[$([N;H2&+0][$([C,a]);!$([C,a](=O))]),$([N;H1&+0]([$([C,a]);!$([C,a](=O))])[$([C,a]);!$([C,a](=O))]),$([N;H0&+0]([C;!$(C(=O))])([C;!$(C(=O))])[C;!$(C(=O))]),$([N,n;X2;+0])]',
    30          'Basic Group'),
    31    'AG':('[C,S](=[O,S,P])-[O;H1]',
    32          'Acidic Group'),
    33    }
    34  defaultBins = [(2,3),(3,4),(4,5),(5,6),(6,7),(7,8),(8,100)]
    35
    36 -def _init():
    37    global labels,patts,factory
    38
    39    labels = []
    40    smaPatts = []
    41    for label in patts.keys():
    42      sma,desc = patts[label]
    43      p = Chem.MolFromSmarts(sma)
    44      if not p:
    45        sys.stderr.write('feature %s failed to parse'%(label))
    46      else:
    47        labels.append(label)
    48        patts[label] = p,desc
    49        smaPatts.append(p)
    50    factory = SigFactory()
    51    factory.SetPatterns(smaPatts)
    52    factory.SetLabels(labels)
    53    factory.SetBins(defaultBins)
    54    factory.SetMinCount(2)
    55    factory.SetMaxCount(3)
    56    factory.SetShortestPathsOnly(1)
    57    factory.SetIncludeBondOrder(0)
    58
    59  _init()
    60