public class EMBLxmlFormat extends RichSequenceFormat.BasicFormat
Modifier and Type | Class and Description |
---|---|
static class |
EMBLxmlFormat.Terms
Implements some EMBLxml-specific terms.
|
RichSequenceFormat.BasicFormat, RichSequenceFormat.HeaderlessFormat
Constructor and Description |
---|
EMBLxmlFormat() |
Modifier and Type | Method and Description |
---|---|
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.
|
String |
getDefaultFormat()
getDefaultFormat returns the String identifier for
the default sub-format written by a SequenceFormat
implementation. |
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 rlistener,
Namespace ns)
Reads a sequence from the given buffered reader using the given tokenizer to parse
sequence symbols.
|
boolean |
readSequence(BufferedReader reader,
SymbolTokenization symParser,
SeqIOListener listener)
Read a sequence and pass data on to a SeqIOListener.
|
void |
writeSequence(Sequence seq,
Namespace ns)
Writes a sequence out to the outputstream given by beginWriting() using the default format of the
implementing class.
|
void |
writeSequence(Sequence seq,
PrintStream os)
writeSequence writes a sequence to the specified
PrintStream, using the default format. |
void |
writeSequence(Sequence seq,
String format,
PrintStream os)
writeSequence writes a sequence to the specified
PrintStream , using the specified format. |
getElideComments, getElideFeatures, getElideReferences, getElideSymbols, getLineWidth, getPrintStream, setElideComments, setElideFeatures, setElideReferences, setElideSymbols, setLineWidth, setPrintStream
public static final String EMBLXML_FORMAT
protected static final String ENTRY_GROUP_TAG
protected static final String ENTRY_TAG
protected static final String ENTRY_ACCESSION_ATTR
protected static final String ENTRY_TAX_DIVISION_ATTR
protected static final String ENTRY_DATACLASS_ATTR
protected static final String ENTRY_CREATED_ATTR
protected static final String ENTRY_RELCREATED_ATTR
protected static final String ENTRY_UPDATED_ATTR
protected static final String ENTRY_RELUPDATED_ATTR
protected static final String ENTRY_VER_ATTR
protected static final String ENTRY_SUBACC_ATTR
protected static final String ENTRY_SUBVER_ATTR
protected static final String ENTRY_SUBWGSVER_ATTR
protected static final String ENTRY_STATUS_ATTR
protected static final String ENTRY_STATUS_DATE_ATTR
protected static final String SEC_ACC_TAG
protected static final String PROJ_ACC_TAG
protected static final String DESC_TAG
protected static final String KEYWORD_TAG
protected static final String REFERENCE_TAG
protected static final String CITATION_TAG
protected static final String CITATION_ID_ATTR
protected static final String CITATION_TYPE_ATTR
protected static final String CITATION_DATE_ATTR
protected static final String CITATION_NAME_ATTR
protected static final String CITATION_VOL_ATTR
protected static final String CITATION_ISSUE_ATTR
protected static final String CITATION_FIRST_ATTR
protected static final String CITATION_LAST_ATTR
protected static final String CITATION_PUB_ATTR
protected static final String CITATION_PATENT_ATTR
protected static final String CITATION_INSTITUTE_ATTR
protected static final String CITATION_YEAR_ATTR
protected static final String DBREFERENCE_TAG
protected static final String DBREF_DB_ATTR
protected static final String DBREF_PRIMARY_ATTR
protected static final String DBREF_SEC_ATTR
protected static final String CONSORTIUM_TAG
protected static final String TITLE_TAG
protected static final String EDITOR_TAG
protected static final String AUTHOR_TAG
protected static final String PATENT_TAG
protected static final String LOCATOR_TAG
protected static final String CITATION_LOCATION_TAG
protected static final String REF_POS_BEGIN_ATTR
protected static final String REF_POS_END_ATTR
protected static final String COMMENT_TAG
protected static final String FEATURE_TAG
protected static final String FEATURE_NAME_ATTR
protected static final String ORGANISM_TAG
protected static final String SCINAME_TAG
protected static final String COMNAME_TAG
protected static final String TAXID_TAG
protected static final String LINEAGE_TAG
protected static final String TAXON_TAG
protected static final String ORGANELLE_TAG
protected static final String QUALIFIER_TAG
protected static final String QUALIFIER_NAME_ATTR
protected static final String LOCATION_TAG
protected static final String LOCATION_TYPE_ATTR
protected static final String LOCATION_COMPL_ATTR
protected static final String LOCATION_ELEMENT_TAG
protected static final String LOC_ELEMENT_TYPE_ATTR
protected static final String LOC_ELEMENT_ACC_ATTR
protected static final String LOC_ELEMENT_VER_ATTR
protected static final String LOC_ELEMENT_COMPL_ATTR
protected static final String BASEPOSITION_TAG
protected static final String BASEPOSITION_TYPE_ATTR
protected static final String CONTIG_TAG
protected static final String SEQUENCE_TAG
protected static final String SEQUENCE_TYPE_ATTR
protected static final String SEQUENCE_LENGTH_ATTR
protected static final String SEQUENCE_TOPOLOGY_ATTR
protected static final String SEQUENCE_VER_ATTR
public EMBLxmlFormat()
public boolean canRead(File file) throws IOException
canRead
in interface RichSequenceFormat
canRead
in class RichSequenceFormat.BasicFormat
file
- the File
to check.IOException
- in case the file is inaccessible.public SymbolTokenization guessSymbolTokenization(File file) throws IOException
guessSymbolTokenization
in interface RichSequenceFormat
guessSymbolTokenization
in class RichSequenceFormat.BasicFormat
file
- the File
object to guess the format of.SymbolTokenization
to read the file with.IOException
- if the file is unrecognisable or inaccessible.public boolean canRead(BufferedInputStream stream) throws IOException
stream
- the BufferedInputStream
to check.IOException
- in case the stream is inaccessible.public 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.public boolean readSequence(BufferedReader reader, SymbolTokenization symParser, SeqIOListener listener) throws IllegalSymbolException, IOException, ParseException
reader
- The stream of data to parse.symParser
- A SymbolParser defining a mapping from
character data to Symbols.listener
- A listener to notify when data is extracted
from the stream.IllegalSymbolException
- if it is not possible to
translate character data from the stream into valid BioJava
symbols.IOException
- if an error occurs while reading from the
stream.ParseException
public boolean readRichSequence(BufferedReader reader, SymbolTokenization symParser, RichSeqIOListener rlistener, Namespace ns) throws IllegalSymbolException, IOException, ParseException
reader
- the input sourcesymParser
- the tokenizer which understands the sequence being readrlistener
- the listener to send sequence events tons
- the namespace to read sequences into.IllegalSymbolException
- if the tokenizer couldn't understand one of the
sequence symbols in the file.IOException
- if there was a read error.ParseException
public void beginWriting() throws IOException
IOException
- if writing fails.public void finishWriting() throws IOException
IOException
- if writing fails.public void writeSequence(Sequence seq, PrintStream os) throws IOException
writeSequence
writes a sequence to the specified
PrintStream, using the default format.seq
- the sequence to write out.os
- the printstream to write to.IOException
public void writeSequence(Sequence seq, String format, PrintStream os) throws IOException
writeSequence
writes a sequence to the specified
PrintStream
, using the specified format.seq
- a Sequence
to write out.format
- a String
indicating which sub-format
of those available from a particular
SequenceFormat
implemention to use when
writing.os
- a PrintStream
object.IOException
- if an error occurs.public void writeSequence(Sequence seq, Namespace ns) throws IOException
seq
- the sequence to writens
- the namespace to write it withIOException
- in case it couldn't write somethingpublic String getDefaultFormat()
getDefaultFormat
returns the String identifier for
the default sub-format written by a SequenceFormat
implementation.String
.Copyright © 2014 BioJava. All rights reserved.