Class RnaSequenceView
java.lang.Object
org.biojava.nbio.core.sequence.template.SequenceProxyView<NucleotideCompound>
org.biojava.nbio.core.sequence.views.RnaSequenceView
- All Implemented Interfaces:
Iterable<NucleotideCompound>
,Accessioned
,ProxySequenceReader<NucleotideCompound>
,Sequence<NucleotideCompound>
,SequenceReader<NucleotideCompound>
,SequenceView<NucleotideCompound>
public class RnaSequenceView
extends SequenceProxyView<NucleotideCompound>
implements ProxySequenceReader<NucleotideCompound>
Attempts to do on the fly translation of RNA by not requesting the compounds
until asked.
- Author:
- ayates
-
Constructor Summary
ConstructorDescriptionRnaSequenceView
(Sequence<NucleotideCompound> sourceDna) RnaSequenceView
(Sequence<NucleotideCompound> sourceDna, CompoundSet<NucleotideCompound> rnaCompounds) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
getCompoundAt
(int position) Returns the Compound at the given biological indexint
getIndexOf
(NucleotideCompound compound) Scans through the Sequence looking for the first occurrence of the given compoundint
getLastIndexOf
(NucleotideCompound compound) Scans through the Sequence looking for the last occurrence of the given compoundReturns the String representation of the Sequencevoid
setCompoundSet
(CompoundSet<NucleotideCompound> compoundSet) void
setContents
(String sequence) Methods inherited from class org.biojava.nbio.core.sequence.template.SequenceProxyView
countCompounds, getAccession, getAsList, getBioEnd, getBioStart, getCompoundSet, getInverse, getLength, getSubSequence, getViewedSequence, iterator, setBioEnd, setBioStart
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.biojava.nbio.core.sequence.template.Accessioned
getAccession
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
Methods inherited from interface org.biojava.nbio.core.sequence.template.Sequence
countCompounds, getAsList, getCompoundSet, getInverse, getLength, getSubSequence
-
Constructor Details
-
RnaSequenceView
-
RnaSequenceView
public RnaSequenceView(Sequence<NucleotideCompound> sourceDna, CompoundSet<NucleotideCompound> rnaCompounds)
-
-
Method Details
-
getSequenceAsString
Description copied from interface:Sequence
Returns the String representation of the Sequence- Specified by:
getSequenceAsString
in interfaceSequence<NucleotideCompound>
- Overrides:
getSequenceAsString
in classSequenceProxyView<NucleotideCompound>
-
getCompoundAt
Description copied from interface:Sequence
Returns the Compound at the given biological index- Specified by:
getCompoundAt
in interfaceSequence<NucleotideCompound>
- Overrides:
getCompoundAt
in classSequenceProxyView<NucleotideCompound>
- Parameters:
position
- Biological index (1 to n)- Returns:
- Compound at the specified position
-
getIndexOf
Description copied from interface:Sequence
Scans through the Sequence looking for the first occurrence of the given compound- Specified by:
getIndexOf
in interfaceSequence<NucleotideCompound>
- Overrides:
getIndexOf
in classSequenceProxyView<NucleotideCompound>
- Parameters:
compound
- Compounds to look for- Returns:
- Index of the first position of the compound in the sequence (1 to n)
-
getLastIndexOf
Description copied from interface:Sequence
Scans through the Sequence looking for the last occurrence of the given compound- Specified by:
getLastIndexOf
in interfaceSequence<NucleotideCompound>
- Overrides:
getLastIndexOf
in classSequenceProxyView<NucleotideCompound>
- Parameters:
compound
- Compounds to look for- Returns:
- Index of the last position of the compound in the sequence (1 to n)
-
getRnaToDna
-
getDnaToRna
-
buildTranslators
protected void buildTranslators() -
setCompoundSet
- Specified by:
setCompoundSet
in interfaceSequenceReader<NucleotideCompound>
-
setContents
- Specified by:
setContents
in interfaceSequenceReader<NucleotideCompound>
- Throws:
CompoundNotFoundException
-