Skip to content

Commit a19bf4f

Browse files
committed
Support SoupX processing
1 parent c204e61 commit a19bf4f

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
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, useEmptyDropsCellRanger = useEmptyDropsCellRanger, nExpectedCells = nExpectedCells, useCellBender = useCellBender)
5+
seuratObj <- CellMembrane::ReadAndFilter10xData(dataDir = rawCountDir, datasetId = datasetId, datasetName = datasetName, emptyDropsLower = emptyDropsLower, emptyDropsFdrThreshold = emptyDropsFdrThreshold, useEmptyDropsCellRanger = useEmptyDropsCellRanger, nExpectedCells = nExpectedCells, useCellBender = useCellBender, useSoupX = useSoupX)
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/src/org/labkey/singlecell/analysis/AbstractSingleCellHandler.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -607,12 +607,15 @@ private List<SingleCellStep.SeuratObjectWrapper> processRawCounts(JobContext ctx
607607
List<SingleCellStep.SeuratObjectWrapper> inputMatrices = new ArrayList<>();
608608
inputFiles.forEach(x -> {
609609
String datasetName = ctx.getSequenceSupport().getCachedReadset(x.getReadset()).getName();
610-
File source = new File(x.getFile().getParentFile(), "raw_feature_bc_matrix");
611-
if (!source.exists())
610+
File countsDir = new File(x.getFile().getParentFile(), "raw_feature_bc_matrix");
611+
if (!countsDir.exists())
612612
{
613-
throw new IllegalArgumentException("Unable to find file: " + source.getPath());
613+
throw new IllegalArgumentException("Unable to find file: " + countsDir.getPath());
614614
}
615615

616+
// The outs directory:
617+
File source = x.getFile().getParentFile();
618+
616619
try
617620
{
618621
File localCopy = new File(ctx.getOutputDir(), x.getRowid() + "_RawData");

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ public Provider()
3535
SeuratToolParameter.create("maxAllowableCells", "Max Cells Allowed", "If more than this many cells are predicted by EmptyDrops, the job will fail", "ldk-integerfield", null, 20000),
3636
SeuratToolParameter.create("useEmptyDropsCellRanger", "Use emptyDropsCellRanger", "If checked, this will run emptyDropsCellRanger instead of emptyDrops", "checkbox", null, false),
3737
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(){{
38+
SeuratToolParameter.create("useCellBender", "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),
41+
SeuratToolParameter.create("useSoupX", "Run SoupX", "If checked, SoupX will be run on the raw count matrix (instead of emptyDrops) to remove background/ambient RNA signal", "checkbox", new JSONObject(){{
3942

4043
}}, false)
4144
), null, null);

0 commit comments

Comments
 (0)