Package CHEM :: Package Annotation :: Module AnnotationAnnotators :: Class FValueAnnotator
[hide private]
[frames] | no frames]

Class FValueAnnotator



BaseAnnotator.BaseAnnotator --+    
                              |    
  BaseAnnotator.SingleAnnotator --+
                                  |
                                 FValueAnnotator

See if the string value (svalue) of the annotation can be parsed as a float value. If so, fill in the fvalue (float value) column.

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)
Assume input to be a tab-delimited string with values corresponding to the columns of the annotation table, in the following order (s2c_id, name, svalue, fvalue):

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)

 
Assume input to be a tab-delimited string with values corresponding to the columns of the annotation table, in the following order (s2c_id, name, svalue, fvalue):
>>> annotator = FValueAnnotator();
>>> input = "1 TestStr TestVal None";
>>> print annotator(input);
None
>>> input = "2 TestInt 0 None";
>>> print "%.1f" % annotator(input);
0.0
>>> input = "3 TestFloat 43.21 None";
>>> print "%.1f" % annotator(input);
43.2
Overrides: BaseAnnotator.BaseAnnotator.allValues