public class UniProtFormat extends RichSequenceFormat.HeaderlessFormat
| Modifier and Type | Class and Description | 
|---|---|
static class  | 
UniProtFormat.Terms
Implements some UniProt-specific terms. 
 | 
RichSequenceFormat.BasicFormat, RichSequenceFormat.HeaderlessFormat| Modifier and Type | Field and Description | 
|---|---|
protected static String | 
ACCESSION_TAG  | 
protected static String | 
AUTHORS_TAG  | 
protected static String | 
COMMENT_TAG  | 
protected static String | 
CONSORTIUM_TAG  | 
protected static String | 
DATABASE_XREF_TAG  | 
protected static String | 
DATE_TAG  | 
protected static String | 
DEFINITION_TAG  | 
protected static Pattern | 
dp_ipi  | 
protected static Pattern | 
dp_uniprot  | 
protected static String | 
END_SEQUENCE_TAG  | 
protected static String | 
FEATURE_TAG  | 
protected static Pattern | 
fp  | 
protected static String | 
GENE_TAG  | 
protected static Pattern | 
headerLine  | 
protected static String | 
KEYWORDS_TAG  | 
protected static String | 
LOCATION_TAG  | 
protected static String | 
LOCUS_TAG  | 
protected static Pattern | 
lp_ipi  | 
protected static Pattern | 
lp_uniprot  | 
protected static String | 
ORGANELLE_TAG  | 
protected static String | 
ORGANISM_TAG  | 
protected static String | 
PROTEIN_EXIST_TAG  | 
protected static String | 
RC_LINE_TAG  | 
protected static String | 
REFERENCE_TAG  | 
protected static String | 
REFERENCE_XREF_TAG  | 
protected static String | 
RP_LINE_TAG  | 
protected static Pattern | 
rppat  | 
protected static String | 
SOURCE_TAG  | 
protected static String | 
START_SEQUENCE_TAG  | 
protected static String | 
TAXON_TAG  | 
protected static String | 
TITLE_TAG  | 
static String | 
UNIPROT_FORMAT
The name of this format 
 | 
| Constructor and Description | 
|---|
UniProtFormat()  | 
| Modifier and Type | Method and Description | 
|---|---|
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. 
 | 
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. | 
beginWriting, finishWritinggetElideComments, getElideFeatures, getElideReferences, getElideSymbols, getLineWidth, getPrintStream, setElideComments, setElideFeatures, setElideReferences, setElideSymbols, setLineWidth, setPrintStreampublic static final String UNIPROT_FORMAT
protected static final String LOCUS_TAG
protected static final String ACCESSION_TAG
protected static final String DEFINITION_TAG
protected static final String DATE_TAG
protected static final String SOURCE_TAG
protected static final String ORGANELLE_TAG
protected static final String ORGANISM_TAG
protected static final String TAXON_TAG
protected static final String GENE_TAG
protected static final String DATABASE_XREF_TAG
protected static final String PROTEIN_EXIST_TAG
protected static final String REFERENCE_TAG
protected static final String RP_LINE_TAG
protected static final String REFERENCE_XREF_TAG
protected static final String AUTHORS_TAG
protected static final String CONSORTIUM_TAG
protected static final String TITLE_TAG
protected static final String LOCATION_TAG
protected static final String RC_LINE_TAG
protected static final String KEYWORDS_TAG
protected static final String COMMENT_TAG
protected static final String FEATURE_TAG
protected static final String START_SEQUENCE_TAG
protected static final String END_SEQUENCE_TAG
protected static final Pattern lp_uniprot
protected static final Pattern dp_uniprot
protected static final Pattern headerLine
public UniProtFormat()
public boolean canRead(File file) throws IOException
canRead in interface RichSequenceFormatcanRead in class RichSequenceFormat.BasicFormatfile - the File to check.IOException - in case the file is inaccessible.public SymbolTokenization guessSymbolTokenization(File file) throws IOException
guessSymbolTokenization in interface RichSequenceFormatguessSymbolTokenization in class RichSequenceFormat.BasicFormatfile - 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.ParseExceptionpublic 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.ParseExceptionpublic 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.IOExceptionpublic 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 © 2020 BioJava. All rights reserved.