Package Bio :: Package Clustalw :: Class _AlignCreator
[hide private]
[frames] | no frames]

Class _AlignCreator

source code

xml.sax.handler.ContentHandler --+
                                 |
                                _AlignCreator

Handler to create a ClustalAlignment object from clustal file info.

This handler is used to accept events coming from a Martel parsing stream, and acts like a normal SAX handler.

After parsing, the alignment object created is available as the align attribute of the class.

Instance Methods [hide private]
 
__init__(self, alphabet)
Create a new handler ready to deal with output from Martel parsing.
source code
 
startElement(self, name, attrs)
Check the various tags for the info we are interested in.
source code
 
characters(self, content)
Receive notification of character data.
source code
 
endElement(self, name)
Signals the end of an element in non-namespace mode.
source code
 
endDocument(self)
Receive notification of the end of a document.
source code

Inherited from xml.sax.handler.ContentHandler: endElementNS, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startElementNS, startPrefixMapping

Method Details [hide private]

__init__(self, alphabet)
(Constructor)

source code 

Create a new handler ready to deal with output from Martel parsing.

Arguments: o alphabet - The alphabet to create all of the new sequences with.

Overrides: xml.sax.handler.ContentHandler.__init__

startElement(self, name, attrs)

source code 

Check the various tags for the info we are interested in.

Overrides: xml.sax.handler.ContentHandler.startElement

characters(self, content)

source code 

Receive notification of character data.

The Parser will call this method to report each chunk of character data. SAX parsers may return all contiguous character data in a single chunk, or they may split it into several chunks; however, all of the characters in any single event must come from the same external entity so that the Locator provides useful information.

Overrides: xml.sax.handler.ContentHandler.characters
(inherited documentation)

endElement(self, name)

source code 

Signals the end of an element in non-namespace mode.

The name parameter contains the name of the element type, just as with the startElement event.

Overrides: xml.sax.handler.ContentHandler.endElement
(inherited documentation)

endDocument(self)

source code 

Receive notification of the end of a document.

The SAX parser will invoke this method only once, and it will be the last method invoked during the parse. The parser shall not invoke this method until it has either abandoned parsing (because of an unrecoverable error) or reached the end of input.

Overrides: xml.sax.handler.ContentHandler.endDocument
(inherited documentation)