Skip to content

Commit 3b4a385

Browse files
committed
Support additional emptyDrops options
1 parent 0495b50 commit 3b4a385

File tree

3 files changed

+49
-33
lines changed

3 files changed

+49
-33
lines changed

singlecell/resources/chunks/PrepareRawCounts.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ for (datasetId in names(seuratObjects)) {
22
rawCountDir <- seuratObjects[[datasetId]]
33

44
datasetName <- datasetIdToName[[datasetId]]
5-
seuratObj <- CellMembrane::ReadAndFilter10xData(dataDir = rawCountDir, datasetId = datasetId, datasetName = datasetName, emptyDropsLower = emptyDropsLower, emptyDropsFdrThreshold = emptyDropsFdrThreshold)
5+
seuratObj <- CellMembrane::ReadAndFilter10xData(dataDir = rawCountDir, datasetId = datasetId, datasetName = datasetName, emptyDropsLower = emptyDropsLower, emptyDropsFdrThreshold = emptyDropsFdrThreshold, useEmptyDropsCellRanger = useEmptyDropsCellRanger, nExpectedCells = nExpectedCells)
66

77
if (!is.null(maxAllowableCells) && ncol(seuratObj) > maxAllowableCells) {
88
stop(paste0('The seurat object has more than the max allowable cells. Please review emptyDrops results'))

singlecell/resources/web/singlecell/panel/SingleCellProcessingPanel.js

Lines changed: 45 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -200,35 +200,6 @@ Ext4.define('SingleCell.panel.SingleCellProcessingPanel', {
200200
},
201201

202202
onDataLoad: function(results){
203-
results.prepareRawData = [{
204-
description: 'Options related to processing the 10x matrix into a seurat object',
205-
label: 'Prepare Raw Counts',
206-
name: 'PrepareRawCounts',
207-
parameters: [{
208-
fieldXtype: 'ldk-integerfield',
209-
name: 'emptyDropsLower',
210-
label: 'EmptyDrops Lower',
211-
description: 'Passed to DropletUtils::emptyDrops lower argument',
212-
defaultValue: 200,
213-
minValue: 0
214-
},{
215-
fieldXtype: 'ldk-numberfield',
216-
name: 'emptyDropsFdrThreshold',
217-
label: 'EmptyDrops FDR Threshold',
218-
description: 'The FDR limit used to filter the results of DropletUtils::emptyDrops',
219-
defaultValue: 0.001,
220-
minValue: 0,
221-
decimalPrecision: 4
222-
},{
223-
fieldXtype: 'ldk-integerfield',
224-
name: 'maxAllowableCells',
225-
label: 'Max Cells Allowed',
226-
description: 'If more than this many cells are predicted by EmptyDrops, the job will fail',
227-
defaultValue: 20000,
228-
minValue: 0
229-
}]
230-
}];
231-
232203
this.add([this.getFilePanelCfg(), this.getProtocolPanelCfg(),{
233204
xtype: 'panel',
234205
title: 'Analysis Options',
@@ -247,10 +218,53 @@ Ext4.define('SingleCell.panel.SingleCellProcessingPanel', {
247218
items.push({
248219
xtype: 'sequenceanalysis-analysissectionpanel',
249220
title: 'Prepare Raw Data',
250-
stepType: 'prepareRawData',
221+
stepType: 'singleCell',
251222
singleTool: true,
223+
comboValue: 'prepareRawData',
252224
sectionDescription: 'This section allows you to control the parsing of the raw 10x count data',
253-
toolConfig: results
225+
toolConfig: {
226+
prepareRawData: [{
227+
description: 'Options related to processing the 10x matrix into a seurat object',
228+
label: 'Prepare Raw Counts',
229+
name: 'PrepareRawCounts',
230+
parameters: [{
231+
fieldXtype: 'ldk-integerfield',
232+
name: 'emptyDropsLower',
233+
label: 'EmptyDrops Lower',
234+
description: 'Passed to DropletUtils::emptyDrops lower argument',
235+
defaultValue: 200,
236+
minValue: 0
237+
}, {
238+
fieldXtype: 'ldk-numberfield',
239+
name: 'emptyDropsFdrThreshold',
240+
label: 'EmptyDrops FDR Threshold',
241+
description: 'The FDR limit used to filter the results of DropletUtils::emptyDrops',
242+
defaultValue: 0.001,
243+
minValue: 0,
244+
decimalPrecision: 4
245+
}, {
246+
fieldXtype: 'ldk-integerfield',
247+
name: 'maxAllowableCells',
248+
label: 'Max Cells Allowed',
249+
description: 'If more than this many cells are predicted by EmptyDrops, the job will fail',
250+
defaultValue: 20000,
251+
minValue: 0
252+
}, {
253+
fieldXtype: 'checkbox',
254+
name: 'useEmptyDropsCellRanger',
255+
label: 'Use emptyDropsCellRanger',
256+
description: 'If checked, this will run emptyDropsCellRanger instead of emptyDrops',
257+
checked: false,
258+
inputValue: true
259+
}, {
260+
fieldXtype: 'checkbox',
261+
name: 'nExpectedCells',
262+
label: '# Expected Cells',
263+
description: 'Only applied if emptyDropsCellRanger is selected. Passed to n.expected.cells argument',
264+
value: 8000
265+
}]
266+
}]
267+
}
254268
});
255269
}
256270

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ public Provider()
2626
super("PrepareRawCounts", LABEL, "CellMembrane/Seurat", "This step reads the raw count matrix/matrices, and runs EmptyDrops to provide an unfiltered count matrix.", Arrays.asList(
2727
SeuratToolParameter.create("emptyDropsLower", "Lower", "Passed to DropletUtils::emptyDrops lower argument", "ldk-integerfield", null, 200),
2828
SeuratToolParameter.create("emptyDropsFdrThreshold", "FDR Threshold", "The FDR limit used to filter the results of DropletUtils::emptyDrops", "ldk-numberfield", null, 0.001),
29-
SeuratToolParameter.create("maxAllowableCells", "Max Cells Allowed", "If more than this many cells are predicted by EmptyDrops, the job will fail", "ldk-integerfield", null, 20000)
29+
SeuratToolParameter.create("maxAllowableCells", "Max Cells Allowed", "If more than this many cells are predicted by EmptyDrops, the job will fail", "ldk-integerfield", null, 20000),
30+
SeuratToolParameter.create("useEmptyDropsCellRanger", "Use emptyDropsCellRanger", "If checked, this will run emptyDropsCellRanger instead of emptyDrops", "checkbox", null, false),
31+
SeuratToolParameter.create("nExpectedCells", "# Expected Cells", "Only applied if emptyDropsCellRanger is selected. Passed to n.expected.cells argument", "ldk-integerfield", null, false)
3032
), null, null);
3133
}
3234

0 commit comments

Comments
 (0)