|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--pal.datatype.SimpleDataType | +--pal.datatype.GeneralizedCodons
Used for mapping an exact codon to an exact state, and vice versa Can also be used as a DataType (exactly as for Codons, but more versatile).
Field Summary | |
static GeneralizedCodons |
DEFAULT_INSTANCE
An instance for Nucleotides because what is the point of reconstructing this class |
Fields inherited from interface pal.datatype.DataType |
AMINO_ACID_DESCRIPTION, AMINOACIDS, CODON_DESCRIPTION, CODONS, GENERALIZED_CODONS_DESCRIPTION, GENERALIZEDCODONS, IUPAC_NUCELOTIDES_DESCRIPTION, IUPACNUCLEOTIDES, NUCLEOTIDE_DESCRIPTION, NUCLEOTIDES, TWO_STATE_DESCRIPTION, TWOSTATES, UNKNOWN_CHARACTER |
Constructor Summary | |
GeneralizedCodons()
The Biologists, what else do we need, constructor (nucleode character types, codon length 3) |
|
GeneralizedCodons(DataType characterType,
int codonLength)
The Computer Scientist's want of abstraction consturctor |
Method Summary | |
char[] |
convertNucleotideToCodon(char[] nucleotideSequence,
int startingPosition,
int length,
boolean reverse)
Translates a Nucleotide sequence into a Codon sequence |
java.lang.String |
convertNucleotideToCodon(java.lang.String nucleotideSequence,
int startingPosition,
int length,
boolean reverse)
Translates a Nucleotide sequence into a Codon sequence |
int[] |
getBaseStatesFromCodonState(int codonState)
Translates an index into a codon |
char |
getChar(int state)
Get character corresponding to a given state |
char |
getCodonCharFromCodon(char[] codon)
Returns a unique ascii character for any given codon |
char |
getCodonCharFromCodonIndex(int index)
Returns a unique ascii character for any given codon index |
char |
getCodonCharFromCodonStates(int[] codon)
Returns a unique ascii character for any given codon |
double[] |
getCodonFrequencies(double[] residueFrequencies)
|
char[] |
getCodonFromCodonChar(char codonChar)
Translates an index into a codon |
char[] |
getCodonFromCodonIndex(int index)
Translates an index into a codon |
int |
getCodonIndexFromCodon(char[] codon)
Returns -1 if the codon has unknowns, or gaps in it, or is less than length length! |
int |
getCodonIndexFromCodonChar(char c)
Returns a unique ascii character for any given codon index |
int |
getCodonIndexFromCodonStates(int[] codon)
Returns -1 if the codon has unknowns, or gaps in it, or is less than length length! |
java.lang.String |
getDescription()
String describing the data type |
double[] |
getNucleotideFrequencies(double[] codonFrequencies)
|
int |
getNumStates()
get number of unique states |
int |
getState(char c)
get state corresponding to a character |
int |
getTypeID()
Get numerical code describing the data type |
boolean |
isUnknownState(int state)
|
Methods inherited from class pal.datatype.SimpleDataType |
getNumSimpleStates, getSimpleStates, isAmbiguousState, isGapChar, isUnknownChar |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final GeneralizedCodons DEFAULT_INSTANCE
Constructor Detail |
public GeneralizedCodons()
public GeneralizedCodons(DataType characterType, int codonLength)
Method Detail |
public final int getCodonIndexFromCodon(char[] codon)
public final int getCodonIndexFromCodonStates(int[] codon)
public final char[] getCodonFromCodonIndex(int index)
public final char[] getCodonFromCodonChar(char codonChar)
public final int[] getBaseStatesFromCodonState(int codonState)
public final char getCodonCharFromCodonIndex(int index)
public final int getCodonIndexFromCodonChar(char c)
public final char getCodonCharFromCodon(char[] codon)
public final char getCodonCharFromCodonStates(int[] codon)
public final java.lang.String convertNucleotideToCodon(java.lang.String nucleotideSequence, int startingPosition, int length, boolean reverse)
public final char[] convertNucleotideToCodon(char[] nucleotideSequence, int startingPosition, int length, boolean reverse)
nucleotideSequence
- - the base nucleotide sequence as a char arraystarting
- position - the starting position to begin reading fromlength
- - the length of the reading frame (in nucleotide units -
should be a multiple of 3, if not remainder is truncated!)reverse
- - if true works backwards with codon at starting
position being last in translation (codon read in reverse as well).
Else reads forwards.translator
- - the nucleotide translator to use for translation
nucleotides into amino acids.public int getNumStates()
public int getState(char c)
c
- characterpublic char getChar(int state)
pal.datatype.DataType
state
- state
return corresponding characterpublic java.lang.String getDescription()
pal.datatype.DataType
public boolean isUnknownState(int state)
isUnknownState
in class SimpleDataType
public int getTypeID()
pal.datatype.DataType
public double[] getCodonFrequencies(double[] residueFrequencies)
public final double[] getNucleotideFrequencies(double[] codonFrequencies)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |