Interface Sequence<C extends Compound>
- 
- Type Parameters:
- C- Compound a Sequence holds
 - All Superinterfaces:
- Accessioned,- Iterable<C>
 - All Known Subinterfaces:
- AlignedSequence<S,C>,- MutableAlignedSequence<S,C>,- ProxySequenceReader<C>,- SequenceReader<C>,- SequenceView<C>
 - All Known Implementing Classes:
- AbstractSequence,- ArrayListProxySequenceReader,- ArrayListSequenceReader,- BasicSequence,- BitSequenceReader,- CDSSequence,- ChromosomeSequence,- ComplementSequenceView,- DNASequence,- ExonSequence,- FourBitSequenceReader,- GenbankProxySequenceReader,- GeneSequence,- IntronSequence,- JoiningSequenceReader,- ProteinSequence,- ReversedSequenceView,- RNASequence,- RnaSequenceView,- SequenceFileProxyLoader,- SequenceProxyView,- SimpleAlignedSequence,- SingleCompoundSequenceReader,- StartCodonSequence,- StopCodonSequence,- StringProxySequenceReader,- TranscriptSequence,- TwoBitSequenceReader,- UniprotProxySequenceReader
 
 public interface Sequence<C extends Compound> extends Iterable<C>, Accessioned Main interface for defining a collection of Compounds and accessing them using biological indexes- Author:
- Richard Holland, Andy Yates, Scooter Willis
 
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description intcountCompounds(C... compounds)Returns the number of times we found a compound in the SequenceList<C>getAsList()Returns the Sequence as a List of compoundsCgetCompoundAt(int position)Returns the Compound at the given biological indexCompoundSet<C>getCompoundSet()Gets the compound set used to back this SequenceintgetIndexOf(C compound)Scans through the Sequence looking for the first occurrence of the given compoundSequenceView<C>getInverse()Does the right thing to get the inverse of the current Sequence.intgetLastIndexOf(C compound)Scans through the Sequence looking for the last occurrence of the given compoundintgetLength()Returns the length of the SequenceStringgetSequenceAsString()Returns the String representation of the SequenceSequenceView<C>getSubSequence(Integer start, Integer end)Returns a portion of the sequence from the different positions.- 
Methods inherited from interface org.biojava.nbio.core.sequence.template.AccessionedgetAccession
 - 
Methods inherited from interface java.lang.IterableforEach, iterator, spliterator
 
- 
 
- 
- 
- 
Method Detail- 
getLengthint getLength() Returns the length of the Sequence
 - 
getCompoundAtC getCompoundAt(int position) Returns the Compound at the given biological index- Parameters:
- position- Biological index (1 to n)
- Returns:
- Compound at the specified position
 
 - 
getIndexOfint getIndexOf(C compound) Scans through the Sequence looking for the first occurrence of the given compound- Parameters:
- compound- Compounds to look for
- Returns:
- Index of the first position of the compound in the sequence (1 to n)
 
 - 
getLastIndexOfint getLastIndexOf(C compound) Scans through the Sequence looking for the last occurrence of the given compound- Parameters:
- compound- Compounds to look for
- Returns:
- Index of the last position of the compound in the sequence (1 to n)
 
 - 
getSequenceAsStringString getSequenceAsString() Returns the String representation of the Sequence
 - 
getSubSequenceSequenceView<C> getSubSequence(Integer start, Integer end) Returns a portion of the sequence from the different positions. This is indexed from 1- Parameters:
- start- Biological index start; must be greater than 0
- end- Biological end; must be less than length + 1
- Returns:
- A SequenceView of the offset
 
 - 
getCompoundSetCompoundSet<C> getCompoundSet() Gets the compound set used to back this Sequence
 - 
countCompoundsint countCompounds(C... compounds) Returns the number of times we found a compound in the Sequence- Parameters:
- compounds- Vargs of the compounds to count
- Returns:
- Number of times a compound was found
 
 - 
getInverseSequenceView<C> getInverse() Does the right thing to get the inverse of the current Sequence. This means either reversing the Sequence and optionally complementing the Sequence.
 
- 
 
-