Package pal.alignment
Class DataTranslator
java.lang.Object
pal.alignment.DataTranslator
-
Constructor Summary
ConstructorsConstructorDescriptionDataTranslator
(int[][] stateData) Base DataType is assumed to be IUPACDataTranslator
(int[][] stateData, MolecularDataType dt) DataTranslator
(int[][] stateData, MolecularDataType dt, IdGroup ids) DataTranslator
(Alignment base) DataTranslator
(MolecularDataType dt, char[][] charData) -
Method Summary
Modifier and TypeMethodDescriptionvoid
ensureUnknownState
(int[] states, int unknownState) Ensures that all states that are "unknown" get set to the value of 'unknownState'static final void
ensureUnknownState
(DataType dt, int[] states, int unknownState) Ensures that all states that are "unknown" (according to a certain DataType) get set to the value of 'unknownState'double[]
getFrequencies
(MolecularDataType dt, int startingIndex) toAlignment
(MolecularDataType dt, int startingIndex) static final char[][]
Converts an state matrix to a char matrix Stored as [sequnce][site]char[][]
toChars
(MolecularDataType dt, int startingIndex) toLeftAlignedReverseComplementNucleotides
(int startingIndex) static final int[][]
toNucleotides
(int[][] dtStates, MolecularDataType dt) Converts an alignment to a state matrix Stored as [sequnce][site]toReverseComplementNucleotides
(int startingIndex) static final int[][]
Converts an alignment to a state matrix Stored as [sequnce][site]static final int[][]
Converts an alignment to a state matrix Stored as [sequnce][site]static final int[][]
Converts an alignment to a state matrix Stored as [sequnce][site]int[][]
toStates
(MolecularDataType dt, int startingIndex)
-
Constructor Details
-
DataTranslator
- Parameters:
base
- the base alignment that will be translated. The data type of this alignment must be of type MolecularDataType- Throws:
IllegalArgumentException
- if base DataType not of type MolecularDataType
-
DataTranslator
public DataTranslator(int[][] stateData) Base DataType is assumed to be IUPAC -
DataTranslator
-
DataTranslator
-
DataTranslator
-
-
Method Details
-
toStates
- Returns:
- an array of states, where the states are of the form dictated by dt, and based on the base alignment
-
getFrequencies
-
ensureUnknownState
public void ensureUnknownState(int[] states, int unknownState) Ensures that all states that are "unknown" get set to the value of 'unknownState' -
toChars
- Returns:
- an array of characters, where the characters are of the form dictated by dt, and based on the base alignment
-
toAlignment
-
toReverseComplementNucleotides
-
toLeftAlignedReverseComplementNucleotides
-
toStates
Converts an alignment to a state matrix Stored as [sequnce][site] -
toStates
Converts an alignment to a state matrix Stored as [sequnce][site] -
toNucleotides
Converts an alignment to a state matrix Stored as [sequnce][site] -
toStates
Converts an alignment to a state matrix Stored as [sequnce][site] -
toChars
Converts an state matrix to a char matrix Stored as [sequnce][site] -
ensureUnknownState
Ensures that all states that are "unknown" (according to a certain DataType) get set to the value of 'unknownState'
-