2.17.2: 2011-06-17

net.sf.basedb.clients.web.servlet
Class PlotServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by net.sf.basedb.clients.web.servlet.PlotServlet
All Implemented Interfaces:
Serializable, Servlet, ServletConfig

public final class PlotServlet
extends HttpServlet

This servlet can plot spot data for a bioassay or bioassay set. It uses the JFreePlot package to generate the plots. It accepts the following parameters:

Parameter Required Default value Description
ID yes The SessionControl ID. See Application.getSessionControl(String, String).
bioassayset_id no The ID of the bioassay set to plot. If no value is specified the bioassay_id is required.
bioassay_id if a bioassay set hasn't been specified The ID of the bioassay to plot.
type no scatter The type of plot to create. Supported values are "scatter", "histogram" or "cfplot".
download no false A boolean value. If 1 or true, the browser will ask to save the image on the local disk.
saveAs no If specified, the image is saved as a file in the BASE file structure.
overwrite no false A boolean values, that is used with the "saveAs" parameter. If 1 or true, an existing file will be overwritten with the image.
width no 600 The width of the generated image in pixels. Must be between 100 and 1000 pixels. The default and max width can be configured in the web.xml file.
height no 400 The hieght of the generated image in pixels. Must be between 100 and 800. The default and max height can be configured in the web.xml file.
format no png The format of the image, "png" and "jpg" are the only supported values.
xLog no false A boolean parameter. If 1 or true the logarithm of the x values is calculated before plotting them.
yLog no false A boolean parameter. If 1 or true the logarithm of the y values is calculated before plotting them.
x yes, unless type is "cfplot" The expression to plot on the x axis. Multiple x parameters may be specified to plot multiple series.
y no, unless type is "scatter" The expression to plot on the y axis. Multiple y parameters may be specified to plot multiple series.
filter no An optional filter expression that limits the result returned by the spot query.
title no The title of the plot. If not specified the plot is generated without title.
xLabel no The label on the x-axis. If not specified the plot is generated without label.
yLabel no The label on the y-axis. If not specified the plot is generated without label.
annotation no Can only be used when plotting a bioassay set. The only allowed value so far is "bioassay" which plots the spots for each bioassay in different series and color.
binSize no 1.0 Only used for histogram plots. This is the range of values put into each bin in the histogram. Ie. if the size is 1, the first bin may have values from -5 to -4, the second bin from -4 to -3, and so on.
yAggregate no count Only used for histogram plots. Determines what to plot on the y axis. Allowed values are "count", "mean", "sum", "max", "min", "stdev". If a value other than "count" is used an expression for the y-axis must also be specified.
hiloAggregate no Only used for histogram plots when the yAggregate parameter isn't "count". Allowed values are "hilomaxmin" and "hilostdev". This options adds a high-low bar to each bin that is either the max/min range or the plotted value +/- 1 standard deviation of the values in each bin.

Version:
2.0
Author:
Nicklas
See Also:
Serialized Form
Last modified
$Date: 2010-08-13 10:50:27 +0200 (Fri, 13 Aug 2010) $

Nested Class Summary
private static class PlotServlet.CFResultIterator
          Special implementation of a SqlResultIterator that combines the result from the parent and child into one virtual iterator.
private static class PlotServlet.CFSqlResult
          A single result row that is combined from the parent and child results. 1 --> parent A, 2 --> parent M, 3 --> parent M - child M
 
Field Summary
private  String cacheBase
           
private  String defaultFormat
           
private  int defaultHeight
           
private  int defaultWidth
           
private  int maxHeight
           
private  int maxWidth
           
private static long serialVersionUID
           
 
Constructor Summary
PlotServlet()
           
 
Method Summary
 void doGet(HttpServletRequest request, HttpServletResponse response)
           
 void doPost(HttpServletRequest request, HttpServletResponse response)
          Forwards requests to doGet(HttpServletRequest, HttpServletResponse)
private  JFreeChart generateCFPlot(BioAssay ba, String xLabel, String yLabel)
          Generates a correction-factor plot, which is plotting the MA-data for the parent together with the difference in M between the parent and child.
 void init()
           
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

maxWidth

private int maxWidth

maxHeight

private int maxHeight

defaultWidth

private int defaultWidth

defaultHeight

private int defaultHeight

defaultFormat

private String defaultFormat

cacheBase

private String cacheBase
Constructor Detail

PlotServlet

public PlotServlet()
Method Detail

init

public void init()
          throws ServletException
Overrides:
init in class GenericServlet
Throws:
ServletException

doGet

public void doGet(HttpServletRequest request,
                  HttpServletResponse response)
           throws IOException,
                  ServletException
Overrides:
doGet in class HttpServlet
Throws:
IOException
ServletException

doPost

public void doPost(HttpServletRequest request,
                   HttpServletResponse response)
            throws IOException,
                   ServletException
Forwards requests to doGet(HttpServletRequest, HttpServletResponse)

Overrides:
doPost in class HttpServlet
Throws:
IOException
ServletException

generateCFPlot

private JFreeChart generateCFPlot(BioAssay ba,
                                  String xLabel,
                                  String yLabel)
                           throws Exception
Generates a correction-factor plot, which is plotting the MA-data for the parent together with the difference in M between the parent and child.

Throws:
Exception

2.17.2: 2011-06-17