|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.biojavax.bio.seq.io.RichSequenceFormat.BasicFormat
org.biojavax.bio.seq.io.UniProtXMLFormat
public class UniProtXMLFormat
Format reader for UniProtXML files. This version of UniProtXML format will generate and write RichSequence objects. Loosely Based on code from the old, deprecated, org.biojava.bio.seq.io.GenbankXmlFormat object. Understands http://www.ebi.uniprot.org/support/docs/uniprot.xsd
Nested Class Summary | |
---|---|
static class |
UniProtXMLFormat.Terms
Implements some UniProtXML-specific terms. |
Nested classes/interfaces inherited from interface org.biojavax.bio.seq.io.RichSequenceFormat |
---|
RichSequenceFormat.BasicFormat, RichSequenceFormat.HeaderlessFormat |
Field Summary | |
---|---|
protected static java.lang.String |
ACCESSION_TAG
|
protected static java.lang.String |
AUTHOR_LIST_TAG
|
protected static java.lang.String |
CITATION_TAG
|
protected static java.lang.String |
COMMENT_ABS_MAX_TAG
|
protected static java.lang.String |
COMMENT_ABSORPTION_TAG
|
protected static java.lang.String |
COMMENT_ERROR_ATTR
|
protected static java.lang.String |
COMMENT_EVENT_TAG
|
protected static java.lang.String |
COMMENT_EXPERIMENTS_TAG
|
protected static java.lang.String |
COMMENT_INTERACT_INTACT_ATTR
|
protected static java.lang.String |
COMMENT_INTERACT_LABEL_TAG
|
protected static java.lang.String |
COMMENT_INTERACTANT_TAG
|
protected static java.lang.String |
COMMENT_ISOFORM_TAG
|
protected static java.lang.String |
COMMENT_KIN_KM_TAG
|
protected static java.lang.String |
COMMENT_KIN_VMAX_TAG
|
protected static java.lang.String |
COMMENT_KINETICS_TAG
|
protected static java.lang.String |
COMMENT_LINK_TAG
|
protected static java.lang.String |
COMMENT_LINK_URI_ATTR
|
protected static java.lang.String |
COMMENT_LOCTYPE_ATTR
|
protected static java.lang.String |
COMMENT_MASS_ATTR
|
protected static java.lang.String |
COMMENT_METHOD_ATTR
|
protected static java.lang.String |
COMMENT_ORGANISMS_TAG
|
protected static java.lang.String |
COMMENT_PH_TAG
|
protected static java.lang.String |
COMMENT_REDOX_TAG
|
protected static java.lang.String |
COMMENT_TAG
|
protected static java.lang.String |
COMMENT_TEMPERATURE_TAG
|
protected static java.lang.String |
COMPONENT_TAG
|
protected static java.lang.String |
CONSORTIUM_TAG
|
protected static java.lang.String |
COPYRIGHT_TAG
|
protected static java.lang.String |
DBXREF_TAG
|
protected static java.lang.String |
DOMAIN_TAG
|
protected static java.lang.String |
EDITOR_LIST_TAG
|
protected static java.lang.String |
ENTRY_CREATED_ATTR
|
protected static java.lang.String |
ENTRY_GROUP_TAG
|
protected static java.lang.String |
ENTRY_NAMESPACE_ATTR
|
protected static java.lang.String |
ENTRY_TAG
|
protected static java.lang.String |
ENTRY_UPDATED_ATTR
|
protected static java.lang.String |
ENTRY_VERSION_ATTR
|
protected static java.lang.String |
EVIDENCE_ATTR
|
protected static java.lang.String |
EVIDENCE_ATTRIBUTE_ATTR
|
protected static java.lang.String |
EVIDENCE_CATEGORY_ATTR
|
protected static java.lang.String |
EVIDENCE_DATE_ATTR
|
protected static java.lang.String |
EVIDENCE_TAG
|
protected static java.lang.String |
FEATURE_DESC_ATTR
|
protected static java.lang.String |
FEATURE_ORIGINAL_TAG
|
protected static java.lang.String |
FEATURE_TAG
|
protected static java.lang.String |
FEATURE_VARIATION_TAG
|
protected static java.lang.String |
GENE_TAG
|
protected static java.lang.String |
GENELOCATION_NAME_TAG
|
protected static java.lang.String |
GENELOCATION_TAG
|
protected static java.lang.String |
ID_ATTR
|
protected static java.lang.String |
ID_TAG
|
protected static java.lang.String |
KEY_ATTR
|
protected static java.lang.String |
KEYWORD_TAG
|
protected static java.lang.String |
LINEAGE_TAG
|
protected static java.lang.String |
LOCATION_BEGIN_TAG
|
protected static java.lang.String |
LOCATION_END_TAG
|
protected static java.lang.String |
LOCATION_POSITION_ATTR
|
protected static java.lang.String |
LOCATION_POSITION_TAG
|
protected static java.lang.String |
LOCATION_SEQ_ATTR
|
protected static java.lang.String |
LOCATION_TAG
|
protected static java.lang.String |
LOCATOR_TAG
|
protected static java.lang.String |
NAME_ATTR
|
protected static java.lang.String |
NAME_TAG
|
protected static java.lang.String |
NOTE_TAG
|
protected static java.lang.String |
ORGANISM_TAG
|
protected static java.lang.String |
PERSON_TAG
|
protected static java.lang.String |
PROPERTY_TAG
|
protected static java.lang.String |
PROTEIN_EXISTS_TAG
|
protected static java.lang.String |
PROTEIN_TAG
|
protected static java.lang.String |
PROTEIN_TYPE_ATTR
|
protected static java.lang.String |
RC_LINE_TAG
|
protected static java.lang.String |
RC_PLASMID_TAG
|
protected static java.lang.String |
RC_SPECIES_TAG
|
protected static java.lang.String |
RC_STRAIN_TAG
|
protected static java.lang.String |
RC_TISSUE_TAG
|
protected static java.lang.String |
RC_TRANSP_TAG
|
protected static java.lang.String |
REF_ATTR
|
protected static java.lang.String |
REFERENCE_TAG
|
protected static java.lang.String |
RP_LINE_TAG
|
protected static java.util.regex.Pattern |
rppat
|
protected static java.lang.String |
SEQUENCE_CHECKSUM_ATTR
|
protected static java.lang.String |
SEQUENCE_LENGTH_ATTR
|
protected static java.lang.String |
SEQUENCE_MASS_ATTR
|
protected static java.lang.String |
SEQUENCE_MODIFIED_ATTR
|
protected static java.lang.String |
SEQUENCE_TAG
|
protected static java.lang.String |
SEQUENCE_VERSION_ATTR
|
protected static java.lang.String |
STATUS_ATTR
|
protected static java.lang.String |
TAXON_TAG
|
protected static java.lang.String |
TEXT_TAG
|
protected static java.lang.String |
TITLE_TAG
|
protected static java.lang.String |
TYPE_ATTR
|
static java.lang.String |
UNIPROTXML_FORMAT
The name of this format |
protected static java.lang.String |
VALUE_ATTR
|
protected static java.util.regex.Pattern |
xmlSchema
|
Constructor Summary | |
---|---|
UniProtXMLFormat()
|
Method Summary | |
---|---|
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. |
Methods inherited from class org.biojavax.bio.seq.io.RichSequenceFormat.BasicFormat |
---|
getElideComments, getElideFeatures, getElideReferences, getElideSymbols, getLineWidth, getPrintStream, setElideComments, setElideFeatures, setElideReferences, setElideSymbols, setLineWidth, setPrintStream |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String UNIPROTXML_FORMAT
protected static final java.lang.String ENTRY_GROUP_TAG
protected static final java.lang.String ENTRY_TAG
protected static final java.lang.String ENTRY_VERSION_ATTR
protected static final java.lang.String ENTRY_NAMESPACE_ATTR
protected static final java.lang.String ENTRY_CREATED_ATTR
protected static final java.lang.String ENTRY_UPDATED_ATTR
protected static final java.lang.String COPYRIGHT_TAG
protected static final java.lang.String ACCESSION_TAG
protected static final java.lang.String NAME_TAG
protected static final java.lang.String TEXT_TAG
protected static final java.lang.String REF_ATTR
protected static final java.lang.String TYPE_ATTR
protected static final java.lang.String KEY_ATTR
protected static final java.lang.String ID_ATTR
protected static final java.lang.String EVIDENCE_ATTR
protected static final java.lang.String VALUE_ATTR
protected static final java.lang.String STATUS_ATTR
protected static final java.lang.String NAME_ATTR
protected static final java.lang.String PROTEIN_TAG
protected static final java.lang.String PROTEIN_TYPE_ATTR
protected static final java.lang.String DOMAIN_TAG
protected static final java.lang.String COMPONENT_TAG
protected static final java.lang.String GENE_TAG
protected static final java.lang.String ORGANISM_TAG
protected static final java.lang.String DBXREF_TAG
protected static final java.lang.String PROPERTY_TAG
protected static final java.lang.String LINEAGE_TAG
protected static final java.lang.String TAXON_TAG
protected static final java.lang.String GENELOCATION_TAG
protected static final java.lang.String GENELOCATION_NAME_TAG
protected static final java.lang.String REFERENCE_TAG
protected static final java.lang.String CITATION_TAG
protected static final java.lang.String TITLE_TAG
protected static final java.lang.String EDITOR_LIST_TAG
protected static final java.lang.String AUTHOR_LIST_TAG
protected static final java.lang.String PERSON_TAG
protected static final java.lang.String CONSORTIUM_TAG
protected static final java.lang.String LOCATOR_TAG
protected static final java.lang.String RP_LINE_TAG
protected static final java.lang.String RC_LINE_TAG
protected static final java.lang.String RC_SPECIES_TAG
protected static final java.lang.String RC_TISSUE_TAG
protected static final java.lang.String RC_TRANSP_TAG
protected static final java.lang.String RC_STRAIN_TAG
protected static final java.lang.String RC_PLASMID_TAG
protected static final java.lang.String COMMENT_TAG
protected static final java.lang.String COMMENT_MASS_ATTR
protected static final java.lang.String COMMENT_ERROR_ATTR
protected static final java.lang.String COMMENT_METHOD_ATTR
protected static final java.lang.String COMMENT_LOCTYPE_ATTR
protected static final java.lang.String COMMENT_ABSORPTION_TAG
protected static final java.lang.String COMMENT_ABS_MAX_TAG
protected static final java.lang.String COMMENT_KINETICS_TAG
protected static final java.lang.String COMMENT_KIN_KM_TAG
protected static final java.lang.String COMMENT_KIN_VMAX_TAG
protected static final java.lang.String COMMENT_PH_TAG
protected static final java.lang.String COMMENT_REDOX_TAG
protected static final java.lang.String COMMENT_TEMPERATURE_TAG
protected static final java.lang.String COMMENT_LINK_TAG
protected static final java.lang.String COMMENT_LINK_URI_ATTR
protected static final java.lang.String COMMENT_EVENT_TAG
protected static final java.lang.String COMMENT_ISOFORM_TAG
protected static final java.lang.String COMMENT_INTERACTANT_TAG
protected static final java.lang.String COMMENT_INTERACT_INTACT_ATTR
protected static final java.lang.String COMMENT_INTERACT_LABEL_TAG
protected static final java.lang.String COMMENT_ORGANISMS_TAG
protected static final java.lang.String COMMENT_EXPERIMENTS_TAG
protected static final java.lang.String NOTE_TAG
protected static final java.lang.String KEYWORD_TAG
protected static final java.lang.String PROTEIN_EXISTS_TAG
protected static final java.lang.String ID_TAG
protected static final java.lang.String FEATURE_TAG
protected static final java.lang.String FEATURE_DESC_ATTR
protected static final java.lang.String FEATURE_ORIGINAL_TAG
protected static final java.lang.String FEATURE_VARIATION_TAG
protected static final java.lang.String EVIDENCE_TAG
protected static final java.lang.String EVIDENCE_CATEGORY_ATTR
protected static final java.lang.String EVIDENCE_ATTRIBUTE_ATTR
protected static final java.lang.String EVIDENCE_DATE_ATTR
protected static final java.lang.String LOCATION_TAG
protected static final java.lang.String LOCATION_SEQ_ATTR
protected static final java.lang.String LOCATION_BEGIN_TAG
protected static final java.lang.String LOCATION_END_TAG
protected static final java.lang.String LOCATION_POSITION_ATTR
protected static final java.lang.String LOCATION_POSITION_TAG
protected static final java.lang.String SEQUENCE_TAG
protected static final java.lang.String SEQUENCE_VERSION_ATTR
protected static final java.lang.String SEQUENCE_LENGTH_ATTR
protected static final java.lang.String SEQUENCE_MASS_ATTR
protected static final java.lang.String SEQUENCE_CHECKSUM_ATTR
protected static final java.lang.String SEQUENCE_MODIFIED_ATTR
protected static final java.util.regex.Pattern rppat
protected static final java.util.regex.Pattern xmlSchema
Constructor Detail |
---|
public UniProtXMLFormat()
Method Detail |
---|
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 with
java.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
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |