|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface RichSequenceFormat
Allows a file format to be read/written as RichSequences.
Nested Class Summary | |
---|---|
static class |
RichSequenceFormat.BasicFormat
Provides a basic format with simple things like line-widths precoded. |
static class |
RichSequenceFormat.HeaderlessFormat
Provides the basic implementation required for simple header/footer-less files such as Genbank. |
Method Summary | |
---|---|
void |
beginWriting()
Informs the writer that we want to start writing. |
boolean |
canRead(java.io.BufferedInputStream stream)
Check to see if a given stream is in our format. |
boolean |
canRead(java.io.File file)
Check to see if a given file is in our format. |
void |
finishWriting()
Informs the writer that are done writing. |
boolean |
getElideComments()
Is the format going to emit events when comments data or remarks from bibliographic references are read? |
boolean |
getElideFeatures()
Is the format going to emit events when feature data is read? |
boolean |
getElideReferences()
Is the format going to emit events when bibliographic reference data is read? |
boolean |
getElideSymbols()
Is the format going to emit events when sequence data is read? |
int |
getLineWidth()
Retrive the current line width. |
java.io.PrintStream |
getPrintStream()
Gets the print stream currently being written to. |
SymbolTokenization |
guessSymbolTokenization(java.io.BufferedInputStream stream)
On the assumption that the stream is readable by this format (not checked), attempt to guess which symbol tokenization we should use to read it. |
SymbolTokenization |
guessSymbolTokenization(java.io.File file)
On the assumption that the file is readable by this format (not checked), attempt to guess which symbol tokenization we should use to read it. |
boolean |
readRichSequence(java.io.BufferedReader reader,
SymbolTokenization symParser,
RichSeqIOListener listener,
Namespace ns)
Reads a sequence from the given buffered reader using the given tokenizer to parse sequence symbols. |
void |
setElideComments(boolean elideComments)
Use this method to toggle reading of comments data. |
void |
setElideFeatures(boolean elideFeatures)
Use this method to toggle reading of feature data. |
void |
setElideReferences(boolean elideReferences)
Use this method to toggle reading of bibliographic reference data. |
void |
setElideSymbols(boolean elideSymbols)
Use this method to toggle reading of sequence data. |
void |
setLineWidth(int width)
Set the line width. |
void |
setPrintStream(java.io.PrintStream os)
Sets the stream to write to. |
void |
writeSequence(Sequence seq,
Namespace ns)
Writes a sequence out to the outputstream given by beginWriting() using the default format of the implementing class. |
Methods inherited from interface org.biojava.bio.seq.io.SequenceFormat |
---|
getDefaultFormat, readSequence, writeSequence, writeSequence |
Method Detail |
---|
boolean canRead(java.io.File file) throws java.io.IOException
file
- the File
to check.
java.io.IOException
- in case the file is inaccessible.SymbolTokenization guessSymbolTokenization(java.io.File file) throws java.io.IOException
file
- the File
object to guess the format of.
SymbolTokenization
to read the file with.
java.io.IOException
- if the file is unrecognisable or inaccessible.boolean canRead(java.io.BufferedInputStream stream) throws java.io.IOException
stream
- the BufferedInputStream
to check.
java.io.IOException
- in case the stream is inaccessible.SymbolTokenization guessSymbolTokenization(java.io.BufferedInputStream stream) throws java.io.IOException
stream
- the BufferedInputStream
object to guess the format of.
SymbolTokenization
to read the stream with.
java.io.IOException
- if the stream is unrecognisable or inaccessible.void setPrintStream(java.io.PrintStream os)
os
- the PrintStream to write to.
java.io.IOException
- if writing fails.java.io.PrintStream getPrintStream()
void beginWriting() throws java.io.IOException
java.io.IOException
- if writing fails.void finishWriting() throws java.io.IOException
java.io.IOException
- if writing fails.boolean readRichSequence(java.io.BufferedReader reader, SymbolTokenization symParser, RichSeqIOListener listener, Namespace ns) throws BioException, IllegalSymbolException, java.io.IOException
reader
- the input sourcesymParser
- the tokenizer which understands the sequence being readlistener
- the listener to send sequence events tons
- the namespace to read sequences into.
BioException
- in case of parsing errors.
IllegalSymbolException
- if the tokenizer couldn't understand one of the
sequence symbols in the file.
java.io.IOException
- if there was a read error.void writeSequence(Sequence seq, Namespace ns) throws java.io.IOException
seq
- the sequence to writens
- the namespace to write it with
java.io.IOException
- in case it couldn't write somethingint getLineWidth()
void setLineWidth(int width)
width
- the new line widthvoid setElideSymbols(boolean elideSymbols)
elideSymbols
- set to true if you don't want the sequence data.boolean getElideSymbols()
void setElideFeatures(boolean elideFeatures)
elideFeatures
- set to true if you don't want the feature data.boolean getElideFeatures()
void setElideReferences(boolean elideReferences)
elideReferences
- set to true if you don't want the bibliographic reference data.boolean getElideReferences()
void setElideComments(boolean elideComments)
elideComments
- set to true if you don't want the comments data.boolean getElideComments()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |