Package jebl.evolution.sequences
Class Nucleotides
- java.lang.Object
-
- jebl.evolution.sequences.Nucleotides
-
public final class Nucleotides extends java.lang.ObjectUninstantiable utility class with only static methods.- Version:
- $Id: Nucleotides.java 986 2009-03-10 01:00:03Z matt_kearse $
- Author:
- Andrew Rambaut, Alexei Drummond
-
-
Field Summary
Fields Modifier and Type Field Description static NucleotideStateA_STATEstatic NucleotideStateB_STATEstatic NucleotideStateC_STATEstatic intCANONICAL_STATE_COUNTstatic NucleotideState[]CANONICAL_STATESDeprecated.static NucleotideState[]COMPLEMENTARY_STATESDeprecated.static NucleotideStateD_STATEstatic NucleotideStateG_STATEstatic NucleotideStateGAP_STATEstatic NucleotideStateH_STATEstatic NucleotideStateK_STATEstatic NucleotideStateM_STATEstatic NucleotideStateN_STATEstatic java.lang.StringNAMEstatic NucleotideStateR_STATEstatic NucleotideStateS_STATEstatic intSTATE_COUNTstatic NucleotideState[]STATESDeprecated.static NucleotideStateT_STATEstatic NucleotideStateUNKNOWN_STATEstatic NucleotideStateV_STATEstatic NucleotideStateW_STATEstatic NucleotideStateY_STATE
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static intgetCanonicalStateCount()static java.util.List<NucleotideState>getCanonicalStates()static NucleotideStategetComplementaryState(NucleotideState state)static NucleotideStategetGapState()java.lang.StringgetName()static NucleotideStategetState(char code)static NucleotideStategetState(int index)static NucleotideStategetState(java.lang.String code)static intgetStateCount()static java.util.List<State>getStates()static NucleotideStategetUnknownState()static booleanisATstate(State state)static booleanisGap(NucleotideState state)static booleanisGCstate(State state)static booleanisPossibleTransition(char c1, char c2)static booleanisPossibleTransition(State s1, State s2)static booleanisPossibleTransversion(char c1, char c2)static booleanisPossibleTransversion(State s1, State s2)static booleanisPurine(State state)static booleanisPyrimidine(State state)static booleanisTransition(State state1, State state2)static booleanisTransversion(State state1, State state2)static booleanisUnknown(NucleotideState state)static CodonState[]toCodons(State[] states, int readingFrame)Convert an array of nucleotide states into an array of codon statesstatic NucleotideState[]toStateArray(byte[] indexArray)static NucleotideState[]toStateArray(java.lang.String sequenceString)
-
-
-
Field Detail
-
NAME
public static final java.lang.String NAME
- See Also:
- Constant Field Values
-
CANONICAL_STATE_COUNT
public static final int CANONICAL_STATE_COUNT
- See Also:
- Constant Field Values
-
STATE_COUNT
public static final int STATE_COUNT
- See Also:
- Constant Field Values
-
A_STATE
public static final NucleotideState A_STATE
-
C_STATE
public static final NucleotideState C_STATE
-
G_STATE
public static final NucleotideState G_STATE
-
T_STATE
public static final NucleotideState T_STATE
-
R_STATE
public static final NucleotideState R_STATE
-
Y_STATE
public static final NucleotideState Y_STATE
-
M_STATE
public static final NucleotideState M_STATE
-
W_STATE
public static final NucleotideState W_STATE
-
S_STATE
public static final NucleotideState S_STATE
-
K_STATE
public static final NucleotideState K_STATE
-
B_STATE
public static final NucleotideState B_STATE
-
D_STATE
public static final NucleotideState D_STATE
-
H_STATE
public static final NucleotideState H_STATE
-
V_STATE
public static final NucleotideState V_STATE
-
N_STATE
public static final NucleotideState N_STATE
-
UNKNOWN_STATE
public static final NucleotideState UNKNOWN_STATE
-
GAP_STATE
public static final NucleotideState GAP_STATE
-
CANONICAL_STATES
@Deprecated public static final NucleotideState[] CANONICAL_STATES
Deprecated.
-
STATES
@Deprecated public static final NucleotideState[] STATES
Deprecated.
-
COMPLEMENTARY_STATES
@Deprecated public static final NucleotideState[] COMPLEMENTARY_STATES
Deprecated.
-
-
Method Detail
-
getComplementaryState
public static NucleotideState getComplementaryState(NucleotideState state)
-
getStateCount
public static int getStateCount()
-
getStates
public static java.util.List<State> getStates()
- Returns:
- A list of all possible states, including the gap and ambiguity states.
-
getCanonicalStateCount
public static int getCanonicalStateCount()
-
getCanonicalStates
public static java.util.List<NucleotideState> getCanonicalStates()
-
getState
public static NucleotideState getState(char code)
-
getState
public static NucleotideState getState(java.lang.String code)
-
getState
public static NucleotideState getState(int index)
-
getUnknownState
public static NucleotideState getUnknownState()
-
getGapState
public static NucleotideState getGapState()
-
isUnknown
public static boolean isUnknown(NucleotideState state)
-
isGap
public static boolean isGap(NucleotideState state)
-
isTransition
public static boolean isTransition(State state1, State state2)
- Returns:
- true if state1 and state2 are different non-ambigous states that are a transition. (i.e. A-G or C-T)
- See Also:
isPossibleTransition(State, State)
-
isTransversion
public static boolean isTransversion(State state1, State state2)
- Returns:
- true if state1 and state2 are different non-ambigous states that are a transversion. (i.e. A-C or A-T or G-C or G-T)
- See Also:
isPossibleTransversion(State, State)
-
isPossibleTransition
public static boolean isPossibleTransition(char c1, char c2)- Returns:
- true if there is a possible transition betwen these states. Possible transition means there is at least 1 transition between at least one of the possible combintaitons of non-ambiguous cannonical states represented by the ambiguity symbols. If neither state is ambigous this method returns true if and only if the states are a transversion.
-
isPossibleTransversion
public static boolean isPossibleTransversion(char c1, char c2)- Returns:
- true if there is a possible transversion betwen these states. Possible transversion means there is at least 1 transversion between at least one of the possible combintaitons of non-ambiguous cannonical states represented by the ambiguity symbols. If neither state is ambigous this method returns true if and only if the states are a transversion.
-
isPossibleTransition
public static boolean isPossibleTransition(State s1, State s2)
- Returns:
- true if there is a possible transition betwen these states. Possible transition means there is at least 1 transition between at least one of the possible combintaitons of non-ambiguous cannonical states represented by the ambiguity symbols. If neither state is ambigous this method returns true if and only if the states are a transversion.
-
isPossibleTransversion
public static boolean isPossibleTransversion(State s1, State s2)
- Returns:
- true if there is a possible transversion betwen these states. Possible transversion means there is at least 1 transversion between at least one of the possible combintaitons of non-ambiguous cannonical states represented by the ambiguity symbols. If neither state is ambigous this method returns true if and only if the states are a transversion.
-
isPurine
public static boolean isPurine(State state)
-
isPyrimidine
public static boolean isPyrimidine(State state)
-
isGCstate
public static boolean isGCstate(State state)
-
isATstate
public static boolean isATstate(State state)
-
getName
public java.lang.String getName()
-
toStateArray
public static NucleotideState[] toStateArray(java.lang.String sequenceString)
-
toStateArray
public static NucleotideState[] toStateArray(byte[] indexArray)
-
toCodons
public static CodonState[] toCodons(State[] states, int readingFrame)
Convert an array of nucleotide states into an array of codon states- Parameters:
states- the nucleotide statesreadingFrame- the reading frame (1 to 3)- Returns:
- the codon states
-
-