public class Nucleotides extends SimpleDataType implements MolecularDataType
MolecularDataType.Utils
Modifier and Type | Field and Description |
---|---|
static int |
A_STATE |
static int |
C_STATE |
static Nucleotides |
DEFAULT_INSTANCE |
static int |
G_STATE |
static int |
UT_STATE |
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 |
---|
Nucleotides() |
Nucleotides(boolean isRNA)
If isRNA is true than getChar(state) will return a U instead of a T
|
Modifier and Type | Method and Description |
---|---|
static void |
complementSequence(int[] sequence)
Complement of a sequence of nucleotides (or IUPACNucleotides - but IUPAC ness is lost)
|
protected char |
getCharImpl(int state)
Get character corresponding to a given state
|
static int |
getComplementState(int baseState)
Obtain the complement state
|
java.lang.String |
getDescription()
description of data type
|
int[] |
getMolecularStatesFromIUPACNucleotides(int[] nucleotideStates,
int startingIndex) |
int[] |
getMolecularStatesFromSimpleNucleotides(int[] nucleotideStates,
int startingIndex) |
int |
getNucleotideLength() |
int[] |
getNucleotideStates(int[] residueStates) |
int |
getNumStates()
get number of unique states
|
int |
getRelavantLength(int numberOfStates) |
static int[] |
getSequenceComplement(int[] sequence)
Obtain the complement of a sequence of nucleotides (or IUPACNucleotides - but IUPAC ness is lost)
|
protected int |
getStateImpl(char c)
Get state corresponding to character c
NOTE: IF YOU CHANGE THIS IT MAY STOP THE NUCLEOTIDE TRANSLATOR FROM WORKING! - It relies on the fact that all the states for 'ACGTU' are between [0, 3] |
int |
getTypeID()
get numerical code describing the data type
|
boolean |
isCreatesIUPACNuecleotides() |
boolean |
isTransitionByChar(char firstChar,
char secondChar) |
boolean |
isTransitionByState(int firstState,
int secondState) |
protected boolean |
isUnknownStateImpl(int state)
For subclasses to handle, without regard for gaps
|
getAmbiguousVersion, getChar, getPreferredChar, getPreferredCharImpl, getRecommendedGapState, getRecommendedUnknownState, getState, hasGap, isAmbiguous, isGapChar, isGapState, isUnknownChar, isUnknownState, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getAmbiguousVersion, getChar, getPreferredChar, getRecommendedGapState, getRecommendedUnknownState, getState, hasGap, isAmbiguous, isGapChar, isGapState, isUnknownChar, isUnknownState
public static final int A_STATE
public static final int C_STATE
public static final int G_STATE
public static final int UT_STATE
public static final Nucleotides DEFAULT_INSTANCE
public Nucleotides()
public Nucleotides(boolean isRNA)
public int getNumStates()
DataType
getNumStates
in interface DataType
protected final boolean isUnknownStateImpl(int state)
SimpleDataType
isUnknownStateImpl
in class SimpleDataType
protected int getStateImpl(char c)
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 final boolean isTransitionByState(int firstState, int secondState)
public final boolean isTransitionByChar(char firstChar, char secondChar)
public int[] getNucleotideStates(int[] residueStates)
getNucleotideStates
in interface MolecularDataType
residueStates
- an array of states corresponding to states of public int getRelavantLength(int numberOfStates)
public int[] getMolecularStatesFromSimpleNucleotides(int[] nucleotideStates, int startingIndex)
getMolecularStatesFromSimpleNucleotides
in interface MolecularDataType
public 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 static final int getComplementState(int baseState)
baseState
- the base state to complement (may be IUPAC but IUPACness is lost)public static final int[] getSequenceComplement(int[] sequence)
sequence
- the sequence (of nucleotide states)public static final void complementSequence(int[] sequence)
sequence
- the sequence (of nucleotide states) (is modified)