|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.gersteinlab.act.CorrelationsCalculator
public class CorrelationsCalculator
This class computes the correlations between different datasets. It takes a number of data files (in WIG or BED format) as input, and computes the correlation between each pair of files. The correlation function can be specified as Pearson, Spearman or normal-score.
Field Summary | |
---|---|
static java.lang.String |
NORMALSCORE
Normal-score correlation |
static java.lang.String |
PEARSON
Pearson correlation |
static java.lang.String |
SPEARMAN
Spearman correlation |
Constructor Summary | |
---|---|
CorrelationsCalculator()
|
Method Summary | |
---|---|
static double |
getNormalScoreCorrelation(double[] v1,
double[] v2)
Compute the normal score correlation between two vectors. |
static double[] |
getNormalScores(double[] r)
Get the normal scores of a set of ranks. |
static double |
getPearsonCorrelation(double[] v1,
double[] v2)
Compute the Pearson correlation between two vectors. |
static double[] |
getRanks(double[] v)
Get the ranks [0..length-1] of the values in a vector. |
static double |
getSpearmanCorrelation(double[] v1,
double[] v2)
Compute the Spearman correlation between two vectors. |
static double[][] |
getUniqueValues(double[] v)
Get the unique values and their ranks [0..length-1] in a vector. |
static void |
main(java.lang.String[] argv)
|
static double[] |
readVector(java.io.File inFile,
Config config)
Read a vector of values from a data file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String PEARSON
public static final java.lang.String SPEARMAN
public static final java.lang.String NORMALSCORE
Constructor Detail |
---|
public CorrelationsCalculator()
Method Detail |
---|
public static void main(java.lang.String[] argv) throws java.lang.Exception
java.lang.Exception
public static double[] readVector(java.io.File inFile, Config config) throws java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetException, java.io.IOException, java.lang.NoSuchMethodException
inFile
- The data fileconfig
- For getting file format configurations
java.lang.ClassNotFoundException
java.lang.IllegalAccessException
java.lang.InstantiationException
java.lang.reflect.InvocationTargetException
java.io.IOException
java.lang.NoSuchMethodException
public static double[][] getUniqueValues(double[] v)
v
- The values
public static double[] getRanks(double[] v)
v
- The values
public static double[] getNormalScores(double[] r)
r
- The ranks
public static double getPearsonCorrelation(double[] v1, double[] v2)
v1
- The first vectorv2
- The second vector
public static double getSpearmanCorrelation(double[] v1, double[] v2)
v1
- The first vectorv2
- The second vector
public static double getNormalScoreCorrelation(double[] v1, double[] v2)
v1
- The first vectorv2
- The second vector
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |