Table of Contents

Class: _BaseGenBankConsumer Bio/GenBank/__init__.py

Abstract GenBank consumer providing useful general functions.

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

Base Classes   
AbstractConsumer
Methods   
__init__
_clean_location
_convert_to_python_numbers
_normalize_spaces
_remove_newlines
_remove_spaces
_split_accessions
_split_keywords
_split_taxonomy
  __init__ 
__init__ ( self )

  _clean_location 
_clean_location ( self,  location_string )

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 
_convert_to_python_numbers (
        self,
        start,
        end,
        )

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.

  _normalize_spaces 
_normalize_spaces ( self,  text )

Replace multiple spaces in the passed text with single spaces.

  _remove_newlines 
_remove_newlines ( self,  text )

Remove any newlines in the passed text, returning the new string.

  _remove_spaces 
_remove_spaces ( self,  text )

Remove all spaces from the passed text.

  _split_accessions 
_split_accessions ( self,  accession_string )

Split a string of accession numbers into a list.

  _split_keywords 
_split_keywords ( self,  keyword_string )

Split a string of keywords into a nice clean list.

  _split_taxonomy 
_split_taxonomy ( self,  taxonomy_string )

Split a string with taxonomy info into a list.


Table of Contents

This document was automatically generated on Mon Jul 1 12:02:49 2002 by HappyDoc version 2.0.1