Skip to content

Commit 9281ed7

Browse files
committed
Turn on automatic DietSeurat when merging many objects
1 parent c834217 commit 9281ed7

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

singlecell/resources/chunks/MergeSeurat.R

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
doDiet <- exists('doDiet') && doDiet
2+
disableAutoDietSeurat <- exists('disableAutoDietSeurat') && disableAutoDietSeurat
3+
if (!doDiet && length(seuratObjects) > 20 && !disableAutoDietSeurat) {
4+
logger::log_info('More than 20 objects are being merged, turning on DietSeurat')
5+
doDiet <- TRUE
6+
}
27

38
mergeBatch <- function(dat) {
49
toMerge <- list()

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ public Provider()
2828
put("allowBlank", false);
2929
put("doNotIncludeInTemplates", true);
3030
}}, null),
31-
SeuratToolParameter.create("doDiet", "Run DietSeurat", "If selected, this will run DietSeurat and gc() on the incoming seurat objects prior to merge. This is primarily to help with memory.", "checkbox", null, false, "dietSeurat", true, false),
31+
SeuratToolParameter.create("doDiet", "Run DietSeurat", "If selected, this will run DietSeurat and gc() on the incoming seurat objects prior to merge. This is primarily to help with memory.", "checkbox", null, true, "dietSeurat", true, false),
32+
SeuratToolParameter.create("disableAutoDietSeurat", "Disable Auto DietSeurat", "By default, this step will enable DietSeurat if if you try to merge more than 20 objects. This disables that behavior.", "checkbox", null, false),
3233
SeuratToolParameter.create("errorOnBarcodeSuffix", "Error On Cell Barcode Suffixes", "In certain cases, software appends a digit (i.e. -1) to the end of cell barcodes; however, no code in DISCVR should do this. These are a problem if different datasets are inconsistent when using them. If this setting is checked, the code will error if these are encountered.", "checkbox", null, true, "errorOnBarcodeSuffix", true, false),
3334
SeuratToolParameter.create("assaysToDrop", "Assays to Drop", "These assays, entered comma-separated or one/line, will be dropped prior to merge.", "sequenceanalysis-trimmingtextarea", new JSONObject(){{
3435
put("height", 150);

0 commit comments

Comments
 (0)