Class EmblLikeFormat
- java.lang.Object
-
- org.biojava.bio.seq.io.EmblLikeFormat
-
- All Implemented Interfaces:
Serializable,EventListener,SequenceFormat,ParseErrorListener,ParseErrorSource
public class EmblLikeFormat extends Object implements SequenceFormat, Serializable, ParseErrorSource, ParseErrorListener
Deprecated.Use org.biojavax.bio.seq.io.EMBLFormat insteadFormat processor for handling EMBL records and similar files. This takes a very simple approach: all `normal' attribute lines are passed to the listener as a tag (first two characters) and a value (the rest of the line from the 6th character onwards). Any data between the special `SQ' line and the "//" entry terminator is passed as a SymbolReader.
This low-level format processor should normally be used in conjunction with one or more `filter' objects, such as EmblProcessor.
Many ideas borrowed from the old EmblFormat processor by Thomas Down and Thad Welch.
- Since:
- 1.1
- Author:
- Thomas Down, Greg Cox, Keith James, Len Trigg, Lorna Morris
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected static StringACCESSION_TAGDeprecated.protected static StringAUTHORS_TAGDeprecated.protected static StringCIRCULAR_TAGDeprecated.protected static StringCOMMENT_TAGDeprecated.protected static StringCOORDINATE_TAGDeprecated.protected static StringDATE_TAGDeprecated.static StringDEFAULTDeprecated.protected static StringDEFINITION_TAGDeprecated.protected static StringDIVISION_TAGDeprecated.protected static StringDR_TAGDeprecated.protected static StringEND_SEQUENCE_TAGDeprecated.protected static StringFEATURE_TABLE_TAGDeprecated.protected static StringFEATURE_TAGDeprecated.protected static StringID_TAGDeprecated.protected static StringJOURNAL_TAGDeprecated.protected static StringKEYWORDS_TAGDeprecated.protected static StringORGANISM_TAGDeprecated.protected static StringORGANISM_XREF_TAGDeprecated.protected static StringREF_ACCESSION_TAGDeprecated.protected static StringREF_XREF_TAGDeprecated.protected static StringREFERENCE_TAGDeprecated.protected static StringSEPARATOR_TAGDeprecated.protected static StringSIZE_TAGDeprecated.protected static StringSOURCE_TAGDeprecated.protected static StringSTART_SEQUENCE_TAGDeprecated.protected static StringSTRAND_NUMBER_TAGDeprecated.protected static StringTITLE_TAGDeprecated.protected static StringTYPE_TAGDeprecated.protected static StringVERSION_TAGDeprecated.
-
Constructor Summary
Constructors Constructor Description EmblLikeFormat()Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddParseErrorListener(ParseErrorListener theListener)Deprecated.Adds a parse error listener to the list of listeners if it isn't already included.voidBadLineParsed(ParseErrorEvent theEvent)Deprecated.This method determines the behaviour when a bad line is processed.StringgetDefaultFormat()Deprecated.booleangetElideSymbols()Deprecated.Return a flag indicating if symbol data will be skipped when parsing streams.protected voidnotifyParseErrorEvent(ParseErrorEvent theEvent)Deprecated.Passes the event on to all the listeners registered for ParseErrorEvents.protected voidprocessSequenceLine(String line, StreamParser parser)Deprecated.Dispatch symbol data from SQ-block line of an EMBL-like file.booleanreadSequence(BufferedReader reader, SymbolTokenization symParser, SeqIOListener listener)Deprecated.Read a sequence and pass data on to a SeqIOListener.voidremoveParseErrorListener(ParseErrorListener theListener)Deprecated.Removes a parse error listener from the list of listeners if it is included.voidsetElideSymbols(boolean b)Deprecated.Specifies whether the symbols (SQ) part of the entry should be ignored.voidwriteSequence(Sequence seq, PrintStream os)Deprecated.writeSequencewrites a sequence to the specified PrintStream, using the default format.voidwriteSequence(Sequence seq, String format, PrintStream os)Deprecated.use writeSequence(Sequence seq, PrintStream os)
-
-
-
Field Detail
-
DEFAULT
public static final String DEFAULT
Deprecated.- See Also:
- Constant Field Values
-
ID_TAG
protected static final String ID_TAG
Deprecated.- See Also:
- Constant Field Values
-
SIZE_TAG
protected static final String SIZE_TAG
Deprecated.- See Also:
- Constant Field Values
-
STRAND_NUMBER_TAG
protected static final String STRAND_NUMBER_TAG
Deprecated.- See Also:
- Constant Field Values
-
TYPE_TAG
protected static final String TYPE_TAG
Deprecated.- See Also:
- Constant Field Values
-
CIRCULAR_TAG
protected static final String CIRCULAR_TAG
Deprecated.- See Also:
- Constant Field Values
-
DIVISION_TAG
protected static final String DIVISION_TAG
Deprecated.- See Also:
- Constant Field Values
-
DR_TAG
protected static final String DR_TAG
Deprecated.- See Also:
- Constant Field Values
-
ACCESSION_TAG
protected static final String ACCESSION_TAG
Deprecated.- See Also:
- Constant Field Values
-
VERSION_TAG
protected static final String VERSION_TAG
Deprecated.- See Also:
- Constant Field Values
-
DATE_TAG
protected static final String DATE_TAG
Deprecated.- See Also:
- Constant Field Values
-
DEFINITION_TAG
protected static final String DEFINITION_TAG
Deprecated.- See Also:
- Constant Field Values
-
KEYWORDS_TAG
protected static final String KEYWORDS_TAG
Deprecated.- See Also:
- Constant Field Values
-
SOURCE_TAG
protected static final String SOURCE_TAG
Deprecated.- See Also:
- Constant Field Values
-
ORGANISM_TAG
protected static final String ORGANISM_TAG
Deprecated.- See Also:
- Constant Field Values
-
ORGANISM_XREF_TAG
protected static final String ORGANISM_XREF_TAG
Deprecated.- See Also:
- Constant Field Values
-
REFERENCE_TAG
protected static final String REFERENCE_TAG
Deprecated.- See Also:
- Constant Field Values
-
COORDINATE_TAG
protected static final String COORDINATE_TAG
Deprecated.- See Also:
- Constant Field Values
-
REF_ACCESSION_TAG
protected static final String REF_ACCESSION_TAG
Deprecated.- See Also:
- Constant Field Values
-
AUTHORS_TAG
protected static final String AUTHORS_TAG
Deprecated.- See Also:
- Constant Field Values
-
REF_XREF_TAG
protected static final String REF_XREF_TAG
Deprecated.- See Also:
- Constant Field Values
-
TITLE_TAG
protected static final String TITLE_TAG
Deprecated.- See Also:
- Constant Field Values
-
JOURNAL_TAG
protected static final String JOURNAL_TAG
Deprecated.- See Also:
- Constant Field Values
-
COMMENT_TAG
protected static final String COMMENT_TAG
Deprecated.- See Also:
- Constant Field Values
-
FEATURE_TAG
protected static final String FEATURE_TAG
Deprecated.- See Also:
- Constant Field Values
-
SEPARATOR_TAG
protected static final String SEPARATOR_TAG
Deprecated.- See Also:
- Constant Field Values
-
FEATURE_TABLE_TAG
protected static final String FEATURE_TABLE_TAG
Deprecated.- See Also:
- Constant Field Values
-
START_SEQUENCE_TAG
protected static final String START_SEQUENCE_TAG
Deprecated.- See Also:
- Constant Field Values
-
END_SEQUENCE_TAG
protected static final String END_SEQUENCE_TAG
Deprecated.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
EmblLikeFormat
public EmblLikeFormat()
Deprecated.
-
-
Method Detail
-
setElideSymbols
public void setElideSymbols(boolean b)
Deprecated.Specifies whether the symbols (SQ) part of the entry should be ignored. If this property is set to
true, the parser will never call addSymbols on theSeqIOListener, but parsing will be faster if you're only interested in header information.This property also allows the header to be parsed for files which have invalid sequence data.
-
getElideSymbols
public boolean getElideSymbols()
Deprecated.Return a flag indicating if symbol data will be skipped when parsing streams.
-
readSequence
public boolean readSequence(BufferedReader reader, SymbolTokenization symParser, SeqIOListener listener) throws IllegalSymbolException, IOException, ParseException
Deprecated.Description copied from interface:SequenceFormatRead a sequence and pass data on to a SeqIOListener.- Specified by:
readSequencein interfaceSequenceFormat- Parameters:
reader- The stream of data to parse.symParser- A SymbolParser defining a mapping from character data to Symbols.listener- A listener to notify when data is extracted from the stream.- Returns:
- a boolean indicating whether or not the stream contains any more sequences.
- Throws:
IllegalSymbolException- if it is not possible to translate character data from the stream into valid BioJava symbols.IOException- if an error occurs while reading from the stream.ParseException
-
processSequenceLine
protected void processSequenceLine(String line, StreamParser parser) throws IllegalSymbolException, ParseException
Deprecated.Dispatch symbol data from SQ-block line of an EMBL-like file.- Throws:
IllegalSymbolExceptionParseException
-
writeSequence
public void writeSequence(Sequence seq, PrintStream os) throws IOException
Deprecated.Description copied from interface:SequenceFormatwriteSequencewrites a sequence to the specified PrintStream, using the default format.- Specified by:
writeSequencein interfaceSequenceFormat- Parameters:
seq- the sequence to write out.os- the printstream to write to.- Throws:
IOException
-
writeSequence
public void writeSequence(Sequence seq, String format, PrintStream os) throws IOException
Deprecated.use writeSequence(Sequence seq, PrintStream os)writeSequencewrites a sequence to the specifiedPrintStream, using the specified format.- Specified by:
writeSequencein interfaceSequenceFormat- Parameters:
seq- aSequenceto write out.format- aStringindicating which sub-format of those available from a particularSequenceFormatimplemention to use when writing.os- aPrintStreamobject.- Throws:
IOException- if an error occurs.
-
getDefaultFormat
public String getDefaultFormat()
Deprecated.getDefaultFormatreturns the String identifier for the default format written by aSequenceFormatimplementation.- Specified by:
getDefaultFormatin interfaceSequenceFormat- Returns:
- a
String.
-
BadLineParsed
public void BadLineParsed(ParseErrorEvent theEvent)
Deprecated.This method determines the behaviour when a bad line is processed. Some options are to log the error, throw an exception, ignore it completely, or pass the event through.
This method should be overwritten when different behavior is desired.
- Specified by:
BadLineParsedin interfaceParseErrorListener- Parameters:
theEvent- The event that contains the bad line and token.
-
addParseErrorListener
public void addParseErrorListener(ParseErrorListener theListener)
Deprecated.Adds a parse error listener to the list of listeners if it isn't already included.- Specified by:
addParseErrorListenerin interfaceParseErrorSource- Parameters:
theListener- Listener to be added.
-
removeParseErrorListener
public void removeParseErrorListener(ParseErrorListener theListener)
Deprecated.Removes a parse error listener from the list of listeners if it is included.- Specified by:
removeParseErrorListenerin interfaceParseErrorSource- Parameters:
theListener- Listener to be removed.
-
notifyParseErrorEvent
protected void notifyParseErrorEvent(ParseErrorEvent theEvent)
Deprecated.Passes the event on to all the listeners registered for ParseErrorEvents.- Parameters:
theEvent- The event to be handed to the listeners.
-
-