Bio :: GenBank :: _BaseGenBankConsumer :: Class _BaseGenBankConsumer
[hide private]
[frames] | no frames]

Class _BaseGenBankConsumer

source code

object --+
         |
        _BaseGenBankConsumer
Known Subclasses:

Abstract GenBank consumer providing useful general functions (PRIVATE).

This just helps to eliminate some duplication in things that most
GenBank consumers want to do.

Instance Methods [hide private]
 
__init__(self)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
_unhandled(self, data) source code
 
__getattr__(self, attr) source code
 
_split_keywords(self, keyword_string)
Split a string of keywords into a nice clean list.
source code
 
_split_accessions(self, accession_string)
Split a string of accession numbers into a list.
source code
 
_split_taxonomy(self, taxonomy_string)
Split a string with taxonomy info into a list.
source code
 
_clean_location(self, location_string)
Clean whitespace out of a location string.
source code
 
_remove_newlines(self, text)
Remove any newlines in the passed text, returning the new string.
source code
 
_normalize_spaces(self, text)
Replace multiple spaces in the passed text with single spaces.
source code
 
_remove_spaces(self, text)
Remove all spaces from the passed text.
source code
 
_convert_to_python_numbers(self, start, end)
Convert a start and end range to python notation.
source code

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

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

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 
x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

_clean_location(self, location_string)

source code 
Clean whitespace out of a location string.

The location parser isn't a fan of whitespace, so we clean it out
before feeding it into the parser.

_convert_to_python_numbers(self, start, end)

source code 
Convert a start and end range to python notation.

In GenBank, starts and ends are defined in "biological" coordinates,
where 1 is the first base and [i, j] means to include both i and j.

In python, 0 is the first base and [i, j] means to include i, but
not j.

So, to convert "biological" to python coordinates, we need to
subtract 1 from the start, and leave the end and things should
be converted happily.