Package org.biojavax.bio.seq.io
Class RichSequenceFormat.BasicFormat
java.lang.Object
org.biojavax.bio.seq.io.RichSequenceFormat.BasicFormat
- All Implemented Interfaces:
SequenceFormat
,RichSequenceFormat
- Direct Known Subclasses:
EMBLxmlFormat
,INSDseqFormat
,RichSequenceFormat.HeaderlessFormat
,UniProtXMLFormat
- Enclosing interface:
RichSequenceFormat
public abstract static class RichSequenceFormat.BasicFormat
extends Object
implements RichSequenceFormat
Provides a basic format with simple things like line-widths precoded.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.biojavax.bio.seq.io.RichSequenceFormat
RichSequenceFormat.BasicFormat, RichSequenceFormat.HeaderlessFormat
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Check to see if a given file is in our format.boolean
Is the format going to emit events when comments data or remarks from bibliographic references are read?boolean
Is the format going to emit events when feature data is read?boolean
Is the format going to emit events when bibliographic reference data is read?boolean
Is the format going to emit events when sequence data is read?int
Retrive the current line width.Gets the print stream currently being written to.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.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
Sets the stream to write to.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.biojavax.bio.seq.io.RichSequenceFormat
beginWriting, canRead, finishWriting, guessSymbolTokenization, readRichSequence, writeSequence
Methods inherited from interface org.biojava.bio.seq.io.SequenceFormat
getDefaultFormat, readSequence, writeSequence, writeSequence
-
Constructor Details
-
BasicFormat
public BasicFormat()
-
-
Method Details
-
canRead
Check to see if a given file is in our format. Some formats may be able to determine this by filename, whilst others may have to open the file and read it to see what format it is in.- Specified by:
canRead
in interfaceRichSequenceFormat
- Parameters:
file
- theFile
to check.- Returns:
- true if the file is readable by this format, false if not.
- Throws:
IOException
- in case the file is inaccessible.
-
guessSymbolTokenization
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. For formats that only accept one tokenization, just return it without checking the file. For formats that accept multiple tokenizations, its up to you how you do it.- Specified by:
guessSymbolTokenization
in interfaceRichSequenceFormat
- Parameters:
file
- theFile
object to guess the format of.- Returns:
- a
SymbolTokenization
to read the file with. - Throws:
IOException
- if the file is unrecognisable or inaccessible.
-
getLineWidth
Retrive the current line width. Defaults to 80.- Specified by:
getLineWidth
in interfaceRichSequenceFormat
- Returns:
- the line width
-
setLineWidth
Set the line width. When writing, the lines of sequence will never be longer than the line width. Defaults to 80.- Specified by:
setLineWidth
in interfaceRichSequenceFormat
- Parameters:
width
- the new line width
-
getElideSymbols
Is the format going to emit events when sequence data is read?- Specified by:
getElideSymbols
in interfaceRichSequenceFormat
- Returns:
- true if it is not otherwise false (false is default) .
-
setElideSymbols
Use this method to toggle reading of sequence data.- Specified by:
setElideSymbols
in interfaceRichSequenceFormat
- Parameters:
elideSymbols
- set to true if you don't want the sequence data.
-
getElideFeatures
Is the format going to emit events when feature data is read?- Specified by:
getElideFeatures
in interfaceRichSequenceFormat
- Returns:
- true if it is not otherwise false (false is default).
-
setElideFeatures
Use this method to toggle reading of feature data.- Specified by:
setElideFeatures
in interfaceRichSequenceFormat
- Parameters:
elideFeatures
- set to true if you don't want the feature data.
-
getElideReferences
Is the format going to emit events when bibliographic reference data is read?- Specified by:
getElideReferences
in interfaceRichSequenceFormat
- Returns:
- true if it is not otherwise false (false is default) .
-
setElideReferences
Use this method to toggle reading of bibliographic reference data.- Specified by:
setElideReferences
in interfaceRichSequenceFormat
- Parameters:
elideReferences
- set to true if you don't want the bibliographic reference data.
-
getElideComments
Is the format going to emit events when comments data or remarks from bibliographic references are read?- Specified by:
getElideComments
in interfaceRichSequenceFormat
- Returns:
- true if it is not otherwise false (false is default).
-
setElideComments
Use this method to toggle reading of comments data. Will also ignore remarks lines in bibliographic references.- Specified by:
setElideComments
in interfaceRichSequenceFormat
- Parameters:
elideComments
- set to true if you don't want the comments data.
-
setPrintStream
Sets the stream to write to.- Specified by:
setPrintStream
in interfaceRichSequenceFormat
- Parameters:
os
- the PrintStream to write to.
-
getPrintStream
Gets the print stream currently being written to.- Specified by:
getPrintStream
in interfaceRichSequenceFormat
- Returns:
- the current print stream.
-