Package jebl.evolution.sequences
Class State
- java.lang.Object
-
- jebl.evolution.sequences.State
-
- All Implemented Interfaces:
java.lang.Comparable
- Direct Known Subclasses:
AminoAcidState
,CodonState
,NucleotideState
public abstract class State extends java.lang.Object implements java.lang.Comparable
- Version:
- $Id: State.java 1002 2009-05-27 03:33:19Z matt_kearse $
- Author:
- Andrew Rambaut, Alexei Drummond
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description int
compareTo(java.lang.Object o)
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.java.util.Set<State>
getCanonicalStates()
java.lang.String
getCode()
Returns the 1 letter code for this state.java.lang.String
getFullName()
A descriptive name for this state.int
getIndex()
java.lang.String
getName()
Deprecated.you probably want to usegetFullName()
orgetCode()
.boolean
isAmbiguous()
abstract boolean
isGap()
boolean
possiblyEqual(State other)
java.lang.String
toString()
-
-
-
Method Detail
-
getCode
public java.lang.String getCode()
Returns the 1 letter code for this state.- Returns:
- the 1 letter code for this state.
-
getIndex
public int getIndex()
-
getFullName
public java.lang.String 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 public java.lang.String 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:
getFullName()
-
isAmbiguous
public boolean isAmbiguous()
-
getCanonicalStates
public java.util.Set<State> getCanonicalStates()
-
possiblyEqual
public boolean possiblyEqual(State other)
- Parameters:
other
- another state to check for the quality 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
public int compareTo(java.lang.Object o)
- Specified by:
compareTo
in interfacejava.lang.Comparable
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
isGap
public abstract boolean isGap()
-
fractionEqual
public 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. 2 identical non-ambigoues states will 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.
-
-