1 | <html> |
---|
2 | <head> |
---|
3 | <meta name="layout" content="main" /> |
---|
4 | <title>Show run ${run.name} | Metagenomics | dbNP</title> |
---|
5 | |
---|
6 | <link rel="stylesheet" href="<g:resource dir="css" file="showAssay.css" />" type="text/css"/> |
---|
7 | <link rel="stylesheet" href="<g:resource dir="css" file="fileuploader.new.css" />" type="text/css"/> |
---|
8 | |
---|
9 | <g:javascript src="jquery.ui.tabbeddialog.js" /> |
---|
10 | <g:javascript src="addFilesDialog.js" /> |
---|
11 | |
---|
12 | <g:javascript src="run.show.enterTagsDialog.js" /> |
---|
13 | <g:javascript src="run.show.assayDialog.js" /> |
---|
14 | <g:javascript src="run.show.runDialog.js" /> |
---|
15 | <g:javascript src="run.show.addSamplesDialog.js" /> |
---|
16 | <g:javascript src="showSampleDialogUniversal.js" /> |
---|
17 | |
---|
18 | <g:javascript src="assay.show.showRunDialog.js" /> |
---|
19 | |
---|
20 | <g:javascript src="fileuploader.new.js" /> |
---|
21 | <g:javascript src="fileuploads.new.js" /> |
---|
22 | |
---|
23 | <script> |
---|
24 | var runId = ${run.id}; |
---|
25 | var numOtherAssays = ${otherAssays.size()}; |
---|
26 | |
---|
27 | // Create a variable with assay names to check for existing names |
---|
28 | var runNames = []; |
---|
29 | <g:each in="${allRuns}" var="currentrun"> |
---|
30 | runNames[ runNames.length ] = {id: ${currentrun.id}, name: '${currentrun.name}', alreadyAdded: false }; |
---|
31 | </g:each> |
---|
32 | |
---|
33 | function initializeUploadedFiles( selector ) { |
---|
34 | if( selector == undefined ) |
---|
35 | selector = ""; |
---|
36 | |
---|
37 | $( selector + ' .uploadedFile').each( function( idx, el ) { |
---|
38 | $(el).html( createFileHTML( $(el).text(), 'getPermanent' ) ); |
---|
39 | }); |
---|
40 | } |
---|
41 | |
---|
42 | // Initializefiles on load |
---|
43 | $(function() { initializeUploadedFiles(); }); |
---|
44 | </script> |
---|
45 | </head> |
---|
46 | <body> |
---|
47 | <h1> |
---|
48 | Run ${run.name} |
---|
49 | </h1> |
---|
50 | |
---|
51 | <div id="editRunDialog" class="dialog"></div> |
---|
52 | <div class="blok_data"> |
---|
53 | <label>Run</label>: ${run.name}<br /> |
---|
54 | <label>Date</label>: <g:formatDate format="dd-MM-yyyy" date="${run.date}"/><br /> |
---|
55 | <label>Supplier</label>: ${run.supplier}<br /> |
---|
56 | <label>Machine</label>: ${run.machine}<br /> |
---|
57 | <label>Parameters</label>: <g:uploadedFile value="${run.parameterFile}" /><br /> |
---|
58 | </div> |
---|
59 | <div class="blok_data"> |
---|
60 | <label># assays</label>: ${run.assays?.size()} |
---|
61 | <% def numHidden = run.assays?.findAll { !it.study.canRead( session.user ) }.size() ; %> |
---|
62 | <g:if test="${numHidden}"> |
---|
63 | (${numHidden} |
---|
64 | <a href="#" onClick="alert( '${numHidden} assay(s) from this run are hidden because you don\'t have the right permissions to view them.' ); return false;"> |
---|
65 | hidden</a>) |
---|
66 | </g:if> |
---|
67 | <br /> |
---|
68 | |
---|
69 | <label># samples</label>: ${run.assaySamples?.size()} |
---|
70 | <% numHidden = run.assaySamples?.findAll { !it.assay?.study.canRead( session.user ) }.size() ; %> |
---|
71 | <g:if test="${numHidden}"> |
---|
72 | (${numHidden} |
---|
73 | <a href="#" onClick="alert( '${numHidden} sample(s) from this run are hidden because you don\'t have the right permissions to view them.' ); return false;"> |
---|
74 | hidden</a>) |
---|
75 | </g:if> |
---|
76 | <br /> |
---|
77 | <label># sequences</label>: ${run.numSequences()}<br /> |
---|
78 | <label># files</label>: ${run.numFiles()}<br /> |
---|
79 | </div> |
---|
80 | <p class="options"> |
---|
81 | <a class="edit" href="#" onClick="showEditRunDialog( ${run.id} ); return false;">Edit run</a> |
---|
82 | </p> |
---|
83 | |
---|
84 | <!-- Samples --> |
---|
85 | <h2>Samples</h2> |
---|
86 | <g:if test="${run.assaySamples == null || run.assaySamples.size() == 0}"> |
---|
87 | No samples found in run. |
---|
88 | </g:if> |
---|
89 | <g:else> |
---|
90 | <table class="paginate"> |
---|
91 | <thead> |
---|
92 | <tr> |
---|
93 | <th nowrap>name</th> |
---|
94 | <th nowrap>study</th> |
---|
95 | <th nowrap>assay</th> |
---|
96 | <th nowrap>tag name</th> |
---|
97 | <th nowrap>tag sequence</th> |
---|
98 | <th nowrap># sequences</th> |
---|
99 | <th nowrap># qual</th> |
---|
100 | <th class="nonsortable"></th> |
---|
101 | </tr> |
---|
102 | </thead> |
---|
103 | <tbody> |
---|
104 | <% def assaySamples = run.assaySamples.findAll { it.assay?.study.canRead( session.user ) }.toList().sort { it.sample.name }; %> |
---|
105 | <g:each in="${assaySamples}" var="assaySample"> |
---|
106 | <tr> |
---|
107 | <td><a href="#" onClick="showSample(${assaySample.id}, 'run'); return false;">${assaySample.sample.name}</a></td> |
---|
108 | <td>${assaySample.assay.study.name}</td> |
---|
109 | <td>${assaySample.assay.name}</td> |
---|
110 | <td>${assaySample.tagName}</td> |
---|
111 | <td>${assaySample.tagSequence}</td> |
---|
112 | <td> |
---|
113 | <g:if test="${assaySample.numSequenceFiles() > 0}"> |
---|
114 | ${assaySample.numSequences()} |
---|
115 | </g:if> |
---|
116 | <g:else> |
---|
117 | - |
---|
118 | </g:else> |
---|
119 | </td> |
---|
120 | <td> |
---|
121 | <g:if test="${assaySample.numQualityFiles() > 0}"> |
---|
122 | ${assaySample.numQualScores()} |
---|
123 | </g:if> |
---|
124 | <g:else> |
---|
125 | - |
---|
126 | </g:else> |
---|
127 | </td> |
---|
128 | <td class="button"> |
---|
129 | <g:if test="${!assaySample.assay.study.canWrite(session.user)}"> |
---|
130 | <img src="${fam.icon(name: 'application_delete')}" class="disabled" title="You can't remove this sample because you don't have sufficient privileges." /> |
---|
131 | </g:if> |
---|
132 | <g:else> |
---|
133 | <g:link onClick="return confirm( 'Are you sure you want to remove the selected sample from this run?' );" controller="run" action="removeSample" id="${run.id}" params="${[assaySampleId: assaySample.id]}" ><img src="${fam.icon(name: 'application_delete')}" /></g:link> |
---|
134 | </g:else> |
---|
135 | </td> |
---|
136 | </tr> |
---|
137 | </g:each> |
---|
138 | </tbody> |
---|
139 | </table> |
---|
140 | <g:if test="${editable}"> |
---|
141 | <p class="options"> |
---|
142 | <% def writableAssaySamples = assaySamples.findAll { it.assay.study.canWrite( session.user ) } %> |
---|
143 | <a class="addAssociation" onClick="showAddSamplesDialog();" href="#">Add samples</a> |
---|
144 | |
---|
145 | <g:if test="${writableAssaySamples.size() > 0}"> |
---|
146 | <a class="editAssociation" onClick="showEnterTagsDialog();" href="#">Edit sample data</a> |
---|
147 | </g:if> |
---|
148 | <g:else> |
---|
149 | <a class="editAssociation disabled" onClick="return false;" href="#">Edit sample data</a> |
---|
150 | </g:else> |
---|
151 | |
---|
152 | <g:if test="${writableAssaySamples.size() == 0 || !run.assays?.size()}"> |
---|
153 | <a class="addSequences disabled" onClick="return false;" href="#">Add sequence files</a> |
---|
154 | </g:if> |
---|
155 | <g:else> |
---|
156 | <a class="addSequences" onClick="showAddFilesDialog();" href="#">Add sequence files</a> |
---|
157 | </g:else> |
---|
158 | |
---|
159 | </p> |
---|
160 | <g:if test="${writableAssaySamples.size() > 0}"> |
---|
161 | <g:render template="enterTagsDialog" model="[run: run, writableAssaySamples: writableAssaySamples]" /> |
---|
162 | <g:render template="addFilesDialog" model="[run: run]" /> |
---|
163 | </g:if> |
---|
164 | |
---|
165 | <g:render template="addSamplesDialog" model="[run: run]" /> |
---|
166 | |
---|
167 | </g:if> |
---|
168 | <div id="showSampleDialog" class="dialog"></div> |
---|
169 | </g:else> |
---|
170 | |
---|
171 | <!-- Runs --> |
---|
172 | <h2>Assays</h2> |
---|
173 | <g:if test="${run.assays == null || run.assays.size() == 0}"> |
---|
174 | No assay found for this run |
---|
175 | </g:if> |
---|
176 | <g:else> |
---|
177 | <table class="paginate"> |
---|
178 | <thead> |
---|
179 | <tr> |
---|
180 | <th nowrap>name</th> |
---|
181 | <th nowrap>study</th> |
---|
182 | <th nowrap># samples</th> |
---|
183 | <th nowrap>other runs</th> |
---|
184 | <th class="nonsortable"></th> |
---|
185 | </tr> |
---|
186 | </thead> |
---|
187 | <tbody> |
---|
188 | <% def assays = run.assays.findAll { it.study.canRead( session.user ) }.toList().sort { it.name }; %> |
---|
189 | <g:each in="${assays}" var="assay"> |
---|
190 | <tr> |
---|
191 | <td><g:link controller="assay" action="show" id="${assay.id}">${assay.name}</g:link></td> |
---|
192 | <td>${assay.study?.name}</td> |
---|
193 | <td>${assay.assaySamples?.size()}</td> |
---|
194 | <td> |
---|
195 | <g:if test="${assay.runs?.size() == 1}"> |
---|
196 | <% /* If only 1 run is found, then it is the current one */ %> |
---|
197 | - |
---|
198 | </g:if> |
---|
199 | <g:else> |
---|
200 | <g:each in="${assay.runs - run}" var="otherRun"> |
---|
201 | <g:link action="show" id="${otherRun.id}">${otherRun.name}</g:link><br /> |
---|
202 | </g:each> |
---|
203 | </g:else> |
---|
204 | </td> |
---|
205 | <td class="button"> |
---|
206 | <g:if test="${run.samples(assay.id).size()}"> |
---|
207 | <img src="${fam.icon(name: 'application_delete')}" class="disabled" title="You can't remove this assay because sequences from this assay are coupled to this run." /> |
---|
208 | </g:if> |
---|
209 | <g:else> |
---|
210 | <g:if test="${!assay.study.canWrite(session.user)}"> |
---|
211 | <img src="${fam.icon(name: 'application_delete')}" class="disabled" title="You can't remove this assay because you don't have sufficient privileges." /> |
---|
212 | </g:if> |
---|
213 | <g:else> |
---|
214 | <g:link onClick="return confirm( 'Are you sure you want to remove the selected assay from this run?' );" controller="run" action="removeAssay" id="${run.id}" params="${[assay_id: assay.id]}" ><img src="${fam.icon(name: 'application_delete')}" /></g:link> |
---|
215 | </g:else> |
---|
216 | </g:else> |
---|
217 | </td> |
---|
218 | </tr> |
---|
219 | </g:each> |
---|
220 | </tbody> |
---|
221 | </table> |
---|
222 | </g:else> |
---|
223 | <% def writableAssays = otherAssays.findAll { it.study.canWrite( session.user ) } %> |
---|
224 | <g:if test="${editable}"> |
---|
225 | <p class="options"> |
---|
226 | <g:if test="${writableAssays.size() > 0}"> |
---|
227 | <a class="addAssociation" href="#" onClick="showAddAssayDialog();">Add assay</a> |
---|
228 | </g:if> |
---|
229 | <g:else> |
---|
230 | <a class="addAssociation disabled" href="#" onClick="return false;">Add assay</a> |
---|
231 | </g:else> |
---|
232 | </p> |
---|
233 | <g:if test="${writableAssays.size() > 0}"> |
---|
234 | <g:render template="addAssayDialog" model="[run: run, writableAssays: writableAssays]" /> |
---|
235 | </g:if> |
---|
236 | </g:if> |
---|
237 | <div id="showRunDialog" class="dialog"></div> |
---|
238 | </body> |
---|
239 | </html> |
---|