Skip to content

Commit 106e82d

Browse files
committed
Update ssGSEA params and allow template to be provided on the URL
1 parent 21f6512 commit 106e82d

File tree

3 files changed

+64
-38
lines changed

3 files changed

+64
-38
lines changed

SequenceAnalysis/resources/web/SequenceAnalysis/panel/BaseSequencePanel.js

Lines changed: 59 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ Ext4.define('SequenceAnalysis.panel.BaseSequencePanel', {
248248
items: [{
249249
xtype: 'labkey-combo',
250250
width: 600,
251-
fieldLabel: 'Select Run',
251+
fieldLabel: 'Select Template',
252252
editable: true,
253253
forceSelection: true,
254254
store: {
@@ -259,7 +259,27 @@ Ext4.define('SequenceAnalysis.panel.BaseSequencePanel', {
259259
sort: 'name',
260260
filterArray: [LABKEY.Filter.create('taskid', this.jobType)],
261261
autoLoad: true,
262-
columns: 'rowid,name,json'
262+
columns: 'rowid,name,json',
263+
listeners: {
264+
load: function(store) {
265+
if (LABKEY.ActionURL.getParameter('template')) {
266+
var thePanel = Ext4.ComponentQuery.query('#selectionArea')[0];
267+
LDK.Assert.assertNotEmpty('Missing selectionArea field', thePanel);
268+
if (!thePanel) {
269+
return;
270+
}
271+
272+
var recIdx = store.find('name', LABKEY.ActionURL.getParameter('template'));
273+
if (recIdx > -1) {
274+
thePanel.down('labkey-combo').setValue(store.getAt(recIdx));
275+
var win = thePanel.up('window');
276+
var btn = win.down('button[text=Submit]');
277+
win.onSubmit(btn);
278+
}
279+
}
280+
},
281+
scope: this
282+
}
263283
},
264284
displayField: 'name',
265285
valueField: 'rowid',
@@ -281,40 +301,7 @@ Ext4.define('SequenceAnalysis.panel.BaseSequencePanel', {
281301
buttons: [{
282302
text: 'Submit',
283303
handler: function (btn) {
284-
var win = btn.up('window');
285-
var combo = win.down('combo');
286-
if (!combo.getValue()) {
287-
Ext4.Msg.alert('Error', 'Must choose a protocol');
288-
return;
289-
}
290-
291-
// can occur in rare cases, probably when store is loading
292-
var recIdx = combo.store.find('rowid', combo.getValue());
293-
if (recIdx < 0) {
294-
Ext4.Msg.alert('Error', 'Must choose a protocol');
295-
return;
296-
}
297-
298-
var rec = combo.store.getAt(recIdx);
299-
var json = rec.get('json');
300-
if (Ext4.isString(rec.get('json'))) {
301-
json = Ext4.decode(json);
302-
}
303-
304-
var useReadsetContainer = win.down('#useReadsetContainer').getValue();
305-
if (!useReadsetContainer) {
306-
delete json.useOutputFileContainer;
307-
delete json.submitJobToReadsetContainer;
308-
}
309-
310-
win.sequencePanel.applySavedValues(json);
311-
312-
var submitJobToReadsetContainer = win.sequencePanel.down('[name="submitJobToReadsetContainer"]');
313-
if (submitJobToReadsetContainer) {
314-
submitJobToReadsetContainer.setValue(useReadsetContainer);
315-
}
316-
317-
win.close();
304+
btn.up('window').onSubmit(btn);
318305
}
319306
},{
320307
text: 'Cancel',
@@ -337,6 +324,42 @@ Ext4.define('SequenceAnalysis.panel.BaseSequencePanel', {
337324
scope : this
338325
});
339326
}
327+
},
328+
onSubmit: function(btn) {
329+
var win = btn.up('window');
330+
var combo = win.down('combo');
331+
if (!combo.getValue()) {
332+
Ext4.Msg.alert('Error', 'Must choose a protocol');
333+
return;
334+
}
335+
336+
// can occur in rare cases, probably when store is loading
337+
var recIdx = combo.store.find('rowid', combo.getValue());
338+
if (recIdx < 0) {
339+
Ext4.Msg.alert('Error', 'Must choose a protocol');
340+
return;
341+
}
342+
343+
var rec = combo.store.getAt(recIdx);
344+
var json = rec.get('json');
345+
if (Ext4.isString(rec.get('json'))) {
346+
json = Ext4.decode(json);
347+
}
348+
349+
var useReadsetContainer = win.down('#useReadsetContainer').getValue();
350+
if (!useReadsetContainer) {
351+
delete json.useOutputFileContainer;
352+
delete json.submitJobToReadsetContainer;
353+
}
354+
355+
win.sequencePanel.applySavedValues(json);
356+
357+
var submitJobToReadsetContainer = win.sequencePanel.down('[name="submitJobToReadsetContainer"]');
358+
if (submitJobToReadsetContainer) {
359+
submitJobToReadsetContainer.setValue(useReadsetContainer);
360+
}
361+
362+
win.close();
340363
}
341364
}).show(btn);
342365
}

singlecell/resources/chunks/CustomGSEA.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ for (datasetId in names(seuratObjects)) {
1212
toCalculate[[vals[1]]] <- unlist(strsplit(vals[2], split = ','))
1313
}
1414

15-
seuratObj <- CellMembrane::RunEscape(seuratObj, customGeneSets = toCalculate, outputAssayName = outputAssayName, doPlot = TRUE, msigdbGeneSets = NULL)
15+
seuratObj <- CellMembrane::RunEscape(seuratObj, customGeneSets = toCalculate, outputAssayName = outputAssayName, doPlot = TRUE, msigdbGeneSets = NULL, performDimRedux = performDimRedux)
1616

1717
saveData(seuratObj, datasetId)
1818

singlecell/src/org/labkey/singlecell/pipeline/singlecell/CustomGSEA.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ public Provider()
3636
}}, "RNA"),
3737
SeuratToolParameter.create("outputAssayName", "Output Assay Name", "The assay to hold the resulting scores.", "textfield", new JSONObject(){{
3838
put("allowBlank", false);
39-
}}, "escape.ssGSEA")
39+
}}, "escape.ssGSEA"),
40+
SeuratToolParameter.create("performDimRedux", "Perform DimRedux", "If true, the standard seurat PCA/FindClusters/UMAP process will be run on the escape data. This may be most useful when using a customGeneSet or a smaller set of features/pathways", "checkbox", new JSONObject(){{
41+
42+
}}, false, null, true)
4043
), List.of("/sequenceanalysis/field/TrimmingTextArea.js"), null);
4144
}
4245

0 commit comments

Comments
 (0)