pal.datatype
public class IUPACNucleotides extends SimpleDataType implements MolecularDataType, AmbiguousDataType
MolecularDataType.Utils
Modifier and Type | Field and Description |
---|---|
static IUPACNucleotides |
DEFAULT_INSTANCE |
static IUPACNucleotides |
DNA_INSTANCE |
static IUPACNucleotides |
RNA_INSTANCE |
AMINO_ACID_DESCRIPTION, AMINOACIDS, CODON_DESCRIPTION, CODONS, GAP_BALANCED, GAP_BALANCED_DESCRIPTION, IUPAC_NUCELOTIDES_DESCRIPTION, IUPACNUCLEOTIDES, NUCLEOTIDE_DESCRIPTION, NUCLEOTIDES, NUMERIC, PRIMARY_SUGGESTED_GAP_CHARACTER, SUGGESTED_GAP_CHARACTERS, SUGGESTED_GAP_STATE, SUGGESTED_UNKNOWN_STATE, TWO_STATE_DESCRIPTION, TWOSTATES, UNKNOWN, UNKNOWN_CHARACTER, UNKNOWN_TLA
Constructor and Description |
---|
IUPACNucleotides() |
IUPACNucleotides(boolean isRNA) |
Modifier and Type | Method and Description |
---|---|
void |
getAmbiguity(int ambiguousState,
boolean[] specificInclusion)
Attempts to "resolve" the ambiguity in a state with regard to the specific data type.
|
void |
getAmbiguity(int ambiguousState,
double[] specificInclusion)
A more accurate attempt to "resolve" the ambiguity in a state with regard to the specific data type.
|
AmbiguousDataType |
getAmbiguousVersion() |
protected char |
getCharImpl(int state) |
java.lang.String |
getDescription()
description of data type
|
static int |
getIUPACState(boolean maybeA,
boolean maybeC,
boolean maybeG,
boolean maybeT) |
static int |
getIUPACState(int inclusion) |
int[] |
getMolecularStatesFromIUPACNucleotides(int[] nucleotideStates,
int startingIndex) |
int[] |
getMolecularStatesFromSimpleNucleotides(int[] nucleotideStates,
int startingIndex) |
int |
getNucleotideLength() |
int[] |
getNucleotideStates(int[] residueStates) |
int |
getNumStates()
Get number of states.
|
int |
getRecommendedUnknownState() |
static int |
getSimpleState(int state)
Converts an IUPAC State to either a A,T,G,C state (eg.
|
static int[] |
getSimpleStates(int[] states)
Converts an IUPAC State array to either a A,T,G,C state (eg.
|
static int[] |
getSimpleStates(int[] states,
int startingIndex)
Converts an IUPAC State array to either a A,T,G,C state (eg.
|
DataType |
getSpecificDataType() |
int[] |
getSpecificStates(int state)
returns an array containing the non-ambiguous states
that this state represents.
|
protected int |
getStateImpl(char c)
For sub classes to implement main functionality of getState.
|
int |
getTypeID()
get numerical code describing the data type
|
boolean |
isAmbiguous() |
boolean |
isCreatesIUPACNuecleotides() |
static boolean |
isNucleotideState(int iupacState,
int nucleotideState) |
protected boolean |
isUnknownStateImpl(int state)
For subclasses to handle, without regard for gaps
|
java.lang.String |
toString() |
getChar, getPreferredChar, getPreferredCharImpl, getRecommendedGapState, getState, hasGap, isGapChar, isGapState, isUnknownChar, isUnknownState
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getChar, getPreferredChar, getRecommendedGapState, getState, hasGap, isGapChar, isGapState, isUnknownChar, isUnknownState
public static final IUPACNucleotides DEFAULT_INSTANCE
public static final IUPACNucleotides DNA_INSTANCE
public static final IUPACNucleotides RNA_INSTANCE
public IUPACNucleotides()
public IUPACNucleotides(boolean isRNA)
public int getNumStates()
getNumStates
in interface DataType
protected boolean isUnknownStateImpl(int state)
SimpleDataType
isUnknownStateImpl
in class SimpleDataType
protected final int getStateImpl(char c)
SimpleDataType
getStateImpl
in class SimpleDataType
protected char getCharImpl(int state)
getCharImpl
in class SimpleDataType
public java.lang.String getDescription()
DataType
getDescription
in interface DataType
public int getTypeID()
DataType
public static final boolean isNucleotideState(int iupacState, int nucleotideState)
public int getRecommendedUnknownState()
getRecommendedUnknownState
in interface DataType
getRecommendedUnknownState
in class SimpleDataType
public static final int getIUPACState(int inclusion)
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 8public static final int getIUPACState(boolean maybeA, boolean maybeC, boolean maybeG, boolean maybeT)
public static final int getSimpleState(int state)
public static final int[] getSimpleStates(int[] states)
public static final int[] getSimpleStates(int[] states, int startingIndex)
staringIndex
- amount to skip at beginning of input arraypublic java.lang.String toString()
toString
in class SimpleDataType
public int[] getNucleotideStates(int[] residueStates)
getNucleotideStates
in interface MolecularDataType
residueStates
- an array of states corresponding to states of public int[] getMolecularStatesFromSimpleNucleotides(int[] nucleotideStates, int startingIndex)
getMolecularStatesFromSimpleNucleotides
in interface MolecularDataType
public final int[] getMolecularStatesFromIUPACNucleotides(int[] nucleotideStates, int startingIndex)
getMolecularStatesFromIUPACNucleotides
in interface MolecularDataType
public boolean isCreatesIUPACNuecleotides()
isCreatesIUPACNuecleotides
in interface MolecularDataType
public final int getNucleotideLength()
getNucleotideLength
in interface MolecularDataType
public int[] getSpecificStates(int state)
getSpecificStates
in interface AmbiguousDataType
public boolean isAmbiguous()
isAmbiguous
in interface DataType
isAmbiguous
in class SimpleDataType
public AmbiguousDataType getAmbiguousVersion()
getAmbiguousVersion
in interface DataType
getAmbiguousVersion
in class SimpleDataType
public DataType getSpecificDataType()
getSpecificDataType
in interface AmbiguousDataType
public void getAmbiguity(int ambiguousState, boolean[] specificInclusion)
getAmbiguity
in interface AmbiguousDataType
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.public void getAmbiguity(int ambiguousState, double[] specificInclusion)
getAmbiguity
in interface AmbiguousDataType
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).