Class Nucleotides


  • public final class Nucleotides
    extends java.lang.Object
    Uninstantiable utility class with only static methods.
    Version:
    $Id: Nucleotides.java 986 2009-03-10 01:00:03Z matt_kearse $
    Author:
    Andrew Rambaut, Alexei Drummond
    • Method Detail

      • 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​(java.lang.String code)
      • 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 states
        readingFrame - the reading frame (1 to 3)
        Returns:
        the codon states