Package jebl.evolution.sequences
Interface SequenceType
-
public interface SequenceTypeInterface 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 Modifier and Type Interface Description static classSequenceType.Utils
-
Field Summary
Fields Modifier and Type Field Description static SequenceTypeAMINO_ACIDstatic SequenceTypeCODONstatic SequenceTypeNUCLEOTIDE
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intgetCanonicalStateCount()Get number of canonical statesjava.util.List<? extends State>getCanonicalStates()Get a list of canonical states ordered by their indices.intgetCodeLength()StategetGapState()Get state corresponding to a gapjava.lang.StringgetName()name of data typejava.lang.StringgetNexusDataType()StategetState(char code)Get state whose code is the one-character string consisting only of code.StategetState(int index)Get state corresponding to a state indexStategetState(java.lang.String code)Get state corresponding to a string codeintgetStateCount()Get number of states including ambiguous statesjava.util.List<? extends State>getStates()Get a list of states ordered by their indices.StategetUnknownState()Get state corresponding to an unknownbooleanisGap(State state)booleanisUnknown(State state)State[]toStateArray(byte[] indexArray)Converts an array of state indices into an array of State objects for this SequenceTypeState[]toStateArray(java.lang.String sequenceString)Converts a string of state codes into an array of State objects for this SequenceType
-
-
-
Field Detail
-
NUCLEOTIDE
static final SequenceType NUCLEOTIDE
-
AMINO_ACID
static final SequenceType AMINO_ACID
-
CODON
static final SequenceType CODON
-
-
Method Detail
-
getStateCount
int getStateCount()
Get number of states including ambiguous states- Returns:
- number of states
-
getStates
java.util.List<? extends State> 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
java.util.List<? extends State> getCanonicalStates()
Get a list of canonical states ordered by their indices.- Returns:
- a list of states
-
getState
State getState(java.lang.String code)
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
State getState(char code)
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
State getState(int index)
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
boolean isUnknown(State state)
- Returns:
- true if this state is an unknown state
-
isGap
boolean isGap(State state)
- Returns:
- true if this state is a gap
-
getName
java.lang.String getName()
name of data type- Returns:
- string describing the data type
-
getNexusDataType
java.lang.String getNexusDataType()
- Returns:
- datatype inside a nexus characters block, if any.
-
toStateArray
State[] toStateArray(java.lang.String sequenceString)
Converts a string of state codes into an array of State objects for this SequenceType- Parameters:
sequenceString-- Returns:
- the State array
-
toStateArray
State[] toStateArray(byte[] indexArray)
Converts an array of state indices into an array of State objects for this SequenceType- Parameters:
indexArray-- Returns:
- the State array
-
-