Table of Contents

Module: SProt Bio/SwissProt/SProt.py

SProt.py

This module provides code to work with the sprotXX.dat file from SwissProt. http://www.expasy.ch/sprot/sprot-top.html

Tested with: Release 37, Release 38, Release 39

Classes: Record Holds SwissProt data. Reference Holds reference data from a SwissProt entry. Iterator Iterates over entries in a SwissProt file. Dictionary Accesses a SwissProt file using a dictionary interface. ExPASyDictionary Accesses SwissProt records from ExPASy. RecordParser Parses a SwissProt record into a Record object. SequenceParser Parses a SwissProt record into a Seq object.

_Scanner Scans SwissProt-formatted data. _RecordConsumer Consumes SwissProt data to a Record object. _SequenceConsumer Consumes SwissProt data to a Seq object.

Functions: index_file Index a SwissProt file for a Dictionary.

Imported modules   
from Bio import File, Index, Alphabet, Seq, SeqRecord
from Bio.ParserSupport import *
from Bio.WWW import ExPASy, RequestLimiter
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 SwissProt 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 entry name 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 SwissProt file using a dictionary interface.

ExPASyDictionary

Access SwissProt at ExPASy using a read-only dictionary interface.

Iterator

Returns one record at a time from a SwissProt file.

Record

Holds information from a SwissProt record.

RecordParser

Parses SwissProt data into a Record object.

Reference

Holds information from 1 references in a SwissProt entry.

SequenceParser

Parses SwissProt data into a Seq object.

_RecordConsumer

Consumer that converts a SwissProt record to a Record object.

_Scanner

Scans SwissProt-formatted data.

_SequenceConsumer

Consumer that converts a SwissProt record to a Seq object.


Table of Contents

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