Skip to content

Commit a4640ab

Browse files
committed
Add option to run DietSeurat prior to merge
1 parent c8cc2e3 commit a4640ab

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

singlecell/resources/chunks/MergeSeurat.R

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@ if (length(seuratObjects) == 1) {
22
print('There is only one seurat object, no need to merge')
33
newSeuratObjects <- seuratObjects
44
} else {
5+
if (exists('doDiet') && doDiet) {
6+
print('Running DietSeurat on inputs')
7+
for (datasetId in seuratObjects) {
8+
seuratObjects[[datasetId]] <- Seurat::DietSeurat(seuratObjects[[datasetId]])
9+
}
10+
11+
gc()
12+
}
13+
514
newSeuratObjects[[projectName]] <- CellMembrane::MergeSeuratObjs(seuratObjects, projectName = projectName)
615
}
716

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ public Provider()
2626
super("MergeSeurat", "Merge Seurat Objects", "CellMembrane/Seurat", "This will merge the incoming seurat objects into a single object, merging all assays. Note: this will discard any normalization or DimRedux data, and performs zero validation to ensure this is compatible with downstream steps.", Arrays.asList(
2727
SeuratToolParameter.create("projectName", "New Dataset Name", "The updated baseline for this merged object.", "textfield", new JSONObject(){{
2828
put("allowBlank", false);
29-
}}, null)
29+
}}, null),
30+
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)
3031
), null, null);
3132
}
3233

0 commit comments

Comments
 (0)