org.geworkbench.analysis
Class AbstractAnalysis

java.lang.Object
  extended by org.geworkbench.analysis.AbstractAnalysis
All Implemented Interfaces:
java.io.Serializable, java.util.Observer, DSDescribable, Analysis
Direct Known Subclasses:
AbstractGridAnalysis, FilteringAnalysis

public abstract class AbstractAnalysis
extends java.lang.Object
implements Analysis, java.io.Serializable, java.util.Observer

Copyright: Copyright (c) 2003

Company: First Genetic Trust Inc.

Implementation of Analysis customized for use within the applications. It handles the saving of all named parameters sets (from within the saveParametersUnderName method). It also provides a default implementation for the validateParameters method by calling the corresponding method in the AbstractSaveableParameterPanel.

Version:
$Id: AbstractAnalysis.java 9977 2012-10-04 16:38:26Z zji $
Author:
First Genetic Trust Inc., keshav, yc2480, os2201
See Also:
Serialized Form

Field Summary
static int AFFY_DETECTION_CALL_FILTER
           
static int ALLELIC_FREQUENCY_TYPE
           
protected  AbstractSaveableParameterPanel aspp
          The parameters panel to be use from within the AnalysisPane in order to collect the analysis parameters from the user.
static int BLAST_TYPE
           
static int DEVIATION_BASED_FILTER_TYPE
           
static int EXPRESSION_THRESHOLD_FILTER_TYPE
           
static int FOLD_CHANGE_TYPE
           
static int GENEPIX_FlAGS_FILTER_TYPE
           
static int HIERARCHICAL_CLUSTERING_TYPE
           
static int HOUSEKEEPINGGENES_VALUE_NORMALIZER_TYPE
           
static int IGNORE_TYPE
           
static int LOG_TRANSFORMATION_NORMALIZER_TYPE
           
static int MARKER_MEAN_MEDIAN_CENTERING_NORMALIZER_TYPE
           
static int MARKER_MEAN_VARIANCE_NORMALIZER_TYPE
           
static int MARKUS_TYPE
           
static int MAX_TYPE
           
static int MEAN_TYPE
           
static int MEDIAN_TYPE
           
static int MEDUSA_TYPE
           
static int MICROARRAY_MEAN_MEDIAN_CENTERING_NORMALIZER_TYPE
           
static int MIN_TYPE
           
static int MISSING_VALUE_NORMALIZER_TYPE
           
static int MISSING_VALUES_FILTER_TYPE
           
static int MRA_TYPE
           
static int NETBOOST_TYPE
           
protected  java.util.Map<ParameterKey,java.util.Map<java.io.Serializable,java.io.Serializable>> parameterHash
          Contains indices that are used in order to recover the set of named parameter settings that have been saved for a particular analysis.
static int PUDGE_TYPE
           
static int QUANTILE_NORMALIZER_TYPE
           
static int REPLACE_TYPE
           
static int SKYBASE_TYPE
           
static int SKYLINE_TYPE
           
static int SOM_CLUSTERING_TYPE
           
 boolean stopAlgorithm
          Set stopAlgorithm to true to stop the Algorithm, in the Algorithm, you'll need to check this variable periodically.
static int THRESHOLD_NORMALIZER_TYPE
           
protected  java.lang.String tmpDir
           
static int TTEST_TYPE
           
static int TWO_CHANNEL_THRESHOLD_FILTER_TYPE
           
static int ZERO_TYPE
           
 
Constructor Summary
AbstractAnalysis()
           
 
Method Summary
 java.lang.String createHistory()
           
 void deleteParameters(java.lang.String name)
           
 java.util.Map<java.io.Serializable,java.io.Serializable> deserializeNamedParameterSet(java.lang.String name)
          Returns the parameters panel populated with the parameter values that where stored under the designated 'name'.
 ParameterPanel deserializeNamedParameterSetPanel(java.lang.String name)
          Returns the parameters panel populated with the parameter values that where stored under the designated 'name'.
 java.lang.String generateHistoryForMaSetView(DSMicroarraySetView<DSGeneMarker,DSMicroarray> maSetView)
           
 java.lang.String generateHistoryStringForGeneralDataSet(DSDataSet dataset)
           
 java.lang.String getDescription()
          Get the description..
 java.lang.String getLabel()
           
 java.lang.String getLastSavedParameterSetName()
           
 java.util.Map<java.io.Serializable,java.io.Serializable> getNamedParameterSet(java.lang.String name)
          Returns the parameter values that were stored (in parameterHash in memory) under the designated name.
 java.lang.String[] getNamesOfStoredParameterSets()
          Returns the names of the parameter sets that were saved through a call to saveParameters(String filename).
 ParameterPanel getParameterPanel()
          returns a GUI for entering analysis-specific parameter values.
 java.util.Map<java.io.Serializable,java.io.Serializable> getParameters()
           
protected  void loadSavedParameterSets()
          load all saved parameter sets in tmpDir
 boolean parameterSetExist(java.util.Map<java.io.Serializable,java.io.Serializable> parameterSet)
          Check if the inputed parameterSet already exist in memory or not.
 void removeNamedParameter(java.lang.String name)
          Deletes a saved setting based on the saved parameter name.
 void saveParameters(java.lang.String setName)
           
 java.lang.String scrubFilename(java.lang.String filename)
           
 void setDefaultPanel(AbstractSaveableParameterPanel panel)
          Set the panel for this analysis to the specific component's 'panel'.
 void setDescription(java.lang.String desc)
          Set new description.
 void setLabel(java.lang.String label)
           
 void setNamedParameterSetPanel(java.lang.String name)
          Similar to getNamedParameterSetPanel, but instead of return the panel, it directly set (reuse) the current panel.
 void setParameters(java.util.Map<java.io.Serializable,java.io.Serializable> parameters)
           
 void update(java.util.Observable ob, java.lang.Object o)
           
 ParamValidationResults validateParameters()
          validates the current parameter setting
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.geworkbench.bison.model.analysis.Analysis
execute
 

Field Detail

AFFY_DETECTION_CALL_FILTER

public static final int AFFY_DETECTION_CALL_FILTER
See Also:
Constant Field Values

MISSING_VALUES_FILTER_TYPE

public static final int MISSING_VALUES_FILTER_TYPE
See Also:
Constant Field Values

DEVIATION_BASED_FILTER_TYPE

public static final int DEVIATION_BASED_FILTER_TYPE
See Also:
Constant Field Values

EXPRESSION_THRESHOLD_FILTER_TYPE

public static final int EXPRESSION_THRESHOLD_FILTER_TYPE
See Also:
Constant Field Values

LOG_TRANSFORMATION_NORMALIZER_TYPE

public static final int LOG_TRANSFORMATION_NORMALIZER_TYPE
See Also:
Constant Field Values

THRESHOLD_NORMALIZER_TYPE

public static final int THRESHOLD_NORMALIZER_TYPE
See Also:
Constant Field Values

MARKER_MEAN_MEDIAN_CENTERING_NORMALIZER_TYPE

public static final int MARKER_MEAN_MEDIAN_CENTERING_NORMALIZER_TYPE
See Also:
Constant Field Values

MICROARRAY_MEAN_MEDIAN_CENTERING_NORMALIZER_TYPE

public static final int MICROARRAY_MEAN_MEDIAN_CENTERING_NORMALIZER_TYPE
See Also:
Constant Field Values

MARKER_MEAN_VARIANCE_NORMALIZER_TYPE

public static final int MARKER_MEAN_VARIANCE_NORMALIZER_TYPE
See Also:
Constant Field Values

MISSING_VALUE_NORMALIZER_TYPE

public static final int MISSING_VALUE_NORMALIZER_TYPE
See Also:
Constant Field Values

SOM_CLUSTERING_TYPE

public static final int SOM_CLUSTERING_TYPE
See Also:
Constant Field Values

HIERARCHICAL_CLUSTERING_TYPE

public static final int HIERARCHICAL_CLUSTERING_TYPE
See Also:
Constant Field Values

IGNORE_TYPE

public static final int IGNORE_TYPE
See Also:
Constant Field Values

REPLACE_TYPE

public static final int REPLACE_TYPE
See Also:
Constant Field Values

MIN_TYPE

public static final int MIN_TYPE
See Also:
Constant Field Values

MAX_TYPE

public static final int MAX_TYPE
See Also:
Constant Field Values

ZERO_TYPE

public static final int ZERO_TYPE
See Also:
Constant Field Values

MEAN_TYPE

public static final int MEAN_TYPE
See Also:
Constant Field Values

MEDIAN_TYPE

public static final int MEDIAN_TYPE
See Also:
Constant Field Values

TWO_CHANNEL_THRESHOLD_FILTER_TYPE

public static final int TWO_CHANNEL_THRESHOLD_FILTER_TYPE
See Also:
Constant Field Values

TTEST_TYPE

public static final int TTEST_TYPE
See Also:
Constant Field Values

HOUSEKEEPINGGENES_VALUE_NORMALIZER_TYPE

public static final int HOUSEKEEPINGGENES_VALUE_NORMALIZER_TYPE
See Also:
Constant Field Values

GENEPIX_FlAGS_FILTER_TYPE

public static final int GENEPIX_FlAGS_FILTER_TYPE
See Also:
Constant Field Values

QUANTILE_NORMALIZER_TYPE

public static final int QUANTILE_NORMALIZER_TYPE
See Also:
Constant Field Values

ALLELIC_FREQUENCY_TYPE

public static final int ALLELIC_FREQUENCY_TYPE
See Also:
Constant Field Values

NETBOOST_TYPE

public static final int NETBOOST_TYPE
See Also:
Constant Field Values

SKYLINE_TYPE

public static final int SKYLINE_TYPE
See Also:
Constant Field Values

MARKUS_TYPE

public static final int MARKUS_TYPE
See Also:
Constant Field Values

MRA_TYPE

public static final int MRA_TYPE
See Also:
Constant Field Values

SKYBASE_TYPE

public static final int SKYBASE_TYPE
See Also:
Constant Field Values

PUDGE_TYPE

public static final int PUDGE_TYPE
See Also:
Constant Field Values

MEDUSA_TYPE

public static final int MEDUSA_TYPE
See Also:
Constant Field Values

FOLD_CHANGE_TYPE

public static final int FOLD_CHANGE_TYPE
See Also:
Constant Field Values

BLAST_TYPE

public static final int BLAST_TYPE
See Also:
Constant Field Values

aspp

protected AbstractSaveableParameterPanel aspp
The parameters panel to be use from within the AnalysisPane in order to collect the analysis parameters from the user.


parameterHash

protected java.util.Map<ParameterKey,java.util.Map<java.io.Serializable,java.io.Serializable>> parameterHash
Contains indices that are used in order to recover the set of named parameter settings that have been saved for a particular analysis. The indices are (key, value) tuples, where 'key', 'value' are defined as:


tmpDir

protected java.lang.String tmpDir

stopAlgorithm

public boolean stopAlgorithm
Set stopAlgorithm to true to stop the Algorithm, in the Algorithm, you'll need to check this variable periodically.

Constructor Detail

AbstractAnalysis

public AbstractAnalysis()
Method Detail

loadSavedParameterSets

protected void loadSavedParameterSets()
load all saved parameter sets in tmpDir


getLastSavedParameterSetName

public java.lang.String getLastSavedParameterSetName()
Returns:
Return the name of last saved parameter set.

removeNamedParameter

public void removeNamedParameter(java.lang.String name)
Deletes a saved setting based on the saved parameter name.

Parameters:
name - - name of the saved parameter

getNamesOfStoredParameterSets

public java.lang.String[] getNamesOfStoredParameterSets()
Returns the names of the parameter sets that were saved through a call to saveParameters(String filename). Names can be removed using removeNamedParameter()

Returns:
Names of parameterSets as an array of Strings.

setNamedParameterSetPanel

public void setNamedParameterSetPanel(java.lang.String name)
Similar to getNamedParameterSetPanel, but instead of return the panel, it directly set (reuse) the current panel.

Parameters:
name -

getNamedParameterSet

public java.util.Map<java.io.Serializable,java.io.Serializable> getNamedParameterSet(java.lang.String name)
Returns the parameter values that were stored (in parameterHash in memory) under the designated name.

Parameters:
name -
Returns:
Return a Map, which use parameter name as the key and parameter value as the value.

deserializeNamedParameterSetPanel

public ParameterPanel deserializeNamedParameterSetPanel(java.lang.String name)
Returns the parameters panel populated with the parameter values that where stored under the designated 'name'.

Parameters:
name -
Returns:

deserializeNamedParameterSet

public java.util.Map<java.io.Serializable,java.io.Serializable> deserializeNamedParameterSet(java.lang.String name)
Returns the parameters panel populated with the parameter values that where stored under the designated 'name'.

Parameters:
name -
Returns:

parameterSetExist

public boolean parameterSetExist(java.util.Map<java.io.Serializable,java.io.Serializable> parameterSet)
Check if the inputed parameterSet already exist in memory or not.

Parameters:
parameterSet -
Returns:

setDefaultPanel

public void setDefaultPanel(AbstractSaveableParameterPanel panel)
Set the panel for this analysis to the specific component's 'panel'. This method also set the tmpDir to the tmpDir under that parameter panel's directory, and load all saved parameter files under that directory.

Parameters:
panel -

getParameterPanel

public ParameterPanel getParameterPanel()
Description copied from interface: Analysis
returns a GUI for entering analysis-specific parameter values.

Specified by:
getParameterPanel in interface Analysis
Returns:
parameterPanel

validateParameters

public ParamValidationResults validateParameters()
Description copied from interface: Analysis
validates the current parameter setting

Specified by:
validateParameters in interface Analysis
Returns:
validation status

setDescription

public void setDescription(java.lang.String desc)
Description copied from interface: DSDescribable
Set new description.

Specified by:
setDescription in interface DSDescribable
Parameters:
desc - The new description.

getDescription

public java.lang.String getDescription()
Description copied from interface: DSDescribable
Get the description..

Specified by:
getDescription in interface DSDescribable
Returns:
A description.

getLabel

public java.lang.String getLabel()
Returns:

setLabel

public void setLabel(java.lang.String label)
Parameters:
name -

update

public void update(java.util.Observable ob,
                   java.lang.Object o)
Specified by:
update in interface java.util.Observer

createHistory

public java.lang.String createHistory()
Returns:

getParameters

public java.util.Map<java.io.Serializable,java.io.Serializable> getParameters()
Specified by:
getParameters in interface Analysis

setParameters

public void setParameters(java.util.Map<java.io.Serializable,java.io.Serializable> parameters)
Specified by:
setParameters in interface Analysis

saveParameters

public void saveParameters(java.lang.String setName)
Specified by:
saveParameters in interface Analysis

deleteParameters

public void deleteParameters(java.lang.String name)
Specified by:
deleteParameters in interface Analysis

scrubFilename

public java.lang.String scrubFilename(java.lang.String filename)

generateHistoryForMaSetView

public java.lang.String generateHistoryForMaSetView(DSMicroarraySetView<DSGeneMarker,DSMicroarray> maSetView)
Parameters:
maSetView -
Returns:

generateHistoryStringForGeneralDataSet

public java.lang.String generateHistoryStringForGeneralDataSet(DSDataSet dataset)