Package Bio :: Package GenBank :: Module utils :: Class FeatureValueCleaner
[hide private]
[frames] | no frames]

Class FeatureValueCleaner

source code

object --+
         |
        FeatureValueCleaner

Provide specialized capabilities for cleaning up values in features.

This class is designed to provide a mechanism to clean up and process values in the key/value pairs of GenBank features. This is useful because in cases like:

/translation="MED
YDPWNLRFQSKYKSRDA"

you'll end up with a value with 012s and spaces in it like:

"MED\012 YDPWEL..."

which you probably don't want.

This cleaning needs to be done on a case by case basis since it is impossible to interpret whether you should be concatenating everything (as in translations), or combining things with spaces (as might be the case with /notes).

Instance Methods [hide private]
 
__init__(self, to_process=['translation'])
Initialize with the keys we should deal with.
source code
 
clean_value(self, key_name, value)
Clean the specified value and return it.
source code
 
_clean_translation(self, value)
Concatenate a translation value to one long protein string.
source code

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

Class Variables [hide private]
  keys_to_process = ['translation']
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, to_process=['translation'])
(Constructor)

source code 
Initialize with the keys we should deal with.
Overrides: object.__init__

clean_value(self, key_name, value)

source code 

Clean the specified value and return it.

If the value is not specified to be dealt with, the original value will be returned.