Package jebl.evolution.sequences
Class State
java.lang.Object
jebl.evolution.sequences.State
- All Implemented Interfaces:
Comparable
- Direct Known Subclasses:
AminoAcidState
,CodonState
,NucleotideState
- Version:
- $Id: State.java 1002 2009-05-27 03:33:19Z matt_kearse $
- Author:
- Andrew Rambaut, Alexei Drummond
-
Method Summary
Modifier and TypeMethodDescriptionint
double
fractionEqual
(State other) Determine how much in common these potentially ambigous states have as a fraction between 0 and 1 2 non-ambiguous states will return 0.getCode()
Returns the 1 letter code for this state.A descriptive name for this state.int
getIndex()
getName()
Deprecated.abstract SequenceType
getType()
boolean
abstract boolean
isGap()
boolean
possiblyEqual
(State other) toString()
-
Method Details
-
getCode
Returns the 1 letter code for this state.- Returns:
- the 1 letter code for this state.
-
getIndex
public int getIndex() -
getFullName
A descriptive name for this state. e.g. "Phenylalanine" or "Adenine".- Returns:
- A descriptive name for this state. e.g. "Phenylalanine" or "Adenine".
-
getName
Deprecated.you probably want to usegetFullName()
orgetCode()
.The 1 letter code (for legacy purposes). Same asgetCode()
- Returns:
- The 1 letter code (for legacy purposes). Same as
getCode()
- See Also:
-
isAmbiguous
public boolean isAmbiguous() -
getCanonicalStates
-
possiblyEqual
- Parameters:
other
- another state to check for the equality with.- Returns:
- true if the other state is or possibly is equal to this state, taking ambiguities into account, i.e. if the ambiguity sets of this and the other state intersect.
-
compareTo
- Specified by:
compareTo
in interfaceComparable
-
toString
-
isGap
public abstract boolean isGap() -
getType
-
fractionEqual
Determine how much in common these potentially ambigous states have as a fraction between 0 and 1 2 non-ambiguous states will return 0. 2 identical non-ambiguous states will return 1. e.g. for Nucleotides R,A = 0.5 R,G = 0.5 R,M = 0.25- Parameters:
other
- another state to compare with- Returns:
- the fraction of canonical states that the 2 potentially ambiguous states have in common between 0 and 1.
-
getFullName()
orgetCode()
.