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

Class AnnotationIDAnnotator



BaseAnnotator.BaseAnnotator --+
                              |
                             AnnotationIDAnnotator

Given a tab-delimited line representing an annotation row, return the id corresponding to it. This would be a composite key, so return the tuple of (source2chemicalmix_id, name)

Instance Methods [hide private]
 
allColumns(self)
Just return the column name that this annotator is meant to populate, but composite key, so return a tuple.
 
allValues(self, input)
Given an annotation row as a text line, parse out the id fields.

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

Class Variables [hide private]

Inherited from BaseAnnotator.BaseAnnotator: specificCols

Method Details [hide private]

allColumns(self)

 
Just return the column name that this annotator is meant to populate, but composite key, so return a tuple.
>>> annotator = AnnotationIDAnnotator();
>>> print annotator.allColumns();
['source2chemicalmix_id', 'name']
Overrides: BaseAnnotator.BaseAnnotator.allColumns

allValues(self, input)

 
Given an annotation row as a text line, parse out the id fields.
>>> annotator = AnnotationIDAnnotator();
>>> input = "1 TestStr TestVal None";
>>> print annotator.allValues(input);
[1, 'TestStr']
>>> input = "2 TestInt 0 None";
>>> print annotator.allValues(input);
[2, 'TestInt']
>>> input = "3 TestFloat 43.21 None";
>>> print annotator.allValues(input);
[3, 'TestFloat']
Overrides: BaseAnnotator.BaseAnnotator.allValues