Skip to content

Commit 89e3a11

Browse files
committed
Allow jobs to control more EmptyDrop options
1 parent c31f9a7 commit 89e3a11

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

singlecell/resources/chunks/PrepareRawCounts.R

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ for (datasetId in names(seuratObjects)) {
44
datasetName <- datasetIdToName[[datasetId]]
55
seuratObj <- CellMembrane::ReadAndFilter10xData(dataDir = rawCountDir, datasetId = datasetId, datasetName = datasetName, emptyDropsLower = emptyDropsLower, emptyDropsFdrThreshold = emptyDropsFdrThreshold)
66

7+
if (!is.null(maxAllowableCells) && ncol(seuratObj) > maxAllowableCells) {
8+
stop(paste0('The seurat object has more than the max allowable cells. Please review emptyDrops results'))
9+
}
10+
711
saveData(seuratObj, datasetId)
812

913
# Cleanup

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,13 @@ Ext4.define('SingleCell.panel.SingleCellProcessingPanel', {
219219
defaultValue: 0.001,
220220
minValue: 0,
221221
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
222229
}]
223230
}];
224231

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ public Provider()
2525
{
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),
28-
SeuratToolParameter.create("emptyDropsFdrThreshold", "FDR Threshold", "The FDR limit used to filter the results of DropletUtils::emptyDrops", "ldk-numberfield", null, 0.001)
28+
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)
2930
), null, null);
3031
}
3132

0 commit comments

Comments
 (0)