Package jebl.evolution.sequences
Interface SequenceType
public interface SequenceType
Interface for sequences data types.
- Version:
- $Id: SequenceType.java 849 2007-12-06 00:10:14Z twobeers $
- Author:
- Andrew Rambaut, Alexei Drummond
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final SequenceType
static final SequenceType
static final SequenceType
-
Method Summary
Modifier and TypeMethodDescriptionint
Get number of canonical statesGet a list of canonical states ordered by their indices.int
Get state corresponding to a gapgetName()
name of data typegetState
(char code) Get state whose code is the one-character string consisting only of code.getState
(int index) Get state corresponding to a state indexGet state corresponding to a string codeint
Get number of states including ambiguous statesGet a list of states ordered by their indices.Get state corresponding to an unknownboolean
boolean
State[]
toStateArray
(byte[] indexArray) Converts an array of state indices into an array of State objects for this SequenceTypeState[]
toStateArray
(String sequenceString) Converts a string of state codes into an array of State objects for this SequenceType
-
Field Details
-
NUCLEOTIDE
-
AMINO_ACID
-
CODON
-
-
Method Details
-
getStateCount
int getStateCount()Get number of states including ambiguous states- Returns:
- number of states
-
getStates
Get a list of states ordered by their indices.- Returns:
- a list of states
-
getCanonicalStateCount
int getCanonicalStateCount()Get number of canonical states- Returns:
- number of states
-
getCanonicalStates
Get a list of canonical states ordered by their indices.- Returns:
- a list of states
-
getState
Get state corresponding to a string code- Parameters:
code
- a string code- Returns:
- the state with the given code, or null if there is no such state
-
getState
Get state whose code is the one-character string consisting only of code.- Parameters:
code
-- Returns:
- the state with the given code, or null if there is no such state
-
getCodeLength
int getCodeLength()- Returns:
- the length, in characters, of a state, when encoded as a string. i.e. 1 for Nucleotides and AminoAcids and 3 for Codons.
-
getState
Get state corresponding to a state index- Parameters:
index
- a state index- Returns:
- the state
-
getUnknownState
State getUnknownState()Get state corresponding to an unknown- Returns:
- the state
-
getGapState
State getGapState()Get state corresponding to a gap- Returns:
- state
-
isUnknown
- Returns:
- true if this state is an unknown state
-
isGap
- Returns:
- true if this state is a gap
-
getName
String getName()name of data type- Returns:
- string describing the data type
-
getNexusDataType
String getNexusDataType()- Returns:
- datatype inside a nexus characters block, if any.
-
toStateArray
Converts a string of state codes into an array of State objects for this SequenceType- Parameters:
sequenceString
-- Returns:
- the State array
-
toStateArray
Converts an array of state indices into an array of State objects for this SequenceType- Parameters:
indexArray
-- Returns:
- the State array
-