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, isUnknownStateclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetChar, getPreferredChar, getRecommendedGapState, getState, hasGap, isGapChar, isGapState, isUnknownChar, isUnknownStatepublic 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 DataTypeprotected boolean isUnknownStateImpl(int state)
SimpleDataTypeisUnknownStateImpl in class SimpleDataTypeprotected final int getStateImpl(char c)
SimpleDataTypegetStateImpl in class SimpleDataTypeprotected char getCharImpl(int state)
getCharImpl in class SimpleDataTypepublic java.lang.String getDescription()
DataTypegetDescription in interface DataTypepublic int getTypeID()
DataTypepublic static final boolean isNucleotideState(int iupacState,
int nucleotideState)
public int getRecommendedUnknownState()
getRecommendedUnknownState in interface DataTypegetRecommendedUnknownState in class SimpleDataTypepublic 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 SimpleDataTypepublic int[] getNucleotideStates(int[] residueStates)
getNucleotideStates in interface MolecularDataTyperesidueStates - an array of states corresponding to states of public int[] getMolecularStatesFromSimpleNucleotides(int[] nucleotideStates,
int startingIndex)
getMolecularStatesFromSimpleNucleotides in interface MolecularDataTypepublic final int[] getMolecularStatesFromIUPACNucleotides(int[] nucleotideStates,
int startingIndex)
getMolecularStatesFromIUPACNucleotides in interface MolecularDataTypepublic boolean isCreatesIUPACNuecleotides()
isCreatesIUPACNuecleotides in interface MolecularDataTypepublic final int getNucleotideLength()
getNucleotideLength in interface MolecularDataTypepublic int[] getSpecificStates(int state)
getSpecificStates in interface AmbiguousDataTypepublic boolean isAmbiguous()
isAmbiguous in interface DataTypeisAmbiguous in class SimpleDataTypepublic AmbiguousDataType getAmbiguousVersion()
getAmbiguousVersion in interface DataTypegetAmbiguousVersion in class SimpleDataTypepublic DataType getSpecificDataType()
getSpecificDataType in interface AmbiguousDataTypepublic void getAmbiguity(int ambiguousState,
boolean[] specificInclusion)
getAmbiguity in interface AmbiguousDataTypeambiguousState - 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 AmbiguousDataTypeambiguousState - 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).