public class SimpleRichSequenceBuilder extends RichSeqIOAdapter implements RichSequenceBuilder
emptyFeature
Constructor and Description |
---|
SimpleRichSequenceBuilder()
Creates a new instance of SimpleRichSequenceBuilder using a SimpleSymbolListFactory
with a threshold of zero.
|
SimpleRichSequenceBuilder(SymbolListFactory factory)
Creates a new instance of SimpleRichSequenceBuilder with the
desired symbollistfactory and threshold of zero.
|
SimpleRichSequenceBuilder(SymbolListFactory factory,
int threshold)
Creates a new instance of SimpleRichSequenceBuilder with the
desired symbollistfactory and threshold.
|
Modifier and Type | Method and Description |
---|---|
void |
addFeatureProperty(Object key,
Object value)
Notify the listener of a feature property.
|
void |
addSequenceProperty(Object key,
Object value)
Notify the listener of a sequence-wide property.
|
void |
addSymbols(Alphabet alpha,
Symbol[] syms,
int start,
int length)
Notify the listener of symbol data.
|
void |
endFeature()
Mark the end of data associated with one specific feature.
|
void |
endSequence()
Notify the listener that processing of the sequence is complete.
|
RichFeature |
getCurrentFeature()
Gets the feature currently being created.
|
RichSequence |
makeRichSequence()
Build a RichSequence.
|
Sequence |
makeSequence()
Return the Sequence object which has been constructed
by this builder.
|
void |
setAccession(String accession)
Call back method so the event emitter can tell the listener
the accession of the record being read.
|
void |
setCircular(boolean circular)
Defined this sequence being parser as circular.
|
void |
setComment(String comment)
Call back method so the event emitter can tell the listener
about a comment in the record being read.
|
void |
setDescription(String description)
Call back method so the event emitter can tell the listener
the description of the record being read.
|
void |
setDivision(String division)
Call back method so the event emitter can tell the listener
the division of the record being read.
|
void |
setIdentifier(String identifier)
Call back method so the event emitter can tell the listener
the identifier of the record being read.
|
void |
setName(String name)
Notify the listener that the current sequence is generally known
by a particular name.
|
void |
setNamespace(Namespace namespace)
Call back method so the event emitter can tell the listener
the namespace of the record being read.
|
void |
setRankedCrossRef(RankedCrossRef ref)
Call back method so the event emitter can tell the listener about a cross reference.
|
void |
setRankedDocRef(RankedDocRef ref)
Call back method so the event emitter can tell the listener
about a literature reference in the record being read.
|
void |
setRelationship(BioEntryRelationship relationship)
Call back method so the event emitter can tell the listener
about a relationship between the bioentry or sequence in the
record being read and another bioentry.
|
void |
setSeqVersion(String seqVersion)
Call back method so the event emitter can tell the listener
the version of the sequence of the record being read.
|
void |
setTaxon(NCBITaxon taxon)
Call back method so the event emitter can tell the listener
the Taxon of the record being read.
|
void |
setURI(String uri)
Notify the listener of a URI identifying the current sequence.
|
void |
setVersion(int version)
Call back method so the event emitter can tell the listener
the version of the record being read.
|
void |
startFeature(Feature.Template templ)
Notify the listener that a new feature object is starting.
|
void |
startSequence()
Start the processing of a sequence.
|
public SimpleRichSequenceBuilder()
public SimpleRichSequenceBuilder(SymbolListFactory factory)
factory
- the symbollistfactory to use from the start.public SimpleRichSequenceBuilder(SymbolListFactory factory, int threshold)
factory
- the symbollistfactory to use.threshold
- the threshold at which the specified symbollistfactory
should come into use. If <=0, it will be used from the start.public void setVersion(int version) throws ParseException
setVersion
in interface RichSeqIOListener
setVersion
in class RichSeqIOAdapter
version
- the version of the recordParseException
- If the Listener cannot understand the event, is unable
to deal with the event or is not expecting the event.public void setURI(String uri) throws ParseException
setURI
in interface SeqIOListener
setURI
in interface RichSeqIOListener
setURI
in class RichSeqIOAdapter
ParseException
public void setSeqVersion(String seqVersion) throws ParseException
setSeqVersion
in interface RichSeqIOListener
setSeqVersion
in class RichSeqIOAdapter
seqVersion
- the version of the recordParseException
- If the Listener cannot understand the event, is unable
to deal with the event or is not expecting the event.public void setAccession(String accession) throws ParseException
setAccession
in interface RichSeqIOListener
setAccession
in class RichSeqIOAdapter
accession
- The accession of the recordParseException
- If the Listener cannot understand the event, is unable
to deal with the event or is not expecting the event.SeqIOListener.setName(String name)
,
RichSeqIOListener.setURI(String uri)
,
RichSeqIOListener.setIdentifier(String identifier)
public void setDescription(String description) throws ParseException
setDescription
in interface RichSeqIOListener
setDescription
in class RichSeqIOAdapter
description
- The description of the recordParseException
- If the Listener cannot understand the event, is unable
to deal with the event or is not expecting the event.public void setDivision(String division) throws ParseException
setDivision
in interface RichSeqIOListener
setDivision
in class RichSeqIOAdapter
division
- The division the entry belongs too.ParseException
- If the Listener cannot understand the event, is unable
to deal with the event or is not expecting the event.public void setIdentifier(String identifier) throws ParseException
setIdentifier
in interface RichSeqIOListener
setIdentifier
in class RichSeqIOAdapter
identifier
- The identifier of the Bioentry.ParseException
- If the Listener cannot understand the event, is unable
to deal with the event or is not expecting the event.SeqIOListener.setName(String name)
,
RichSeqIOListener.setAccession(String accession)
,
RichSeqIOListener.setURI(String uri)
public void setName(String name) throws ParseException
setName
in interface SeqIOListener
setName
in class RichSeqIOAdapter
name
- the String that should be returned by getName for the sequence
being parsedParseException
public void setRankedCrossRef(RankedCrossRef ref) throws ParseException
setRankedCrossRef
in interface RichSeqIOListener
setRankedCrossRef
in class RichSeqIOAdapter
ref
- the cross referenceParseException
- If the Listener cannot understand the event, is unable
to deal with the event or is not expecting the event.public void addSymbols(Alphabet alpha, Symbol[] syms, int start, int length) throws IllegalAlphabetException
addSymbols
in interface SeqIOListener
addSymbols
in class RichSeqIOAdapter
alpha
- The alphabet of the symbol datasyms
- An array containing symbolsstart
- The start offset of valid data within the arraylength
- The number of valid symbols in the arrayIllegalAlphabetException
- if we can't cope with this
alphabet.public void setComment(String comment) throws ParseException
setComment
in interface RichSeqIOListener
setComment
in class RichSeqIOAdapter
comment
- The commentParseException
- If the Listener cannot understand the event, is unable
to deal with the event or is not expecting the event.public void setNamespace(Namespace namespace) throws ParseException
The namespace is a concept from the BioSQL schema that enables Bioentries to be disambiguated. It is possible in BioSQL and should be possible in other collections of BioEntries to have records that have the same name, accession and version but different namespaces. This method would be expected to be called if you are reading a sequence from a biosql database or if you are implementing a listener that knows how to write to a biosql database. If you give a sequence a namespace and it is persited to biosql at somepoint in it's life you could expect it to be persisted to that namespace (if possible).
setNamespace
in interface RichSeqIOListener
setNamespace
in class RichSeqIOAdapter
namespace
- The namespace of the entry.ParseException
- If the Listener cannot understand the event, is unable
to deal with the event or is not expecting the event.public void startFeature(Feature.Template templ) throws ParseException
startFeature
in interface SeqIOListener
startFeature
in class RichSeqIOAdapter
ParseException
public RichFeature getCurrentFeature() throws ParseException
getCurrentFeature
in interface RichSeqIOListener
getCurrentFeature
in class RichSeqIOAdapter
ParseException
- if a feature is not currently being created.public void setTaxon(NCBITaxon taxon) throws ParseException
setTaxon
in interface RichSeqIOListener
setTaxon
in class RichSeqIOAdapter
taxon
- The taxon information relevant to this entry.ParseException
- If the Listener cannot understand the event, is unable
to deal with the event or is not expecting the event.public void setRelationship(BioEntryRelationship relationship) throws ParseException
setRelationship
in interface RichSeqIOListener
setRelationship
in class RichSeqIOAdapter
relationship
- The relationshipParseException
- If the Listener cannot understand the event, is unable
to deal with the event or is not expecting the event.public void setRankedDocRef(RankedDocRef ref) throws ParseException
setRankedDocRef
in interface RichSeqIOListener
setRankedDocRef
in class RichSeqIOAdapter
ref
- A literature reference contained in the entry.ParseException
- If the Listener cannot understand the event, is unable
to deal with the event or is not expecting the event.public void startSequence() throws ParseException
startSequence
in interface SeqIOListener
startSequence
in class RichSeqIOAdapter
ParseException
public void addFeatureProperty(Object key, Object value) throws ParseException
addFeatureProperty
in interface SeqIOListener
addFeatureProperty
in class RichSeqIOAdapter
ParseException
public void addSequenceProperty(Object key, Object value) throws ParseException
addSequenceProperty
in interface SeqIOListener
addSequenceProperty
in class RichSeqIOAdapter
ParseException
public void endFeature() throws ParseException
endFeature
in interface SeqIOListener
endFeature
in class RichSeqIOAdapter
ParseException
public void endSequence() throws ParseException
endSequence
in interface SeqIOListener
endSequence
in class RichSeqIOAdapter
ParseException
public void setCircular(boolean circular) throws ParseException
setCircular
in interface RichSeqIOListener
setCircular
in class RichSeqIOAdapter
circular
- set this to true if you want it to be circular.ParseException
- If the Listener cannot understand the event, is unable
to deal with the event or is not expecting the event.public Sequence makeSequence() throws BioException
makeSequence
in interface SequenceBuilder
makeSequence
in interface RichSequenceBuilder
BioException
public RichSequence makeRichSequence() throws BioException
makeRichSequence
in interface RichSequenceBuilder
BioException
- if it is not possible to build a RichSequenceCopyright © 2014 BioJava. All rights reserved.