Skip to content

Commit 4d012c9

Browse files
committed
Add option to limit max cells for SDA
1 parent 3625871 commit 4d012c9

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

singlecell/resources/chunks/RunSDA.R

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ sdaFiles <- data.frame(DatasetId = character(), FileName = character())
77
for (datasetId in names(seuratObjects)) {
88
printName(datasetId)
99
seuratObj <- readRDS(seuratObjects[[datasetId]])
10-
gc()
10+
11+
if (!is.null(maxAllowableCells) && maxAllowableCells > 0 && ncol(seuratObj) > maxAllowableCells) {
12+
stop(paste0('The object has ', ncol(seuratObj), ' which is above the maxAllowableCells: ', maxAllowableCells))
13+
}
1114

1215
outputFolder <- paste0('sdaOutput.', datasetId)
1316
if (dir.exists(outputFolder)) {

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ public Provider()
3535
SeuratToolParameter.create("numComps", "Num Comps", "Passed to SDAtools::run_SDA(). 30 is a good minimum but depends on input data complexity.", "ldk-integerfield", new JSONObject(){{
3636
put("minValue", 0);
3737
}}, 50),
38+
SeuratToolParameter.create("maxAllowableCells", "Max Allowable Cells", "If the input cells are above this value, an error will be thrown. This is designed to limit the amount of data passed to SDA. Use -1 for no limit.", "ldk-integerfield", new JSONObject(){{
39+
put("minValue", -1);
40+
}}, 150000, null, true),
3841
SeuratToolParameter.create("featureInclusionList", "Genes to Include", "These genes, entered comma-separated or one/line, will be added to the default Seurat::VariableFeatures gene set when running PCA", "sequenceanalysis-trimmingtextarea", new JSONObject(){{
3942
put("height", 150);
4043
put("delimiter", ",");

0 commit comments

Comments
 (0)