Class SequenceProxyView<C extends Compound>
java.lang.Object
org.biojava.nbio.core.sequence.template.SequenceProxyView<C>
- All Implemented Interfaces:
Iterable<C>
,Accessioned
,Sequence<C>
,SequenceView<C>
- Direct Known Subclasses:
ComplementSequenceView
,ReversedSequenceView
,RnaSequenceView
-
Constructor Summary
ConstructorDescriptionSequenceProxyView
(Sequence<C> sequence) SequenceProxyView
(Sequence<C> sequence, Integer bioStart, Integer bioEnd) Main constructor for working with SequenceProxyViews -
Method Summary
Modifier and TypeMethodDescriptionint
countCompounds
(C... compounds) Returns the number of times we found a compound in the SequenceReturns the AccessionID this location is currently bound withReturns the Sequence as a List of compounds1-indexed, inclusive.1-indexed, inclusive.getCompoundAt
(int position) Returns the Compound at the given biological indexGets the compound set used to back this Sequenceint
getIndexOf
(C compound) Scans through the Sequence looking for the first occurrence of the given compoundDoes the right thing to get the inverse of the current Sequence.int
getLastIndexOf
(C compound) Scans through the Sequence looking for the last occurrence of the given compoundint
Returns the length of the SequenceReturns the String representation of the SequencegetSubSequence
(Integer bioStart, Integer bioEnd) Returns a portion of the sequence from the different positions.iterator()
void
void
setBioStart
(Integer bioStart) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
SequenceProxyView
public SequenceProxyView() -
SequenceProxyView
-
SequenceProxyView
Main constructor for working with SequenceProxyViews- Parameters:
sequence
- Sequence to proxybioStart
- Start; cannot be less than 1bioEnd
- End; cannot be greater than the sequence length
-
-
Method Details
-
getViewedSequence
- Specified by:
getViewedSequence
in interfaceSequenceView<C extends Compound>
-
getSequenceAsString
Description copied from interface:Sequence
Returns the String representation of the Sequence- Specified by:
getSequenceAsString
in interfaceSequence<C extends Compound>
-
getAsList
Description copied from interface:Sequence
Returns the Sequence as a List of compounds -
getCompoundAt
Description copied from interface:Sequence
Returns the Compound at the given biological index- Specified by:
getCompoundAt
in interfaceSequence<C extends Compound>
- 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<C extends Compound>
- 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<C extends Compound>
- Parameters:
compound
- Compounds to look for- Returns:
- Index of the last position of the compound in the sequence (1 to n)
-
getLength
public int getLength()Description copied from interface:Sequence
Returns the length of the Sequence -
getCompoundSet
Description copied from interface:Sequence
Gets the compound set used to back this Sequence- Specified by:
getCompoundSet
in interfaceSequence<C extends Compound>
-
getSubSequence
Description copied from interface:Sequence
Returns a portion of the sequence from the different positions. This is indexed from 1- Specified by:
getSubSequence
in interfaceSequence<C extends Compound>
- Parameters:
bioStart
- Biological index start; must be greater than 0bioEnd
- Biological end; must be less than length + 1- Returns:
- A SequenceView of the offset
-
iterator
-
getAccession
Description copied from interface:Accessioned
Returns the AccessionID this location is currently bound with- Specified by:
getAccession
in interfaceAccessioned
-
getBioStart
Description copied from interface:SequenceView
1-indexed, inclusive.- Specified by:
getBioStart
in interfaceSequenceView<C extends Compound>
- Returns:
- the bioStart
-
setBioStart
- Parameters:
bioStart
- the bioStart to set
-
getBioEnd
Description copied from interface:SequenceView
1-indexed, inclusive.- Specified by:
getBioEnd
in interfaceSequenceView<C extends Compound>
- Returns:
- the bioEnd
-
setBioEnd
- Parameters:
bioEnd
- the bioEnd to set
-
countCompounds
Description copied from interface:Sequence
Returns the number of times we found a compound in the Sequence- Specified by:
countCompounds
in interfaceSequence<C extends Compound>
- Parameters:
compounds
- Vargs of the compounds to count- Returns:
- Number of times a compound was found
-
getInverse
Description copied from interface:Sequence
Does the right thing to get the inverse of the current Sequence. This means either reversing the Sequence and optionally complementing the Sequence.- Specified by:
getInverse
in interfaceSequence<C extends Compound>
-