source: branches/uk_ac_ebi_Tab2MageImporter/jsp/uk/ac/ebi/nugo/plugins/experiment.jsp @ 531

Last change on this file since 531 was 531, checked in by mbayer, 13 years ago

had to add in ability for user to configure subject names and tissues against filenames and factors too - this implemented in UI now
also restructured code in writer class and test class

File size: 21.9 KB
Line 
1<%@ page import="net.sf.basedb.core.*"%>
2<%@ page import="net.sf.basedb.clients.web.*"%>
3<%@ page import="net.sf.basedb.util.*"%>
4<%@ page import="java.util.*"%>
5
6<jsp:useBean id="inputDataBean" class="uk.ac.ebi.nugo.plugins.DataBean" scope="application"/>
7<!-- submits the form data back to the bean assuming that each form element is matched to a variable in the bean by the same name -->
8<jsp:setProperty name="inputDataBean" property="*"/>
9
10<%
11final SessionControl sc = Base.getExistingSessionControl(pageContext, true);
12final String ID = sc.getId();
13final String requestId = request.getParameter("requestId");
14
15//we also need to figure out the name/id of the currently selected experiment that this import is getting initiated from
16ItemContext cc = sc.getCurrentContext(Item.EXPERIMENT);
17int experimentID = cc.getId();
18DbControl dc = sc.newDbControl();
19Experiment experiment = Experiment.getById(dc,experimentID);
20String expName = experiment.getName();
21dc.close();
22
23//set the experiment id in the bean so we can get at it later in the plugin
24inputDataBean.setExperimentId(new Integer(experimentID).toString());
25 %>
26
27<html>
28
29<head>
30
31<link rel="stylesheet" type="text/css" href="<%= request.getContextPath()%>/plugins/uk/ac/ebi/nugo/plugins/styles.css" />
32<link rel="stylesheet" type="text/css" href="/base/include/styles/main.css">
33<link rel="stylesheet" type="text/css" href="/base/include/styles/size_m.css">
34
35<script>
36self.resizeTo(800,850);
37</script>
38
39<script language="JavaScript" src="<%= request.getContextPath()%>/include/scripts/main.js" type="text/javascript"></script>
40
41<script type="text/javascript">
42    function getScale()
43    {
44      return 1.0;
45    }
46    function selectArrayDesignOnClick()
47    {
48      var frm = document.forms['experimentData'];
49      var url = '<%= request.getContextPath()%>/lims/arraydesigns/index.jsp?ID=<%=ID%>&cmd=UpdateContext&mode=selectone&callback=setArrayDesignCallback';
50      if (frm.accession.length > 0)
51      {
52        var id = Math.abs(parseInt(frm.accession[0].value));       
53        url += '&item_id='+id;
54      }
55      Main.openPopup(url, 'SelectArrayDesign', 1000, 700);
56    }
57    function setArrayDesignCallback(id, name)
58    {
59      var frm = document.forms['experimentData'];
60      var list = frm.accession;
61      if (list.length < 1 || list[0].value == '0') // >
62      {
63        Forms.addListOption(list, 0, new Option());
64      }
65      list[0].value = name;
66      list[0].text = name;
67      list.selectedIndex = 0;
68      parentsChanged = true;
69    }
70  //submits form
71  function submit()
72  {
73    document.experimentData.submit();
74  }
75
76    //function to display or hide a given element
77    function showHideItems(myItem, myButton)
78    {
79       //this is the ID of the hidden item
80      var myItem = document.getElementById(myItem);
81
82      //this is the ID of the plus/minus button image
83      var myButton = document.getElementById(myButton);
84
85        if (myItem.style.display != "none")
86        {
87            //items are currently displayed, so hide them
88            myItem.style.display = "none";
89            swapImage(myButton,"plus");
90        }
91        else
92        {
93            //items are currently hidden, so display them
94            myItem.style.display = "block";
95            swapImage(myButton,"minus");
96        }
97    }
98
99    //function to swap an image based on its current state
100    function swapImage(myImage, state)
101    {
102        if (state == "minus")
103        {
104            myImage.src = "<%= request.getContextPath()%>/plugins/uk/ac/ebi/nugo/plugins/hide.gif";
105        }
106
107        else
108        {
109            myImage.src = "<%= request.getContextPath()%>/plugins/uk/ac/ebi/nugo/plugins/show.gif";
110      }
111    }
112
113</script>
114
115</head>
116
117<!-- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
118
119<body>
120
121
122
123 
124
125<h1>Tab2MAGE Importer -- Your Experiment</h1>
126Page 1 of 4
127<p>
128
129Please configure your experiment for upload by answering the questions on this and the following two pages.
130The answers you provide will be used to automatically create a new experiment in BASE and your raw data will be imported
131into this. All the associated objects (Hybridizations, Scans, Extracts etc.) will also be created.
132<p>
133
134<form name="experimentData" action="<%= request.getContextPath()%>/plugins/uk/ac/ebi/nugo/plugins/protocols.jsp" method="post">
135<input type="hidden" name="ID" value="<%=ID%>"> 
136<input type="hidden"name="requestId" value="<%=requestId%>"> 
137
138<table cellpadding="0" cellspacing="0">
139
140  <!-- ------------------------------------------------------------------------------------------------------------------------------------------------ -->
141  <tr >
142    <td class="boldText">Domain:</td>
143    <td class="input"><input type="text" size="45" name="domain" value="scri.ac.uk" /></td>
144    <td class="helpText">The domain tag provides information on the originator of the output MAGE-ML document. This field can contain
145    any suitable string, such as the originating internet domain name (e.g. "ebi.ac.uk").</td>
146  </tr>
147 
148  <!-- ------------------------------------------------------------------------------------------------------------------------------------------------ -->
149  <tr >
150    <td class="boldText">Array Acession:</td>
151
152    <td class="input">
153
154    <div id="accession" class="selectionlist required">
155    <table class="noBorder"  cellspacing="0" cellpadding="5">
156      <tr class="noBorder">
157        <td style="border-style: none;"><select name="accession" onchange="arrayDesignOnChange()"></select></td>
158        <td style="border-style: none;">
159        <div class="buttonclass"
160          onmouseover="this.className='buttonclass_hover';"
161          onmouseout="this.className='buttonclass';"
162          onclick="selectArrayDesignOnClick()">
163        <div class="buttonclass_inner">Select&hellip;</div>
164        </div>
165        </td>
166      </tr>
167    </table>
168    </div>
169    </td>
170
171    <td class="helpText">Please select an existing array design from BASE or create a
172    new one. For ArrayExpress submissions, the array design name becomes
173    the array accession identifier. Accession numbers for experiments
174    submitted to ArrayExpress should have the format E-XXXX-n.</td>
175
176  </tr>
177
178
179
180      <!-- ------------------------------------------------------------------------------------------------------------------------------------------------ -->
181    <tr >
182      <td class="boldText">Quality Control:</td>
183      <td class="input"><select multiple name="qualityControl" size="7">
184        <option selected="selected">biological replicate</option>
185        <option>dye swap quality control</option>
186        <option>peer review quality control</option>
187        <option>real time PCR quality control</option>
188        <option>reverse transcription PCR quality control</option>
189        <option selected="selected">spike quality control</option>
190        <option>technical replicate</option>
191      </select></td>
192      <td class="helpText">A list of terms taken from the <a
193        href="http://mged.sourceforge.net/ontologies/MGEDontology.php"
194        target="_blank">MGED ontology</a>. Multiple values can be selected
195      by holding down the Ctrl key and clicking on items.</td>
196    </tr>
197
198    <!-- ------------------------------------------------------------------------------------------------------------------------------------------------ -->
199    <tr>
200      <td class="boldText">Experiment Design Type:</td>
201      <td class="input">
202
203      <table class="noBorder" cellpadding="3">
204
205        <tr>
206          <td valign="top" style="border-style: none;">Biological Property<br />
207          </td>
208          <td colspan="2" style="border-style: none;"><a
209            onclick="showHideItems('BiologicalProperty', 'buttonBiologicalProperty');"
210            title="Show/hide items"> <img
211            src="<%= request.getContextPath()%>/plugins/uk/ac/ebi/nugo/plugins/show.gif"
212            border="0" id="buttonBiologicalProperty"
213            name="buttonBiologicalProperty" /></a> <!-- begin div containing hidden items -->
214          <div id="BiologicalProperty" style="display:none"><select
215            multiple="multiple" name="biologicalProperty" size="16">
216            <option selected="selected">cell_component_comparison_design</option>
217            <option>cell_cycle_design</option>
218            <option>cell_type_comparison_design</option>
219            <option>cellular_process_design</option>
220            <option>development_or_differentiation_design</option>
221            <option>imprinting_design</option>
222            <option>individual_genetic_characteristics_design</option>
223            <option>innate_behavior_design</option>
224            <option>is_expressed_design</option>
225            <option>organism_part_comparison_design</option>
226            <option>organism_status_design</option>
227            <option>physiological_process_design</option>
228            <option>sex_design</option>
229            <option>species_design</option>
230            <option>strain_or_line_design</option>
231            <option>unknown_experiment_design_type</option>
232          </select></div>
233          </td>
234        </tr>
235
236        <tr>
237          <td style="border-style: none;">BioMolecular Annotation</td>
238          <td style="border-style: none;"><a
239            onclick="showHideItems('BioMolecularAnnotation', 'buttonBioMolecularAnnotation');"
240            title="Show/hide items"> <img
241            src="<%= request.getContextPath()%>/plugins/uk/ac/ebi/nugo/plugins/show.gif"
242            border="0" id="buttonBioMolecularAnnotation"
243            name="buttonBioMolecularAnnotation" /></a> <!-- begin div containing hidden items -->
244          <div id="BioMolecularAnnotation" style="display:none"><select
245            multiple="multiple" name="bioMolecularAnnotation"  size="11">
246            <option selected="selected">RNA_stability_design</option>
247            <option>binding_site_identification_design</option>
248            <option>co-expression_design</option>
249            <option>comparative_genome_hybridization_design</option>
250            <option>genotyping_design</option>
251            <option>operon_identification_design</option>
252            <option>secreted_protein_identification_design</option>
253            <option>tiling_path_design</option>
254            <option>transcript_identification_design</option>
255            <option>translational_bias_design</option>
256            <option>unknown_experiment_design_type</option>
257          </select></div>
258          </td>
259        </tr>
260
261        <tr>
262          <td style="border-style: none;">Epidemiological Design</td>
263          <td style="border-style: none;"><a
264            onclick="showHideItems('EpidemiologicalDesign', 'buttonEpidemiologicalDesign');"
265            title="Show/hide items"> <img
266            src="<%= request.getContextPath()%>/plugins/uk/ac/ebi/nugo/plugins/show.gif"
267            border="0" id="buttonEpidemiologicalDesign"
268            name="buttonEpidemiologicalDesign" /></a> <!-- begin div containing hidden items -->
269          <div id="EpidemiologicalDesign" style="display:none"><select
270            multiple="multiple" name="epidemiologicalDesign"  size="4">
271            <option>clinical_history_design</option>
272            <option>disease_state_design</option>
273            <option selected="selected">family_history_design</option>
274            <option>unknown_experiment_design_type</option>
275          </select></div>
276          </td>
277        </tr>
278
279        <tr>
280          <td style="border-style: none;">Methodological Design</td>
281          <td style="border-style: none;"><a
282            onclick="showHideItems('MethodologicalDesign', 'buttonMethodologicalDesign');"
283            title="Show/hide items"> <img
284            src="<%= request.getContextPath()%>/plugins/uk/ac/ebi/nugo/plugins/show.gif"
285            border="0" id="buttonMethodologicalDesign"
286            name="buttonMethodologicalDesign" /></a> <!-- begin div containing hidden items -->
287          <div id="MethodologicalDesign" style="display:none"><select
288            multiple="multiple" name="methodologicalDesign" size="18">
289            <option>all_pairs</option>
290            <option>array_platform_variation_design</option>
291            <option>dye_swap_design</option>
292            <option>ex_vivo_design</option>
293            <option>hardware_variation_design</option>
294            <option>in_vitro_design</option>
295            <option>in_vivo_design</option>
296            <option>loop_design</option>
297            <option>normalization_testing_design</option>
298            <option>operator_variation_design</option>
299            <option>optimization_design</option>
300            <option>quality_control_testing_design</option>
301            <option>reference_design</option>
302            <option>replicate_design</option>
303            <option>self_vs_self_design</option>
304            <option>software_variation_design</option>
305            <option>time_series_design</option>
306            <option>unknown_experiment_design_type</option>
307          </select></div>
308          </td>
309        </tr>
310
311        <tr>
312          <td style="border-style: none;">Perturbational Design</td>
313          <td style="border-style: none;"><a
314            onclick="showHideItems('PerturbationalDesign', 'buttonPerturbationalDesign');"
315            title="Show/hide items"> <img
316            src="<%= request.getContextPath()%>/plugins/uk/ac/ebi/nugo/plugins/show.gif"
317            border="0" id="buttonPerturbationalDesign"
318            name="buttonPerturbationalDesign" /></a> <!-- begin div containing hidden items -->
319          <div id="PerturbationalDesign" style="display:none"><select
320            multiple="multiple" name="perturbationalDesign" size="12">
321            <option>cellular_modification_design</option>
322            <option>compound_treatment_design</option>
323            <option>disease_state_design</option>
324            <option>dose_response_design</option>
325            <option>genetic_modification_design</option>
326            <option>growth_condition_design</option>
327            <option>injury_design</option>
328            <option>non-targeted_transgenic_variation_design</option>
329            <option>pathogenicity_design</option>
330            <option>stimulated_design_type</option>
331            <option>stimulus_or_stress_design</option>
332            <option>unknown_experiment_design_type</option>
333          </select></div>
334          </td>
335        </tr>
336
337        <tr>
338          <td style="border-style: none;">Technological Design</td>
339          <td style="border-style: none;"><a
340            onclick="showHideItems('TechnologicalDesign', 'buttonTechnologicalDesign');"
341            title="Show/hide items"> <img
342            src="<%= request.getContextPath()%>/plugins/uk/ac/ebi/nugo/plugins/show.gif"
343            border="0" id="buttonTechnologicalDesign"
344            name="buttonTechnologicalDesign" /></a> <!-- begin div containing hidden items -->
345          <div id="TechnologicalDesign" style="display:none"><select
346            multiple="multiple" name="technologicalDesign" size="4">
347            <option>binding_site_identification_design</option>
348            <option>cellular_modification_design</option>
349            <option>comparative_genome_hybridization_design</option>
350            <option>transcript_identification_design</option>
351          </select></div>
352          </td>
353        </tr>
354
355      </table>
356
357
358      </td>
359      <td class="helpText">A list of terms taken from the <a
360        href="http://mged.sourceforge.net/ontologies/MGEDontology.php"
361        target="_blank">MGED ontology</a>.
362      <p>Click "expand" for an item to see list boxes with specific
363      choices.<br />
364      <br />
365      Multiple values can be selected by holding down the Ctrl key and
366      clicking on items.
367      </td>
368    </tr>
369
370    <!-- ------------------------------------------------------------------------------------------------------------------------------------------------ -->
371    <tr>
372      <td class="boldText">Experiment Name:</td>
373      <td class="input"><textarea rows="4" cols="30"
374        name="experimentName"><%=expName %></textarea></td>
375      <td class="helpText">The name you have chosen for the Experiment.</td>
376    </tr>
377
378    <!-- ------------------------------------------------------------------------------------------------------------------------------------------------ -->
379    <tr>
380      <td class="boldText">Experiment Description:</td>
381      <td class="input"><textarea rows="4" cols="30"
382        name="description">This is a totally contrived example experiment.</textarea></td>
383      <td class="helpText">A short paragraph describing the purpose of the experiment.</td>
384    </tr>
385
386    <!-- ------------------------------------------------------------------------------------------------------------------------------------------------ -->
387    <tr>
388      <td class="boldText">Release Date:</td>
389      <td class="input"><input type="text" size="10"
390        name="releaseDate" value="2007-12-03" /></td>
391      <td class="helpText">Date for public release, in the format YYYY-MM-DD.</td>
392    </tr>
393    <!-- ------------------------------------------------------------------------------------------------------------------------------------------------ -->
394    <tr>
395      <td class="boldText">Submission Date:</td>
396      <td class="input"><input type="text" size="10"
397        name="submissionDate" value="2007-12-03" /></td>
398      <td class="helpText">Date of submission, in the format YYYY-MM-DD.</td>
399    </tr>
400    <!-- ------------------------------------------------------------------------------------------------------------------------------------------------ -->
401    <tr>
402      <td class="boldText">Submitter:</td>
403      <td class="input"><input type="text" size="45" name="submitter"
404        value="Joe Bloggs" /></td>
405      <td class="helpText">The name of the person responsible for submitting the
406      experiment to the database.</td>
407    </tr>
408    <!-- ------------------------------------------------------------------------------------------------------------------------------------------------ -->
409    <tr>
410      <td class="boldText">Organization:</td>
411      <td class="input"><input type="text" size="45"
412        name="organization" value="SCRI" /></td>
413      <td class="helpText">The organization to which the submitter is affiliated.</td>
414    </tr>
415    <!-- ------------------------------------------------------------------------------------------------------------------------------------------------ -->
416
417    <tr>
418      <td class="boldText">Publication Details:</td>
419      <td class="input"></td>
420      <td class="helpText">Publication details for any manuscript
421      associated with the experiment.</td>
422    </tr>
423
424    <tr>
425      <td class="plainLabel" style="border-style: none;">Title:</td>
426      <td class="input" style="border-style: none;"><textarea rows="3" cols="30"
427        name="publicationTitle" >My Ropey Paper</textarea></td>
428      <td style="border-style: none;"></td>
429    </tr>
430    <!-- ------------------------------------------------------------------------------------------------------------------------------------------------ -->
431    <tr>
432      <td class="plainLabel" style="border-style: none;">Authors:</td>
433      <td class="input" style="border-style: none;"><textarea rows="3" cols="30" name="authors">Bloggs, Joe</textarea></td>
434      <td  class="helpText" style="border-style: none;">The authors list is a semicolon-delimited list of names.</td>
435    </tr>
436    <!-- ------------------------------------------------------------------------------------------------------------------------------------------------ -->
437    <tr>
438      <td class="plainLabel" style="border-style: none;">Journal:</td>
439      <td class="input" style="border-style: none;"><textarea rows="3" cols="30" name="journal">The Journal of Irreproducible Results</textarea></td>
440      <td  class="helpText" style="border-style: none;">The journal field should contain a standard Pubmed journal
441      abbreviated name. </td>
442    </tr>
443    <!-- ------------------------------------------------------------------------------------------------------------------------------------------------ -->
444    <tr>
445      <td class="plainLabel" style="border-style: none;">Volume:</td>
446      <td class="input" style="border-style: none;"><input type="text" size="10" name="volume"
447        value="5" /></td>
448      <td style="border-style: none;"></td>
449    </tr>
450    <!-- ------------------------------------------------------------------------------------------------------------------------------------------------ -->
451    <tr>
452      <td class="plainLabel" style="border-style: none;">Issue:</td>
453      <td class="input" style="border-style: none;"><input type="text" size="10" name="issue"
454        value="2" /></td>
455      <td style="border-style: none;"></td>
456    </tr>
457    <!-- ------------------------------------------------------------------------------------------------------------------------------------------------ -->
458    <tr>
459      <td class="plainLabel" style="border-style: none;">Pages:</td>
460      <td class="input" style="border-style: none;"><input type="text" size="10" name="pages"
461        value="123-135" /></td>
462      <td style="border-style: none;"></td>
463    </tr>
464    <!-- ------------------------------------------------------------------------------------------------------------------------------------------------ -->
465    <tr>
466      <td class="plainLabel" style="border-style: none;">Year:</td>
467      <td class="input" style="border-style: none;"><input type="text" size="10" name="year"
468        value="2007" /></td>
469      <td style="border-style: none;"></td>
470    </tr>
471    <!-- ------------------------------------------------------------------------------------------------------------------------------------------------ -->
472    <tr>
473      <td class="plainLabel" style="border-style: none;">Pubmed ID:</td>
474      <td class="input" style="border-style: none;"><input type="text" size="30" name="pubmedId"
475        value="11009762" /></td>
476      <td style="border-style: none;"></td>
477
478    </tr>
479
480    <!-- ------------------------------------------------------------------------------------------------------------------------------------------------ -->
481  </table>
482
483  <p>
484
485
486  <table align="center" class="noBorder" cellspacing="5"  cellpadding="5">
487  <tr class="noBorder">
488    <td id="next" width="50%" style="border-style: none;"><div class="buttons" onmouseover="this.className='buttons_hover';" onmouseout="this.className='buttons';" onclick="submit()"><div class="buttons_inner"><table  class="noBorder" cellspacing="0" cellpadding="0"><tr  class="noBorder"><td style="border-style: none;"><img src="/base/images/gonext.gif" border="0"></td><td style="border-style: none;">Next</td></tr></table></div></div></td>
489    <td id="close" width="50%" style="border-style: none;"><div class="buttons" onmouseover="this.className='buttons_hover';" onmouseout="this.className='buttons';" onclick="window.close()"><div class="buttons_inner"><table  class="noBorder" cellspacing="0" cellpadding="0"><tr  class="noBorder"><td style="border-style: none;"><img src="/base/images/cancel.gif" border="0"></td><td style="border-style: none;">Cancel</td></tr></table></div></div></td>  </tr>
490  </table>
491
492</form>
493
494</body>
495</html>
496
497
Note: See TracBrowser for help on using the repository browser.