|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Canvas | +--ClusterGramCanvas
Create a ClusterGram canvas and display the colored green/red similarity table in a popup window.
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/.
DrawClusterGram
,
HierClustNode
, Serialized FormInner classes inherited from class java.awt.Canvas |
java.awt.Canvas.AccessibleAWTCanvas |
Inner classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.AWTTreeLock |
Field Summary | |
private boolean |
addKmeansDataFlag
flag: if cdg.plotMode==mae.PLOT_KMEANS_CLUSTERGRAM) |
private int |
botEdge
|
private int |
boxHeight
size of a data box in the clustergram |
private int |
boxWidth
bottom edge of box array |
private int[] |
boxX
ULHC event hlr [0:nCols-1] |
private int[] |
boxY
ULHC event hlr [0:nRows-1] |
private java.lang.String[] |
colLabel
opt. |
private DrawClusterGram |
dcg
parent class |
private float[] |
dGramDistL
[0:nObj-2] log dist. |
private float[] |
dGramDistR
[0:nObj-2] log dist. |
private float[] |
dGramDistS
[0:nObj-2] log dist. |
private float[] |
dGramEnumOrder
[0:nObj-2] enumeration order |
private float[] |
dGramEOleft
[0:nObj-2] left child enum order |
private float[] |
dGramEOright
[0:nObj-2] right child enum order |
private int[] |
dGramLeftNNbr
[0:nObj-2] Left Node Number |
private int[] |
dGramNodeNbr
[0:nObj-2] Node Number |
private int[] |
dGramRightNNbr
[0:nObj-2] Right Node Number |
private int |
dGramX1
left horizontal size of dendrogram region |
private int |
dGramX2
right horizontal size of dendrogram region |
(package private) int |
dGramZoomMag
zoom in on dendrogram - set by DrawClusterGram checkbox |
private boolean |
didDataSetupFlag
flag: set by setupData() if successful |
private boolean |
drawIntoImageFlag
set if draw clustergram to GIF file |
private java.lang.String |
featuresStr
current gene feature data |
private java.awt.FontMetrics |
fm
font metrics for font |
private java.awt.Font |
font
drawing font |
private int |
fontHeight
|
private int |
fontLeading
|
private int |
fontWidth
|
(package private) boolean |
foundObjFlag
found object row when clicked on it |
private java.lang.String |
genomicDataStr
current gene genomic data |
private int |
guardRows
# of extra rows so cover the viewport |
(package private) int |
iDataV
col to norm by in [0:nDataV-1] |
private boolean |
isBoxSelectedFlag
set by event handler mouse on click |
private int |
leftEdge
left edge of box array |
private int |
leftLabel
left edge of Left label |
(package private) static MAExplorer |
mae
link to global MAExplorer instance |
(package private) static int |
MAX_COLORS
maximum colors used - Dark green to dark red |
private float |
maxDgramDist
max of dGramDistS[] |
(package private) static int |
MIN_CANVAS_HEIGHT
default canvas height |
(package private) static int |
MIN_CANVAS_WIDTH
default canvas width |
private int |
mouseModifiers
set by event handler mouse coords on click |
private int |
nCols
# of columns i.e. |
private int |
nRows
# of rows i.e. |
private float[][] |
objDataV
[0:maxGenes-1][0:nCols-1] normalized data for each object |
private java.lang.String |
oGifFileName
GIF output file if used |
private GeneList |
orderedCL
gene list for rows |
(package private) int |
preferredHeight
preferred height size of entire canvas |
(package private) int |
preferredWidth
preferred width size of entire canvas |
private java.awt.Color[] |
ratioColor
used for color mapping |
private float[] |
ratioRange
used for color mapping |
private int |
rightEdge
right edge of box array |
private java.lang.String[] |
rowLabel
row labels (Master_ID + MasterGeneName) |
private int[] |
rowMID
row MID index |
private int |
scaleMapX
position of scale map X |
private int |
scaleMapY
position of scale map Y |
(package private) int |
selCol
selected column set by event handler mouse on click |
private float |
selDist
distance selected by clicking on dendrogram |
(package private) int |
selMID
set by event handler on click |
(package private) int |
selRow
selected row set by event handler mouse on click |
private boolean |
shortWidthFlag
flag: plot narrower boxes |
(package private) int |
statVertOffset
offset of status canvas if drawing it at top of GIF image canvas, else 0 |
private int |
topEdge
top edge of box array |
private HierClustNode |
tree
hierarchical cluster tree |
private boolean |
useColNbrFlag
flag: 1, 2, 3, ... |
private boolean |
useFullHPStageNameFlag
flag: use full HP stage name for COL name |
private int |
vertLabelX
vertical label ULHC |
private int |
vertLabelY1
top y for vert label |
private int |
vertLabelY2
bottom y for vert label |
private int |
xCursor
x cursor set by event handler mouse coords on click |
private int |
yCursor
y cursor set by event handler mouse coords on click |
Fields inherited from class java.awt.Canvas |
base, nameCounter, serialVersionUID |
Fields inherited from class java.awt.Component |
accessibleContext, actionListenerK, adjustmentListenerK, appContext, background, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, changeSupport, componentListener, componentListenerK, componentOrientation, componentSerializedDataVersion, containerListenerK, cursor, dbg, dropTarget, enabled, eventMask, focusListener, focusListenerK, 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) |
ClusterGramCanvas(MAExplorer mae,
DrawClusterGram dcg,
GeneList orderedCL,
HierClustNode tree)
ClusterGramCanvas() - Constructor to display expresion profile in canvas |
Method Summary | |
private void |
copyGenesInSubtreeToEGL()
copyGenesInSubtreeToEGL() - Copy terminal genes in dendrogram subtree to E.G.L for box that was selected at (selRow,selCol) such that terminal genes LEQ selDist GT 0.0F and dcg.drawDendroGramFlag. |
private void |
drawDendrogram(java.awt.Graphics g,
int r1,
int r2)
drawDendrogram() - draw dendrogram from row r1 to r2. |
(package private) boolean |
drawGifFile(java.lang.String oGifFileName)
drawGifFile() - draw clustergram into Gif image file if in stand-alone mode. |
private void |
drawRow(java.awt.Graphics g,
int r,
float[] dataV)
drawRow() - draw row of boxes, left & right label, save the coords. |
(package private) void |
drawScaleMap(java.awt.Graphics g)
drawScaleMap() - draw the X/Y color scale map. |
private void |
drawSelectedHP(java.awt.Graphics g,
int r1,
int r2)
drawSelectedHP() - draw selected box as white circle if the selected row is within [r1:r2]. |
(package private) void |
drawVerticalLabels(java.awt.Graphics g)
drawVerticalLabels() - Draw the vertical labels of samples |
java.awt.Dimension |
getMinimumSize()
getMinimumSize() - get the minimum preferred size |
java.awt.Dimension |
getPreferredSize()
getPreferredSize() - get the preferred size |
void |
paint(java.awt.Graphics g)
paint() - draw ClusterGram [r1:r2] from scroller percentage and canvas height. |
private boolean |
selectObject(int xC,
int yC)
selectObject() - test mouse cursor to select row or box if within any box |
(package private) void |
setBoxSizes(java.awt.Graphics g)
setBoxSizes() - set box sizes based on font metrics. |
(package private) void |
setCurrentGene(int xCursor,
int yCursor,
int mouseModifiers,
boolean changeCurGeneFlag)
setCurrentGene() - set current gene from (xCursor,yCursor) in ClusterGram. |
(package private) void |
setEGLtoSubTreeGenes(int[] subtreeNbrs)
setEGLtoSubTreeGenes() - Copy genes to E.G.L. |
private java.awt.Color |
setRatioColor(float ratio,
int n)
setRatioColor() - map data ratio to color (used to color a box). |
private void |
setupData()
setupData() - setup additional data arrays for ClusterGram |
(package private) void |
showGeneMsgsAndPlot(int mid,
int selRow)
showGeneMsgsAndPlot() - show quant & genomic data messages in MSG & in plot |
private void |
unpackTreeDgramLists(HierClustNode tree)
unpackTreeDgramLists() - extract dGram arrays for drawing dendrograms |
(package private) void |
updateCurGene(int mid)
updateCurGene() - set current gene by MID from PopupRegistry |
(package private) boolean |
updateData(GeneList orderedCL,
HierClustNode tree)
updateData() - update expression profile with new gene data |
Methods inherited from class java.awt.Canvas |
|
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, areInputMethodsEnabled, bounds, checkGD, checkImage, checkImage, checkWindowClosingException, coalesceEvents, contains, contains, createChildHierarchyEvents, createHierarchyEvents, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, dispatchEventImpl, doLayout, enable, enable, enableEvents, enableInputMethods, eventEnabled, firePropertyChange, getAccessibleIndexInParent, getAccessibleStateSet, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont_NoClientCode, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getInputContext, getInputMethodRequests, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen_NoTreeLock, getLocationOnScreen, getMaximumSize, getName, getNativeContainer, getParent_NoClientCode, getParent, getPeer, getSize, getSize, getToolkit, getToolkitImpl, getTreeLock, getWidth, getWindowForObject, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, initIDs, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isEnabledImpl, isFocusTraversable, isLightweight, isOpaque, isRecursivelyVisible, isShowing, isValid, isVisible, keyDown, keyUp, layout, lightweightPaint, lightweightPrint, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, numListening, paintAll, paintHeavyweightComponents, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, printHeavyweightComponents, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, readObject, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, resetGC, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, update, validate, writeObject |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait |
Field Detail |
static MAExplorer mae
static final int MIN_CANVAS_WIDTH
static final int MIN_CANVAS_HEIGHT
static final int MAX_COLORS
int preferredHeight
int preferredWidth
int statVertOffset
private HierClustNode tree
private DrawClusterGram dcg
private float[][] objDataV
private float maxDgramDist
private float[] dGramDistS
private float[] dGramDistR
private float[] dGramDistL
private float[] dGramEnumOrder
private float[] dGramEOright
private float[] dGramEOleft
private int[] dGramNodeNbr
private int[] dGramRightNNbr
private int[] dGramLeftNNbr
private java.awt.Color[] ratioColor
private float[] ratioRange
private boolean shortWidthFlag
private boolean addKmeansDataFlag
private boolean useColNbrFlag
private boolean useFullHPStageNameFlag
private boolean didDataSetupFlag
boolean foundObjFlag
int dGramZoomMag
private java.awt.Font font
private java.awt.FontMetrics fm
private int fontHeight
private int fontWidth
private int fontLeading
private int guardRows
private int nRows
private int nCols
private GeneList orderedCL
private int dGramX1
private int dGramX2
private int scaleMapX
private int scaleMapY
private int vertLabelX
private int vertLabelY1
private int vertLabelY2
private int leftLabel
private int leftEdge
private int rightEdge
private int topEdge
private int botEdge
private int boxWidth
private int boxHeight
private boolean isBoxSelectedFlag
int selRow
int selCol
int iDataV
private int mouseModifiers
private int xCursor
private int yCursor
int selMID
private float selDist
private java.lang.String featuresStr
private java.lang.String genomicDataStr
private int[] boxX
private int[] boxY
private java.lang.String[] colLabel
private java.lang.String[] rowLabel
private int[] rowMID
private boolean drawIntoImageFlag
private java.lang.String oGifFileName
Constructor Detail |
ClusterGramCanvas(MAExplorer mae, DrawClusterGram dcg, GeneList orderedCL, HierClustNode tree)
mae
- is the instance of MAExplorerdcg
- is the parent windoworderedCL
- is the gene list for rowstree
- is the hierarchical cluster treeunpackTreeDgramLists(HierClustNode)
,
updateData(GeneList, HierClustNode)
Method Detail |
boolean drawGifFile(java.lang.String oGifFileName)
oGifFileName
- is the name of the GIF output file.Component.repaint()
boolean updateData(GeneList orderedCL, HierClustNode tree)
orderedCL
- is the ordered gene list for rowstree
- hierarchical cluster treeGeneList
,
HierClustNode
,
Component.repaint()
,
setupData()
,
unpackTreeDgramLists(HierClustNode)
private void unpackTreeDgramLists(HierClustNode tree)
tree
- hierarchical cluster treeHierClustNode
private void setupData()
Gene.isGeneProperty(int)
,
GeneList
,
Util.cvtValueToStars(float, float, int, boolean)
public java.awt.Dimension getPreferredSize()
getPreferredSize
in class java.awt.Component
public java.awt.Dimension getMinimumSize()
getMinimumSize
in class java.awt.Component
private boolean selectObject(int xC, int yC)
xC
- is the x coordinate selected in the windowyC
- is the y coordinate selected in the windowvoid showGeneMsgsAndPlot(int mid, int selRow)
mid
- is the master gene indexselRow
- is the row selected if not -1MaHybridSample.getSpotDataStatic(int, boolean)
,
SpotFeatures.getSpotFeatures(java.awt.Point, MaHybridSample)
,
SpotFeatures.getSpotGenomicData(java.awt.Point, MaHybridSample)
,
Util.cvf2s(float, int)
,
Util.showFeatures(java.lang.String, java.lang.String)
,
Util.showMsg(java.lang.String)
void updateCurGene(int mid)
mid
- is the master gene indexScrollPane.getScrollPosition()
,
ScrollPane.getViewportSize()
,
ScrollPane.setScrollPosition(int, int)
,
showGeneMsgsAndPlot(int, int)
void setCurrentGene(int xCursor, int yCursor, int mouseModifiers, boolean changeCurGeneFlag)
xCursor
- of current geneyCursor
- of current genemouseModifiers
- when selected the current genechangeCurGeneFlag
- is on if we should call the popup registryPopupRegistry.updateCurGene(int, int, java.lang.Object)
,
Component.repaint()
,
selectObject(int, int)
,
showGeneMsgsAndPlot(int, int)
void setBoxSizes(java.awt.Graphics g)
g
- is graphics contextprivate java.awt.Color setRatioColor(float ratio, int n)
ratio
- is the ratio to use in looking up the colorn
- is the number of colors in mapprivate void drawRow(java.awt.Graphics g, int r, float[] dataV)
g
- is graphics contextr
- is the row in the cluster gramdataV
- is the data vectorGeneList.isMIDinGeneList(int)
,
setRatioColor(float, int)
private void copyGenesInSubtreeToEGL()
HierClustNode.findSubtreeOfNodeNbrs(int)
,
setEGLtoSubTreeGenes(int[])
void setEGLtoSubTreeGenes(int[] subtreeNbrs)
subtreeNbrs
- is the list of genes to be copied to the E.G.L.EditedGeneList.addGeneToEditedCL(int)
private void drawSelectedHP(java.awt.Graphics g, int r1, int r2)
g
- is the graphic contextr1
- starting row that is visibler2
- ending row that is visiblevoid drawVerticalLabels(java.awt.Graphics g)
g
- is the graphic contextvoid drawScaleMap(java.awt.Graphics g)
RED BLACK GREEN <1/8X 1/6X 1/4X 1/2X 1X 2X 4X 6X >8X Selected Row[#row] Master_ID (if Y selected) Selected Col[#col] Sample name (if X & Y selected) Normalization Col[#iDataV] Norm Sample name (if X selected)(if X selected) (if X selected)
g
- is the graphic contextUtil.cvf2s(float, int)
private void drawDendrogram(java.awt.Graphics g, int r1, int r2)
The spacing between terminal nodes is boxHeight. The region for drawing dendrogram is dGramX1 to dGramX2. The 'enum order' is the spacing on particular ordered rows and is fractional for non-terminal nodes. We used the ordered hierarchical cluster data for nodes in [r1:r2]. dGramDist[0:nObj-1] distance between children. dGramDistR[0:nObj-1] distance between Right children. dGramDistL[0:nObj-1] distance between Left children. dGramEnumOrder[0:nObj-1] enumeration order. dGramEOright[0:nObj-1] right child enum order. dGramEOleft[0:nObj-1] left child enum order. dGramNodeNbr[0:nObj-1] - Node Number dGramEOrightNNbr[0:nObj-1] - Right Node Number dGramLeftNNbr[0:nObj-1] - Left Node Number
g
- is the graphic contextr1
- starting row that is visibler1
- ending row that is visiblepublic void paint(java.awt.Graphics g)
paint
in class java.awt.Canvas
g
- is the graphic contextDrawClusterGram.drawScaleMapAndVerticalLabels(java.awt.Graphics)
,
ScrollPane.getHScrollbarHeight()
,
ScrollPane.getVAdjustable()
,
ScrollPane.getViewportSize()
,
WriteGifEncoder
,
WriteGifEncoder.writeFile(java.lang.String)
,
copyGenesInSubtreeToEGL()
,
drawDendrogram(java.awt.Graphics, int, int)
,
drawRow(java.awt.Graphics, int, float[])
,
drawScaleMap(java.awt.Graphics)
,
drawSelectedHP(java.awt.Graphics, int, int)
,
drawVerticalLabels(java.awt.Graphics)
,
Component.repaint()
,
setBoxSizes(java.awt.Graphics)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |