Package CHEM :: Package ML :: Package features :: Module AggregateSpectrumExtractor :: Class AggregateSpectrumExtractor
[hide private]
[frames] | no frames]

Class AggregateSpectrumExtractor



BaseFeatureExtractor.BaseFeatureExtractor --+
                                            |
                                           AggregateSpectrumExtractor

Extension of simple SpectrumExtractor. Basically just does the simple SpectrumExtractor for all values of k (length of substrings to compare) from a minimum (default=1) up to the length of the strings.

Instance Methods [hide private]
 
__init__(self)
Constructor.
 
loadOptions(self, options)
Load relevant options derived from an optparse.OptionParser into the state of this object.
 
__call__(self, aString)
Create a dictionary keyed by all the k-mers (k-length substrings) of aString, with values equal to the number of times that k-mer appears in aString.
 
objectDescription(self, obj)
Input is a string itself, so just return the first token
 
getNameID(self, obj)
See if a second token exists, otherwise, return sentinel value

Inherited from BaseFeatureExtractor.BaseFeatureExtractor: loadArgs, main, outputFeatures

Class Variables [hide private]
  minK = 1

Inherited from BaseFeatureExtractor.BaseFeatureExtractor: inputFunction, inputIter, outFile, parser

Method Details [hide private]

__init__(self)
(Constructor)

 
Constructor. Initializes expected command-line options.
Overrides: BaseFeatureExtractor.BaseFeatureExtractor.__init__

loadOptions(self, options)

 

Load relevant options derived from an optparse.OptionParser into the state of this object.

Sub-classes should have this handle any of the options it added to the command-line parser via the constructor.
Overrides: BaseFeatureExtractor.BaseFeatureExtractor.loadOptions
(inherited documentation)

__call__(self, aString)
(Call operator)

 
Create a dictionary keyed by all the k-mers (k-length substrings) of aString, with values equal to the number of times that k-mer appears in aString.
Overrides: BaseFeatureExtractor.BaseFeatureExtractor.__call__

objectDescription(self, obj)

 
Input is a string itself, so just return the first token
Overrides: BaseFeatureExtractor.BaseFeatureExtractor.objectDescription

getNameID(self, obj)

 
See if a second token exists, otherwise, return sentinel value
Overrides: BaseFeatureExtractor.BaseFeatureExtractor.getNameID