|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectnix.util.gen.Num
Math and statistical static methods.
| Constructor Summary | |
Num()
|
|
| Method Summary | |
static double[] |
arrayListOfDoubleToArray(java.util.ArrayList dbl)
ArrayList of Double to double[] |
static float[] |
arrayListOfFloatToArray(java.util.ArrayList flt)
ArrayList of Float to float[] |
static double[] |
arrayListToDoubles(java.util.ArrayList doubles)
ArrayList of Double to double[] |
static int[] |
arrayListToInts(java.util.ArrayList integers)
ArrayList of Integer to int[] |
static double |
aveFoldDiffCombine(int[] t,
int[] c)
Calculates the average fold difference between two int[]s of the same length. |
static double |
aveFoldDiffIndividual(int[] t,
int[] c)
Calculates the average fold difference between two int[]s of the same length. |
static double |
averageFloatArray(float[] f)
Averages a float[] |
static double[] |
averageFloatArrays(float[][] ints)
Average float[][] values to double[], averages repeats [values][numRepeats] |
static double[] |
averageFloatArraysFlipped(float[][] ints)
Average float[][] values to double[], averages repeats [numChips][OligoValues]. |
static double |
averageIntArray(int[] f)
Averages a int[] |
static double[] |
averageIntIntArray(int[][] ints)
Average int[][] values to double[], averages repeats [numRepeats][values] |
static double[] |
averageIntIntArray2(int[][] ints)
Average int[][] values to double[], averages values [numRepeats][values] |
static double |
calcMaxMedianAbsoluteDifference(float[][] oligosValues)
Calculates the maximum median absolute difference between arrays of float where int[oligo index number][oligo intensity measurements] |
static double |
calcMeanMedianAbsoluteDifference(float[][] oligosValues)
Calculates the mean of the median absolute differences between arrays of float where float[oligo index number][oligo intensity measurements] |
static float[] |
collapseFloatArray(float[][] fs)
Assumes equal lengths of the float[]s |
static int[] |
collapseIntArray(int[][] ints)
Assumes equal lengths of the int[]s |
static float[] |
convertToFloat(int[] d)
Convert to float[] |
static int[] |
convertToInt(double[] d)
Convert to Int[] |
static int[] |
convertToInt(float[] d)
Convert to Int[] |
static double |
correlationCoefficient(double[] x,
double[] y)
Calculates Pearson correlation coefficient, r, from two double[]s |
static double |
correlationCoefficient(float[] x,
float[] y)
Calculates Pearson correlation coefficient, r, from two float[]s. |
static double |
correlationCoefficient(int[] x,
int[] y)
Calculates Pearson correlation coefficient, r, from two int[]s. |
static double[] |
difference(double[] t,
double[] c)
Returns the difference of each pair. |
static double[] |
difference(int[] t,
int[] c)
Returns the difference of each pair. |
static float |
findHighestFloat(float[] ints)
Finds and returns the biggest int in an float[]. |
static int |
findHighestInt(int[] ints)
Finds and returns the biggest int in an int[]. |
static double[] |
findMinMaxDoubleValues(double[] f)
Finds min and max values of a float array. |
static float[] |
findMinMaxFloatArrays(float[][] f)
Finds min and max values of a float array. |
static float[] |
findMinMaxFloatValues(float[] f)
Finds min and max values of a float array. |
static int[] |
findMinMaxIntInt(int[][] f)
Finds min and max values of a int array. |
static int[] |
findMinMaxIntValues(int[] f)
Finds min and max values of a int array. |
static int[] |
findStartStopIndexes(int[] positions,
int startValue,
int stopValue)
Finds the start and stop indexes given a sorted int[] of values and two values, one after the other, close together, otherwise just use Arrays.binarySearch. |
static java.lang.String |
formatNumber(double num,
int numberOfDecimalPlaces)
Converts a double ddd.dddddddd to a user determined number of decimal places right of the . |
static java.lang.String |
formatNumberOneFraction(double num)
Converts a double ddd.dddddddd to sss.s |
static java.lang.String |
formatPercentOneFraction(double num)
Converts 0.345543 to 34.6% |
static float |
getAverageInts(int start,
int end)
Gets the average of the integers bracketed and including the start and end. |
static double[] |
loadDoubles(java.io.File f)
Loads a column of double from a file into an array. |
static int[] |
loadInts(java.io.File f)
Loads a column of ints from a file into an array. |
static double |
log10(double number)
Returns the LOG base 10 of the number. |
static double |
log2(double number)
Returns the LOG base 2 of the number. |
static double[] |
logRatios(double[] t,
double[] c)
Calculates log base 2 ratios |
static double[] |
logRatios(float[] t,
float[] c)
Calculates log base 2 ratios |
static double |
mean(double[] t)
Averages a double array. |
static float |
mean(float[] t)
Averages a float array. |
static double |
mean(int[] t)
Averages a int array. |
static java.lang.String |
meanDoubles(java.util.ArrayList Doubles)
Averages an ArrayList of Double objects. |
static int |
meanIntegers(java.util.ArrayList Integers)
Averages an ArrayList of Integer objects. |
static double |
median(double[] sorted)
Calculates Median of a sorted double[]. |
static double |
median(float[] m)
Calculates Median of a sorted float[]. |
static double |
median(int[] m)
Calculates Median of a sorted int[]. |
static double |
median(short[] m)
Calculates Median of a sorted short[]. |
static double |
medianAbsoluteDifference(float[] x,
float[] y)
Calculates the median absolute difference. |
static void |
medianNormalize(float[][] f,
float targetMedian,
boolean skipZeros)
Median normalizes original array to a given number. |
static float[] |
medianNormalize(float[] f,
float targetMedian)
Median normalize array to a given number. |
static int[] |
modeOfHistogram(int[] ints)
Finds mode of a int[] histogram array, assumes one peak, returns the index position, value/frequency. |
static int |
parseInt(java.lang.String stringInt,
int failNumber)
Attemps to parse an int, returns failNumber if it fails. |
static double[] |
ratio(double[] t,
double[] c)
Returns the ratio of each pair. |
static double[] |
ratio(float[] t,
float[] c)
Returns the ratio of each pair. |
static double[] |
ratio(int[] t,
double[] c)
Returns the ratio of each pair. |
static double[] |
ratio(int[] t,
int[] c)
Returns the ratio of each pair. |
static double |
relativeDifference(double t,
double c)
Calculates relative difference. |
static double[] |
relativeDifferences(float[] t,
float[] c)
Calculates relative differences. |
static double[] |
removeNaNInfinite(double[] d)
Removes any NaN or Infinite |
static float[] |
removeZeroValues(float[] f)
Remove zero values from float array. |
static float[][] |
removeZeroValues(float[][] f)
Provide a float[2][0], will remove zeros from both and there matched pair. |
static float[][][] |
removeZeroValues(float[][] t,
float[][] c)
Removes zero values and their assoicated values from all arrays. |
static double[] |
round(double[] d,
int numDecimals)
Rounds a double[] based on number of desired decimals, ie 1 = x.x, 2 = x.xx limited to 6 |
static double |
round(double d,
int numDecimals)
Rounds a double based on number of desired decimals, ie 1 = x.x, 2 = x.xx limited to 6 |
static double[] |
smoothScores(double[] scores,
int[] positions,
int windowSize)
Uses a sliding window to smooth the scores applying a trimmed mean (drop 1 from ends) to the scores found within the window. |
static double |
standardDeviation(double[] x)
Calculates standard deviation of an double[] |
static double |
standardDeviation(double[] x,
double mean)
Calculates standard deviation of a double[] and mean. |
static double |
standardDeviation(float[] x)
Calculates standard deviation of an float[] |
static double |
standardDeviation(float[] x,
double mean)
Calculates standard deviation of an float[] and mean. |
static double |
standardDeviation(int[] x)
Calculates standard deviation of an int[] |
static double |
standardDeviation(int[] x,
double mean)
Calculates standard deviation of an int[] and mean. |
static double |
standardDeviationOfDifference(int[] t,
int[] c)
Calculates the standard deviation of the difference between two int[]s of the same length. |
static double |
standardError(double[] x,
double mean)
Calculates standard error of a double[] given it's mean. |
static void |
statFloatArray(float[] f)
Calculates Min, Max, Mean, Median, Mode, and Histogram/10 for a Float[] |
static int |
sumIntArray(int[] ints)
Sums an int array |
static double |
trimmedMean(double[] sortedDouble,
int trimNumber)
Makes a trimmed mean, note the trim number is not a % but the number of values to drop from the beginning and end of the ordered set. |
static int |
trimOutliers(float[][] f,
double cutoff,
float replacement)
Sets values exceeding the cutoff to the default. |
static int |
trimOutliers(float[] f,
double cutoff,
float replacement)
Sets values exceeding the cutoff to the default. |
static double[] |
windowAverageScores(double[] scores,
int windowSize)
Slides a window along an array, one index at a time, averaging the contents. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Num()
| Method Detail |
public static float[][][] removeZeroValues(float[][] t,
float[][] c)
public static int trimOutliers(float[] f,
double cutoff,
float replacement)
public static int trimOutliers(float[][] f,
double cutoff,
float replacement)
public static float[] medianNormalize(float[] f,
float targetMedian)
public static void medianNormalize(float[][] f,
float targetMedian,
boolean skipZeros)
public static int[] convertToInt(double[] d)
public static int[] convertToInt(float[] d)
public static float[] convertToFloat(int[] d)
public static double[] relativeDifferences(float[] t,
float[] c)
public static double relativeDifference(double t,
double c)
public static double[] logRatios(double[] t,
double[] c)
public static double[] logRatios(float[] t,
float[] c)
public static double[] round(double[] d,
int numDecimals)
public static double round(double d,
int numDecimals)
public static double[] removeNaNInfinite(double[] d)
public static double log10(double number)
public static double log2(double number)
public static int[] loadInts(java.io.File f)
public static double[] loadDoubles(java.io.File f)
public static int[] arrayListToInts(java.util.ArrayList integers)
public static double[] arrayListToDoubles(java.util.ArrayList doubles)
public static int parseInt(java.lang.String stringInt,
int failNumber)
public static void statFloatArray(float[] f)
public static float[] removeZeroValues(float[] f)
public static float getAverageInts(int start,
int end)
public static int[] collapseIntArray(int[][] ints)
public static float[] collapseFloatArray(float[][] fs)
public static double averageIntArray(int[] f)
public static double averageFloatArray(float[] f)
public static int[] findMinMaxIntValues(int[] f)
public static float[] findMinMaxFloatValues(float[] f)
public static double[] findMinMaxDoubleValues(double[] f)
public static int[] findMinMaxIntInt(int[][] f)
public static float[] findMinMaxFloatArrays(float[][] f)
public static int[] findStartStopIndexes(int[] positions,
int startValue,
int stopValue)
public static double standardDeviationOfDifference(int[] t,
int[] c)
public static double[] averageIntIntArray(int[][] ints)
public static double[] averageFloatArrays(float[][] ints)
public static double[] averageFloatArraysFlipped(float[][] ints)
public static double[] averageIntIntArray2(int[][] ints)
public static double[] smoothScores(double[] scores,
int[] positions,
int windowSize)
public static double[] windowAverageScores(double[] scores,
int windowSize)
public static double trimmedMean(double[] sortedDouble,
int trimNumber)
public static double[] arrayListOfDoubleToArray(java.util.ArrayList dbl)
public static float[] arrayListOfFloatToArray(java.util.ArrayList flt)
public static double aveFoldDiffCombine(int[] t,
int[] c)
public static double aveFoldDiffIndividual(int[] t,
int[] c)
public static double[] ratio(double[] t,
double[] c)
public static double[] ratio(float[] t,
float[] c)
public static double[] ratio(int[] t,
double[] c)
public static double[] ratio(int[] t,
int[] c)
public static double[] difference(int[] t,
int[] c)
public static double[] difference(double[] t,
double[] c)
public static double standardDeviation(int[] x)
public static double standardDeviation(int[] x,
double mean)
public static double standardDeviation(float[] x)
public static double standardDeviation(float[] x,
double mean)
public static double standardDeviation(double[] x)
public static double standardDeviation(double[] x,
double mean)
public static double standardError(double[] x,
double mean)
public static double medianAbsoluteDifference(float[] x,
float[] y)
public static double calcMaxMedianAbsoluteDifference(float[][] oligosValues)
public static double calcMeanMedianAbsoluteDifference(float[][] oligosValues)
public static double correlationCoefficient(int[] x,
int[] y)
public static float[][] removeZeroValues(float[][] f)
public static double correlationCoefficient(float[] x,
float[] y)
public static double correlationCoefficient(double[] x,
double[] y)
public static java.lang.String formatPercentOneFraction(double num)
public static java.lang.String formatNumberOneFraction(double num)
public static java.lang.String formatNumber(double num,
int numberOfDecimalPlaces)
public static double median(double[] sorted)
public static double median(int[] m)
public static double median(short[] m)
public static double median(float[] m)
public static float mean(float[] t)
public static double mean(int[] t)
public static double mean(double[] t)
public static int meanIntegers(java.util.ArrayList Integers)
public static java.lang.String meanDoubles(java.util.ArrayList Doubles)
public static int findHighestInt(int[] ints)
public static float findHighestFloat(float[] ints)
public static int sumIntArray(int[] ints)
public static int[] modeOfHistogram(int[] ints)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||