Table of Contents

Class: MindyDictionary Bio/GenBank/__init__.py

Access a GenBank file using a dictionary interface, though a Mindy DB.

WARNING: This is very experimental and subject to change. It requires the use of Andrew Dalke's mindy.

This is the Dictionary interface to use after you create an index database using the function index_file_db.

Methods   
__getattr__
__getitem__
__init__
__len__
aliases
keys
  __getattr__ 
__getattr__ ( self,  name )

  __getitem__ 
__getitem__ ( self,  key )

Retrieve an item from the indexed file.

The key can be either a primary identifier or an alias. The lookup will first try to get the file via the primary identifier, and if it can't do this, will subsequently try to get it through the aliases to these keys. If the aliases are ambigous, an error will be raised.

Most of the time I find it easiest to search by aliases (the GenBank accession numbers), but YMMV.

Exceptions   
KeyError( "Multiple records found for key %s" % key )
KeyError( "No records found for key %s" % key )
  __init__ 
__init__ (
        self,
        db_name,
        db_directory,
        parser=None,
        )

Initialize and open up a GenBank dictionary.

Arguments:

  • db_name - The name of the database we should retrieve information from.

  • db_directory - The location of the database specified in db_name.

  • parser - An optional argument specifying a parser object that the records should be run through before returning the output. If parser is None then the unprocessed contents of the file will be returned.

Exceptions   
SystemExit( "You must have mindy installed:\n" + "http://www.biopython.org/~dalke/mindy-0.1.tar.gz" )
  __len__ 
__len__ ( self )

  aliases 
aliases ( self )

Provide all aliases in the current database.

  keys 
keys ( self )

Provide all identifiers for the current database.


Table of Contents

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