Package org.biojava.bio.seq.io
Class GenbankFormat
java.lang.Object
org.biojava.bio.seq.io.GenbankFormat
- All Implemented Interfaces:
Serializable
,EventListener
,SequenceFormat
,ParseErrorListener
,ParseErrorSource
- Direct Known Subclasses:
GenbankXmlFormat
,GenpeptFormat
public class GenbankFormat
extends Object
implements SequenceFormat, Serializable, ParseErrorListener, ParseErrorSource
Deprecated.
Use org.biojavax.bio.seq.io.GenbankFormat
Format reader for GenBank files. Converted from the old style io to
the new by working from
EmblLikeFormat
.- Author:
- Thomas Down, Thad Welch Added GenBank header info to the sequence annotation. The ACCESSION header tag is not included. Stored in sequence.getName()., Greg Cox, Keith James, Matthew Pocock, Ron Kuhn
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final String
Deprecated.protected static final String
Deprecated.protected static final String
Deprecated.protected static final String
Deprecated.protected static final String
Deprecated.protected static final String
Deprecated.protected static final String
Deprecated.static final String
Deprecated.protected static final String
Deprecated.protected static final String
Deprecated.protected static final String
Deprecated.protected static final String
Deprecated.protected static final String
Deprecated.protected static final String
Deprecated.protected static final String
Deprecated.protected static final String
Deprecated.protected static final String
Deprecated.protected static final String
Deprecated.protected static final String
Deprecated.protected static final String
Deprecated.protected static final String
Deprecated.protected static final String
Deprecated.protected static final String
Deprecated.protected static final String
Deprecated.protected static final String
Deprecated.protected static final String
Deprecated.protected static final String
Deprecated.protected static final String
Deprecated.protected static final String
Deprecated.protected static final String
Deprecated. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addParseErrorListener
(ParseErrorListener theListener) Deprecated.Adds a parse error listener to the list of listeners if it isn't already included.void
BadLineParsed
(ParseErrorEvent theEvent) Deprecated.This method determines the behaviour when a bad line is processed.Deprecated.boolean
Deprecated.protected void
notifyParseErrorEvent
(ParseErrorEvent theEvent) Deprecated.Passes the event on to all the listeners registered for ParseErrorEvents.boolean
readSequence
(BufferedReader reader, SymbolTokenization symParser, SeqIOListener listener) Deprecated.Reads a sequence from the specified reader using the Symbol parser and Sequence Factory provided.void
removeParseErrorListener
(ParseErrorListener theListener) Deprecated.Removes a parse error listener from the list of listeners if it is included.void
setElideSymbols
(boolean elideSymbols) Deprecated.Use this method to toggle reading of sequence data.void
writeSequence
(Sequence seq, PrintStream os) Deprecated.writeSequence
writes a sequence to the specified PrintStream, using the default format.void
writeSequence
(Sequence seq, String format, PrintStream os) Deprecated.use writeSequence(Sequence seq, PrintStream os)
-
Field Details
-
DEFAULT
Deprecated.- See Also:
-
LOCUS_TAG
Deprecated.- See Also:
-
SIZE_TAG
Deprecated.- See Also:
-
STRAND_NUMBER_TAG
Deprecated.- See Also:
-
TYPE_TAG
Deprecated.- See Also:
-
CIRCULAR_TAG
Deprecated.- See Also:
-
DIVISION_TAG
Deprecated.- See Also:
-
DATE_TAG
Deprecated.- See Also:
-
ACCESSION_TAG
Deprecated.- See Also:
-
VERSION_TAG
Deprecated.- See Also:
-
GI_TAG
Deprecated.- See Also:
-
KEYWORDS_TAG
Deprecated.- See Also:
-
DEFINITION_TAG
Deprecated.- See Also:
-
SOURCE_TAG
Deprecated.- See Also:
-
ORGANISM_TAG
Deprecated.- See Also:
-
REFERENCE_TAG
Deprecated.- See Also:
-
COORDINATE_TAG
Deprecated.- See Also:
-
REF_ACCESSION_TAG
Deprecated.- See Also:
-
AUTHORS_TAG
Deprecated.- See Also:
-
TITLE_TAG
Deprecated.- See Also:
-
JOURNAL_TAG
Deprecated.- See Also:
-
PUBMED_TAG
Deprecated.- See Also:
-
MEDLINE_TAG
Deprecated.- See Also:
-
COMMENT_TAG
Deprecated.- See Also:
-
FEATURE_TAG
Deprecated.- See Also:
-
BASE_COUNT_TAG
Deprecated.- See Also:
-
FEATURE_FLAG
Deprecated.- See Also:
-
START_SEQUENCE_TAG
Deprecated.- See Also:
-
END_SEQUENCE_TAG
Deprecated.- See Also:
-
FEATURE_LINE_PREFIX
Deprecated.- See Also:
-
-
Constructor Details
-
GenbankFormat
public GenbankFormat()Deprecated.
-
-
Method Details
-
readSequence
public boolean readSequence(BufferedReader reader, SymbolTokenization symParser, SeqIOListener listener) throws IllegalSymbolException, IOException, ParseException Deprecated.Reads a sequence from the specified reader using the Symbol parser and Sequence Factory provided. The sequence read in must be in Genbank format.- Specified by:
readSequence
in 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:
- boolean True if there is another sequence in the file; false otherwise
- 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
-
writeSequence
Deprecated.Description copied from interface:SequenceFormat
writeSequence
writes a sequence to the specified PrintStream, using the default format.- Specified by:
writeSequence
in interfaceSequenceFormat
- Parameters:
seq
- the sequence to write out.os
- the printstream to write to.- Throws:
IOException
-
writeSequence
Deprecated.use writeSequence(Sequence seq, PrintStream os)writeSequence
writes a sequence to the specifiedPrintStream
, using the specified format.- Specified by:
writeSequence
in interfaceSequenceFormat
- Parameters:
seq
- aSequence
to write out.format
- aString
indicating which sub-format of those available from a particularSequenceFormat
implemention to use when writing.os
- aPrintStream
object.- Throws:
IOException
- if an error occurs.
-
getDefaultFormat
Deprecated.getDefaultFormat
returns the String identifier for the default format.- Specified by:
getDefaultFormat
in interfaceSequenceFormat
- Returns:
- a
String
.
-
addParseErrorListener
Deprecated.Adds a parse error listener to the list of listeners if it isn't already included.- Specified by:
addParseErrorListener
in interfaceParseErrorSource
- Parameters:
theListener
- Listener to be added.
-
removeParseErrorListener
Deprecated.Removes a parse error listener from the list of listeners if it is included.- Specified by:
removeParseErrorListener
in interfaceParseErrorSource
- Parameters:
theListener
- Listener to be removed.
-
BadLineParsed
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:
BadLineParsed
in interfaceParseErrorListener
- Parameters:
theEvent
- The event that contains the bad line and token.
-
notifyParseErrorEvent
Deprecated.Passes the event on to all the listeners registered for ParseErrorEvents.- Parameters:
theEvent
- The event to be handed to the listeners.
-
getElideSymbols
Deprecated. -
setElideSymbols
Deprecated.Use this method to toggle reading of sequence data. If you're only interested in header data set to true.- Parameters:
elideSymbols
- set to true if you don't want the sequence data.
-