Prosite
This module provides code to work with the prosite.dat file from
Prosite.
http://www.expasy.ch/prosite/
Tested with:
Release 15.0, July 1998
Release 16.0, July 1999
Release 17.0, Dec 2001
Classes:
Record Holds Prosite data.
PatternHit Holds data from a hit against a Prosite pattern.
Iterator Iterates over entries in a Prosite file.
Dictionary Accesses a Prosite file using a dictionary interface.
ExPASyDictionary Accesses Prosite records from ExPASy.
RecordParser Parses a Prosite record into a Record object.
_Scanner Scans Prosite-formatted data.
_RecordConsumer Consumes Prosite data to a Record object.
Functions:
scan_sequence_expasy Scan a sequence for occurrences of Prosite patterns.
index_file Index a Prosite file for a Dictionary.
_extract_record Extract Prosite data from a web page.
_extract_pattern_hits Extract Prosite patterns from a web page.
Imported modules
|
|
from Bio import File, Index
from Bio.ParserSupport import *
from Bio.WWW import ExPASy, RequestLimiter
import re
import sgmllib
import string
from types import *
|
Functions
|
|
_extract_pattern_hits
_extract_record
index_file
scan_sequence_expasy
|
|
_extract_pattern_hits
|
_extract_pattern_hits ( handle )
_extract_pattern_hits(handle) -> list of PatternHit's
Extract hits from a web page. Raises a ValueError if there
was an error in the query.
Exceptions
|
|
SyntaxError, "Expected accession but got:\n%s" % data
ValueError, p.broken_message
|
|
|
_extract_record
|
_extract_record ( handle )
_extract_record(handle) -> str
Extract PROSITE data from a web page. Raises a ValueError if no
data was found in the web page.
Exceptions
|
|
ValueError, "No data found in web page."
|
|
|
index_file
|
index_file (
filename,
indexname,
rec2key=None,
)
index_file(filename, indexname, rec2key=None)
Index a Prosite 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 id name will be used.
Exceptions
|
|
KeyError, "duplicate key %s found" % key
KeyError, "empty key was produced"
ValueError, "%s does not exist" % filename
|
|
|
scan_sequence_expasy
|
scan_sequence_expasy (
seq=None,
id=None,
exclude_frequent=None,
)
scan_sequence_expasy(seq=None, id=None, exclude_frequent=None) ->
list of PatternHit's Search a sequence for occurrences of Prosite patterns. You can
specify either a sequence in seq or a SwissProt/trEMBL ID or accession
in id. Only one of those should be given. If exclude_frequent
is true, then the patterns with the high probability of occurring
will be excluded.
Exceptions
|
|
ValueError, "Please specify either a sequence or an id"
|
|
Classes
|
|
Dictionary |
Accesses a Prosite file using a dictionary interface.
|
ExPASyDictionary |
Access PROSITE at ExPASy using a read-only dictionary interface.
|
Iterator |
Returns one record at a time from a Prosite file.
|
PatternHit |
Holds information from a hit against a Prosite pattern.
|
Record |
Holds information from a Prosite record.
|
RecordParser |
Parses Prosite data into a Record object.
|
_RecordConsumer |
Consumer that converts a Prosite record to a Record object.
|
_Scanner |
Scans Prosite-formatted data.
|
|
|