Skip to content

Commit 0c6c0cf

Browse files
committed
Support cellbender for CITE-seq and/or RNA
1 parent 441c00e commit 0c6c0cf

File tree

6 files changed

+14
-58
lines changed

6 files changed

+14
-58
lines changed

singlecell/resources/chunks/AppendCiteSeq.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ for (datasetId in names(seuratObjects)) {
1616
matrixDir <- featureData[[datasetId]]
1717
if (!is.null(matrixDir)) {
1818
tryCatch({
19-
seuratObj <- CellMembrane::AppendCiteSeq(seuratObj, unfilteredMatrixDir = matrixDir, normalizeMethod = normalizeMethod, datasetId = datasetId, featureMetadata = featureMetadata, adtWhitelist = adtWhitelist)
19+
seuratObj <- CellMembrane::AppendCiteSeq(seuratObj, unfilteredMatrixDir = matrixDir, normalizeMethod = normalizeMethod, datasetId = datasetId, featureMetadata = featureMetadata, adtWhitelist = adtWhitelist, runCellBender = runCellBender)
2020
}, error = function(e){
2121
print(paste0('Error running AppendCiteSeq for: ', datasetId))
2222
print(conditionMessage(e))

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, useEmptyDropsCellRanger = useEmptyDropsCellRanger, nExpectedCells = nExpectedCells)
5+
seuratObj <- CellMembrane::ReadAndFilter10xData(dataDir = rawCountDir, datasetId = datasetId, datasetName = datasetName, emptyDropsLower = emptyDropsLower, emptyDropsFdrThreshold = emptyDropsFdrThreshold, useEmptyDropsCellRanger = useEmptyDropsCellRanger, nExpectedCells = nExpectedCells, useCellBender = useCellBender)
66

77
if (!is.null(maxAllowableCells) && ncol(seuratObj) > maxAllowableCells) {
88
addErrorMessage(paste0('The seurat object has ', ncol(seuratObj), ' cells, which is more than the max allowable cells (', maxAllowableCells, '). Please review emptyDrops results as this probably means thresholds were suboptimal.'))

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

Lines changed: 1 addition & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -222,58 +222,7 @@ Ext4.define('SingleCell.panel.SingleCellProcessingPanel', {
222222
singleTool: true,
223223
comboValue: 'PrepareRawCounts',
224224
sectionDescription: 'This section allows you to control the parsing of the raw 10x count data',
225-
toolConfig: {
226-
singleCellRawData: [{
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-
additionalExtConfig: {
237-
minValue: 0
238-
}
239-
}, {
240-
fieldXtype: 'ldk-numberfield',
241-
name: 'emptyDropsFdrThreshold',
242-
label: 'EmptyDrops FDR Threshold',
243-
description: 'The FDR limit used to filter the results of DropletUtils::emptyDrops',
244-
defaultValue: 0.001,
245-
additionalExtConfig: {
246-
minValue: 0,
247-
decimalPrecision: 4
248-
}
249-
}, {
250-
fieldXtype: 'ldk-integerfield',
251-
name: 'maxAllowableCells',
252-
label: 'Max Cells Allowed',
253-
description: 'If more than this many cells are predicted by EmptyDrops, the job will fail',
254-
defaultValue: 20000,
255-
additionalExtConfig: {
256-
minValue: 0
257-
}
258-
}, {
259-
fieldXtype: 'checkbox',
260-
name: 'useEmptyDropsCellRanger',
261-
label: 'Use emptyDropsCellRanger',
262-
description: 'If checked, this will run emptyDropsCellRanger instead of emptyDrops',
263-
checked: false,
264-
inputValue: true
265-
}, {
266-
fieldXtype: 'ldk-integerfield',
267-
name: 'nExpectedCells',
268-
label: '# Expected Cells',
269-
description: 'Only applied if emptyDropsCellRanger is selected. Passed to n.expected.cells argument',
270-
defaultValue: 8000,
271-
additionalExtConfig: {
272-
minValue: 0
273-
}
274-
}]
275-
}]
276-
}
225+
toolConfig: results
277226
});
278227
}
279228

singlecell/src/org/labkey/singlecell/SingleCellModule.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,7 @@ public static void registerPipelineSteps()
146146
SequencePipelineService.get().registerPipelineStep(new MergeSeurat.Provider());
147147
SequencePipelineService.get().registerPipelineStep(new NormalizeAndScale.Provider());
148148

149-
//Note: this should not be registered normally. It is used directly in ProcessSingleCellHandler
150-
//SequencePipelineService.get().registerPipelineStep(new PrepareRawCounts.Provider());
149+
SequencePipelineService.get().registerPipelineStep(new PrepareRawCounts.Provider());
151150

152151
SequencePipelineService.get().registerPipelineStep(new RemoveCellCycle.Provider());
153152
SequencePipelineService.get().registerPipelineStep(new RunCellHashing.Provider());

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,14 @@ private static List<ToolParameterDescriptor> getParams()
5050
{
5151
List<ToolParameterDescriptor> ret = new ArrayList<>();
5252
ret.add(SeuratToolParameter.create("normalizeMethod", "Normalization Method", "", "ldk-simplecombo", new JSONObject(){{
53-
put("storeValues", "dsb");
53+
put("storeValues", "dsb;clr");
5454
put("initialValues", "dsb");
5555
}}, "dsb"));
5656

57+
ret.add(SeuratToolParameter.create("runCellBender", "Run CellBender", "If checked, cellbender will be run on the raw count matrix to remove background/ambient RNA signal", "checkbox", new JSONObject(){{
58+
59+
}}, false));
60+
5761
return ret;
5862
}
5963

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package org.labkey.singlecell.pipeline.singlecell;
22

33
import org.apache.logging.log4j.Logger;
4+
import org.json.JSONObject;
45
import org.junit.Assert;
56
import org.junit.Test;
67
import org.labkey.api.pipeline.PipelineJob;
@@ -33,7 +34,10 @@ public Provider()
3334
SeuratToolParameter.create("emptyDropsFdrThreshold", "FDR Threshold", "The FDR limit used to filter the results of DropletUtils::emptyDrops", "ldk-numberfield", null, 0.001),
3435
SeuratToolParameter.create("maxAllowableCells", "Max Cells Allowed", "If more than this many cells are predicted by EmptyDrops, the job will fail", "ldk-integerfield", null, 20000),
3536
SeuratToolParameter.create("useEmptyDropsCellRanger", "Use emptyDropsCellRanger", "If checked, this will run emptyDropsCellRanger instead of emptyDrops", "checkbox", null, false),
36-
SeuratToolParameter.create("nExpectedCells", "# Expected Cells", "Only applied if emptyDropsCellRanger is selected. Passed to n.expected.cells argument", "ldk-integerfield", null, false)
37+
SeuratToolParameter.create("nExpectedCells", "# Expected Cells", "Only applied if emptyDropsCellRanger is selected. Passed to n.expected.cells argument", "ldk-integerfield", null, false),
38+
SeuratToolParameter.create("runCellBender", "Run CellBender", "If checked, cellbender will be run on the raw count matrix (instead of emptyDrops) to remove background/ambient RNA signal", "checkbox", new JSONObject(){{
39+
40+
}}, false)
3741
), null, null);
3842
}
3943

0 commit comments

Comments
 (0)