Package pal.datatype

Class IUPACNucleotides

    • Constructor Detail

      • IUPACNucleotides

        public IUPACNucleotides()
      • IUPACNucleotides

        public IUPACNucleotides​(boolean isRNA)
    • Method Detail

      • getNumStates

        public int getNumStates()
        Get number of states.
        Specified by:
        getNumStates in interface DataType
        Returns:
        number of unique states
      • isUnknownStateImpl

        protected boolean isUnknownStateImpl​(int state)
        Description copied from class: SimpleDataType
        For subclasses to handle, without regard for gaps
        Specified by:
        isUnknownStateImpl in class SimpleDataType
      • getStateImpl

        protected final int getStateImpl​(char c)
        Description copied from class: SimpleDataType
        For sub classes to implement main functionality of getState. Gaps do not need to be considered
        Specified by:
        getStateImpl in class SimpleDataType
      • getDescription

        public java.lang.String getDescription()
        Description copied from interface: DataType
        description of data type
        Specified by:
        getDescription in interface DataType
        Returns:
        string describing the data type
      • getTypeID

        public int getTypeID()
        Description copied from interface: DataType
        get numerical code describing the data type
        Specified by:
        getTypeID in interface DataType
        Returns:
        numerical code
      • isNucleotideState

        public static final boolean isNucleotideState​(int iupacState,
                                                      int nucleotideState)
        Returns:
        true if the iupacState is an state which includes the possibility of being of a nucleotide state
      • getIUPACState

        public static final int getIUPACState​(int inclusion)
        Parameters:
        inclusion - should be a number constructed as follows 1. start at zero 2. if maybe A add 1 3. if maybe C add 2 4. if maybe G add 4 5. if maybe T add 8
      • getIUPACState

        public static final int getIUPACState​(boolean maybeA,
                                              boolean maybeC,
                                              boolean maybeG,
                                              boolean maybeT)
      • getSimpleState

        public static final int getSimpleState​(int state)
        Converts an IUPAC State to either a A,T,G,C state (eg. if state represents either C or G, state becomes C - an arbitary choice is made to take "lowest" letter)
      • getSimpleStates

        public static final int[] getSimpleStates​(int[] states)
        Converts an IUPAC State array to either a A,T,G,C state (eg. if state represents either C or G, state becomes C - an arbitary choice is made to take "lowest" letter)
        Returns:
        new array containing only simple states (orignal is not altered)
      • getSimpleStates

        public static final int[] getSimpleStates​(int[] states,
                                                  int startingIndex)
        Converts an IUPAC State array to either a A,T,G,C state (eg. if state represents either C or G, state becomes C - an arbitary choice is made to take "lowest" letter)
        Parameters:
        staringIndex - amount to skip at beginning of input array
        Returns:
        new array containing only simple states (orignal is not altered)
      • getNucleotideStates

        public int[] getNucleotideStates​(int[] residueStates)
        Specified by:
        getNucleotideStates in interface MolecularDataType
        Parameters:
        residueStates - an array of states corresponding to states of this datatype
        Returns:
        a copy of the input
      • getSpecificStates

        public int[] getSpecificStates​(int state)
        returns an array containing the non-ambiguous states that this state represents.
        Specified by:
        getSpecificStates in interface AmbiguousDataType
      • getAmbiguity

        public void getAmbiguity​(int ambiguousState,
                                 boolean[] specificInclusion)
        Attempts to "resolve" the ambiguity in a state with regard to the specific data type.
        Specified by:
        getAmbiguity in interface AmbiguousDataType
        Parameters:
        ambiguousState - the state of this data type (the ambiguous one!)
        specificInclusion - An array of length equal to or greater than the number of states of the specific DataType. Each state of the specific data type is represented by the corresponding element in this array. The result of this method will be to set the states that the ambiguous state cannot represent to false, and those states that the ambiguous state might represent to true.
      • getAmbiguity

        public void getAmbiguity​(int ambiguousState,
                                 double[] specificInclusion)
        A more accurate attempt to "resolve" the ambiguity in a state with regard to the specific data type.
        Specified by:
        getAmbiguity in interface AmbiguousDataType
        Parameters:
        ambiguousState - the state of this data type (the ambiguous one!)
        specificInclusion - An array of length equal to or greater than the number of states of the specific DataType. Each state of the specific data type is represented by the corresponding element in this array. The result of this method will be to set the states that the ambiguous state cannot represent to zero, and those states that the ambiguous state might represent to a value representing the frequency that the ambiguous state is actually that specific state. In general this should be one for each specific state covered by the ambiguous state (result should be suitable for use in likelihood calculations).