1 | <%-- $Id: index.jsp 4486 2008-09-08 06:58:19Z nicklas $ |
---|
2 | ------------------------------------------------------------------ |
---|
3 | BioArray Software Environment (BASE) - http:// base.thep.lu.se/ |
---|
4 | |
---|
5 | This file is part of BASE - BioArray Software Environment. |
---|
6 | Available at http://base.thep.lu.se/ |
---|
7 | |
---|
8 | BASE is free software; you can redistribute it and/or |
---|
9 | modify it under the terms of the GNU General Public License |
---|
10 | as published by the Free Software Foundation; either version 3 |
---|
11 | of the License, or (at your option) any later version. |
---|
12 | |
---|
13 | BASE is distributed in the hope that it will be useful, |
---|
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
16 | GNU General Public License for more details. |
---|
17 | |
---|
18 | You should have received a copy of the GNU General Public License |
---|
19 | along with this program; if not, write to the Free Software |
---|
20 | Foundation, Inc., 59 Temple Place - Suite 330, |
---|
21 | Boston, MA 02111-1307, USA. |
---|
22 | ------------------------------------------------------------------ |
---|
23 | |
---|
24 | @author Nicklas |
---|
25 | @version 2.0 |
---|
26 | --%> |
---|
27 | <%@ page session="false" |
---|
28 | import="net.sf.basedb.core.SessionControl" |
---|
29 | import="net.sf.basedb.core.DbControl" |
---|
30 | import="net.sf.basedb.core.Experiment" |
---|
31 | import="net.sf.basedb.core.BioAssaySet" |
---|
32 | import="net.sf.basedb.core.BioAssay" |
---|
33 | import="net.sf.basedb.core.RawDataType" |
---|
34 | import="net.sf.basedb.core.RawDataProperty" |
---|
35 | import="net.sf.basedb.core.Formula" |
---|
36 | import="net.sf.basedb.core.AnnotationType" |
---|
37 | import="net.sf.basedb.core.ItemQuery" |
---|
38 | import="net.sf.basedb.core.ItemResultList" |
---|
39 | import="net.sf.basedb.core.Include" |
---|
40 | import="net.sf.basedb.core.Permission" |
---|
41 | import="net.sf.basedb.core.Item" |
---|
42 | import="net.sf.basedb.core.query.Orders" |
---|
43 | import="net.sf.basedb.core.query.Hql" |
---|
44 | import="net.sf.basedb.core.query.Restrictions" |
---|
45 | import="net.sf.basedb.core.query.Restriction" |
---|
46 | import="net.sf.basedb.core.query.Expressions" |
---|
47 | import="net.sf.basedb.clients.web.Base" |
---|
48 | import="net.sf.basedb.clients.web.DynamicUtil" |
---|
49 | import="net.sf.basedb.clients.web.util.HTML" |
---|
50 | import="net.sf.basedb.util.Values" |
---|
51 | import="net.sf.basedb.clients.web.WebException" |
---|
52 | import="net.sf.basedb.clients.web.taglib.table.TableColumn" |
---|
53 | import="java.util.List" |
---|
54 | import="java.util.LinkedList" |
---|
55 | %> |
---|
56 | <%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> |
---|
57 | <%@ taglib prefix="t" uri="/WEB-INF/tab.tld" %> |
---|
58 | <%! |
---|
59 | private static void addFormulaOption(StringBuilder options, String formula, String title, String description) |
---|
60 | { |
---|
61 | options.append("<option value=\"").append(HTML.encodeTags(formula)).append("\""); |
---|
62 | options.append(" title=\"").append(HTML.encodeTags(description)).append("\""); |
---|
63 | options.append(">").append(HTML.encodeTags(title)).append("\n"); |
---|
64 | } |
---|
65 | |
---|
66 | %> |
---|
67 | <% |
---|
68 | final SessionControl sc = Base.getExistingSessionControl(pageContext, true); |
---|
69 | final float scale = Base.getScale(sc); |
---|
70 | final String ID = sc.getId(); |
---|
71 | final DbControl dc = sc.newDbControl(); |
---|
72 | try |
---|
73 | { |
---|
74 | int bioAssaySetId = Values.getInt(request.getParameter("bioassayset_id")); |
---|
75 | int bioAssayId = Values.getInt(request.getParameter("bioassay_id")); |
---|
76 | BioAssay ba = bioAssayId == 0 ? null : BioAssay.getById(dc, bioAssayId); |
---|
77 | BioAssaySet bas = ba == null ? BioAssaySet.getById(dc, bioAssaySetId) : ba.getBioAssaySet(); |
---|
78 | RawDataType rdt = bas.getRawDataType(); |
---|
79 | Experiment experiment = bas.getExperiment(); |
---|
80 | int maxRawMappings = bas.getMaxRawMappingsForSpot(); |
---|
81 | |
---|
82 | List<TableColumn> formulas = new LinkedList<TableColumn>(); |
---|
83 | DynamicUtil.addSpotColumns(formulas, dc, rdt.getChannels()); |
---|
84 | DynamicUtil.addFormulaColumns(formulas, dc, rdt, Formula.Type.COLUMN_EXPRESSION, "", "", maxRawMappings == 1); |
---|
85 | DynamicUtil.addExtraColumns(formulas, dc, bas, "ev", "#", "[Xtra] "); |
---|
86 | if (maxRawMappings == 1) |
---|
87 | { |
---|
88 | DynamicUtil.addRawDataColumns(formulas, dc, rdt, "", "", "[Raw] "); |
---|
89 | } |
---|
90 | |
---|
91 | StringBuilder formulaOptions = new StringBuilder(); |
---|
92 | for (TableColumn tc : formulas) |
---|
93 | { |
---|
94 | if (tc.getJepExpression() != null && tc.getDatatype().isNumerical()) |
---|
95 | { |
---|
96 | String jepExpression = tc.getJepExpression(); |
---|
97 | addFormulaOption(formulaOptions, jepExpression, tc.getTitle(), tc.getDescription()); |
---|
98 | } |
---|
99 | } |
---|
100 | |
---|
101 | StringBuilder filterOptions = new StringBuilder(); |
---|
102 | ItemQuery<Formula> formulaQuery = Formula.getQuery(Formula.Type.COLUMN_RESTRICTION, rdt); |
---|
103 | formulaQuery.order(Orders.asc(Hql.property("name"))); |
---|
104 | formulaQuery.include(Include.MINE, Include.SHARED, Include.IN_PROJECT, Include.OTHERS); |
---|
105 | for (Formula formula : formulaQuery.list(dc)) |
---|
106 | { |
---|
107 | String f = formula.getFormulas().get(0); |
---|
108 | if (maxRawMappings == 1 || !f.contains("raw(")) |
---|
109 | { |
---|
110 | addFormulaOption(filterOptions, f, |
---|
111 | formula.getName(), formula.getDescription()); |
---|
112 | } |
---|
113 | } |
---|
114 | |
---|
115 | // Annnotations -- experimental factors and bioassay annotations |
---|
116 | final ItemQuery<AnnotationType> query = AnnotationType.getQuery(null); |
---|
117 | query.join(Hql.leftJoin("experiments", Item.EXPERIMENT.getAlias())); |
---|
118 | query.join(Hql.innerJoin("itemTypes", "itemType")); |
---|
119 | Restriction ef = Restrictions.eq( |
---|
120 | Hql.alias(Item.EXPERIMENT.getAlias()), |
---|
121 | Hql.entity(experiment) |
---|
122 | ); |
---|
123 | Restriction baa = Restrictions.eq( |
---|
124 | Hql.alias("itemType"), |
---|
125 | Expressions.integer(Item.BIOASSAY.getValue()) |
---|
126 | ); |
---|
127 | query.restrict(Restrictions.or(ef, baa)); |
---|
128 | query.include(Include.MINE, Include.SHARED, Include.IN_PROJECT, Include.OTHERS); |
---|
129 | query.order(Orders.asc(Hql.property("name"))); |
---|
130 | List<AnnotationType> experimentalFactors = query.list(dc); |
---|
131 | |
---|
132 | String title = HTML.encodeTags("Plot " + (ba == null ? bas.getName() : ba.getName())); |
---|
133 | |
---|
134 | final boolean hasCreateFilePermission = sc.hasPermission(Permission.CREATE, Item.FILE); |
---|
135 | |
---|
136 | %> |
---|
137 | <base:page type="popup" title="<%=title%>"> |
---|
138 | <base:head styles="tabcontrol.css" scripts="tabcontrol.js"> |
---|
139 | <script language="JavaScript"> |
---|
140 | |
---|
141 | function validate() |
---|
142 | { |
---|
143 | var plotType = getPlotType(); |
---|
144 | if (plotType == 'scatter') |
---|
145 | { |
---|
146 | return validateScatterPlot(); |
---|
147 | } |
---|
148 | else if (plotType == 'histogram') |
---|
149 | { |
---|
150 | return validateHistogramPlot(); |
---|
151 | } |
---|
152 | return false; |
---|
153 | } |
---|
154 | function validateScatterPlot() |
---|
155 | { |
---|
156 | var frm = document.forms['scatter']; |
---|
157 | if (Main.trimString(frm.yFormula.value) == '') |
---|
158 | { |
---|
159 | alert("You must enter an expression for the Y axis"); |
---|
160 | frm.yFormula.focus(); |
---|
161 | return false; |
---|
162 | } |
---|
163 | else if (Main.trimString(frm.xFormula.value) == '') |
---|
164 | { |
---|
165 | alert("You must enter an expression for the X axis"); |
---|
166 | frm.xFormula.focus(); |
---|
167 | return false; |
---|
168 | } |
---|
169 | return true; |
---|
170 | } |
---|
171 | function validateHistogramPlot() |
---|
172 | { |
---|
173 | var frm = document.forms['histogram']; |
---|
174 | var yAggregate = Forms.getCheckedRadio(frm.yAggregate).value; |
---|
175 | if (Main.trimString(frm.xFormula.value) == '') |
---|
176 | { |
---|
177 | alert("You must enter an expression for the X axis"); |
---|
178 | frm.xFormula.focus(); |
---|
179 | return false; |
---|
180 | } |
---|
181 | else if (yAggregate != 'count' && Main.trimString(frm.yFormula.value) == '') |
---|
182 | { |
---|
183 | alert("You must enter an expression for the Y axis"); |
---|
184 | frm.yFormula.focus(); |
---|
185 | return false; |
---|
186 | } |
---|
187 | return true; |
---|
188 | } |
---|
189 | |
---|
190 | var plotType = 'scatter'; |
---|
191 | function getPlotType() |
---|
192 | { |
---|
193 | return plotType; |
---|
194 | } |
---|
195 | |
---|
196 | function switchTab(tabControlId, tabId) |
---|
197 | { |
---|
198 | if (tabId == 'scatter' || tabId == 'histogram') |
---|
199 | { |
---|
200 | plotType = tabId; |
---|
201 | } |
---|
202 | TabControl.setActiveTab(tabControlId, tabId); |
---|
203 | } |
---|
204 | |
---|
205 | function presetOnChange(list, formula, label) |
---|
206 | { |
---|
207 | var index = list.selectedIndex; |
---|
208 | formula.value = list[index].value; |
---|
209 | if (label && list[index].value != '') label.value = list[index].text; |
---|
210 | list.selectedIndex = 0; |
---|
211 | } |
---|
212 | |
---|
213 | function aggregateOnChange() |
---|
214 | { |
---|
215 | var frm = document.forms['histogram']; |
---|
216 | var selected = Forms.getCheckedRadio(frm.yAggregate); |
---|
217 | var isCount = selected.value == 'count'; |
---|
218 | frm.yFormula.disabled = isCount; |
---|
219 | frm.yPresets.disabled = isCount; |
---|
220 | frm.yLog.disabled = isCount; |
---|
221 | for (var i = 0; i < frm.hiloAggregate.length; i++) |
---|
222 | { |
---|
223 | frm.hiloAggregate[i].disabled = isCount; |
---|
224 | } |
---|
225 | if (isCount) |
---|
226 | { |
---|
227 | Main.removeClass(frm.yFormula, 'required'); |
---|
228 | frm.yLabel.value = 'Count'; |
---|
229 | } |
---|
230 | else |
---|
231 | { |
---|
232 | Main.addClass(frm.yFormula, 'required'); |
---|
233 | var yPreset = frm.yPresets[frm.yPresets.selectedIndex]; |
---|
234 | if (yPreset.value != '') frm.yLabel.value = yPreset.text; |
---|
235 | } |
---|
236 | } |
---|
237 | |
---|
238 | function annotationOnChange(list) |
---|
239 | { |
---|
240 | var frm = document.forms['plot']; |
---|
241 | var selected = list[list.selectedIndex]; |
---|
242 | var value = selected.value && selected.value != '$' ? selected.text : ''; |
---|
243 | value = value.replace('\[A\] ', ''); |
---|
244 | frm.subTitle.value = value; |
---|
245 | |
---|
246 | var annotationFrm = document.forms['annotation']; |
---|
247 | if (selected.value.substring(0, 1) == '$') |
---|
248 | { |
---|
249 | annotationFrm.annotationExp.disabled = true; |
---|
250 | } |
---|
251 | else |
---|
252 | { |
---|
253 | if (selected.value) |
---|
254 | { |
---|
255 | annotationFrm.annotationExp.value = selected.value; |
---|
256 | } |
---|
257 | annotationFrm.annotationExp.disabled = false; |
---|
258 | annotationFrm.annotationExp.focus(); |
---|
259 | } |
---|
260 | } |
---|
261 | |
---|
262 | function annotationExpressionOnChange() |
---|
263 | { |
---|
264 | var annotationFrm = document.forms['annotation']; |
---|
265 | annotationFrm.annotationPresets.selectedIndex = annotationFrm.annotationPresets.length-1; |
---|
266 | } |
---|
267 | |
---|
268 | function generatePlotUrl(fullSize) |
---|
269 | { |
---|
270 | if (validate()) |
---|
271 | { |
---|
272 | var plotFrm = document.forms['plot']; |
---|
273 | var url = 'plot?ID=<%=ID%>&bioassayset_id=<%=bioAssaySetId%>&bioassay_id=<%=bioAssayId%>'; |
---|
274 | url += '&title='+Main.encodeURI(plotFrm.title.value); |
---|
275 | url += '&subTitle='+Main.encodeURI(plotFrm.subTitle.value); |
---|
276 | if (fullSize) |
---|
277 | { |
---|
278 | url += '&width='+plotFrm.width.value; |
---|
279 | url += '&height='+plotFrm.height.value; |
---|
280 | } |
---|
281 | |
---|
282 | var filterFrm = document.forms['filter']; |
---|
283 | if (filterFrm.filter.value != '') |
---|
284 | { |
---|
285 | url += '&filter='+Main.encodeURI(filterFrm.filter.value); |
---|
286 | } |
---|
287 | |
---|
288 | var annotationFrm = document.forms['annotation']; |
---|
289 | var annotation = ''; |
---|
290 | if (!annotationFrm.annotationExp.disabled) |
---|
291 | { |
---|
292 | if (annotationFrm.annotationExp.value) |
---|
293 | { |
---|
294 | annotation = '=' + annotationFrm.annotationExp.value; |
---|
295 | } |
---|
296 | } |
---|
297 | else |
---|
298 | { |
---|
299 | annotation = annotationFrm.annotationPresets[annotationFrm.annotationPresets.selectedIndex].value.substring(1); |
---|
300 | } |
---|
301 | if (annotation) |
---|
302 | { |
---|
303 | url += '&annotation='+Main.encodeURI(annotation); |
---|
304 | } |
---|
305 | |
---|
306 | var plotType = getPlotType(); |
---|
307 | if (plotType == 'scatter') |
---|
308 | { |
---|
309 | var frm = document.forms['scatter']; |
---|
310 | url += '&type=scatter'; |
---|
311 | url += '&x='+Main.encodeURI(frm.xFormula.value); |
---|
312 | url += '&xLog='+(frm.xLog.checked ? 1 : 0); |
---|
313 | url += '&xLabel='+Main.encodeURI(frm.xLabel.value); |
---|
314 | url += '&y='+Main.encodeURI(frm.yFormula.value); |
---|
315 | url += '&yLog='+(frm.yLog.checked ? 1 : 0); |
---|
316 | url += '&yLabel='+Main.encodeURI(frm.yLabel.value); |
---|
317 | } |
---|
318 | else |
---|
319 | { |
---|
320 | var frm = document.forms['histogram']; |
---|
321 | var yAggregate = Forms.getCheckedRadio(frm.yAggregate).value; |
---|
322 | url += '&type=histogram'; |
---|
323 | url += '&x='+Main.encodeURI(frm.xFormula.value); |
---|
324 | url += '&xLog='+(frm.xLog.checked ? 1 : 0); |
---|
325 | url += '&xLabel='+Main.encodeURI(frm.xLabel.value); |
---|
326 | url += '&binSize='+Main.encodeURI(frm.binSize.value); |
---|
327 | url += '&yAggregate='+yAggregate; |
---|
328 | if (yAggregate != 'count') |
---|
329 | { |
---|
330 | url += '&y='+Main.encodeURI(frm.yFormula.value); |
---|
331 | url += '&yLog='+(frm.yLog.checked ? 1 : 0); |
---|
332 | url += '&hiloAggregate='+Forms.getCheckedRadio(frm.hiloAggregate).value |
---|
333 | } |
---|
334 | url += '&yLabel='+Main.encodeURI(frm.yLabel.value); |
---|
335 | } |
---|
336 | return url; |
---|
337 | } |
---|
338 | } |
---|
339 | |
---|
340 | function openExpressionBuilder(title, frmName, inputName, formulaType) |
---|
341 | { |
---|
342 | if (!document.forms[frmName][inputName].disabled) |
---|
343 | { |
---|
344 | var restrictions = formulaType == '<%=Formula.Type.COLUMN_RESTRICTION.name()%>'; |
---|
345 | Main.expressionBuilder('<%=ID%>', title, frmName, inputName, formulaType, '<%=rdt.getId()%>', <%=rdt.getChannels()%>, restrictions, <%=bas.getId()%>); |
---|
346 | } |
---|
347 | } |
---|
348 | |
---|
349 | function previewPlot() |
---|
350 | { |
---|
351 | var url = generatePlotUrl(false); |
---|
352 | if (url) |
---|
353 | { |
---|
354 | url += '&width=600&height=400'; |
---|
355 | var image = document.getElementById('preview'); |
---|
356 | if (image.src.indexOf('plot_select') == -1) |
---|
357 | { |
---|
358 | var background = document.getElementById('background'); |
---|
359 | background.src = image.src; |
---|
360 | } |
---|
361 | image.src = getRoot()+'images/plot_generating.gif'; |
---|
362 | // Otherwise, the browser refuses to display the 'plot_generating.gif' while we are waiting. |
---|
363 | //setTimeout('changePreviewImage()', 100); |
---|
364 | image.realImg = new Image(); |
---|
365 | image.realImg.onload = changePreviewImage; |
---|
366 | image.realImg.src = url; |
---|
367 | } |
---|
368 | } |
---|
369 | |
---|
370 | function changePreviewImage() |
---|
371 | { |
---|
372 | var image = document.getElementById('preview'); |
---|
373 | image.src = image.realImg.src; |
---|
374 | image.realImg = null; |
---|
375 | } |
---|
376 | |
---|
377 | function viewPlot() |
---|
378 | { |
---|
379 | var url = generatePlotUrl(true); |
---|
380 | if (url) |
---|
381 | { |
---|
382 | var frm = document.forms['plot']; |
---|
383 | var width = parseInt(frm.width.value); |
---|
384 | var height = parseInt(frm.height.value); |
---|
385 | if (!width || width < 600) width = 600; |
---|
386 | if (!height || height < 400) height = 400; |
---|
387 | Main.openPopup('view.jsp?ID=<%=ID%>&title='+Main.encodeURI(frm.title.value), 'ViewPlot', width+50, height+100); |
---|
388 | } |
---|
389 | } |
---|
390 | |
---|
391 | function downloadPlot() |
---|
392 | { |
---|
393 | var url = generatePlotUrl(true); |
---|
394 | if (url) |
---|
395 | { |
---|
396 | Main.openPopup('download.jsp?ID=<%=ID%>', 'DownloadPlot', 500, 260); |
---|
397 | } |
---|
398 | } |
---|
399 | |
---|
400 | function savePlotAs() |
---|
401 | { |
---|
402 | var url = generatePlotUrl(true); |
---|
403 | if (url) |
---|
404 | { |
---|
405 | Main.openPopup('save_as.jsp?ID=<%=ID%>', 'SavePlotAs', 500, 260); |
---|
406 | } |
---|
407 | } |
---|
408 | |
---|
409 | function init() |
---|
410 | { |
---|
411 | aggregateOnChange(); |
---|
412 | } |
---|
413 | </script> |
---|
414 | </base:head> |
---|
415 | <base:body onload="init()"> |
---|
416 | |
---|
417 | <h3 class="docked"><%=title%> <base:help tabcontrol="plotType" /></h3> |
---|
418 | <div class="boxed"> |
---|
419 | |
---|
420 | <table border="0" cellspacing="0" cellpadding="2" width="100%"> |
---|
421 | <tr valign="bottom"> |
---|
422 | <td> |
---|
423 | <form name="plot"> |
---|
424 | <table class="form"> |
---|
425 | <tr> |
---|
426 | <td class="prompt">Plot title</td> |
---|
427 | <td colspan="2"><input type="text" class="text" size="30" maxlength="255" name="title" |
---|
428 | value="<%=HTML.encodeTags(ba == null ? bas.getName() : ba.getName())%>"></td> |
---|
429 | </tr> |
---|
430 | <tr> |
---|
431 | <td class="prompt">Subtitle</td> |
---|
432 | <td colspan="2"><input type="text" class="text" size="30" maxlength="255" name="subTitle" |
---|
433 | value=""></td> |
---|
434 | </tr> |
---|
435 | <tr> |
---|
436 | <td class="prompt">Width</td> |
---|
437 | <td><input type="text" class="text" size="12" maxlength="10" name="width" |
---|
438 | value="800" onkeypress="return Numbers.integerOnly(event)"></td> |
---|
439 | <td rowspan="2" valign="center">(not used by preview)</td> |
---|
440 | </tr> |
---|
441 | <tr> |
---|
442 | <td class="prompt">Height</td> |
---|
443 | <td><input type="text" class="text" size="12" maxlength="10" name="height" |
---|
444 | value="600" onkeypress="return Numbers.integerOnly(event)"></td> |
---|
445 | </tr> |
---|
446 | </table> |
---|
447 | </form> |
---|
448 | <p> |
---|
449 | |
---|
450 | <t:tabcontrol id="plotType" style="<%="width: "+(int)(scale*340)+"px;"%>" contentstyle="<%="height: "+(int)(scale*340)+"px;"%>" |
---|
451 | switch="switchTab"> |
---|
452 | <t:tab id="scatter" title="Scatter plot" helpid="plotter.scatterplot" |
---|
453 | tooltip="Create a scatter plot"> |
---|
454 | <form name="scatter"> |
---|
455 | <table border="0" cellspacing="0" cellpadding="2" class="form"> |
---|
456 | <tr> |
---|
457 | <td class="prompt" colspan="3">Y-axis</td> |
---|
458 | </tr> |
---|
459 | <tr> |
---|
460 | <td> Presets</td> |
---|
461 | <td colspan="2"> |
---|
462 | <select name="yPresets" style="width: 20em;" |
---|
463 | onchange="presetOnChange(this, this.form.yFormula, this.form.yLabel)" |
---|
464 | > |
---|
465 | <option value="">- select from list or enter formula below - |
---|
466 | <%=formulaOptions.toString()%> |
---|
467 | </select> |
---|
468 | </td> |
---|
469 | </tr> |
---|
470 | <tr> |
---|
471 | <td> Expression</td> |
---|
472 | <td><input type="text" class="text required" size="30" maxlength="255" name="yFormula"></td> |
---|
473 | <td> |
---|
474 | <base:button |
---|
475 | title="" |
---|
476 | image="expression_builder.gif" |
---|
477 | tooltip="Use the Expression builder" |
---|
478 | onclick="openExpressionBuilder('Y-axis expression', 'scatter', 'yFormula', 'COLUMN_EXPRESSION')" |
---|
479 | /> |
---|
480 | </td> |
---|
481 | </tr> |
---|
482 | <tr> |
---|
483 | <td> Label</td> |
---|
484 | <td colspan="2"><input type="text" class="text" size="30" maxlength="255" name="yLabel"></td> |
---|
485 | </tr> |
---|
486 | <tr> |
---|
487 | <td> Log scale</td> |
---|
488 | <td colspan="2"><input type="checkbox" name="yLog" value="1"></td> |
---|
489 | </tr> |
---|
490 | <tr> |
---|
491 | <td class="prompt" colspan="3">X-axis</td> |
---|
492 | </tr> |
---|
493 | <tr> |
---|
494 | <td>Presets</td> |
---|
495 | <td colspan="2"> |
---|
496 | <select name="xPresets" style="width: 20em;" |
---|
497 | onchange="presetOnChange(this, this.form.xFormula, this.form.xLabel)" |
---|
498 | > |
---|
499 | <option value="">- select from list or enter formula below - |
---|
500 | <%=formulaOptions.toString()%> |
---|
501 | </select> |
---|
502 | </td> |
---|
503 | </tr> |
---|
504 | <tr> |
---|
505 | <td>Expression</td> |
---|
506 | <td><input type="text" class="text required" size="30" maxlength="255" name="xFormula"></td> |
---|
507 | <td> |
---|
508 | <base:button |
---|
509 | title="" |
---|
510 | image="expression_builder.gif" |
---|
511 | tooltip="Use the Expression builder" |
---|
512 | onclick="openExpressionBuilder('X-axis expression', 'scatter', 'xFormula', 'COLUMN_EXPRESSION')" |
---|
513 | /> |
---|
514 | </td> |
---|
515 | </tr> |
---|
516 | <tr> |
---|
517 | <td>Label</td> |
---|
518 | <td colspan="2"><input type="text" class="text" size="30" maxlength="255" name="xLabel"></td> |
---|
519 | </tr> |
---|
520 | <tr> |
---|
521 | <td>Log scale</td> |
---|
522 | <td colspan="2"><input type="checkbox" name="xLog" value="1"></td> |
---|
523 | </tr> |
---|
524 | </table> |
---|
525 | </form> |
---|
526 | </t:tab> |
---|
527 | |
---|
528 | <t:tab id="histogram" title="Histogram plot" helpid="plotter.histogram" |
---|
529 | tooltip="Create a histogram plot"> |
---|
530 | <form name="histogram"> |
---|
531 | <table border="0" cellspacing="0" cellpadding="2" class="form"> |
---|
532 | <tr> |
---|
533 | <td class="prompt" >Y-axis</td> |
---|
534 | <td colspan="2"> |
---|
535 | <input type="radio" name="yAggregate" value="count" checked onchange="aggregateOnChange()"> Count |
---|
536 | <input type="radio" name="yAggregate" value="mean" onchange="aggregateOnChange()"> Mean |
---|
537 | </td> |
---|
538 | </tr> |
---|
539 | <tr> |
---|
540 | <td> Hi-lo</td> |
---|
541 | <td colspan="2"> |
---|
542 | <input type="radio" name="hiloAggregate" value="" checked> None |
---|
543 | <input type="radio" name="hiloAggregate" value="hilomaxmin"> Min/Max |
---|
544 | <input type="radio" name="hiloAggregate" value="hilostdev"> Stdev |
---|
545 | </td> |
---|
546 | </tr> |
---|
547 | <tr> |
---|
548 | <td> Presets</td> |
---|
549 | <td colspan="2"> |
---|
550 | <select name="yPresets" style="width: 20em;" |
---|
551 | onchange="presetOnChange(this, this.form.yFormula, this.form.yLabel)" |
---|
552 | disabled |
---|
553 | > |
---|
554 | <option value="">- select from list or enter formula below - |
---|
555 | <%=formulaOptions.toString()%> |
---|
556 | </select> |
---|
557 | </td> |
---|
558 | </tr> |
---|
559 | <tr> |
---|
560 | <td> Expression</td> |
---|
561 | <td><input type="text" class="text" size="30" maxlength="255" name="yFormula" disabled></td> |
---|
562 | <td> |
---|
563 | <base:button |
---|
564 | title="" |
---|
565 | image="expression_builder.gif" |
---|
566 | tooltip="Use the Expression builder" |
---|
567 | onclick="openExpressionBuilder('Y-axis expression', 'histogram', 'yFormula', 'COLUMN_EXPRESSION')" |
---|
568 | /> |
---|
569 | </td> |
---|
570 | </tr> |
---|
571 | |
---|
572 | <tr> |
---|
573 | <td> Label</td> |
---|
574 | <td colspan="2"><input type="text" class="text" size="30" maxlength="255" |
---|
575 | name="yLabel" value="Count"></td> |
---|
576 | </tr> |
---|
577 | <tr> |
---|
578 | <td> Log scale</td> |
---|
579 | <td colspan="2"><input type="checkbox" name="yLog" value="1"></td> |
---|
580 | </tr> |
---|
581 | <tr> |
---|
582 | <td class="prompt" colspan="3">X-axis</td> |
---|
583 | </tr> |
---|
584 | <tr> |
---|
585 | <td>Presets</td> |
---|
586 | <td colspan="2"> |
---|
587 | <select name="xPresets" style="width: 20em;" |
---|
588 | onchange="presetOnChange(this, this.form.xFormula, this.form.xLabel)" |
---|
589 | > |
---|
590 | <option value="">- select from list or enter formula below - |
---|
591 | <%=formulaOptions.toString()%> |
---|
592 | </select> |
---|
593 | </td> |
---|
594 | </tr> |
---|
595 | <tr> |
---|
596 | <td>Expression</td> |
---|
597 | <td><input type="text" class="text required" size="30" |
---|
598 | maxlength="255" name="xFormula"></td> |
---|
599 | <td> |
---|
600 | <base:button |
---|
601 | title="" |
---|
602 | image="expression_builder.gif" |
---|
603 | tooltip="Use the Expression builder" |
---|
604 | onclick="openExpressionBuilder('X-axis expression', 'histogram', 'xFormula', 'COLUMN_EXPRESSION')" |
---|
605 | /> |
---|
606 | </td> |
---|
607 | </tr> |
---|
608 | <tr> |
---|
609 | <td>Label</td> |
---|
610 | <td colspan="2"><input type="text" class="text" size="30" maxlength="255" name="xLabel"></td> |
---|
611 | </tr> |
---|
612 | <tr> |
---|
613 | <td>Log scale</td> |
---|
614 | <td colspan="2"><input type="checkbox" name="xLog" value="1"></td> |
---|
615 | </tr> |
---|
616 | <tr> |
---|
617 | <td>Bin size</td> |
---|
618 | <td colspan="2"><input type="text" class="text" name="binSize" value="1"></td> |
---|
619 | </tr> |
---|
620 | </table> |
---|
621 | </form> |
---|
622 | </t:tab> |
---|
623 | |
---|
624 | <t:tab id="filter" title="Filter" helpid="plotter.filter" |
---|
625 | tooltip="Specify a filter for spots that should be included in the plot"> |
---|
626 | <form name="filter"> |
---|
627 | <table border="0" cellspacing="0" cellpadding="2" class="form"> |
---|
628 | <tr> |
---|
629 | <td class="prompt" colspan="2">Filter</td> |
---|
630 | </tr> |
---|
631 | <tr> |
---|
632 | <td> Presets</td> |
---|
633 | <td colspan="2"> |
---|
634 | <select name="filterPresets" style="width: 20em;" |
---|
635 | onchange="presetOnChange(this, this.form.filter, null)" |
---|
636 | > |
---|
637 | <option value="">- select from list or enter formula below - |
---|
638 | <%=filterOptions.toString()%> |
---|
639 | </select> |
---|
640 | </td> |
---|
641 | </tr> |
---|
642 | <tr> |
---|
643 | <td> Expression</td> |
---|
644 | <td><input type="text" class="text" size="30" maxlength="255" name="filter"></td> |
---|
645 | <td> |
---|
646 | <base:button |
---|
647 | title="" |
---|
648 | image="expression_builder.gif" |
---|
649 | tooltip="Use the Expression builder" |
---|
650 | onclick="openExpressionBuilder('Filter expression', 'filter', 'filter', 'COLUMN_RESTRICTION')" |
---|
651 | /> |
---|
652 | </td> |
---|
653 | </tr> |
---|
654 | </table> |
---|
655 | </form> |
---|
656 | </t:tab> |
---|
657 | |
---|
658 | <t:tab id="annotation" title="Annotation" helpid="plotter.annotation" |
---|
659 | tooltip="Specify a property or expression for sub-grouping the plotted values"> |
---|
660 | <form name="annotation"> |
---|
661 | |
---|
662 | <table border="0" cellspacing="0" cellpadding="2" class="form"> |
---|
663 | <tr> |
---|
664 | <td class="prompt" colspan="2">Annotation</td> |
---|
665 | </tr> |
---|
666 | <tr> |
---|
667 | <td> Presets</td> |
---|
668 | <td colspan="2"> |
---|
669 | <select name="annotationPresets" onchange="annotationOnChange(this)"> |
---|
670 | <option value="$">- none - |
---|
671 | <% |
---|
672 | if (ba == null) |
---|
673 | { |
---|
674 | %> |
---|
675 | <option value="$bioassay">Bioassay |
---|
676 | <option value="$spots">Spots |
---|
677 | <option value="$arrayDesign.name">Array design |
---|
678 | <option value="$software.name">Software |
---|
679 | <option value="$protocol.name">Protocol |
---|
680 | <option value="$scan.scanner.name">Scanner |
---|
681 | <option value="$scan.protocol.name">Scanning protocol |
---|
682 | <option value="$scan.hybridization.protocol.name">Hybridization protocol |
---|
683 | <option value="$scan.hybridization.creationEvent.eventDate">Hybridization date |
---|
684 | <option value="" disabled>- annotations - |
---|
685 | <% |
---|
686 | for (AnnotationType at : experimentalFactors) |
---|
687 | { |
---|
688 | %> |
---|
689 | <option value="$<%=at.getId()%>">[A] <%=HTML.encodeTags(at.getName())%> |
---|
690 | <% |
---|
691 | } |
---|
692 | } |
---|
693 | %> |
---|
694 | <option value="" disabled>- expressions - |
---|
695 | <%=filterOptions.toString()%> |
---|
696 | <option value="">Other... |
---|
697 | </select> |
---|
698 | </td> |
---|
699 | </tr> |
---|
700 | <tr> |
---|
701 | <td> Expression</td> |
---|
702 | <td><input type="text" class="text" size="30" maxlength="255" name="annotationExp" |
---|
703 | onchange="annotationExpressionOnChange()" disabled></td> |
---|
704 | <td> |
---|
705 | <base:button |
---|
706 | title="" |
---|
707 | image="expression_builder.gif" |
---|
708 | tooltip="Use the Expression builder" |
---|
709 | onclick="openExpressionBuilder('Annotation filter', 'annotation', 'annotationExp', 'COLUMN_RESTRICTION')" |
---|
710 | /> |
---|
711 | </td> |
---|
712 | </tr> |
---|
713 | </table> |
---|
714 | </form> |
---|
715 | </t:tab> |
---|
716 | |
---|
717 | </t:tabcontrol> |
---|
718 | </td> |
---|
719 | <td xstyle="width: 600px;"> |
---|
720 | <div style="position: relative; top: 0px; left: 0px; width: 600px; height: 400px; padding-bottom: 2px;"> |
---|
721 | <img src="../../../images/plot_empty.png" id="background" |
---|
722 | style="position: absolute; top: 0px; left: 0px; z-index: 1; border: 1px solid #999999;"> |
---|
723 | <img src="../../../images/plot_select.gif" id="preview" |
---|
724 | style="position: relative; top: 0px; left: 0px; z-index: 2; border: 1px solid #999999;"> |
---|
725 | </div> |
---|
726 | </td> |
---|
727 | </tr> |
---|
728 | </table> |
---|
729 | </div> |
---|
730 | <p> |
---|
731 | <div align="center"> |
---|
732 | <base:buttongroup> |
---|
733 | <base:button title="Preview" onclick="previewPlot()" |
---|
734 | image="plotter_preview.gif" tooltip="Generate a preview of the plot" |
---|
735 | /> |
---|
736 | <base:button title="View…" onclick="viewPlot()" |
---|
737 | image="plotter.gif" tooltip="View a fullsized version of the plot (in a popup)" |
---|
738 | /> |
---|
739 | <base:button title="Download…" onclick="downloadPlot()" |
---|
740 | image="download.gif" |
---|
741 | tooltip="Downlad a fullsized version of the plot to you computer" |
---|
742 | /> |
---|
743 | <base:button title="Save as…" onclick="savePlotAs()" |
---|
744 | image="<%=hasCreateFilePermission ? "saveas.gif" : "saveas_disabled.gif"%>" |
---|
745 | disabled="<%=!hasCreateFilePermission%>" |
---|
746 | tooltip="<%=hasCreateFilePermission ? |
---|
747 | "Save a fullsized version of the plot on the BASE server" : |
---|
748 | "You don't have permission to create files" %>" |
---|
749 | /> |
---|
750 | <base:button onclick="window.close()" title="Close" /> |
---|
751 | </base:buttongroup> |
---|
752 | </div> |
---|
753 | |
---|
754 | </base:body> |
---|
755 | </base:page> |
---|
756 | <% |
---|
757 | } |
---|
758 | finally |
---|
759 | { |
---|
760 | if (dc != null) dc.close(); |
---|
761 | } |
---|
762 | %> |
---|