userinterface.gui
Class GuiHalfLife

java.lang.Object
  extended by userinterface.gui.GuiHalfLife

public class GuiHalfLife
extends java.lang.Object

'Interface' which connects GUI and methods for half life calculations

Author:
Stefanie Kaufmann

Field Summary
static java.lang.String EU
           
static java.lang.String NEW
           
static java.lang.String PRE
           
 
Constructor Summary
GuiHalfLife()
           
 
Method Summary
 void addHL(java.lang.String hlName, int time, int replicate)
          Add a half life object to the current list, also add corresponding time
 void calcHL()
          Use set variables and create half life objects for every method, calculate half lives
 void calcHLonMedian(java.util.List<CorrectionFactors> corr)
          Calculates the Half life values based on a list of correction factors which correspond to the list of half lives
 double calculateMedian()
           
 void clearHL()
          Resets everything that has been used for half life calculation of previous half life list
 java.util.List<CorrectionFactors> getCFonMedian(double mD)
          Calculates the median for each half life object and the correction factors based on this median
 java.util.List<HalfLife> getHL()
          Returns the list of half life objects calculated
 double getMD()
          Returns the last calculated median
 java.util.List<java.lang.String> getMethods()
          Returns the list of method descriptions used for half life calculation
 java.util.List<java.lang.Integer> getReplicates()
          Returns the number of the used replicate for each half life object
 java.util.List<java.lang.Integer> getTimes()
          Returns the list of time points used for calculation
 boolean hasHL()
          Checks whether there are any half lives
 void saveHL()
          Based on calculated half lives, writes results into output file
 void setCorr(CorrectionFactors corr)
          Sets the correction factors needed for half life calculation
 void setData(Data data)
          Sets the data on which the half life calculation is based
 void setMethods(java.util.List<java.lang.String> methods)
          Sets the list of method descriptions for calculation
 void setOutput(java.lang.String filename, int which, boolean nan)
          Sets all necessary variables for defining the output
 void setRatioMethod(int method)
          Changes the method used for ratio calculation
 void setReplicates(java.util.List<java.lang.Integer> replicates)
          Sets the numbers of the replicates for the half life calculations
 void setTimes(java.util.List<java.lang.Integer> times)
          Sets the list of time points for calculation, order corresponding to the list of methods
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NEW

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

PRE

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

EU

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

GuiHalfLife

public GuiHalfLife()
Method Detail

calcHL

public void calcHL()
Use set variables and create half life objects for every method, calculate half lives


calculateMedian

public double calculateMedian()

getCFonMedian

public java.util.List<CorrectionFactors> getCFonMedian(double mD)
Calculates the median for each half life object and the correction factors based on this median

Returns:
A list of correction factors based on median, corresponding to the list of half lives

calcHLonMedian

public void calcHLonMedian(java.util.List<CorrectionFactors> corr)
Calculates the Half life values based on a list of correction factors which correspond to the list of half lives

Parameters:
corr - List containing a set of correction factors for every half life object

saveHL

public void saveHL()
Based on calculated half lives, writes results into output file


clearHL

public void clearHL()
Resets everything that has been used for half life calculation of previous half life list


hasHL

public boolean hasHL()
Checks whether there are any half lives

Returns:
True if already any half lives have been set

addHL

public void addHL(java.lang.String hlName,
                  int time,
                  int replicate)
Add a half life object to the current list, also add corresponding time

Parameters:
hlName - Name of the half life object (new/pre/eu)
time - Timepoint for which calculation is wanted
replicate - Replicate for which the calculation is wanted

setRatioMethod

public void setRatioMethod(int method)
Changes the method used for ratio calculation

Parameters:
method - The method to be used for ratio calculation

setOutput

public void setOutput(java.lang.String filename,
                      int which,
                      boolean nan)
Sets all necessary variables for defining the output

Parameters:
filename - Name of the file in which output will be saved
which - Which results will be saved (ratio/halflife/both?)
nan - Should NaN and negative values be kept?

setData

public void setData(Data data)
Sets the data on which the half life calculation is based

Parameters:
data - The data object for the calculation

setReplicates

public void setReplicates(java.util.List<java.lang.Integer> replicates)
Sets the numbers of the replicates for the half life calculations

Parameters:
replicates - The list of replicate numbers

setCorr

public void setCorr(CorrectionFactors corr)
Sets the correction factors needed for half life calculation

Parameters:
corr - The correction factors for the calculation

setMethods

public void setMethods(java.util.List<java.lang.String> methods)
Sets the list of method descriptions for calculation

Parameters:
methods - The list of methods for half life calculation

setTimes

public void setTimes(java.util.List<java.lang.Integer> times)
Sets the list of time points for calculation, order corresponding to the list of methods

Parameters:
times - A list of time points for half life calculation

getMethods

public java.util.List<java.lang.String> getMethods()
Returns the list of method descriptions used for half life calculation

Returns:
The list of methods for half life calculation

getReplicates

public java.util.List<java.lang.Integer> getReplicates()
Returns the number of the used replicate for each half life object

Returns:
The numbers of the used replicates

getMD

public double getMD()
Returns the last calculated median

Returns:
The last calculated median

getTimes

public java.util.List<java.lang.Integer> getTimes()
Returns the list of time points used for calculation

Returns:
The list of time points for half life calculation

getHL

public java.util.List<HalfLife> getHL()
Returns the list of half life objects calculated

Returns:
The list of half life objects