public class GenbankFileFormer extends Object implements SeqFileFormer
GenbankFileFormer performs the detailed formatting of
Genbank entries for writing to a PrintStream. There is
some code dupication with EmblFileFormer which could
be factored out.| Modifier | Constructor and Description |
|---|---|
protected |
GenbankFileFormer()
Deprecated.
Creates a new
GenbankFileFormer using
System.out stream. |
protected |
GenbankFileFormer(PrintStream stream)
Deprecated.
Creates a new
GenbankFileFormer using the
specified stream. |
| Modifier and Type | Method and Description |
|---|---|
void |
addFeatureProperty(Object key,
Object value)
Deprecated.
Notify the listener of a feature property.
|
void |
addSequenceProperty(Object key,
Object value)
Deprecated.
Notify the listener of a sequence-wide property.
|
void |
addSymbols(Alphabet alpha,
Symbol[] syms,
int start,
int length)
Deprecated.
Notify the listener of symbol data.
|
void |
endFeature()
Deprecated.
Mark the end of data associated with one specific feature.
|
void |
endSequence()
Deprecated.
Notify the listener that processing of the sequence is complete.
|
String |
formatLocation(Feature theFeature)
Formats the location of a feature.
|
String |
formatLocation(Location loc,
StrandedFeature.Strand strand)
formatLocation creates an EMBL/Genbank style
representation of a Location. |
StringBuffer |
formatLocation(StringBuffer sb,
Location loc,
StrandedFeature.Strand strand)
formatLocation creates an EMBL/Genbank style
representation of a Location. |
PrintStream |
getPrintStream()
Deprecated.
getPrintStream returns the
PrintStream to which an instance will write the
formatted data. |
boolean |
getVectorNTISupport()
Deprecated.
Is VectorNTI compatable output being produced?
|
void |
setName(String id)
Deprecated.
Notify the listener that the current sequence is generally known
by a particular name.
|
void |
setPrintStream(PrintStream stream)
Deprecated.
setPrintStream informs an instance which
PrintStream to use. |
void |
setURI(String uri)
Deprecated.
Notify the listener of a URI identifying the current sequence.
|
void |
setVectorNTISupport(boolean b)
Deprecated.
VectorNTI requires GenBank format to be a little more specific than
required by the GenBank definition.
|
void |
startFeature(Feature.Template templ)
Deprecated.
Notify the listener that a new feature object is starting.
|
void |
startSequence()
Deprecated.
Start the processing of a sequence.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitformatLocation, formatLocationprotected GenbankFileFormer()
GenbankFileFormer using
System.out stream.protected GenbankFileFormer(PrintStream stream)
GenbankFileFormer using the
specified stream.stream - a PrintStream.public PrintStream getPrintStream()
SeqFileFormergetPrintStream returns the
PrintStream to which an instance will write the
formatted data. If this has not been set, an implementation
should default to System.out.getPrintStream in interface SeqFileFormerPrintStream which will be written to.public void setPrintStream(PrintStream stream)
SeqFileFormersetPrintStream informs an instance which
PrintStream to use.setPrintStream in interface SeqFileFormerstream - a PrintStream to write to.public void setName(String id) throws ParseException
SeqIOListenersetName in interface SeqIOListenerid - the String that should be returned by getName for the sequence
being parsedParseExceptionpublic void startSequence() throws ParseException
SeqIOListenerstartSequence in interface SeqIOListenerParseExceptionpublic void endSequence() throws ParseException
SeqIOListenerendSequence in interface SeqIOListenerParseExceptionpublic void setURI(String uri) throws ParseException
SeqIOListenersetURI in interface SeqIOListenerParseExceptionpublic void addSymbols(Alphabet alpha, Symbol[] syms, int start, int length) throws IllegalAlphabetException
SeqIOListeneraddSymbols in interface SeqIOListeneralpha - The alphabet of the symbol datasyms - An array containing symbolsstart - The start offset of valid data within the arraylength - The number of valid symbols in the arrayIllegalAlphabetException - if we can't cope with this
alphabet.public void addSequenceProperty(Object key, Object value) throws ParseException
SeqIOListeneraddSequenceProperty in interface SeqIOListenerParseExceptionpublic void startFeature(Feature.Template templ) throws ParseException
SeqIOListenerstartFeature in interface SeqIOListenerParseExceptionpublic void endFeature() throws ParseException
SeqIOListenerendFeature in interface SeqIOListenerParseExceptionpublic void addFeatureProperty(Object key, Object value) throws ParseException
SeqIOListeneraddFeatureProperty in interface SeqIOListenerParseExceptionpublic void setVectorNTISupport(boolean b)
b - to support or not to support.public boolean getVectorNTISupport()
public String formatLocation(Feature theFeature)
theFeature - The feature with the location to formatpublic String formatLocation(Location loc, StrandedFeature.Strand strand)
formatLocation creates an EMBL/Genbank style
representation of a Location. This is a
convenience method only. The version which has a
StringBuffer parameter (and returns the
StringBuffer) is preferred. If a compound location is
formatted using this method, it is returned as a join-type location
rather than an order-type.loc - a Location to format.strand - a StrandedFeature.Strand
indicating the Location's strand.StringBuffer.public StringBuffer formatLocation(StringBuffer sb, Location loc, StrandedFeature.Strand strand)
formatLocation creates an EMBL/Genbank style
representation of a Location. Supported location
forms:
123 <123 or >123 (123.567) (123.567)..789 123..(567.789) (123.345)..(567.789) 123..456 <123..567 or 123..>567 or <123..>567 123^567 AL123465:(123..567)If a compound location is formatted using this method, it is returned as a join-type location rather than an order-type. To preserve the join/order distinction; and to format locations like AL123465:(123..567), use the formatLocation(Feature) method.
sb - a StringBufferloc - a Location to format.strand - a StrandedFeature.Strand
indicating the Location's strand.StringBuffer.Copyright © 2014 BioJava. All rights reserved.