|
||||||||||
| 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(BufferedInputStream stream)
Check to see if a given stream is in our format. |
boolean |
canRead(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. |
PrintStream |
getPrintStream()
Gets the print stream currently being written to. |
SymbolTokenization |
guessSymbolTokenization(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(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(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(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(File file)
throws IOException
file - the File to check.
IOException - in case the file is inaccessible.
SymbolTokenization guessSymbolTokenization(File file)
throws IOException
file - the File object to guess the format of.
SymbolTokenization to read the file with.
IOException - if the file is unrecognisable or inaccessible.
boolean canRead(BufferedInputStream stream)
throws IOException
stream - the BufferedInputStream to check.
IOException - in case the stream is inaccessible.
SymbolTokenization guessSymbolTokenization(BufferedInputStream stream)
throws IOException
stream - the BufferedInputStream object to guess the format of.
SymbolTokenization to read the stream with.
IOException - if the stream is unrecognisable or inaccessible.void setPrintStream(PrintStream os)
os - the PrintStream to write to.
IOException - if writing fails.PrintStream getPrintStream()
void beginWriting()
throws IOException
IOException - if writing fails.
void finishWriting()
throws IOException
IOException - if writing fails.
boolean readRichSequence(BufferedReader reader,
SymbolTokenization symParser,
RichSeqIOListener listener,
Namespace ns)
throws BioException,
IllegalSymbolException,
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.
IOException - if there was a read error.
void writeSequence(Sequence seq,
Namespace ns)
throws IOException
seq - the sequence to writens - the namespace to write it with
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 | |||||||||