|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpal.alignment.AlignmentUtils
public class AlignmentUtils
Helper utilities for alignments.
Constructor Summary | |
---|---|
AlignmentUtils()
|
Method Summary | |
---|---|
static Alignment |
concatAlignments(Alignment[] alignments,
DataType dt)
Concatenates an array of alignments such that the resulting alignment is all of the sub alignments place along side each other |
static int |
countUnknowns(Alignment a,
DataType dt)
Tests the characters of an alignment to see if there are any characters that are not within a data type. |
static double[] |
estimateCodonFrequenciesF1X4(Alignment a)
Estimate the frequencies of codons, calculated from the average nucleotide frequencies. |
static double[] |
estimateCodonFrequenciesF3X4(Alignment a)
Estimate the frequencies of codons, calculated from the average nucleotide frequencies at the three codon positions. |
static double[] |
estimateFrequencies(Alignment a)
count states |
static double[][] |
estimateTupletFrequencies(Alignment a,
int tupletSize)
Estimates frequencies via tuplets. |
static void |
getAlignedSequenceIndices(Alignment a,
int i,
int[] indices,
DataType dataType,
int unknownState)
Returns state indices for a sequence. |
static int[][] |
getAlignedStates(Alignment base)
Unknown characters are given the state of -1 |
static int[][] |
getAlignedStates(Alignment base,
int unknownState)
|
static double |
getAlignmentPenalty(Alignment a,
DataType dataType,
TransitionPenaltyTable penalties,
double gapCreation,
double gapExtension,
boolean local)
Returns total sum of pairs alignment distance using gap creation and extension penalties and transition penalties as defined in the TransitionPenaltyTable provided. |
static double |
getAlignmentPenalty(Alignment a,
TransitionPenaltyTable penalties,
double gapCreation,
double gapExtension)
Returns total sum of pairs alignment penalty using gap creation and extension penalties and transition penalties in the TransitionPenaltyTable provided. |
static Alignment |
getChangedDataType(Alignment a,
DataType dt)
Returns an alignment which follows the pattern of the input alignment except that all sites which do not contain states in dt (excluding the gap character) are removed. |
static double |
getConsistency(Alignment a,
Alignment b)
|
static Alignment |
getLeadingIncompleteCodonsStripped(Alignment base)
Creates a new nucleotide alignment based on the input that has any leading incomplete codons (that is, the first codon of the sequence that is not a gap/unknown but is not complete - has a nucleotide unknown) replaced by a triplet of unknowns |
static void |
getPositionMisalignmentInfo(Alignment a,
java.io.PrintWriter out,
int startingCodonPosition)
|
static void |
getPositionMisalignmentInfo(Alignment a,
java.io.PrintWriter out,
int startingCodonPosition,
CodonTable translator,
boolean removeIncompleteCodons)
|
static char[] |
getSequenceCharArray(Alignment a,
int sequence)
Returns a particular sequence of an alignment as a char array |
static java.lang.String |
getSequenceString(Alignment a,
int sequence)
Returns a particular sequence of an alignment as a String |
static DataType |
getSuitableInstance(Alignment alignment)
guess data type suitable for a given sequence data set |
static DataType |
getSuitableInstance(char[][] sequences)
guess data type suitable for a given sequence data set |
static DataType |
getSuitableInstance(java.lang.String[] sequences)
guess data type suitable for a given sequence data set |
static boolean |
isGap(Alignment a,
int seq,
int site)
Returns true if the alignment has a gap at the site in the sequence specified. |
static boolean |
isSiteRedundant(Alignment a,
int site)
|
static void |
print(Alignment a,
java.io.PrintWriter out)
print alignment (default format: INTERLEAVED) |
static void |
printCLUSTALW(Alignment a,
java.io.PrintWriter out)
Print alignment (in CLUSTAL W format) |
static void |
printInterleaved(Alignment a,
java.io.PrintWriter out)
print alignment (in PHYLIP 3.4 INTERLEAVED format) |
static void |
printPlain(Alignment a,
java.io.PrintWriter out)
print alignment (in plain format) |
static void |
printPlain(Alignment a,
java.io.PrintWriter out,
boolean relaxed)
print alignment (in plain format) |
static void |
printSequential(Alignment a,
java.io.PrintWriter out)
print alignment (in PHYLIP SEQUENTIAL format) |
static Alignment |
removeRedundantSites(Alignment a)
|
static void |
report(Alignment a,
java.io.PrintWriter out)
Report number of sequences, sites, and data type |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AlignmentUtils()
Method Detail |
---|
public static void report(Alignment a, java.io.PrintWriter out)
public static void print(Alignment a, java.io.PrintWriter out)
public static void printPlain(Alignment a, java.io.PrintWriter out)
public static void printPlain(Alignment a, java.io.PrintWriter out, boolean relaxed)
public static void printSequential(Alignment a, java.io.PrintWriter out)
public static void printInterleaved(Alignment a, java.io.PrintWriter out)
public static void printCLUSTALW(Alignment a, java.io.PrintWriter out)
public static final void getAlignedSequenceIndices(Alignment a, int i, int[] indices, DataType dataType, int unknownState)
public static final int[][] getAlignedStates(Alignment base)
public static final int[][] getAlignedStates(Alignment base, int unknownState)
public static double getAlignmentPenalty(Alignment a, TransitionPenaltyTable penalties, double gapCreation, double gapExtension)
public static double getAlignmentPenalty(Alignment a, DataType dataType, TransitionPenaltyTable penalties, double gapCreation, double gapExtension, boolean local)
gapCreation
- the cost of the initial gap opening charactergapExtension
- the cost of the remaining gap characterslocal
- true if end gaps ignored, false otherwisepublic static DataType getSuitableInstance(Alignment alignment)
alignment
- alignment
public static DataType getSuitableInstance(java.lang.String[] sequences)
alignment
- the alignment represented as an array of strings
public static DataType getSuitableInstance(char[][] sequences)
alignment
- the alignment represented as an array of strings
public static double[] estimateCodonFrequenciesF1X4(Alignment a)
a
- The base alignment, will be converted to nucleotides
public static double[] estimateCodonFrequenciesF3X4(Alignment a)
a
- The base alignment, will be converted to nucleotides
public static double[] estimateFrequencies(Alignment a)
public static double[][] estimateTupletFrequencies(Alignment a, int tupletSize)
a
- The input alignmenttupletSize
- the size of the tupletpublic static final boolean isSiteRedundant(Alignment a, int site)
public static final Alignment removeRedundantSites(Alignment a)
public static final boolean isGap(Alignment a, int seq, int site)
public static void getPositionMisalignmentInfo(Alignment a, java.io.PrintWriter out, int startingCodonPosition, CodonTable translator, boolean removeIncompleteCodons)
startingCodonPosition
- from {0,1,2}, representing codon position
of first value in sequences...translator
- the translator to use for converting codons to
amino acids.removeIncompleteCodons
- removes end codons that are not complete
(due to startingPosition, and sequence length).public static void getPositionMisalignmentInfo(Alignment a, java.io.PrintWriter out, int startingCodonPosition)
startingCodonPosition
- - from {0,1,2}, representing codon position of first value in sequences...public static final Alignment concatAlignments(Alignment[] alignments, DataType dt)
public static final char[] getSequenceCharArray(Alignment a, int sequence)
public static final java.lang.String getSequenceString(Alignment a, int sequence)
public static final Alignment getChangedDataType(Alignment a, DataType dt)
public static final int countUnknowns(Alignment a, DataType dt)
public static final Alignment getLeadingIncompleteCodonsStripped(Alignment base)
base
- The basis alignment (of any molecular data type)
public static double getConsistency(Alignment a, Alignment b)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |