Package org.biojava3.core.sequence.views
Class ComplementSequenceView<C extends ComplementCompound>
java.lang.Object
org.biojava3.core.sequence.template.SequenceProxyView<C>
org.biojava3.core.sequence.views.ComplementSequenceView<C>
- Type Parameters:
C- Must be a subtype of @{link ComplementCompound} since only those support complements
- All Implemented Interfaces:
Iterable<C>,Accessioned,Sequence<C>,SequenceView<C>
For a given sequence this class will create a view over the top of it and for every request the
code will return the complement of the underlying base e.g. base A will become base T
- Author:
- Andy Yates
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetCompoundAt(int position) Returns the Compound at the given biological indexintgetIndexOf(C compound) Scans through the Sequence looking for the first occurrence of the given compoundintgetLastIndexOf(C compound) Scans through the Sequence looking for the last occurrence of the given compoundReturns the String representation of the SequenceMethods inherited from class org.biojava3.core.sequence.template.SequenceProxyView
countCompounds, getAccession, getAsList, getBioEnd, getBioStart, getCompoundSet, getInverse, getLength, getSubSequence, getViewedSequence, iterator, setBioEnd, setBioStartMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
ComplementSequenceView
-
-
Method Details
-
getSequenceAsString
Description copied from interface:SequenceReturns the String representation of the Sequence- Specified by:
getSequenceAsStringin interfaceSequence<C extends ComplementCompound>- Overrides:
getSequenceAsStringin classSequenceProxyView<C extends ComplementCompound>
-
getCompoundAt
Description copied from interface:SequenceReturns the Compound at the given biological index- Specified by:
getCompoundAtin interfaceSequence<C extends ComplementCompound>- Overrides:
getCompoundAtin classSequenceProxyView<C extends ComplementCompound>- Parameters:
position- Biological index (1 to n)- Returns:
- Compound at the specified position
-
getIndexOf
Description copied from interface:SequenceScans through the Sequence looking for the first occurrence of the given compound- Specified by:
getIndexOfin interfaceSequence<C extends ComplementCompound>- Overrides:
getIndexOfin classSequenceProxyView<C extends ComplementCompound>- 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:SequenceScans through the Sequence looking for the last occurrence of the given compound- Specified by:
getLastIndexOfin interfaceSequence<C extends ComplementCompound>- Overrides:
getLastIndexOfin classSequenceProxyView<C extends ComplementCompound>- Parameters:
compound- Compounds to look for- Returns:
- Index of the last position of the compound in the sequence (1 to n)
-