AFLPgui
Class ScatterGraph
java.lang.Object
|
+--AFLPgui.Graph
|
+--AFLPgui.ScatterGraph
- public class ScatterGraph
- extends Graph
This class provides a way to draw a graph on a graphics object. This
makes it easy for different graphs to be drawn. This one will show
the distribution of peak heights. For every lane, the heighest peak's
value will be plotted. All of the lanes will be plotted at the same
horizontal position. If a lane has more than one peak, a different color
will be used, as opposed to those lanes which have only one peak in
the specified region. The region is a range of sizes, in bp, which
is specified when the graph is drawn.
- See Also:
Graph
Constructor Summary |
ScatterGraph()
Creates a new graph where those lanes with one peak in the defined
region will be black and those with more than one peak will be red. |
ScatterGraph(java.awt.Color singlePeak,
java.awt.Color multiPeak)
Creates a new graph with the specified parameters. |
Method Summary |
void |
drawGraph(java.awt.Graphics g,
int x,
int y,
int width,
int height,
int bottom_border,
double scale,
double minSize,
double maxSize,
DataList lanes)
Draw the scatter graph with the specified properties. |
protected double |
findMax(DataList peakList)
Gives the maximum height for all of the peaks in the given list. |
int |
getPreferredWidth()
Gives the preferred width of this graph. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ScatterGraph
public ScatterGraph()
- Creates a new graph where those lanes with one peak in the defined
region will be black and those with more than one peak will be red.
ScatterGraph
public ScatterGraph(java.awt.Color singlePeak,
java.awt.Color multiPeak)
- Creates a new graph with the specified parameters.
- Parameters:
singlePeak
- the color for a lane that has only one peak in
the region.multiPeak
- the color for a lane that has multiple peaks.
drawGraph
public void drawGraph(java.awt.Graphics g,
int x,
int y,
int width,
int height,
int bottom_border,
double scale,
double minSize,
double maxSize,
DataList lanes)
- Draw the scatter graph with the specified properties.
- Overrides:
drawGraph
in class Graph
- Parameters:
g
- the graphics to draw onx
- the x coordinate of the upper left corner of the graph
area. (The position of the vertical axis)y
- the y coordinate of the upper left corner of the graphwidth
- the width of the graph area.height
- the height of the graphscale
- the scale of the graph, pixel = intensity*scaleminSize
- the minimum size, in bp, that the graph should includemaxSize
- the maximum size, in bp, that the graph should includelanes
- the lanes to include in the graph.
getPreferredWidth
public int getPreferredWidth()
- Gives the preferred width of this graph. Since the scatter graphs
width is independent of the number of lanes, this is useful since
the graph does not need to be very wide
- Overrides:
getPreferredWidth
in class Graph
- Returns:
- gives a value of 20 pixels.
findMax
protected double findMax(DataList peakList)
- Gives the maximum height for all of the peaks in the given list.
- Parameters:
peakList
- the peaks to find the maximum height in.- Returns:
- the largest height value contained by any peak