Package Chem :: Package Pharm2D :: Module Signature :: Class Pharm2DSig
[hide private]
[frames] | no frames]

Class Pharm2DSig

source code

object --+
         |
        Pharm2DSig



**Notes on Use**

  - After any changes, the Init() method should be called

**Important Attributes**

 - patterns: a list of SmartsPatterns used to determine the features
    patterns can be initialized directly from the list or from a list of SMARTS
    strings

 - bins: the list of distance bins to be used.

 - minCount/maxCount: the minimum/maximum number of points to be included
    in a pharmacophore

 - shortestPathsOnly: toggles limiting the path-discovery algorithms to
    only find the shortest paths between 2 features.

 - includeBondOrder: toggles inclusion of bond order in consideration of
    shortest paths.

**Limitations of Current Implementation**

 - All distances have the same numbers of bins

 - Only shortest-path matches are implemented

 



Instance Methods [hide private]
 
__init__(self, patts=None, bins=None, labels=None, minCnt=2, maxCnt=4, shortestPathsOnly=1, includeBondOrder=0)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
_initLocals(self)
Internal use only...
source code
 
__getstate__(self)
used by the pickling machinery...
source code
 
__setstate__(self, state)
used by the pickling machinery...
source code
 
__len__(self) source code
 
__getitem__(self, idx) source code
 
SetPatterns(self, patts) source code
 
SetPatternsFromSmarts(self, smarts) source code
 
GetPattern(self, which) source code
 
GetNumPatterns(self) source code
 
SetLabels(self, labels) source code
 
GetLabel(self, which) source code
 
SetBins(self, bins)
bins should be a list of 2-tuples
source code
 
GetBin(self, which) source code
 
GetNumBins(self) source code
 
GetMinDist(self) source code
 
GetMaxDist(self) source code
 
SetMinCount(self, min) source code
 
GetMinCount(self) source code
 
SetMaxCount(self, max) source code
 
GetMaxCount(self) source code
 
SetShortestPathsOnly(self, val) source code
 
GetShortestPathsOnly(self) source code
 
SetIncludeBondOrder(self, val) source code
 
GetIncludeBondOrder(self) source code
 
GetSize(self) source code
 
Init(self, createBitVect=1)
Initializes internal parameters.
source code
 
GetBitIdx(self, patts, dists, checkPatts=1)
returns the index for a pharmacophore described using a set of patterns and distances **Arguments*** - patts: a sequence of pattern indices - dists: a sequence of distance between the patterns, only the unique distances should be included, and they should be in the order defined in Utils.
source code
 
SetBit(self, patts, dists, checkPatts=1)
sets the bit defined by a collection of patterns and distances **Arguments*** - patts: a sequence of pattern indices - dists: a sequence of distance between the patterns, only the unique distances should be included, and they should be in the order defined in Utils.
source code
 
GetBit(self, patts, dists, checkPatts=1)
returns the value of a **Arguments*** - patts: a sequence of pattern indices - dists: a sequence of distance between the patterns, only the unique distances should be included, and they should be in the order defined in Utils.
source code
 
GetOnBits(self)
returns our on bits ...
source code
 
GetBitInfo(self, idx)
returns information about the given bit...
source code
 
GetBitDescription(self, bitIdx, includeBins=0, fullPage=1)
returns HTML with a description of the bit...
source code
 
_findBinIdx(self, dists, bins, scaffolds)
OBSOLETE: this has been rewritten in C++ Internal use only Returns the index of a bin defined by a set of distances.
source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, patts=None, bins=None, labels=None, minCnt=2, maxCnt=4, shortestPathsOnly=1, includeBondOrder=0)
(Constructor)

source code 
x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

_initLocals(self)

source code 
Internal use only

    

__getstate__(self)

source code 
used by the pickling machinery

    

__setstate__(self, state)

source code 
used by the pickling machinery

    

Init(self, createBitVect=1)

source code 
Initializes internal parameters.  This **must** be called after
  making any changes to the signature

**Arguments**

  - createBitVect: (optional) if this is nonzero, the bit vector
    used to store the on bits will be allocated.  Otherwise the
    existing bit vect will be reused (it better be big enough)

GetBitIdx(self, patts, dists, checkPatts=1)

source code 
returns the index for a pharmacophore described using a set of
  patterns and distances

**Arguments***

  - patts: a sequence of pattern indices

  - dists: a sequence of distance between the patterns, only the
    unique distances should be included, and they should be in the
    order defined in Utils.

  - checkPatts: (optional) if nonzero, the pattern vector is
    checked to ensure it is sorted


**Returns**

  the integer bit index
  

SetBit(self, patts, dists, checkPatts=1)

source code 
sets the bit defined by a collection of patterns and distances

**Arguments***

  - patts: a sequence of pattern indices

  - dists: a sequence of distance between the patterns, only the
    unique distances should be included, and they should be in the
    order defined in Utils.

  - checkPatts: (optional) if nonzero, the pattern vector is
    checked to ensure it is sorted

**Returns**

  the original status of the bit (whether or not it was set)
  

GetBit(self, patts, dists, checkPatts=1)

source code 
returns the value of a 

**Arguments***

  - patts: a sequence of pattern indices

  - dists: a sequence of distance between the patterns, only the
    unique distances should be included, and they should be in the
    order defined in Utils.

  - checkPatts: (optional) if nonzero, the pattern vector is
    checked to ensure it is sorted

**Returns**

   whether or not the bit is set
   

GetOnBits(self)

source code 
returns our on bits 

    

GetBitInfo(self, idx)

source code 
returns information about the given bit

**Arguments**

  - idx: the bit index to be considered

**Returns**

  a 3-tuple:

    1) the number of points in the pharmacophore

    2) the proto-pharmacophore (tuple of pattern indices)

    3) the scaffold (tuple of distance indices)

GetBitDescription(self, bitIdx, includeBins=0, fullPage=1)

source code 
returns HTML with a description of the bit

**Arguments**

  - bitIdx: an integer bit index

  - includeBins: (optional) if nonzero, information about the bins will be
    included as well

  - fullPage: (optional) if nonzero, html headers and footers will
    be included (so as to make the output a complete page)

**Returns**

  a string with the HTML

_findBinIdx(self, dists, bins, scaffolds)

source code 
OBSOLETE: this has been rewritten in C++
Internal use only
 Returns the index of a bin defined by a set of distances.

**Arguments**

  - dists: a sequence of distances (not binned)

  - bins: a sorted sequence of distance bins (2-tuples)

  - scaffolds: a list of possible scaffolds (bin combinations)

**Returns**

  an integer bin index
  
**Note**

  the value returned here is not an index in the overall
  signature.  It is, rather, an offset of a scaffold in the
  possible combinations of distance bins for a given
  proto-pharmacophore.