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 Constructor Description BasicFormat()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanRead(File file)Check to see if a given file is in our format.booleangetElideComments()Is the format going to emit events when comments data or remarks from bibliographic references are read?booleangetElideFeatures()Is the format going to emit events when feature data is read?booleangetElideReferences()Is the format going to emit events when bibliographic reference data is read?booleangetElideSymbols()Is the format going to emit events when sequence data is read?intgetLineWidth()Retrive the current line width.PrintStreamgetPrintStream()Gets the print stream currently being written to.SymbolTokenizationguessSymbolTokenization(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.voidsetElideComments(boolean elideComments)Use this method to toggle reading of comments data.voidsetElideFeatures(boolean elideFeatures)Use this method to toggle reading of feature data.voidsetElideReferences(boolean elideReferences)Use this method to toggle reading of bibliographic reference data.voidsetElideSymbols(boolean elideSymbols)Use this method to toggle reading of sequence data.voidsetLineWidth(int width)Set the line width.voidsetPrintStream(PrintStream os)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 Detail
-
BasicFormat
public BasicFormat()
-
-
Method Detail
-
canRead
public boolean canRead(File file) throws IOException
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:
canReadin interfaceRichSequenceFormat- Parameters:
file- theFileto check.- Returns:
- true if the file is readable by this format, false if not.
- Throws:
IOException- in case the file is inaccessible.
-
guessSymbolTokenization
public SymbolTokenization guessSymbolTokenization(File file) throws IOException
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:
guessSymbolTokenizationin interfaceRichSequenceFormat- Parameters:
file- theFileobject to guess the format of.- Returns:
- a
SymbolTokenizationto read the file with. - Throws:
IOException- if the file is unrecognisable or inaccessible.
-
getLineWidth
public int getLineWidth()
Retrive the current line width. Defaults to 80.- Specified by:
getLineWidthin interfaceRichSequenceFormat- Returns:
- the line width
-
setLineWidth
public void setLineWidth(int width)
Set the line width. When writing, the lines of sequence will never be longer than the line width. Defaults to 80.- Specified by:
setLineWidthin interfaceRichSequenceFormat- Parameters:
width- the new line width
-
getElideSymbols
public boolean getElideSymbols()
Is the format going to emit events when sequence data is read?- Specified by:
getElideSymbolsin interfaceRichSequenceFormat- Returns:
- true if it is not otherwise false (false is default) .
-
setElideSymbols
public void setElideSymbols(boolean elideSymbols)
Use this method to toggle reading of sequence data.- Specified by:
setElideSymbolsin interfaceRichSequenceFormat- Parameters:
elideSymbols- set to true if you don't want the sequence data.
-
getElideFeatures
public boolean getElideFeatures()
Is the format going to emit events when feature data is read?- Specified by:
getElideFeaturesin interfaceRichSequenceFormat- Returns:
- true if it is not otherwise false (false is default).
-
setElideFeatures
public void setElideFeatures(boolean elideFeatures)
Use this method to toggle reading of feature data.- Specified by:
setElideFeaturesin interfaceRichSequenceFormat- Parameters:
elideFeatures- set to true if you don't want the feature data.
-
getElideReferences
public boolean getElideReferences()
Is the format going to emit events when bibliographic reference data is read?- Specified by:
getElideReferencesin interfaceRichSequenceFormat- Returns:
- true if it is not otherwise false (false is default) .
-
setElideReferences
public void setElideReferences(boolean elideReferences)
Use this method to toggle reading of bibliographic reference data.- Specified by:
setElideReferencesin interfaceRichSequenceFormat- Parameters:
elideReferences- set to true if you don't want the bibliographic reference data.
-
getElideComments
public boolean getElideComments()
Is the format going to emit events when comments data or remarks from bibliographic references are read?- Specified by:
getElideCommentsin interfaceRichSequenceFormat- Returns:
- true if it is not otherwise false (false is default).
-
setElideComments
public void setElideComments(boolean elideComments)
Use this method to toggle reading of comments data. Will also ignore remarks lines in bibliographic references.- Specified by:
setElideCommentsin interfaceRichSequenceFormat- Parameters:
elideComments- set to true if you don't want the comments data.
-
setPrintStream
public void setPrintStream(PrintStream os)
Sets the stream to write to.- Specified by:
setPrintStreamin interfaceRichSequenceFormat- Parameters:
os- the PrintStream to write to.
-
getPrintStream
public PrintStream getPrintStream()
Gets the print stream currently being written to.- Specified by:
getPrintStreamin interfaceRichSequenceFormat- Returns:
- the current print stream.
-
-