halo.halflife
Class HalfLife

java.lang.Object
  extended by halo.halflife.HalfLife
Direct Known Subclasses:
HalfLife_New, HalfLife_NewPre, HalfLife_Pre

public abstract class HalfLife
extends java.lang.Object

Calculation of half-lives and median-based Correction Factors

Author:
Stefanie Kaufmann

Field Summary
static java.lang.String NEWLY
           
static java.lang.String NEWPRE
           
static java.lang.String PRE
           
 
Constructor Summary
HalfLife()
          Constructs a HalfLife object with default Alpha
 
Method Summary
abstract  CorrectionFactors calculateCorrectionFactors(double medianHWZ, double t)
          Calculation of correction factors based on a median
abstract  void calculateHalfLives(double t)
          Calculation of half-lives
 Alpha getAlpha()
          Returns the alpha object defining the calculation method of alpha
 double getC_l()
          Returns the correction factor c_l
 double getC_u()
          Returns the correction factor c_u
 Data getData()
          Returns the data object holding the original data
 double[] getHwz()
          Returns the half-life values
 double getMax()
          Returns the highest present half-life value
static double getMaximumHalfLife()
          Returns the set maximum half-life
static double getMinimumHalfLife()
          Returns the set minimum half-life
 java.lang.String getName()
          Returns the name of this method
 Mapping<java.lang.String,java.lang.Integer> getNewMapping()
          Returns the mapping corresponding to ratios/half-lives
 double[] getRatio()
          Returns the ratio values
 int getReplicate()
          Returns the number of the used replicate
abstract  void initialize(Data data)
          initializes the HalfLife object & extracts the needed values of the Data object
abstract  void initialize(Data data, int replicate)
          initializes the HalfLife object for a specific replicate of the data
static double median(double[] inp)
          Calculation of the median of a single dimensional array
 void printHalfLivesWithAttributes(java.lang.String file, java.util.ArrayList<java.lang.String> labels)
          Prints half-life values together with a given list of attributes into an output file
 double[] ratioOfReplicate(double[][] rna, double[][] total)
          Calculates the ratio of a specific replicate
 void setAlpha(Alpha alpha)
          Sets the Alpha object defining the method for calculation of alpha(t)
abstract  void setCorrectionFactor(CorrectionFactors corr)
          Sets the set of correction factors
 void setCorrectionFactors(double c_u, double c_l)
          Sets the correction factors c_u and c_l
 void setHwz(double[] hwz)
          Sets the half-life values
static void setMaximumHalfLife(double maximumHalfLife)
          Sets the maximum half-life value to be used
static void setMinimumHalfLife(double minimumHalfLife)
          Sets the minimal half-life value to be used
 void setNewMap(Mapping<java.lang.String,java.lang.Integer> newMap)
          Sets the mapping corresponding to the ratio values
 void writeToFileHalfLives(java.lang.String output)
          Writes the half-life values contained in the object together with corresponding spotIds into a file
 void writeToFileRatios(java.lang.String output)
          Writes Ratio array into a file with two columns: column 1: spotID, column 2: corresponding ratio
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NEWLY

public static final java.lang.String NEWLY
See Also:
Constant Field Values

PRE

public static final java.lang.String PRE
See Also:
Constant Field Values

NEWPRE

public static final java.lang.String NEWPRE
See Also:
Constant Field Values
Constructor Detail

HalfLife

public HalfLife()
Constructs a HalfLife object with default Alpha

Method Detail

initialize

public abstract void initialize(Data data)
initializes the HalfLife object & extracts the needed values of the Data object

Parameters:
data - The data object for which the half-life calculation shall be done

initialize

public abstract void initialize(Data data,
                                int replicate)
initializes the HalfLife object for a specific replicate of the data

Parameters:
data - The data object for which the half-life calculation shall be done
replicate - The replicate that shall be used

calculateHalfLives

public abstract void calculateHalfLives(double t)
Calculation of half-lives

Parameters:
t - Time

calculateCorrectionFactors

public abstract CorrectionFactors calculateCorrectionFactors(double medianHWZ,
                                                             double t)
Calculation of correction factors based on a median

Parameters:
medianHWZ - median mRNA half-life
t - Time
Returns:
CorrectionFactors c_u and c_l

median

public static double median(double[] inp)
Calculation of the median of a single dimensional array

Parameters:
inp - The array for which the median shall be calculated
Returns:
Median value

ratioOfReplicate

public double[] ratioOfReplicate(double[][] rna,
                                 double[][] total)
Calculates the ratio of a specific replicate

Parameters:
rna - Set of RNA values serving as numerator
total - Set of RNA values serving as denominator
Returns:
The ratio of the two sets of RNA restricted to a single replicate

writeToFileHalfLives

public void writeToFileHalfLives(java.lang.String output)
Writes the half-life values contained in the object together with corresponding spotIds into a file

Parameters:
output - Name of output file

writeToFileRatios

public void writeToFileRatios(java.lang.String output)
Writes Ratio array into a file with two columns: column 1: spotID, column 2: corresponding ratio

Parameters:
output - The name of the file for the output

printHalfLivesWithAttributes

public void printHalfLivesWithAttributes(java.lang.String file,
                                         java.util.ArrayList<java.lang.String> labels)
Prints half-life values together with a given list of attributes into an output file

Parameters:
file - The name of the output file
labels - The labels of attributes

setNewMap

public void setNewMap(Mapping<java.lang.String,java.lang.Integer> newMap)
Sets the mapping corresponding to the ratio values

Parameters:
newMap - The mapping corresponding to the ratios

setAlpha

public void setAlpha(Alpha alpha)
Sets the Alpha object defining the method for calculation of alpha(t)

Parameters:
alpha - The alpha object

setCorrectionFactor

public abstract void setCorrectionFactor(CorrectionFactors corr)
Sets the set of correction factors

Parameters:
corr - The correction factors

setHwz

public void setHwz(double[] hwz)
Sets the half-life values

Parameters:
hwz - The half-life values

setCorrectionFactors

public void setCorrectionFactors(double c_u,
                                 double c_l)
Sets the correction factors c_u and c_l

Parameters:
c_u - The correction factor c_u
c_l - The correction factor c_l

setMaximumHalfLife

public static void setMaximumHalfLife(double maximumHalfLife)
Sets the maximum half-life value to be used

Parameters:
maximumHalfLife - Maximum half-life

setMinimumHalfLife

public static void setMinimumHalfLife(double minimumHalfLife)
Sets the minimal half-life value to be used

Parameters:
minimumHalfLife - Minimum half-life

getAlpha

public Alpha getAlpha()
Returns the alpha object defining the calculation method of alpha

Returns:
The alpha object

getMax

public double getMax()
Returns the highest present half-life value

Returns:
Highest present half-life value

getName

public java.lang.String getName()
Returns the name of this method

Returns:
The name of this method

getC_l

public double getC_l()
Returns the correction factor c_l

Returns:
The correction factor c_l

getC_u

public double getC_u()
Returns the correction factor c_u

Returns:
The correction factor c_u

getNewMapping

public Mapping<java.lang.String,java.lang.Integer> getNewMapping()
Returns the mapping corresponding to ratios/half-lives

Returns:
The mapping corresponding to ratios and half-life values

getData

public Data getData()
Returns the data object holding the original data

Returns:
The data object

getHwz

public double[] getHwz()
Returns the half-life values

Returns:
The half-life values

getRatio

public double[] getRatio()
Returns the ratio values

Returns:
The ratio values

getReplicate

public int getReplicate()
Returns the number of the used replicate

Returns:
The number of the replicate

getMinimumHalfLife

public static double getMinimumHalfLife()
Returns the set minimum half-life

Returns:
Minimum half-life

getMaximumHalfLife

public static double getMaximumHalfLife()
Returns the set maximum half-life

Returns:
Maximum half-life