Package jebl.evolution.sequences
Interface Sequence
- All Superinterfaces:
Attributable
,Comparable
- All Known Implementing Classes:
BasicSequence
,CanonicalSequence
,CodonSequence
,ConsensusSequence
,FilteredSequence
,GaplessSequence
,TranslatedSequence
A biomolecular sequence.
- Version:
- $Id: Sequence.java 365 2006-06-28 07:34:56Z pepster $
- Author:
- Andrew Rambaut, Alexei Drummond
-
Nested Class Summary
Nested classes/interfaces inherited from interface jebl.util.Attributable
Attributable.Utils
-
Method Summary
Modifier and TypeMethodDescriptionstatic Sequence
appendSequences
(Sequence sequence1, Sequence sequence2) Append two sequences together to create a new sequence object.int
Get the length of the sequencegetState
(int site) static int
getStateCount
(Sequence sequence, State state) Counts the number of occurances of a statebyte[]
State[]
static Sequence
getSubSequence
(Sequence sequence, int from, int to) Returns a sub-sequence for states from, to (inclusive).getTaxon()
static Sequence
replaceStates
(Sequence sequence, List<State> searchStates, State replaceState) Searchers and replaces a sequence of any states givenstatic Sequence
Strips a sequence of gapsstatic Sequence
stripStates
(Sequence sequence, List<State> stripStates) Strips a sequence of any states givenstatic Sequence
trimSequence
(Sequence sequence, List<State> trimStates) Methods inherited from interface jebl.util.Attributable
getAttribute, getAttributeMap, getAttributeNames, removeAttribute, setAttribute
Methods inherited from interface java.lang.Comparable
compareTo
-
Method Details
-
getTaxon
Taxon getTaxon()- Returns:
- the taxon that this sequence represents (primarily used to match sequences with tree nodes)
-
getSequenceType
SequenceType getSequenceType()- Returns:
- the type of symbols that this sequence is made up of.
-
getString
String getString()- Returns:
- a string representing the sequence of symbols.
-
getStates
State[] getStates()- Returns:
- an array of state objects.
-
getStateIndices
byte[] getStateIndices()- Returns:
- an array of state indices.
-
getState
- Returns:
- the state at site.
-
getLength
int getLength()Get the length of the sequence- Returns:
- the length
-
appendSequences
Append two sequences together to create a new sequence object. New sequence has the taxon of the first sequence.- Parameters:
sequence1
-sequence2
-- Returns:
-
getSubSequence
Returns a sub-sequence for states from, to (inclusive).- Parameters:
sequence
-from
-to
-- Returns:
-
trimSequence
-
stripGaps
Strips a sequence of gaps- Parameters:
sequence
- the sequence- Returns:
- the stripped sequence
-
stripStates
Strips a sequence of any states given- Parameters:
sequence
- the sequencestripStates
- the states to strip- Returns:
- an array of states
-
replaceStates
Searchers and replaces a sequence of any states given- Parameters:
sequence
- the sequencesearchStates
- the states to search for- Returns:
- an array of states
-
getStateCount
Counts the number of occurances of a state- Parameters:
sequence
- the sequence string to countstate
- the state- Returns:
- the number of occurances
-