|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--org.biojava.bio.program.sax.AbstractNativeAppSAXParser
|
+--org.biojava.bio.program.sax.ClustalWAlignmentSAXParser
A SAX2 parser for dealing with a multiple sequence alignment as produced by ClustalW outputing .aln format. For example,
K1C0_XENLA/125-441 DKVHALETANTELERKIKEWYEKQRPGSSSGDGAKDYSKYYT K1C4_XENLA/81-396 EKVRALEAANADLELKIREWYEKQK-GSGIGAGSKDFSKYFE K1C5_XENLA/73-384 DRVRSLEQANHELELKIREYLDKK-----AAVGSLDYSGYYN keratin15 DKVRALEEANADLEVKIHDWYQKQTP----ASPECDYSQYFK K1C0_XENLA/125-441 -----AKFLLQNDNARLAADDFKMKFEN-------------- K1C4_XENLA/81-396 -----SRVVLQIDNAKLAADDFRLKFEN-------------- K1C5_XENLA/73-384 -----TRLVLSIDNAKLAADDFKIKYES-------------- keratin15 -----SRVILEIDNARLAADDFRLKYEN--------------
Please note, this parser reads the whole alignment in to core memory and thus does not scale to work with very large alignments on low-end hardware.
Please also note that this class has not been tested with many version of CLUSTAL W. Copyright © 2000,2001 Cambridge Antibody Technology. All Rights Reserved.
Primary author -
| Field Summary | |
protected int |
iState
|
protected java.lang.String |
oFullNamespacePrefix
|
protected org.xml.sax.ContentHandler |
oHandler
|
protected java.lang.String |
oNamespacePrefix
|
protected boolean |
tNamespacePrefixes
|
protected boolean |
tNamespaces
|
| Constructor Summary | |
ClustalWAlignmentSAXParser()
Initialises internal state Sets namespace prefix to "biojava" |
|
| Method Summary | |
void |
addPrefixMapping(java.lang.String poPrefix,
java.lang.String poURI)
Adds a namespace prefix to URI mapping as (key,value) pairs. |
protected void |
changeState(int piState)
Centralise chaining of iState field to help with debugging. |
protected void |
characters(char[] ch,
int start,
int length)
Utility method to centralize the sending of a SAX characters message a document handler. |
protected void |
endElement(org.biojava.bio.program.sax.QName poQName)
Utility method to centralize the sending of a SAX endElement message a document handler. |
org.xml.sax.ContentHandler |
getContentHandler()
Return the content handler. |
protected java.io.BufferedReader |
getContentStream(org.xml.sax.InputSource poSource)
Create a stream from an an InputSource, picking the correct stream according to order of precedance. |
org.xml.sax.DTDHandler |
getDTDHandler()
Do-nothing implementation of interface method |
org.xml.sax.EntityResolver |
getEntityResolver()
Do-nothing implementation of interface method |
org.xml.sax.ErrorHandler |
getErrorHandler()
Do-nothing implementation of interface method |
boolean |
getFeature(java.lang.String poName)
Do-nothing implementation of interface method |
java.lang.String |
getNamespacePrefix()
Describe getNamespacePrefix method here. |
boolean |
getNamespacePrefixes()
Support SAX2 configuration of namespace support of parser. |
boolean |
getNamespaces()
Support SAX2 configuration of namespace support of parser. |
java.lang.Object |
getProperty(java.lang.String name)
Do-nothing implementation of interface method |
java.lang.String |
getURIFromPrefix(java.lang.String poPrefix)
Gets the URI for a namespace prefix, given that prefix, or null if the prefix is not recognised. |
void |
parse(org.xml.sax.InputSource poSource)
Describe 'parse' method here. |
void |
parse(java.lang.String poSystemId)
Full implementation of interface method. |
java.lang.String |
prefix(java.lang.String poElementName)
Given an unprefixed element name, returns a new element name with a namespace prefix |
void |
setContentHandler(org.xml.sax.ContentHandler poHandler)
Allow an application to register a content event handler. |
void |
setDTDHandler(org.xml.sax.DTDHandler handler)
Do-nothing implementation of interface method |
void |
setEntityResolver(org.xml.sax.EntityResolver resolver)
Do-nothing implementation of interface method |
void |
setErrorHandler(org.xml.sax.ErrorHandler handler)
Do-nothing implementation of interface method |
void |
setFeature(java.lang.String poName,
boolean value)
Handles support for Namespaces and Namespace-prefixes |
void |
setNamespacePrefix(java.lang.String poPrefix)
|
void |
setProperty(java.lang.String name,
java.lang.Object value)
Do-nothing implementation of interface method |
protected void |
startElement(org.biojava.bio.program.sax.QName poQName,
org.xml.sax.Attributes atts)
Utility method to centralize sending of a SAX startElement message to document handler |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected org.xml.sax.ContentHandler oHandler
protected boolean tNamespaces
protected boolean tNamespacePrefixes
protected java.lang.String oNamespacePrefix
protected java.lang.String oFullNamespacePrefix
protected int iState
| Constructor Detail |
public ClustalWAlignmentSAXParser()
| Method Detail |
public void parse(org.xml.sax.InputSource poSource)
throws java.io.IOException,
org.xml.sax.SAXException
parse in interface org.xml.sax.XMLReaderparse in class org.biojava.bio.program.sax.AbstractNativeAppSAXParserjava.io.IOException
org.xml.sax.SAXExceptionpublic void setContentHandler(org.xml.sax.ContentHandler poHandler)
Applications may register a new or different handler in the middle of a parse, and the SAX parser must begin using the new handler immediately.
setContentHandler in interface org.xml.sax.XMLReaderpoHandler - a ContentHandler The XML content handler
java.lang.NullPointerException - If the handler argument is nullpublic org.xml.sax.ContentHandler getContentHandler()
getContentHandler in interface org.xml.sax.XMLReaderContentHandler The current content handler,
or null if none has been registered.
public void parse(java.lang.String poSystemId)
throws java.io.IOException,
org.xml.sax.SAXException
parse in interface org.xml.sax.XMLReaderjava.io.IOException
org.xml.sax.SAXException
public boolean getFeature(java.lang.String poName)
throws org.xml.sax.SAXNotRecognizedException,
org.xml.sax.SAXNotSupportedException
getFeature in interface org.xml.sax.XMLReaderorg.xml.sax.SAXNotRecognizedException
org.xml.sax.SAXNotSupportedException
public void setFeature(java.lang.String poName,
boolean value)
throws org.xml.sax.SAXNotRecognizedException,
org.xml.sax.SAXNotSupportedException
setFeature in interface org.xml.sax.XMLReaderorg.xml.sax.SAXNotRecognizedException
org.xml.sax.SAXNotSupportedException
public java.lang.Object getProperty(java.lang.String name)
throws org.xml.sax.SAXNotRecognizedException,
org.xml.sax.SAXNotSupportedException
getProperty in interface org.xml.sax.XMLReaderorg.xml.sax.SAXNotRecognizedException
org.xml.sax.SAXNotSupportedException
public void setProperty(java.lang.String name,
java.lang.Object value)
throws org.xml.sax.SAXNotRecognizedException,
org.xml.sax.SAXNotSupportedException
setProperty in interface org.xml.sax.XMLReaderorg.xml.sax.SAXNotRecognizedException
org.xml.sax.SAXNotSupportedExceptionpublic void setEntityResolver(org.xml.sax.EntityResolver resolver)
setEntityResolver in interface org.xml.sax.XMLReaderpublic org.xml.sax.EntityResolver getEntityResolver()
getEntityResolver in interface org.xml.sax.XMLReaderpublic void setDTDHandler(org.xml.sax.DTDHandler handler)
setDTDHandler in interface org.xml.sax.XMLReaderpublic org.xml.sax.DTDHandler getDTDHandler()
getDTDHandler in interface org.xml.sax.XMLReaderpublic void setErrorHandler(org.xml.sax.ErrorHandler handler)
setErrorHandler in interface org.xml.sax.XMLReaderpublic org.xml.sax.ErrorHandler getErrorHandler()
getErrorHandler in interface org.xml.sax.XMLReader
protected void startElement(org.biojava.bio.program.sax.QName poQName,
org.xml.sax.Attributes atts)
throws org.xml.sax.SAXException
poQName - a QName valueatts - an Attributes value
org.xml.sax.SAXException - if an error occurs
protected void endElement(org.biojava.bio.program.sax.QName poQName)
throws org.xml.sax.SAXException
org.xml.sax.SAXException - thrown if
thrown - if
protected void characters(char[] ch,
int start,
int length)
throws org.xml.sax.SAXException
start - -length - -
org.xml.sax.SAXException - thrown if
thrown - ifpublic boolean getNamespaces()
getNamespaces in interface org.biojava.bio.program.sax.NamespaceConfigurationIFpublic boolean getNamespacePrefixes()
getNamespacePrefixes in interface org.biojava.bio.program.sax.NamespaceConfigurationIF
public void addPrefixMapping(java.lang.String poPrefix,
java.lang.String poURI)
poPrefix - a String representation of the
namespace prefixpoURI - a String representation of the URI
for the namespace prefix.public java.lang.String getURIFromPrefix(java.lang.String poPrefix)
getURIFromPrefix in interface org.biojava.bio.program.sax.NamespaceConfigurationIFpoPrefix - a String The namespace prefix.public void setNamespacePrefix(java.lang.String poPrefix)
poPrefix - a String valuepublic java.lang.String getNamespacePrefix()
getNamespacePrefix method here.
String valuepublic java.lang.String prefix(java.lang.String poElementName)
String valueprotected java.io.BufferedReader getContentStream(org.xml.sax.InputSource poSource)
BufferedReader valueprotected void changeState(int piState)
piState - an int value
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||