|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.jstacs.utils.PFMComparator
public class PFMComparator
This class implements a number of methods for the comparison of position frequency matrices (PFMs) as described in the Amadeus paper
Nested Class Summary | |
---|---|
static class |
PFMComparator.NormalizedEuclideanDistance
This class implements the normalized Euclidean distance. |
static class |
PFMComparator.OneMinusPearsonCorrelationCoefficient
This class implements the Pearson correlation coefficient. |
static class |
PFMComparator.PFMDistance
This interface declares a method for comparing different PFMs. |
static class |
PFMComparator.SymmetricKullbackLeiblerDivergence
This class implements the symmetric Kullback-Leibler-divergence. |
Constructor Summary | |
---|---|
PFMComparator()
|
Method Summary | |
---|---|
static ComparableElement<String,Double>[] |
find(ComplementableDiscreteAlphabet abc,
double[][] pfm,
ArrayList<AbstractMap.SimpleEntry<String,double[][]>> knownPFMs,
PFMComparator.PFMDistance distance,
int minOverlap,
int allowMiniShift,
boolean pValues,
double threshold)
This methods finds for a user specified PFM pfm similar PFMs in a list of known PFMs. |
static String |
getConsensus(AlphabetContainer con,
double[][] pfm)
This method extracts the The method does not use any degenerated IUPAC code. |
static double[] |
getCounts(DataSet... data)
This method counts the occurrences of symbols in the given data sets. |
static double[][] |
getPFM(DataSet data)
This method creates a PFM from a DataSet of Sequence s. |
static double[][] |
getPFM(DataSet data,
double[] weights)
This method creates a PFM from a DataSet of Sequence s. |
static double[][] |
getReverseComplement(ComplementableDiscreteAlphabet abc,
double[][] pfm)
This method returns the PFM that is the reverse complement of the given PFM. |
static String |
matrixToString(double[][] matrix)
Returns a string representation of the matrix, where each row of the matrix is printed on one line and columns are separated by tabstops. |
static void |
normalize(double[] counts)
This method enables the user to normalize a array containing counts. |
static ArrayList<AbstractMap.SimpleEntry<String,double[][]>> |
readPFMsFromEMBL(String fileName,
int max)
This method reads a number of PFMs from a file and return them in an ArrayList together with some annotation. |
static ArrayList<AbstractMap.SimpleEntry<String,double[][]>> |
readPFMsFromJasparFastA(String filename)
This method reads a number of PFMs from a file in the Jaspar FastA-like format and returns them in an ArrayList together with some annotation. |
static ArrayList<AbstractMap.SimpleEntry<String,double[][]>> |
readPFMsFromUniprobe(String startdir)
This method reads a number of PFMs from a directory as downloaded from the Uniprobe data base and returns them in an ArrayList together with some annotation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PFMComparator()
Method Detail |
---|
public static String matrixToString(double[][] matrix)
matrix
- the matrix
public static String getConsensus(AlphabetContainer con, double[][] pfm)
con
- the AlphabetContainer
that was used to create the PFMpfm
- the position frequency matrix (or also possible the position weight matrix)
public static double[] getCounts(DataSet... data)
data
- the data sets
public static void normalize(double[] counts)
counts
- the array of countspublic static double[][] getPFM(DataSet data)
DataSet
of Sequence
s.
data
- the DataSet
public static double[][] getPFM(DataSet data, double[] weights)
DataSet
of Sequence
s.
data
- the DataSet
weights
- the weights on the sequences in data
public static double[][] getReverseComplement(ComplementableDiscreteAlphabet abc, double[][] pfm)
abc
- the ComplementableDiscreteAlphabet
that is used to create the reverse complementpfm
- the absolute frequencies for each position and symbol;
public static ArrayList<AbstractMap.SimpleEntry<String,double[][]>> readPFMsFromUniprobe(String startdir) throws IOException
ArrayList
together with some annotation.
startdir
- the directory containing the PFMs in Uniprobe format
ArrayList
containing AbstractMap.SimpleEntry
s with annotation and PFM
IOException
- if something went wrong while reading a filepublic static ArrayList<AbstractMap.SimpleEntry<String,double[][]>> readPFMsFromJasparFastA(String filename) throws IOException
ArrayList
together with some annotation.
filename
- the path to the file containing the Jaspar PFMs
ArrayList
containing AbstractMap.SimpleEntry
s with annotation and PFM
IOException
- if something went wrong while reading the filepublic static ArrayList<AbstractMap.SimpleEntry<String,double[][]>> readPFMsFromEMBL(String fileName, int max) throws IOException
ArrayList
together with some annotation.
fileName
- the name of the file containing the PFMs in EMBL formatmax
- the maximal number of PFMs that should be read
ArrayList
containing AbstractMap.SimpleEntry
s with annotation and PFM
IOException
- if something went wrong while reading the filepublic static ComparableElement<String,Double>[] find(ComplementableDiscreteAlphabet abc, double[][] pfm, ArrayList<AbstractMap.SimpleEntry<String,double[][]>> knownPFMs, PFMComparator.PFMDistance distance, int minOverlap, int allowMiniShift, boolean pValues, double threshold)
pfm
similar PFMs in a list of known PFMs.
abc
- the alphabet of this PFMpfm
- the PFM to be compare to the known PFMsknownPFMs
- a ArrayList
of known PFMsdistance
- a distance measure to assess the similarity of the PFMsminOverlap
- the minimal number of consecutive positions in an alignmentallowMiniShift
- the minimal number of allowed shifts (even if the minimal overlap is bigger)pValues
- compute p-values for matrix similaritythreshold
- only hits with a distance below this threshold will be reported
readPFMsFromEMBL(String, int)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |