T
- the token type of the underlying data sourceC
- the compound type of the provided BioJava sequencespublic class SingleBioJava3SequenceAdapter<T,C extends org.biojava3.core.sequence.template.Compound> extends AbstractSingleSequenceDataAdapter<T> implements org.biojava3.core.sequence.template.Sequence<C>
SingleSequenceDataAdapter
that allow
to view one sequence of a AlignmentModel
as a BioJava Sequence
object.
Note that the underlying sequence data provider is directly used to that all changes in that provider are also reflected by the instance of this class.
Constructor and Description |
---|
SingleBioJava3SequenceAdapter(AlignmentModel<T> underlyingProvider,
java.lang.String sequenceID,
org.biojava3.core.sequence.template.CompoundSet<C> compoundSet)
Creates a new instance of this class that does not allow unknown compounds.
|
SingleBioJava3SequenceAdapter(AlignmentModel<T> underlyingProvider,
java.lang.String sequenceID,
org.biojava3.core.sequence.template.CompoundSet<C> compoundSet,
C unknownCompound)
Creates a new instance of this class allowing unknown compounds.
|
SingleBioJava3SequenceAdapter(AlignmentModel<T> underlyingProvider,
java.lang.String sequenceID,
int offset,
int length,
org.biojava3.core.sequence.template.CompoundSet<C> compoundSet)
Creates a new instance of this class that does not allow unknown compounds.
|
SingleBioJava3SequenceAdapter(AlignmentModel<T> underlyingProvider,
java.lang.String sequenceID,
int offset,
int length,
org.biojava3.core.sequence.template.CompoundSet<C> compoundSet,
C unknownCompound)
Creates a new instance of this class allowing unknown compounds.
|
Modifier and Type | Method and Description |
---|---|
int |
countCompounds(C... compounds) |
org.biojava3.core.sequence.AccessionID |
getAccession()
This method always returns null since sequences stored in instances of
AlignmentModel
do not store an associated instance of AccessionID . |
java.util.List<C> |
getAsList() |
C |
getCompoundAt(int index) |
org.biojava3.core.sequence.template.CompoundSet<C> |
getCompoundSet() |
int |
getIndexOf(C compound) |
org.biojava3.core.sequence.template.SequenceView<C> |
getInverse() |
int |
getLastIndexOf(C compound) |
java.lang.String |
getSequenceAsString() |
org.biojava3.core.sequence.template.SequenceView<C> |
getSubSequence(java.lang.Integer start,
java.lang.Integer end) |
C |
getUnknownCompound()
Returns the compound that will be inserted into the BioJava sequence if no according compound to the token
in the underlying data source can be found in the specified compound set.
|
boolean |
isAllowUnkownCompounds() |
java.util.Iterator<C> |
iterator() |
getLength, getOffset, getSequenceID, setLength, setOffset, setSequenceID
getUnderlyingModel, setUnderlyingModel
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getUnderlyingModel
public SingleBioJava3SequenceAdapter(AlignmentModel<T> underlyingProvider, java.lang.String sequenceID, int offset, int length, org.biojava3.core.sequence.template.CompoundSet<C> compoundSet)
provider
- the sequence data provider that contains the sequence to be viewedsequenceID
- the ID used in provider
of the sequence to be viewedoffset
- the start index of the subsequence to be viewed (The first token has the index 0.)length
- the length of the subsequence to be viewedcompoundSet
- the compound set to be used for the translationpublic SingleBioJava3SequenceAdapter(AlignmentModel<T> underlyingProvider, java.lang.String sequenceID, int offset, int length, org.biojava3.core.sequence.template.CompoundSet<C> compoundSet, C unknownCompound)
provider
- the sequence data provider that contains the sequence to be viewedsequenceID
- the ID used in provider
of the sequence to be viewedoffset
- the start index of the subsequence to be viewed (The first token has the index 0.)length
- the length of the subsequence to be viewedcompoundSet
- the compound set to be used for the translationunknownCompound
- the compound that will be inserted into the BioJava sequence if no according
compound to the token in the underlying data source can be found in compoundSet
public SingleBioJava3SequenceAdapter(AlignmentModel<T> underlyingProvider, java.lang.String sequenceID, org.biojava3.core.sequence.template.CompoundSet<C> compoundSet)
provider
- the sequence data provider that contains the sequence to be viewedsequenceID
- the ID used in provider
of the sequence to be viewedcompoundSet
- the compound set to be used for the translationpublic SingleBioJava3SequenceAdapter(AlignmentModel<T> underlyingProvider, java.lang.String sequenceID, org.biojava3.core.sequence.template.CompoundSet<C> compoundSet, C unknownCompound)
provider
- the sequence data provider that contains the sequence to be viewedsequenceID
- the ID used in provider
of the sequence to be viewedcompoundSet
- the compound set to be used for the translationunknownCompound
- the compound that will be inserted into the BioJava sequence if no according
compound to the token in the underlying data source can be found in compoundSet
public boolean isAllowUnkownCompounds()
public C getUnknownCompound()
public C getCompoundAt(int index)
getCompoundAt
in interface org.biojava3.core.sequence.template.Sequence<C extends org.biojava3.core.sequence.template.Compound>
index
- InvalidUnderlyingTokenException
public org.biojava3.core.sequence.template.CompoundSet<C> getCompoundSet()
getCompoundSet
in interface org.biojava3.core.sequence.template.Sequence<C extends org.biojava3.core.sequence.template.Compound>
public java.util.Iterator<C> iterator()
iterator
in interface java.lang.Iterable<C extends org.biojava3.core.sequence.template.Compound>
public org.biojava3.core.sequence.AccessionID getAccession()
AlignmentModel
do not store an associated instance of AccessionID
.getAccession
in interface org.biojava3.core.sequence.template.Accessioned
Accessioned.getAccession()
public int countCompounds(C... compounds)
countCompounds
in interface org.biojava3.core.sequence.template.Sequence<C extends org.biojava3.core.sequence.template.Compound>
public java.util.List<C> getAsList()
getAsList
in interface org.biojava3.core.sequence.template.Sequence<C extends org.biojava3.core.sequence.template.Compound>
public int getIndexOf(C compound)
getIndexOf
in interface org.biojava3.core.sequence.template.Sequence<C extends org.biojava3.core.sequence.template.Compound>
public org.biojava3.core.sequence.template.SequenceView<C> getInverse()
getInverse
in interface org.biojava3.core.sequence.template.Sequence<C extends org.biojava3.core.sequence.template.Compound>
public int getLastIndexOf(C compound)
getLastIndexOf
in interface org.biojava3.core.sequence.template.Sequence<C extends org.biojava3.core.sequence.template.Compound>
public java.lang.String getSequenceAsString()
getSequenceAsString
in interface org.biojava3.core.sequence.template.Sequence<C extends org.biojava3.core.sequence.template.Compound>
public org.biojava3.core.sequence.template.SequenceView<C> getSubSequence(java.lang.Integer start, java.lang.Integer end)
getSubSequence
in interface org.biojava3.core.sequence.template.Sequence<C extends org.biojava3.core.sequence.template.Compound>