Skip to content

Commit 072220a

Browse files
committed
Support additional UCell/ssGSEA params
1 parent 9281ed7 commit 072220a

File tree

4 files changed

+16
-3
lines changed

4 files changed

+16
-3
lines changed

singlecell/resources/chunks/CustomUCell.R

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ for (datasetId in names(seuratObjects)) {
2020
print(Seurat::FeaturePlot(seuratObj, features = paste0(n, '_UCell'), min.cutoff = 'q02', max.cutoff = 'q98'))
2121
}
2222

23+
if (!is.null(outputAssayName)) {
24+
dat <- as.matrix(seuratObj@meta.data[paste0(names(toCalculate), '_UCell')])
25+
rownames(dat) <- rownames(seuratObj@meta.data)
26+
colnames(dat) <- gsub(colnames(dat), pattern = '_', replacement = '-')
27+
seuratObj[[outputAssayName]] <- Seurat::CreateAssayObject(data = Matrix::t(dat))
28+
}
29+
2330
saveData(seuratObj, datasetId)
2431

2532
# Cleanup

singlecell/resources/chunks/RunEscape.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 <- readSeuratRDS(seuratObjects[[datasetId]])
44

5-
seuratObj <- CellMembrane::RunEscape(seuratObj, outputAssayName = outputAssayName, doPlot = TRUE)
5+
seuratObj <- CellMembrane::RunEscape(seuratObj, outputAssayName = outputAssayName, doPlot = TRUE, performDimRedux = performDimRedux)
66

77
saveData(seuratObj, datasetId)
88

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@ public Provider()
3737
}}, false, null, true),
3838
SeuratToolParameter.create("assayName", "Assay Name", "Passed directly to UCell::AddModuleScore_UCell.", "textfield", new JSONObject(){{
3939

40-
}}, "RNA")
40+
}}, "RNA"),
41+
SeuratToolParameter.create("outputAssayName", "Output Assay Name", "If provided, the set of UCell scores will be saved in a standalone assay.", "textfield", new JSONObject(){{
42+
43+
}}, null, null, true)
4144
), List.of("/sequenceanalysis/field/TrimmingTextArea.js"), null);
4245
}
4346

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ public Provider()
2323
super("RunEscape", "Escape/ssGSEA", "escape", "Runs escape to perform ssGSEA using Hallmark gene sets.", Arrays.asList(
2424
SeuratToolParameter.create("outputAssayName", "Output Assay Name", "The name of the assay to store results", "textfield", new JSONObject(){{
2525
put("allowBank", false);
26-
}}, "escape.ssGSEA")
26+
}}, "escape.ssGSEA"),
27+
SeuratToolParameter.create("performDimRedux", "Perform DimRedux", "If true, the standard seurat PCA/FindClusters/UMAP process will be run on the escape data. This may be most useful when using a customGeneSet or a smaller set of features/pathways", "checkbox", new JSONObject(){{
28+
29+
}}, false, null, true)
2730
), null, null);
2831
}
2932

0 commit comments

Comments
 (0)