Skip to content

Commit be6c0f2

Browse files
committed
Expose celltypist batch size argument for large inputs
1 parent eb5b1a8 commit be6c0f2

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

singlecell/resources/chunks/RunCelltypist.R

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

55
for (mn in modelNames) {
6-
seuratObj <- RIRA::RunCellTypist(seuratObj, modelName = paste0(mn, '.pkl'), convertAmbiguousToNA = convertAmbiguousToNA, columnPrefix = paste0('celltypist.', mn, '.'), pThreshold = pThreshold, minProp = minProp, maxAllowableClasses = maxAllowableClasses, minFractionToInclude = minFractionToInclude, useMajorityVoting = useMajorityVoting, mode = mode)
6+
seuratObj <- RIRA::RunCellTypist(seuratObj, modelName = paste0(mn, '.pkl'), convertAmbiguousToNA = convertAmbiguousToNA, columnPrefix = paste0('celltypist.', mn, '.'), pThreshold = pThreshold, minProp = minProp, maxAllowableClasses = maxAllowableClasses, minFractionToInclude = minFractionToInclude, useMajorityVoting = useMajorityVoting, mode = mode, maxBatchSize = maxBatchSize)
77
}
88

99
saveData(seuratObj, datasetId)

singlecell/resources/chunks/RunCelltypistCustomModel.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
printName(datasetId)
33
seuratObj <- readRDS(seuratObjects[[datasetId]])
44

5-
seuratObj <- RIRA::RunCellTypist(seuratObj, modelName = modelFile, columnPrefix = columnPrefix, convertAmbiguousToNA = convertAmbiguousToNA, pThreshold = pThreshold, minProp = minProp, maxAllowableClasses = maxAllowableClasses, minFractionToInclude = minFractionToInclude, useMajorityVoting = useMajorityVoting, mode = mode)
5+
seuratObj <- RIRA::RunCellTypist(seuratObj, modelName = modelFile, columnPrefix = columnPrefix, convertAmbiguousToNA = convertAmbiguousToNA, pThreshold = pThreshold, minProp = minProp, maxAllowableClasses = maxAllowableClasses, minFractionToInclude = minFractionToInclude, useMajorityVoting = useMajorityVoting, mode = mode, maxBatchSize = maxBatchSize)
66

77
saveData(seuratObj, datasetId)
88
}

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,11 @@ public Provider()
6262
put("minValue", 0);
6363
put("maxValue", 1);
6464
put("decimalPrecision", 3);
65-
}}, 0)
65+
}}, 0),
66+
SeuratToolParameter.create("maxBatchSize", "Max Cells Per Batch", "If the object has more than this many cells, celltypist will be run in batches", "ldk-integerfield", new JSONObject()
67+
{{
68+
put("minValue", 0);
69+
}}, 500000)
6670
), null, null);
6771
}
6872

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,11 @@ public Provider()
6969
put("minValue", 0);
7070
put("maxValue", 1);
7171
put("decimalPrecision", 3);
72-
}}, 0)
72+
}}, 0),
73+
SeuratToolParameter.create("maxBatchSize", "Max Cells Per Batch", "If the object has more than this many cells, celltypist will be run in batches", "ldk-integerfield", new JSONObject()
74+
{{
75+
put("minValue", 0);
76+
}}, 500000)
7377
), PageFlowUtil.set("sequenceanalysis/field/SequenceOutputFileSelectorField.js"), null);
7478
}
7579

0 commit comments

Comments
 (0)