Package org.biojava.bio.seq.io
Class GenbankFormat
- java.lang.Object
-
- org.biojava.bio.seq.io.GenbankFormat
-
- All Implemented Interfaces:
java.io.Serializable,java.util.EventListener,SequenceFormat,ParseErrorListener,ParseErrorSource
- Direct Known Subclasses:
GenbankXmlFormat,GenpeptFormat
public class GenbankFormat extends java.lang.Object implements SequenceFormat, java.io.Serializable, ParseErrorListener, ParseErrorSource
Deprecated.Use org.biojavax.bio.seq.io.GenbankFormatFormat reader for GenBank files. Converted from the old style io to the new by working fromEmblLikeFormat.- 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:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.StringACCESSION_TAGDeprecated.protected static java.lang.StringAUTHORS_TAGDeprecated.protected static java.lang.StringBASE_COUNT_TAGDeprecated.protected static java.lang.StringCIRCULAR_TAGDeprecated.protected static java.lang.StringCOMMENT_TAGDeprecated.protected static java.lang.StringCOORDINATE_TAGDeprecated.protected static java.lang.StringDATE_TAGDeprecated.static java.lang.StringDEFAULTDeprecated.protected static java.lang.StringDEFINITION_TAGDeprecated.protected static java.lang.StringDIVISION_TAGDeprecated.protected static java.lang.StringEND_SEQUENCE_TAGDeprecated.protected static java.lang.StringFEATURE_FLAGDeprecated.protected static java.lang.StringFEATURE_LINE_PREFIXDeprecated.protected static java.lang.StringFEATURE_TAGDeprecated.protected static java.lang.StringGI_TAGDeprecated.protected static java.lang.StringJOURNAL_TAGDeprecated.protected static java.lang.StringKEYWORDS_TAGDeprecated.protected static java.lang.StringLOCUS_TAGDeprecated.protected static java.lang.StringMEDLINE_TAGDeprecated.protected static java.lang.StringORGANISM_TAGDeprecated.protected static java.lang.StringPUBMED_TAGDeprecated.protected static java.lang.StringREF_ACCESSION_TAGDeprecated.protected static java.lang.StringREFERENCE_TAGDeprecated.protected static java.lang.StringSIZE_TAGDeprecated.protected static java.lang.StringSOURCE_TAGDeprecated.protected static java.lang.StringSTART_SEQUENCE_TAGDeprecated.protected static java.lang.StringSTRAND_NUMBER_TAGDeprecated.protected static java.lang.StringTITLE_TAGDeprecated.protected static java.lang.StringTYPE_TAGDeprecated.protected static java.lang.StringVERSION_TAGDeprecated.
-
Constructor Summary
Constructors Constructor Description GenbankFormat()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.java.lang.StringgetDefaultFormat()Deprecated.booleangetElideSymbols()Deprecated.protected voidnotifyParseErrorEvent(ParseErrorEvent theEvent)Deprecated.Passes the event on to all the listeners registered for ParseErrorEvents.booleanreadSequence(java.io.BufferedReader reader, SymbolTokenization symParser, SeqIOListener listener)Deprecated.Reads a sequence from the specified reader using the Symbol parser and Sequence Factory provided.voidremoveParseErrorListener(ParseErrorListener theListener)Deprecated.Removes a parse error listener from the list of listeners if it is included.voidsetElideSymbols(boolean elideSymbols)Deprecated.Use this method to toggle reading of sequence data.voidwriteSequence(Sequence seq, java.io.PrintStream os)Deprecated.writeSequencewrites a sequence to the specified PrintStream, using the default format.voidwriteSequence(Sequence seq, java.lang.String format, java.io.PrintStream os)Deprecated.use writeSequence(Sequence seq, PrintStream os)
-
-
-
Field Detail
-
DEFAULT
public static final java.lang.String DEFAULT
Deprecated.- See Also:
- Constant Field Values
-
LOCUS_TAG
protected static final java.lang.String LOCUS_TAG
Deprecated.- See Also:
- Constant Field Values
-
SIZE_TAG
protected static final java.lang.String SIZE_TAG
Deprecated.- See Also:
- Constant Field Values
-
STRAND_NUMBER_TAG
protected static final java.lang.String STRAND_NUMBER_TAG
Deprecated.- See Also:
- Constant Field Values
-
TYPE_TAG
protected static final java.lang.String TYPE_TAG
Deprecated.- See Also:
- Constant Field Values
-
CIRCULAR_TAG
protected static final java.lang.String CIRCULAR_TAG
Deprecated.- See Also:
- Constant Field Values
-
DIVISION_TAG
protected static final java.lang.String DIVISION_TAG
Deprecated.- See Also:
- Constant Field Values
-
DATE_TAG
protected static final java.lang.String DATE_TAG
Deprecated.- See Also:
- Constant Field Values
-
ACCESSION_TAG
protected static final java.lang.String ACCESSION_TAG
Deprecated.- See Also:
- Constant Field Values
-
VERSION_TAG
protected static final java.lang.String VERSION_TAG
Deprecated.- See Also:
- Constant Field Values
-
GI_TAG
protected static final java.lang.String GI_TAG
Deprecated.- See Also:
- Constant Field Values
-
KEYWORDS_TAG
protected static final java.lang.String KEYWORDS_TAG
Deprecated.- See Also:
- Constant Field Values
-
DEFINITION_TAG
protected static final java.lang.String DEFINITION_TAG
Deprecated.- See Also:
- Constant Field Values
-
SOURCE_TAG
protected static final java.lang.String SOURCE_TAG
Deprecated.- See Also:
- Constant Field Values
-
ORGANISM_TAG
protected static final java.lang.String ORGANISM_TAG
Deprecated.- See Also:
- Constant Field Values
-
REFERENCE_TAG
protected static final java.lang.String REFERENCE_TAG
Deprecated.- See Also:
- Constant Field Values
-
COORDINATE_TAG
protected static final java.lang.String COORDINATE_TAG
Deprecated.- See Also:
- Constant Field Values
-
REF_ACCESSION_TAG
protected static final java.lang.String REF_ACCESSION_TAG
Deprecated.- See Also:
- Constant Field Values
-
AUTHORS_TAG
protected static final java.lang.String AUTHORS_TAG
Deprecated.- See Also:
- Constant Field Values
-
TITLE_TAG
protected static final java.lang.String TITLE_TAG
Deprecated.- See Also:
- Constant Field Values
-
JOURNAL_TAG
protected static final java.lang.String JOURNAL_TAG
Deprecated.- See Also:
- Constant Field Values
-
PUBMED_TAG
protected static final java.lang.String PUBMED_TAG
Deprecated.- See Also:
- Constant Field Values
-
MEDLINE_TAG
protected static final java.lang.String MEDLINE_TAG
Deprecated.- See Also:
- Constant Field Values
-
COMMENT_TAG
protected static final java.lang.String COMMENT_TAG
Deprecated.- See Also:
- Constant Field Values
-
FEATURE_TAG
protected static final java.lang.String FEATURE_TAG
Deprecated.- See Also:
- Constant Field Values
-
BASE_COUNT_TAG
protected static final java.lang.String BASE_COUNT_TAG
Deprecated.- See Also:
- Constant Field Values
-
FEATURE_FLAG
protected static final java.lang.String FEATURE_FLAG
Deprecated.- See Also:
- Constant Field Values
-
START_SEQUENCE_TAG
protected static final java.lang.String START_SEQUENCE_TAG
Deprecated.- See Also:
- Constant Field Values
-
END_SEQUENCE_TAG
protected static final java.lang.String END_SEQUENCE_TAG
Deprecated.- See Also:
- Constant Field Values
-
FEATURE_LINE_PREFIX
protected static final java.lang.String FEATURE_LINE_PREFIX
Deprecated.- See Also:
- Constant Field Values
-
-
Method Detail
-
readSequence
public boolean readSequence(java.io.BufferedReader reader, SymbolTokenization symParser, SeqIOListener listener) throws IllegalSymbolException, java.io.IOException, ParseExceptionDeprecated.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:
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:
- 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.java.io.IOException- if an error occurs while reading from the stream.ParseException
-
writeSequence
public void writeSequence(Sequence seq, java.io.PrintStream os) throws java.io.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:
java.io.IOException
-
writeSequence
public void writeSequence(Sequence seq, java.lang.String format, java.io.PrintStream os) throws java.io.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:
java.io.IOException- if an error occurs.
-
getDefaultFormat
public java.lang.String getDefaultFormat()
Deprecated.getDefaultFormatreturns the String identifier for the default format.- Specified by:
getDefaultFormatin interfaceSequenceFormat- Returns:
- a
String.
-
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.
-
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.
-
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.
-
getElideSymbols
public boolean getElideSymbols()
Deprecated.
-
setElideSymbols
public void setElideSymbols(boolean elideSymbols)
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.
-
-