Package CHEM :: Package Annotation :: Module ChemicalAnnotators :: Class RigidSegmentAnnotator
[hide private]
[frames] | no frames]

Class RigidSegmentAnnotator



BaseAnnotator.BaseAnnotator --+    
                              |    
  BaseAnnotator.SingleAnnotator --+
                                  |
                                 RigidSegmentAnnotator

Determine the number of rigid segments.  
That is, the number of segments partititioned by rotatable bonds.
Rotatable bonds defined in OEChem as:
   A single, non-ring bond between two non-terminal, non-triple-bonded atoms. 
   An atom is considered non-terminal if it is connected to two or more non-hydrogen atoms, 
   i.e. OEAtomBase::GetHvyDegree >= 2. 

>>> annotator = RigidSegmentAnnotator();
>>> smilesList = [];
>>> smilesList.append("c1ccccc1O");
>>> smilesList.append("OC(C)N");
>>> smilesList.append("COCN(C)C");
>>> smilesList.append("C1OCNCO1");
>>> smilesList.append("C1OC(C)NCO1");
>>> smilesList.append("C1O[C@H](C)NCO1");
>>> smilesList.append("OC=CN");
>>> smilesList.append("OC=C");
>>> smilesList.append("OC=COC");
>>> smilesList.append("c1ccccc1c2ccccc2");
>>> smilesList.append("C1CCCCC1C2CCCCC2");
>>> smilesList.append("CCCCCCCCCCCC");
>>> smilesList.append("CCC(CCC)CCC(CC)C");
>>> for smiles in smilesList:
...     print "%s %d" % (smiles, callBySmiles(annotator, smiles)[0]);
...
c1ccccc1O 1
OC(C)N 1
COCN(C)C 2
C1OCNCO1 1
C1OC(C)NCO1 1
C1O[C@H](C)NCO1 1
OC=CN 1
OC=C 1
OC=COC 2
c1ccccc1c2ccccc2 2
C1CCCCC1C2CCCCC2 2
CCCCCCCCCCCC 6
CCC(CCC)CCC(CC)C 5



Instance Methods [hide private]
 
allColumns(self)
Return an ordered sequence of all the column names that this multiple annotator can generate values for.
 
allValues(self, input)
Return an ordered sequence of all the values this multiple annotator can calculate off of the input.

Inherited from BaseAnnotator.SingleAnnotator: __call__, __init__, columnName

Inherited from BaseAnnotator.BaseAnnotator: annotateDict, iteritems, iterkeys, itervalues, keys, specifyColumns, values

Class Variables [hide private]

Inherited from BaseAnnotator.BaseAnnotator: specificCols

Method Details [hide private]

allColumns(self)

 

Return an ordered sequence of all the column names that this multiple annotator can generate values for.

To facilitate ease of filtering with case-insensitivity, all of the values returned by this method should be lowercase.
Overrides: BaseAnnotator.BaseAnnotator.allColumns
(inherited documentation)

allValues(self, input)

 
Return an ordered sequence of all the values this multiple annotator can calculate off of the input. The order must correspond to the column list returned by allColumns so the caller can know which element is which.
Overrides: BaseAnnotator.BaseAnnotator.allValues
(inherited documentation)