|
StdHandler
Handle_dbid -- get the primary identifier
Handle_description -- get the description
Handle_dbxref -- get database cross references
Handle_sequence -- get the sequence information
Handle_features -- get the features
Handle_hsp -- get similar search HSPs
...
These are composable to build specialized handler
class BuildSeqRecord(Dispatch.Dispatcher):
def __init__(self):
Dispatch.Dispatcher.__init__(self, namespace = Std.NS)
self.acquire(StdHandler.Handle_dbid(self.add_dbid))
self.acquire(StdHandler.Handle_sequence(self.add_sequence))
...
def add_sequence(self, (alphabet, seq, gapchar, stopchar)):
alphabet = alphabet_table.get(alphabet,
Alphabet.single_letter_alphabet)
self.seq = Seq.Seq(seq, alphabet)
|
|