public class INSDseqFormat extends RichSequenceFormat.BasicFormat
Modifier and Type | Class and Description |
---|---|
static class |
INSDseqFormat.Terms
Implements some INSDseq-specific terms.
|
RichSequenceFormat.BasicFormat, RichSequenceFormat.HeaderlessFormat
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
ACC_VERSION_TAG |
protected static java.lang.String |
ACCESSION_TAG |
protected static java.lang.String |
AUTHOR_TAG |
protected static java.lang.String |
AUTHORS_GROUP_TAG |
protected static java.lang.String |
COMMENT_TAG |
protected static java.lang.String |
CONSORTIUM_TAG |
protected static java.lang.String |
CONTIG_TAG |
protected static java.lang.String |
CREATE_DATE_TAG |
protected static java.lang.String |
CREATE_REL_TAG |
protected static java.lang.String |
DATABASE_XREF_TAG |
protected static java.util.regex.Pattern |
dbxp |
protected static java.lang.String |
DEFINITION_TAG |
protected static java.lang.String |
DIVISION_TAG |
protected static java.lang.String |
FEATURE_ACCESSION_TAG |
protected static java.lang.String |
FEATURE_FROM_TAG |
protected static java.lang.String |
FEATURE_INTERBP_TAG |
protected static java.lang.String |
FEATURE_INTERVAL_TAG |
protected static java.lang.String |
FEATURE_INTERVALS_GROUP_TAG |
protected static java.lang.String |
FEATURE_ISCOMP_TAG |
protected static java.lang.String |
FEATURE_KEY_TAG |
protected static java.lang.String |
FEATURE_LOC_TAG |
protected static java.lang.String |
FEATURE_OPERATOR_TAG |
protected static java.lang.String |
FEATURE_PARTIAL3_TAG |
protected static java.lang.String |
FEATURE_PARTIAL5_TAG |
protected static java.lang.String |
FEATURE_POINT_TAG |
protected static java.lang.String |
FEATURE_TAG |
protected static java.lang.String |
FEATURE_TO_TAG |
protected static java.lang.String |
FEATUREQUAL_NAME_TAG |
protected static java.lang.String |
FEATUREQUAL_TAG |
protected static java.lang.String |
FEATUREQUAL_VALUE_TAG |
protected static java.lang.String |
FEATUREQUALS_GROUP_TAG |
protected static java.lang.String |
FEATURES_GROUP_TAG |
static java.lang.String |
INSDSEQ_FORMAT
The name of this format
|
protected static java.lang.String |
INSDSEQ_TAG |
protected static java.lang.String |
INSDSEQS_GROUP_TAG |
protected static java.lang.String |
JOURNAL_TAG |
protected static java.lang.String |
KEYWORD_TAG |
protected static java.lang.String |
KEYWORDS_GROUP_TAG |
protected static java.lang.String |
LENGTH_TAG |
protected static java.lang.String |
LOCUS_TAG |
protected static java.lang.String |
MOLTYPE_TAG |
protected static java.lang.String |
ORGANISM_TAG |
protected static java.lang.String |
OTHER_SEQID_TAG |
protected static java.lang.String |
OTHER_SEQIDS_GROUP_TAG |
protected static java.lang.String |
PUBMED_TAG |
protected static java.lang.String |
REFERENCE_LOCATION_TAG |
protected static java.lang.String |
REFERENCE_POSITION_TAG |
protected static java.lang.String |
REFERENCE_TAG |
protected static java.lang.String |
REFERENCES_GROUP_TAG |
protected static java.lang.String |
REMARK_TAG |
protected static java.lang.String |
SECONDARY_ACCESSION_TAG |
protected static java.lang.String |
SECONDARY_ACCESSIONS_GROUP_TAG |
protected static java.lang.String |
SEQUENCE_TAG |
protected static java.lang.String |
SOURCE_TAG |
protected static java.lang.String |
STRANDED_TAG |
protected static java.lang.String |
TAXONOMY_TAG |
protected static java.lang.String |
TITLE_TAG |
protected static java.lang.String |
TOPOLOGY_TAG |
protected static java.lang.String |
UPDATE_DATE_TAG |
protected static java.lang.String |
UPDATE_REL_TAG |
protected static java.util.regex.Pattern |
xmlSchema |
protected static java.lang.String |
XREF_DBNAME_TAG |
protected static java.lang.String |
XREF_ID_TAG |
protected static java.lang.String |
XREF_TAG |
Constructor and Description |
---|
INSDseqFormat() |
Modifier and Type | Method and Description |
---|---|
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.
|
java.lang.String |
getDefaultFormat()
getDefaultFormat returns the String identifier for
the default sub-format written by a SequenceFormat
implementation. |
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 rlistener,
Namespace ns)
Reads a sequence from the given buffered reader using the given tokenizer to parse
sequence symbols.
|
boolean |
readSequence(java.io.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,
java.io.PrintStream os)
writeSequence writes a sequence to the specified
PrintStream, using the default format. |
void |
writeSequence(Sequence seq,
java.lang.String format,
java.io.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 java.lang.String INSDSEQ_FORMAT
protected static final java.lang.String INSDSEQS_GROUP_TAG
protected static final java.lang.String INSDSEQ_TAG
protected static final java.lang.String LOCUS_TAG
protected static final java.lang.String LENGTH_TAG
protected static final java.lang.String TOPOLOGY_TAG
protected static final java.lang.String STRANDED_TAG
protected static final java.lang.String MOLTYPE_TAG
protected static final java.lang.String DIVISION_TAG
protected static final java.lang.String UPDATE_DATE_TAG
protected static final java.lang.String CREATE_DATE_TAG
protected static final java.lang.String UPDATE_REL_TAG
protected static final java.lang.String CREATE_REL_TAG
protected static final java.lang.String DEFINITION_TAG
protected static final java.lang.String DATABASE_XREF_TAG
protected static final java.lang.String XREF_TAG
protected static final java.lang.String ACCESSION_TAG
protected static final java.lang.String ACC_VERSION_TAG
protected static final java.lang.String SECONDARY_ACCESSIONS_GROUP_TAG
protected static final java.lang.String SECONDARY_ACCESSION_TAG
protected static final java.lang.String OTHER_SEQIDS_GROUP_TAG
protected static final java.lang.String OTHER_SEQID_TAG
protected static final java.lang.String KEYWORDS_GROUP_TAG
protected static final java.lang.String KEYWORD_TAG
protected static final java.lang.String SOURCE_TAG
protected static final java.lang.String ORGANISM_TAG
protected static final java.lang.String TAXONOMY_TAG
protected static final java.lang.String REFERENCES_GROUP_TAG
protected static final java.lang.String REFERENCE_TAG
protected static final java.lang.String REFERENCE_LOCATION_TAG
protected static final java.lang.String REFERENCE_POSITION_TAG
protected static final java.lang.String TITLE_TAG
protected static final java.lang.String JOURNAL_TAG
protected static final java.lang.String PUBMED_TAG
protected static final java.lang.String XREF_DBNAME_TAG
protected static final java.lang.String XREF_ID_TAG
protected static final java.lang.String REMARK_TAG
protected static final java.lang.String AUTHORS_GROUP_TAG
protected static final java.lang.String AUTHOR_TAG
protected static final java.lang.String CONSORTIUM_TAG
protected static final java.lang.String COMMENT_TAG
protected static final java.lang.String FEATURES_GROUP_TAG
protected static final java.lang.String FEATURE_TAG
protected static final java.lang.String FEATURE_KEY_TAG
protected static final java.lang.String FEATURE_LOC_TAG
protected static final java.lang.String FEATURE_INTERVALS_GROUP_TAG
protected static final java.lang.String FEATURE_INTERVAL_TAG
protected static final java.lang.String FEATURE_FROM_TAG
protected static final java.lang.String FEATURE_TO_TAG
protected static final java.lang.String FEATURE_POINT_TAG
protected static final java.lang.String FEATURE_ISCOMP_TAG
protected static final java.lang.String FEATURE_INTERBP_TAG
protected static final java.lang.String FEATURE_ACCESSION_TAG
protected static final java.lang.String FEATURE_OPERATOR_TAG
protected static final java.lang.String FEATURE_PARTIAL5_TAG
protected static final java.lang.String FEATURE_PARTIAL3_TAG
protected static final java.lang.String FEATUREQUALS_GROUP_TAG
protected static final java.lang.String FEATUREQUAL_TAG
protected static final java.lang.String FEATUREQUAL_NAME_TAG
protected static final java.lang.String FEATUREQUAL_VALUE_TAG
protected static final java.lang.String SEQUENCE_TAG
protected static final java.lang.String CONTIG_TAG
protected static final java.util.regex.Pattern dbxp
protected static final java.util.regex.Pattern xmlSchema
public boolean canRead(java.io.File file) throws java.io.IOException
canRead
in interface RichSequenceFormat
canRead
in class RichSequenceFormat.BasicFormat
file
- the File
to check.java.io.IOException
- in case the file is inaccessible.public SymbolTokenization guessSymbolTokenization(java.io.File file) throws java.io.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.java.io.IOException
- if the file is unrecognisable or inaccessible.public boolean canRead(java.io.BufferedInputStream stream) throws java.io.IOException
stream
- the BufferedInputStream
to check.java.io.IOException
- in case the stream is inaccessible.public 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.public boolean readSequence(java.io.BufferedReader reader, SymbolTokenization symParser, SeqIOListener listener) throws IllegalSymbolException, java.io.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.java.io.IOException
- if an error occurs while reading from the
stream.ParseException
public boolean readRichSequence(java.io.BufferedReader reader, SymbolTokenization symParser, RichSeqIOListener rlistener, Namespace ns) throws IllegalSymbolException, java.io.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.java.io.IOException
- if there was a read error.ParseException
public void beginWriting() throws java.io.IOException
java.io.IOException
- if writing fails.public void finishWriting() throws java.io.IOException
java.io.IOException
- if writing fails.public void writeSequence(Sequence seq, java.io.PrintStream os) throws java.io.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.java.io.IOException
public void writeSequence(Sequence seq, java.lang.String format, java.io.PrintStream os) throws java.io.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.java.io.IOException
- if an error occurs.public void writeSequence(Sequence seq, Namespace ns) throws java.io.IOException
seq
- the sequence to writens
- the namespace to write it withjava.io.IOException
- in case it couldn't write somethingpublic java.lang.String getDefaultFormat()
getDefaultFormat
returns the String identifier for
the default sub-format written by a SequenceFormat
implementation.String
.