Fasta package
This module provides code to work with FASTA-formatted sequences.
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.
_Scanner Scans a FASTA-format stream.
_RecordConsumer Consumes FASTA data to a Record object.
_SequenceConsumer Consumes FASTA data to a Sequence object.
Functions:
index_file Index a FASTA file for a Dictionary.
Imported modules
|
|
from Bio import File, Index, Seq, SeqRecord, Alphabet
from Bio.ParserSupport import *
import os
import string
from types import *
|
Functions
|
|
index_file
|
|
index_file
|
index_file (
filename,
indexname,
rec2key=None,
)
index_file(filename, indexname, rec2key=None)
Index a FASTA file. filename is the name of the file.
indexname is the name of the dictionary. rec2key is an
optional callback that takes a Record and generates a unique key
(e.g. the accession number) for the record. If not specified,
the sequence title will be used.
Exceptions
|
|
KeyError, "duplicate key %s found" % key
KeyError, "empty sequence key was produced"
ValueError, "%s does not exist" % filename
|
|
Classes
|
|
Dictionary |
Accesses a FASTA file using a dictionary interface.
|
Iterator |
Returns one record at a time from a FASTA file.
|
Record |
Holds information from a FASTA record.
|
RecordParser |
Parses FASTA sequence data into a Record object.
|
SequenceParser |
Parses FASTA sequence data into a Sequence object.
|
_RecordConsumer |
Consumer that converts a FASTA record to a Record object.
|
_Scanner |
Scans a FASTA-formatted file.
|
_SequenceConsumer |
Consumer that converts a FASTA record to a Sequence object.
|
|
|