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, wait
formatLocation, formatLocation
protected GenbankFileFormer()
GenbankFileFormer
using
System.out
stream.protected GenbankFileFormer(PrintStream stream)
GenbankFileFormer
using the
specified stream.stream
- a PrintStream
.public PrintStream getPrintStream()
SeqFileFormer
getPrintStream
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 SeqFileFormer
PrintStream
which will be written to.public void setPrintStream(PrintStream stream)
SeqFileFormer
setPrintStream
informs an instance which
PrintStream
to use.setPrintStream
in interface SeqFileFormer
stream
- a PrintStream
to write to.public void setName(String id) throws ParseException
SeqIOListener
setName
in interface SeqIOListener
id
- the String that should be returned by getName for the sequence
being parsedParseException
public void startSequence() throws ParseException
SeqIOListener
startSequence
in interface SeqIOListener
ParseException
public void endSequence() throws ParseException
SeqIOListener
endSequence
in interface SeqIOListener
ParseException
public void setURI(String uri) throws ParseException
SeqIOListener
setURI
in interface SeqIOListener
ParseException
public void addSymbols(Alphabet alpha, Symbol[] syms, int start, int length) throws IllegalAlphabetException
SeqIOListener
addSymbols
in interface SeqIOListener
alpha
- 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
SeqIOListener
addSequenceProperty
in interface SeqIOListener
ParseException
public void startFeature(Feature.Template templ) throws ParseException
SeqIOListener
startFeature
in interface SeqIOListener
ParseException
public void endFeature() throws ParseException
SeqIOListener
endFeature
in interface SeqIOListener
ParseException
public void addFeatureProperty(Object key, Object value) throws ParseException
SeqIOListener
addFeatureProperty
in interface SeqIOListener
ParseException
public 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 StringBuffer
loc
- a Location
to format.strand
- a StrandedFeature.Strand
indicating the Location
's strand.StringBuffer
.Copyright © 2014 BioJava. All rights reserved.