Class ExprProfileOverlay

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Panel
                    |
                    +--ExprProfileOverlay
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.event.AdjustmentListener, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

class ExprProfileOverlay
extends java.awt.Panel
implements java.awt.event.AdjustmentListener

This class displays a scrollable expression profile overlay. It extends the Draw2Dplot class and consists of an overlay plot of the expression profiles of genes in the specifimed gene list. Selecting a particular profile sets the current gene and calls the PopupRegistry to update other windows.

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/07/07 21:40:41 $ $Revision: 1.8 $
Author:
P. Lemkin (NCI), G. Thornwall (SAIC), NCI-Frederick, Frederick, MD
See Also:
MAExplorer Home, ExprProfile, ShowPlotPopup, Serialized Form

Inner classes inherited from class java.awt.Panel
java.awt.Panel.AccessibleAWTPanel
 
Inner classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.AWTTreeLock
 
Field Summary
private  Gene bestGene
          gene if mouse event
private  int bestHP
          HP if mouse event
private  float bestIntens
          intensity if mouse event
private  int bestMid
          gene clone ID if mouse event
private  java.lang.String[] cTitle
          titles [0:nGenes-1] "#Master_ID"
(package private)  Draw2Dplot d2dp
          draw 2D overlay of EP plots
private  boolean doMeanPlotsFlag
          if plot means and SD
private  ExprProfile[] epOverlayList
          list of overlay expr.
private  GeneList epOvrLayCL
          special [nGenes*nHP_E] CL
private  java.awt.Panel epPanel
          holds g2D overlay plot
private  ExprProfilePanel[] epplList
          Expr Profs [nGridElements]
private  GeneList exprProfileCL
          GeneList being used
private  boolean hasMeanPlotsFlag
          if hpDataXXX[] exists
private  float hLB
          lower HP sample # to display
private  float[][] hpDataMnA
          mean[0:nMnGenes-1][0:nHP_E-1]
private  int[] hpDataNbrA
          # of samples for hpDataXXX[n][]
private  float[][] hpDataSDA
          S.D.[0:nMnGenes-1][0:nHP_E-1]
private  java.awt.Scrollbar hsL
          lower bound horizontal scroll bar
private  java.awt.Scrollbar hsU
          upper bound horizontal scroll bar
private  float hUB
          upper HP sample # to display
private  MAExplorer mae
          links to global MAExplorer instance
private  int[] mapPointToMid
          [nGenes*nHP_E] mid mapping
private  float maxHPdataMn
          max of hpDataMnA[][] data
private  int maxHsteps
          # of steps for hsL hsU
private  int maxVsteps
          # of steps for vsL vsU
private  int mNbr
          .mList[mNbr] in database to display
private  int nGenes
          # genes in exprProfileCL
private  int nHP_E
          # of HPS in an Expr Profile
private  int nMnGenes
          # of averaged genes ~ nGenes
private  int nPoints
          nGenes*nHP_E
(package private)  int plotStyleMode
          plot style mode: 0=line, 1=circle, 2=curve
private  int prevBestMID
          save previous MID found with mouse
private  int[] propList
          [nGenes*nHP_E] EP overlay props
private  int sbSize
          width of scroll bar control
(package private)  ShowExprProfilesPopup sepp
          Parent window
private  boolean showErrBarsFlag
          pass through to EP panel
private  java.lang.String title
          title for entire EP.
private  float vLB
          lower expression value to display
private  java.awt.Scrollbar vsL
          lower bound vertical scroll bar
private  java.awt.Scrollbar vsU
          upper bound vertical scroll bar
private  float vUB
          upper expression value to display
private  float[] xList
          [nGenes*nHP_E] EP overlay X coords
private  float[] yList
          [nGenes*nHP_E] EP overlay Y coords
(package private)  int zoomBarsMag
          zoom factor: 1X, 2X, 5X, 10X pass through to EP panel
 
Fields inherited from class java.awt.Panel
base, nameCounter, serialVersionUID
 
Fields inherited from class java.awt.Container
component, containerListener, containerSerializedDataVersion, dbg, dispatcher, layoutMgr, listeningBoundsChildren, listeningChildren, maxSize, ncomponents, printing, printingThreads
 
Fields inherited from class java.awt.Component
accessibleContext, actionListenerK, adjustmentListenerK, appContext, background, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, changeSupport, componentListener, componentListenerK, componentOrientation, componentSerializedDataVersion, containerListenerK, cursor, dropTarget, enabled, eventMask, focusListener, focusListenerK, font, foreground, graphicsConfig, hasFocus, height, hierarchyBoundsListener, hierarchyBoundsListenerK, hierarchyListener, hierarchyListenerK, incRate, inputMethodListener, inputMethodListenerK, isInc, isPacked, itemListenerK, keyListener, keyListenerK, LEFT_ALIGNMENT, locale, LOCK, metrics, minSize, mouseListener, mouseListenerK, mouseMotionListener, mouseMotionListenerK, name, nameExplicitlySet, newEventsOnly, ownedWindowK, parent, peer, peerFont, popups, prefSize, privateKey, RIGHT_ALIGNMENT, textListenerK, TOP_ALIGNMENT, valid, visible, width, windowClosingException, windowListenerK, x, y
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
(package private) ExprProfileOverlay(MAExplorer mae, ShowExprProfilesPopup sepp, GeneList exprProfileCL, java.lang.String title, int preferredPanelWidth, boolean showKmeansDataFlag)
          ExprProfileOverlay() - Create popup overlay plot of ExprProfiles.
 
Method Summary
 void adjustmentValueChanged(java.awt.event.AdjustmentEvent e)
          adjustmentValueChanged() - handle scroll events and cause a repaint.
(package private)  boolean drawGifFile(java.lang.String oGifFileName)
          drawGifFile() - draw plot into Gif image file if in standalone mode.
 void mouseHandler(int x, int y, int mouseKeyMods, boolean setCurGeneFlag)
          mouseHandler() - interact with current 2D plot if a graphic plot.
 void paint(java.awt.Graphics g)
          paint() - redraw plots near selected row.
private  void setCurGene(int mid)
          setCurGene() - set current gene from mid if it is not -1.
(package private)  void setEPcanvasDrawingOptions(boolean showErrBarsFlag, int zoomBarsMag, int plotStyleMode)
          setEPcanvasDrawingOptions() - set err-bar and zoom status and then repaint.
(package private)  void setPlotEPmeansData(int nMnGenes, int[] hpDataNbrA, float[][] hpDataMnA, float[][] hpDataSDA, boolean doMeanPlotsFlag)
          setPlotEPmeansData() - set expression profile to plot mean data for each panel
private  void showGeneMsgsAndPlot()
          showGeneMsgsAndPlot() - show quant genomic data messages in MSG and in plot
private  void showGeneOfInterest(int mid, int mouseKeyMods, boolean setCurGeneFlag)
          showGeneOfInterest() - show quant and genomic data if click on point in plot
(package private)  void updateCurGene(int mid)
          updateCurGene() - update the current gene in the expression profile plot list
(package private)  void updateData(GeneList exprProfileCL, java.lang.String title)
          updateData() - update exprression profile scroller with new gene data.
 
Methods inherited from class java.awt.Panel
, addNotify, constructComponentName, getAccessibleContext
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, adjustListeningChildren, applyOrientation, checkGD, countComponents, createChildHierarchyEvents, createHierarchyEvents, deliverEvent, dispatchEventImpl, dispatchEventToSelf, doLayout, eventEnabled, findComponentAt, findComponentAt, findComponentAt, getAccessibleAt, getAccessibleChild, getAccessibleChildrenCount, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents_NoClientCode, getComponents, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMouseEventTarget, getPreferredSize, getWindow, initIDs, insets, invalidate, invalidateTree, isAncestorOf, layout, lightweightPaint, lightweightPrint, list, list, locate, minimumSize, nextFocus, numListening, paintComponents, paintHeavyweightComponents, paramString, postProcessKeyEvent, postsOldMouseEvents, preferredSize, preProcessKeyEvent, print, printComponents, printHeavyweightComponents, processContainerEvent, processEvent, proxyEnableEvents, proxyRequestFocus, readObject, remove, remove, removeAll, removeContainerListener, removeNotify, setFocusOwner, setFont, setLayout, transferFocus, update, validate, validateTree, writeObject
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, areInputMethodsEnabled, bounds, checkImage, checkImage, checkWindowClosingException, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAccessibleIndexInParent, getAccessibleStateSet, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont_NoClientCode, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen_NoTreeLock, getLocationOnScreen, getName, getNativeContainer, getParent_NoClientCode, getParent, getPeer, getSize, getSize, getToolkit, getToolkitImpl, getTreeLock, getWidth, getWindowForObject, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isEnabledImpl, isFocusTraversable, isLightweight, isOpaque, isRecursivelyVisible, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, resetGC, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

mae

private MAExplorer mae
links to global MAExplorer instance

sepp

ShowExprProfilesPopup sepp
Parent window

title

private java.lang.String title
title for entire EP. panel

exprProfileCL

private GeneList exprProfileCL
GeneList being used

nGenes

private int nGenes
# genes in exprProfileCL

sbSize

private int sbSize
width of scroll bar control

prevBestMID

private int prevBestMID
save previous MID found with mouse

mNbr

private int mNbr
.mList[mNbr] in database to display

epOverlayList

private ExprProfile[] epOverlayList
list of overlay expr. profiles

d2dp

Draw2Dplot d2dp
draw 2D overlay of EP plots

epplList

private ExprProfilePanel[] epplList
Expr Profs [nGridElements]

cTitle

private java.lang.String[] cTitle
titles [0:nGenes-1] "#Master_ID"

nHP_E

private int nHP_E
# of HPS in an Expr Profile

nMnGenes

private int nMnGenes
# of averaged genes ~ nGenes

hpDataNbrA

private int[] hpDataNbrA
# of samples for hpDataXXX[n][]

maxHPdataMn

private float maxHPdataMn
max of hpDataMnA[][] data

hpDataMnA

private float[][] hpDataMnA
mean[0:nMnGenes-1][0:nHP_E-1]

hpDataSDA

private float[][] hpDataSDA
S.D.[0:nMnGenes-1][0:nHP_E-1]

showErrBarsFlag

private boolean showErrBarsFlag
pass through to EP panel

doMeanPlotsFlag

private boolean doMeanPlotsFlag
if plot means and SD

hasMeanPlotsFlag

private boolean hasMeanPlotsFlag
if hpDataXXX[] exists

plotStyleMode

int plotStyleMode
plot style mode: 0=line, 1=circle, 2=curve

zoomBarsMag

int zoomBarsMag
zoom factor: 1X, 2X, 5X, 10X pass through to EP panel

epPanel

private java.awt.Panel epPanel
holds g2D overlay plot

hsL

private java.awt.Scrollbar hsL
lower bound horizontal scroll bar

hsU

private java.awt.Scrollbar hsU
upper bound horizontal scroll bar

vsL

private java.awt.Scrollbar vsL
lower bound vertical scroll bar

vsU

private java.awt.Scrollbar vsU
upper bound vertical scroll bar

maxHsteps

private int maxHsteps
# of steps for hsL hsU

maxVsteps

private int maxVsteps
# of steps for vsL vsU

hLB

private float hLB
lower HP sample # to display

hUB

private float hUB
upper HP sample # to display

vLB

private float vLB
lower expression value to display

vUB

private float vUB
upper expression value to display

xList

private float[] xList
[nGenes*nHP_E] EP overlay X coords

yList

private float[] yList
[nGenes*nHP_E] EP overlay Y coords

nPoints

private int nPoints
nGenes*nHP_E

propList

private int[] propList
[nGenes*nHP_E] EP overlay props

mapPointToMid

private int[] mapPointToMid
[nGenes*nHP_E] mid mapping

epOvrLayCL

private GeneList epOvrLayCL
special [nGenes*nHP_E] CL

bestGene

private Gene bestGene
gene if mouse event

bestHP

private int bestHP
HP if mouse event

bestMid

private int bestMid
gene clone ID if mouse event

bestIntens

private float bestIntens
intensity if mouse event
Constructor Detail

ExprProfileOverlay

ExprProfileOverlay(MAExplorer mae,
                   ShowExprProfilesPopup sepp,
                   GeneList exprProfileCL,
                   java.lang.String title,
                   int preferredPanelWidth,
                   boolean showKmeansDataFlag)
ExprProfileOverlay() - Create popup overlay plot of ExprProfiles. Set the Filter.workingCL if the specified list is null.
Parameters:
mae - is the MAExplorer instance
sepp - is the ShowExprProfilesPopup Parent
GeneList - exprProfileCL is thege ne list to use
title - is the window title
preferredPanelWidth - is set by parent Frame if not 0
showKmeansDataFlag - to report Kmeans data else just Master_ID and name
See Also:
Draw2Dplot, ExprProfile, Util.showMsg(java.lang.String), updateData(GeneList, java.lang.String)
Method Detail

drawGifFile

boolean drawGifFile(java.lang.String oGifFileName)
drawGifFile() - draw plot into Gif image file if in standalone mode. This sets it up and lets paint() to the heavy lifting...
Parameters:
oGifFileName - is the full path GIF output file
Returns:
false if unable to generate the image file.
See Also:
Component.repaint()

updateData

void updateData(GeneList exprProfileCL,
                java.lang.String title)
updateData() - update exprression profile scroller with new gene data. This will cause it to repaint as well.
Parameters:
exprProfileCL - is the new list of genes
title - for canvas label
See Also:
Component.repaint()

setEPcanvasDrawingOptions

void setEPcanvasDrawingOptions(boolean showErrBarsFlag,
                               int zoomBarsMag,
                               int plotStyleMode)
setEPcanvasDrawingOptions() - set err-bar and zoom status and then repaint.
Parameters:
showErrBarsFlag - to show error bars in the plot
zoomBarsMag - is the zoom magnification
plotStyleMode - is the style mode as line, circle, curve
See Also:
Component.repaint()

setPlotEPmeansData

void setPlotEPmeansData(int nMnGenes,
                        int[] hpDataNbrA,
                        float[][] hpDataMnA,
                        float[][] hpDataSDA,
                        boolean doMeanPlotsFlag)
setPlotEPmeansData() - set expression profile to plot mean data for each panel
Parameters:
nMnGenes - is the # of averaged genes
hpDataNbrA - is a list of the # samples hpDataXXX[n][]
hpDataMnA - is a list of the mean[0:nMnGenes-1][0:nHP_E-1] data
hpDataSDA - is a list ofthe S.D.[0:nMnGenes-1][0:nHP_E-1] data
doMeanPlotsFlag - if true
See Also:
Component.repaint()

paint

public void paint(java.awt.Graphics g)
paint() - redraw plots near selected row.
Overrides:
paint in class java.awt.Container
Parameters:
g - is graphics context
See Also:
Draw2Dplot.update2Dplot(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, int, int, double, double, double, double, double, double, boolean, boolean, float[], float[], int[], GeneList, int, int[]), GeneBitSet.setItem(int), GeneList, GeneList.clear()

updateCurGene

void updateCurGene(int mid)
updateCurGene() - update the current gene in the expression profile plot list
Parameters:
mid - is the Master Gene Index if not -1
See Also:
PopupRegistry

adjustmentValueChanged

public void adjustmentValueChanged(java.awt.event.AdjustmentEvent e)
adjustmentValueChanged() - handle scroll events and cause a repaint.
Specified by:
adjustmentValueChanged in interface java.awt.event.AdjustmentListener
Parameters:
e - is scroller adjustment event
See Also:
Draw2Dplot.updateScrolledRegion(float, float, float, float), Component.repaint()

mouseHandler

public void mouseHandler(int x,
                         int y,
                         int mouseKeyMods,
                         boolean setCurGeneFlag)
mouseHandler() - interact with current 2D plot if a graphic plot. If get a hit, then display data for the gene. Note: because the plot lives in the ScrollerImageCanvas, there is only ONE plot so can't get into trouble with multiple plots.
Parameters:
x - is x coordinate at mouse event
y - is y coordinate at mouse event
mouseKeyMods - is keyboard status at mouse event
setCurGeneFlag - if true
See Also:
Draw2Dplot.set2DplotSubtitles(java.lang.String, java.lang.String, java.lang.String, java.lang.String), showGeneOfInterest(int, int, boolean), Component.repaint()

setCurGene

private void setCurGene(int mid)
setCurGene() - set current gene from mid if it is not -1.
Parameters:
mid - is the Master Gene Index if not -1
See Also:
CompositeDatabase.setObjCoordFromMID(int, java.lang.Object)

showGeneMsgsAndPlot

private void showGeneMsgsAndPlot()
showGeneMsgsAndPlot() - show quant genomic data messages in MSG and in plot
See Also:
Draw2Dplot.set2DplotSubtitles(java.lang.String, java.lang.String, java.lang.String, java.lang.String), GridCoords.cvtGID2str(int, boolean), SpotFeatures.getSpotFeatures(java.awt.Point, MaHybridSample), SpotFeatures.getSpotGenomicData(java.awt.Point, MaHybridSample), Util.showMsg(java.lang.String), Util.showFeatures(java.lang.String, java.lang.String)

showGeneOfInterest

private void showGeneOfInterest(int mid,
                                int mouseKeyMods,
                                boolean setCurGeneFlag)
showGeneOfInterest() - show quant and genomic data if click on point in plot
Parameters:
mid - is the Master Gene Index if not -1
mouseKeyMods - is keyboard status at mouse press event
setCurGeneFlag - if true
See Also:
Component.repaint(), PopupRegistry.chkOtherCurGeneEffects(int, int), setCurGene(int), showGeneMsgsAndPlot(), Component.repaint()