MAEPlugin.analysis
Class NormalizationPlugin

java.lang.Object
  |
  +--MAEPlugin.MAEPlugin
        |
        +--MAEPlugin.CheckBoxMenuPlugin
              |
              +--MAEPlugin.analysis.AnalysisPlugin
                    |
                    +--MAEPlugin.analysis.NormalizationPlugin
All Implemented Interfaces:
java.util.EventListener, java.awt.event.ItemListener, Normalization, PluginStub

public abstract class NormalizationPlugin
extends AnalysisPlugin
implements Normalization

This class extends the analysis MAEPlugin base class to implement the Normalization base class. The "active normalization" is a static reference that all Normalization classes share. Whichever one is active will be the one used. Created on September 7, 2001, 5:46 PM

This work was produced by Peter Lemkin of the National Cancer Institute, an agency of the United States Government. As a work of the United States Government there is no associated copyright. It is offered as open source software under the Mozilla Public License (version 1.1) subject to the limitations noted in the accompanying LEGAL file. This notice must be included with the code. The MAExplorer Mozilla and Legal files are available on http://maexplorer.sourceforge.net/.

Version:
$Date: 2003/03/03 16:22:10 $ / $Revision: 1.6 $
Author:
Jai Evans (DECA/CIT), C. Santos (DECA/CIT), P. Lemkin (NCI-FCRDC)
See Also:
MAExplorer Home

Field Summary
protected static Normalization activeNormalization
          Pointer to the current active Normalization object.
protected  java.lang.Object sample
           
 
Fields inherited from class MAEPlugin.MAEPlugin
DBUG_MAEP, jarResources, registryMaxSize
 
Fields inherited from interface MAEPlugin.PluginStub
PLUGIN_VERSION
 
Constructor Summary
NormalizationPlugin()
          NormalizationPlugin() - Default Constructor puts default menu name in menu.
NormalizationPlugin(java.lang.String menuLabel)
          NormalizationPlugin() - Default Constructor puts menu name in menu.
NormalizationPlugin(java.lang.String menuLabel, java.lang.String pluginFileName)
          NormalizationPlugin() - Default Constructor puts menu name in menu and file name.
 
Method Summary
abstract  float[] calcIntensityScaleExtrema(float maxRI, float minRI, float maxRaw, float minRaw, int sampleNbr)
          calcIntensityScaleExtrema() - compute scaled Intensity upper and lower limits of raw data for each sample.
abstract  void close(boolean preserveDataStructuresFlag)
          close() - close the plugin
static void disableNormalizationPlugin()
          disableNormalizationPlugin() - clear activeNormalization state.
abstract  boolean finishPipeline(int optArg)
          finishPipeline() - finish filter at end of normalization of all genes (if required).
static Normalization getActiveNormalization()
          getActiveNormalization() - Bean-style method for getting the activeNormalization.
static boolean getNormalizationState()
          getNormalizationState() - Static method for using testing getActiveNormalization().
 java.lang.Object getSample()
          getSample() - used to Get the primary sample, to get the variables
 void pluginHalt()
          pluginHalt() - stop the plugin
 void pluginMain()
          pluginMain() is the method activated when end-users check a checkbox API.
abstract  void recalcNormalizationExtrema()
          recalcNormalizationExtrema() - set the extreama for all samples for this plugin
abstract  boolean resetPipeline(int optArg)
          resetPipeline() - reset filter at start of data Normalization.
abstract  float scaleIntensityData(float rawData)
          scaleIntensityData() - scale raw intensity data as fct of normalization mode.
abstract  float scaleIntensityData(float rawIntensity, float rawBkgrd, int mid, int gid, int sampleIdx)
          scaleIntensityData() - the gene normalization operating on gene mid for sampleIdx where the data is ether extracted here or from the resetPipeline pre-analysis.
abstract  float scaleIntensityData(float rawData, int mid, int gid, int sampleNbr)
          scaleIntensityData() - scale raw intensity data as fct of normalization mode.
 void setActiveNormalization(Normalization obj)
          setActiveNormalization() - Bean-style method for setting the activeNormalization.
 void setSample(java.lang.Object obj)
          setSample() - method used to set primary variables from the sample.
abstract  void updateCurGene(int mid)
          updateCurGene() - abstract method end-users must implement to use the API.
abstract  void updateFilter()
          updateFilter() - abstract method end-users must implement to use the API.
abstract  void updateLabels()
          updateLabels() - abstract method end-users must implement to use the API.
abstract  void updateSlider()
          updateSlider() - abstract method end-users must implement to use the API.
 
Methods inherited from class MAEPlugin.CheckBoxMenuPlugin
getState, itemStateChanged, setState
 
Methods inherited from class MAEPlugin.MAEPlugin
getFlag, getInstance, getMAEStub, getMenuHook, getMenuInsertionPointName, getMenuItem, getNumberPlugins, getPluginDescription, getPluginFileName, getPluginName, getPlugins, menuActivated, pluginInit, removePlugin, setFlag, setJarResources, setMAEStub, setMenuHook, setMenuInsertionPointName, setMenuItem, setMenuLabel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface MAEPlugin.Normalization
getState, setState
 

Field Detail

activeNormalization

protected static Normalization activeNormalization
Pointer to the current active Normalization object. Reference to this object allows normalization methods to find the active normalization. This is static since only one normalization method may be active at a time. If the value is null, then there is NO active NormalizationPlugin even if several are loaded.

sample

protected java.lang.Object sample
Constructor Detail

NormalizationPlugin

public NormalizationPlugin()
NormalizationPlugin() - Default Constructor puts default menu name in menu.

NormalizationPlugin

public NormalizationPlugin(java.lang.String menuLabel)
NormalizationPlugin() - Default Constructor puts menu name in menu.
Parameters:
menuLabel - is the name of the plugin for use as the menu item

NormalizationPlugin

public NormalizationPlugin(java.lang.String menuLabel,
                           java.lang.String pluginFileName)
NormalizationPlugin() - Default Constructor puts menu name in menu and file name.
Parameters:
menuLabel - is the name of the plugin for use as the menu item
pluginFileName - name of the plugin without the ".jar"
Method Detail

pluginMain

public final void pluginMain()
pluginMain() is the method activated when end-users check a checkbox API. This is unlike other plugins in that analysis will be done passively.
Overrides:
pluginMain in class CheckBoxMenuPlugin

disableNormalizationPlugin

public static final void disableNormalizationPlugin()
disableNormalizationPlugin() - clear activeNormalization state. If the state is null, then there are no active normalization plugins even if one or more is loaded.

getNormalizationState

public static final boolean getNormalizationState()
getNormalizationState() - Static method for using testing getActiveNormalization(). It is used in MaeJavaAPI. If there is no active NormalizationPlugin instance, then this is false.
Returns:
state of normalization plugin. True if active.

getActiveNormalization

public static final Normalization getActiveNormalization()
getActiveNormalization() - Bean-style method for getting the activeNormalization. If there is no active NormalizationPlugin instance, then this is null.
Returns:
Normalization instance

setActiveNormalization

public final void setActiveNormalization(Normalization obj)
setActiveNormalization() - Bean-style method for setting the activeNormalization. This method calls underlying methods in MAExplorer to treat the checkbox as a radio button and make sure that it disables other Normalization methods whether built-in or other normalization plugins.
Parameters:
obj - is Normalization plugin object

pluginHalt

public void pluginHalt()
pluginHalt() - stop the plugin
Overrides:
pluginHalt in class MAEPlugin

getSample

public final java.lang.Object getSample()
getSample() - used to Get the primary sample, to get the variables
Specified by:
getSample in interface Normalization
Returns:
sample as Object

setSample

public final void setSample(java.lang.Object obj)
setSample() - method used to set primary variables from the sample.
Specified by:
setSample in interface Normalization
Parameters:
obj - is the NormalizationPlugin sample object

resetPipeline

public abstract boolean resetPipeline(int optArg)
resetPipeline() - reset filter at start of data Normalization. We will test for ALL GENES (if required) using the midOK[] boolean created here to later determine if we actually perform the test. This sets up the state that may be used during the pipeline operation.
Specified by:
resetPipeline in interface Normalization
Parameters:
optArg - - optional argument
Returns:
true if succeed

finishPipeline

public abstract boolean finishPipeline(int optArg)
finishPipeline() - finish filter at end of normalization of all genes (if required). This may be used to clean up the state after the pipeline operation.
Specified by:
finishPipeline in interface Normalization
Parameters:
optArg - - optional argument
Returns:
true if succeed

calcIntensityScaleExtrema

public abstract float[] calcIntensityScaleExtrema(float maxRI,
                                                  float minRI,
                                                  float maxRaw,
                                                  float minRaw,
                                                  int sampleNbr)
calcIntensityScaleExtrema() - compute scaled Intensity upper and lower limits of raw data for each sample. It is called to get extrema for use in scaling displays and other computations where the limits must be known.
Specified by:
calcIntensityScaleExtrema in interface Normalization
Parameters:
maxRI - maximum raw ratio intensity
minRI - minimum raw ratio intensity
maxRaw - maximum raw intensity max(rawF1,rawF2)
minRaw - minimum raw intensity min(rawF1,rawF2)
sampleNbr - for the sample sample number in the range [1:maxSamples]
Returns:
an array with the following scaled data:
   element 0 = maxDataS
   element 1 = minDataS
   element 2 = maxRawS
   element 3 = minRawS

scaleIntensityData

public abstract float scaleIntensityData(float rawData)
scaleIntensityData() - scale raw intensity data as fct of normalization mode. This is called on a per-spot basis.
Specified by:
scaleIntensityData in interface Normalization
Parameters:
rawData - is unnormalized data for spot
Returns:
scaled normalized spot data

scaleIntensityData

public abstract float scaleIntensityData(float rawData,
                                         int mid,
                                         int gid,
                                         int sampleNbr)
scaleIntensityData() - scale raw intensity data as fct of normalization mode. There is a (gid,sampleNbr) dependence on the normalization. This is called on a per-spot basis.
Specified by:
scaleIntensityData in interface Normalization
Parameters:
rawData - is unnormalized data for spot
mid - is MID of the spot
gid - is GID of the spot
sampleNbr - for the sample array
Returns:
normalized spot data

scaleIntensityData

public abstract float scaleIntensityData(float rawIntensity,
                                         float rawBkgrd,
                                         int mid,
                                         int gid,
                                         int sampleIdx)
scaleIntensityData() - the gene normalization operating on gene mid for sampleIdx where the data is ether extracted here or from the resetPipeline pre-analysis. If the normalization is inoperative, then just return 0.0. The mid must be >=0 since -1 indicates an illegal gene. The midOK[mid] must be true, else it indicates an illegal gene. [NOTE] The plugin writer should try to avoid doing special analyses here that need to be computed DURING the processing and instead do the computations during the resetPipeline() operation if possible. That may be able to optimized and the data cached to avoid constant recomputation.
Specified by:
scaleIntensityData in interface Normalization
Parameters:
rawIntensity - is intensity value to be normalized
rawBkgrd - is background intensity to be used in normalization if the use Background flag is set.
mid - is the Master Gene ID to test if not -1 and the gene exists
gid - is the spot Geometry Gene Index to test if not -1 and the spot exists
sampleIdx - is the HybridSample index number for single sample HP-X or HP-Y. For Cy3 vs Cy5 mode, it is 0 for Cy3 (F1), and 1 for Cy5 (F2). For HP-X 'set' vs HP-Y 'set' mode, it is 0 for HP-X 'set', and 1 for HP-Y 'set'
Returns:
scaled data if normalization is active, else 0.0F

recalcNormalizationExtrema

public abstract void recalcNormalizationExtrema()
recalcNormalizationExtrema() - set the extreama for all samples for this plugin
Specified by:
recalcNormalizationExtrema in interface Normalization

updateCurGene

public abstract void updateCurGene(int mid)
updateCurGene() - abstract method end-users must implement to use the API. It is called by the popup Registry for the user to update any dependent data since the current gene has changed.
Parameters:
mid - is the MID (Master Gene ID) that is the new current gene.

updateFilter

public abstract void updateFilter()
updateFilter() - abstract method end-users must implement to use the API. It is called by the popup Registry for the user to update any dependent data since the data Filter has changed.

updateSlider

public abstract void updateSlider()
updateSlider() - abstract method end-users must implement to use the API. It is called by the popup Registry for the user to update any dependent data since the threshold sliders have changed. This is invoked from the PopupRegistry.

updateLabels

public abstract void updateLabels()
updateLabels() - abstract method end-users must implement to use the API. It is called by the popup Registry for the user to update any dependent data since some global labels have changed.

close

public abstract void close(boolean preserveDataStructuresFlag)
close() - close the plugin
Parameters:
preserveDataStructuresFlag - to save data structures