Package Bio :: Package Fasta
[hide private]
[frames] | no frames]

Package Fasta

source code

Utilities for working with FASTA-formatted sequences.

This module uses Martel-based parsing to speed up the parsing process.

Classes: Record Holds FASTA sequence data. Iterator Iterates over sequence data in a FASTA file. Dictionary Accesses a FASTA file using a dictionary interface. RecordParser Parses FASTA sequence data into a Record object. SequenceParser Parses FASTA sequence data into a Sequence object.

Functions: index_file Index a FASTA file for a Dictionary.

Submodules [hide private]

Classes [hide private]
  Record
Holds information from a FASTA record.
  Iterator
Returns one record at a time from a FASTA file.
  RecordParser
Parses FASTA sequence data into a Fasta.Record object.
  SequenceParser
Parses FASTA sequence data into a SeqRecord object.
  Dictionary
Accesses an indexed FASTA file using a dictionary interface.
  _FastaTitleIndexer
Simple indexer to index by the title of a FASTA record.
  _FastaFunctionIndexer
Indexer to index based on values returned by a function.
Functions [hide private]
 
index_file(filename, indexname, rec2key=None, use_berkeley=0)
Index a FASTA file.
source code
Function Details [hide private]

index_file(filename, indexname, rec2key=None, use_berkeley=0)

source code 

Index a FASTA file. DEPRECATED

filename is the name of the file to index.

indexname is the name of the dictionary to be created. This can be just the name of the index, in which case the index information will be created in a directory of the given index name in the current directory, or a full pathname to a directory to save the indexing information.

rec2key is an optional callback fuction that takes a Fasta Record and generates a unique key (e.g. the accession number) for the record. Optionally, it can also return 3 items, to be used as the id (unique key) name, and aliases for the index. If not specified, the sequence title will be used.

use_berkeley specifies whether to use the BerkeleyDB indexer, which uses the bsddb3 wrappers around the embedded database Berkeley DB. By default, the standard flat file (non-Berkeley) indexes are used.