Class PlotServlet
- java.lang.Object
-
- javax.servlet.GenericServlet
-
- javax.servlet.http.HttpServlet
-
- 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:Plot parameters Parameter Required Default value Description ID yes The SessionControl ID. See Application.getSessionControl(String, String, String, boolean)
.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: 2019-04-11 09:31:26 +0200 (tors, 11 apr. 2019) $
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
PlotServlet.CFResultIterator
Special implementation of aSqlResultIterator
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
Fields Modifier and Type Field Description private String
cacheBase
private String
defaultFormat
private int
defaultHeight
private int
defaultWidth
private int
maxHeight
private int
maxWidth
private static long
serialVersionUID
-
Constructor Summary
Constructors Constructor Description PlotServlet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
doGet(HttpServletRequest request, HttpServletResponse response)
void
doPost(HttpServletRequest request, HttpServletResponse response)
Forwards requests todoGet(HttpServletRequest, HttpServletResponse)
private org.jfree.chart.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
-
-
-
-
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
-
-
Method Detail
-
init
public void init() throws ServletException
- Overrides:
init
in classGenericServlet
- Throws:
ServletException
-
doGet
public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
- Overrides:
doGet
in classHttpServlet
- Throws:
IOException
ServletException
-
doPost
public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
Forwards requests todoGet(HttpServletRequest, HttpServletResponse)
- Overrides:
doPost
in classHttpServlet
- Throws:
IOException
ServletException
-
-