org.biojava3.core.sequence.views
Class RnaSequenceView
java.lang.Object
org.biojava3.core.sequence.template.SequenceProxyView<NucleotideCompound>
org.biojava3.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
Methods inherited from class org.biojava3.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 |
RnaSequenceView
public RnaSequenceView(Sequence<NucleotideCompound> sourceDna)
RnaSequenceView
public RnaSequenceView(Sequence<NucleotideCompound> sourceDna,
CompoundSet<NucleotideCompound> rnaCompounds)
getSequenceAsString
public String getSequenceAsString()
- Description copied from interface:
Sequence
- Returns the String representation of the Sequence
- Specified by:
getSequenceAsString
in interface Sequence<NucleotideCompound>
- Overrides:
getSequenceAsString
in class SequenceProxyView<NucleotideCompound>
getCompoundAt
public NucleotideCompound getCompoundAt(int position)
- Description copied from interface:
Sequence
- Returns the Compound at the given biological index
- Specified by:
getCompoundAt
in interface Sequence<NucleotideCompound>
- Overrides:
getCompoundAt
in class SequenceProxyView<NucleotideCompound>
- Parameters:
position
- Biological index (1 to n)
- Returns:
- Compound at the specified position
getIndexOf
public int getIndexOf(NucleotideCompound compound)
- Description copied from interface:
Sequence
- Scans through the Sequence looking for the first occurrence of the given
compound
- Specified by:
getIndexOf
in interface Sequence<NucleotideCompound>
- Overrides:
getIndexOf
in class SequenceProxyView<NucleotideCompound>
- Parameters:
compound
- Compounds to look for
- Returns:
- Index of the first position of the compound in the sequence (1 to n)
getLastIndexOf
public int getLastIndexOf(NucleotideCompound compound)
- Description copied from interface:
Sequence
- Scans through the Sequence looking for the last occurrence of the given
compound
- Specified by:
getLastIndexOf
in interface Sequence<NucleotideCompound>
- Overrides:
getLastIndexOf
in class SequenceProxyView<NucleotideCompound>
- Parameters:
compound
- Compounds to look for
- Returns:
- Index of the last position of the compound in the sequence (1 to n)
getRnaToDna
public Map<NucleotideCompound,NucleotideCompound> getRnaToDna()
getDnaToRna
public Map<NucleotideCompound,NucleotideCompound> getDnaToRna()
buildTranslators
protected void buildTranslators()
setCompoundSet
public void setCompoundSet(CompoundSet<NucleotideCompound> compoundSet)
- Specified by:
setCompoundSet
in interface SequenceReader<NucleotideCompound>
setContents
public void setContents(String sequence)
- Specified by:
setContents
in interface SequenceReader<NucleotideCompound>