Skip to content

Commit 94331b0

Browse files
committed
Support additional scRNA-seq tools
1 parent 472eeb3 commit 94331b0

File tree

6 files changed

+107
-1
lines changed

6 files changed

+107
-1
lines changed

singlecell/resources/chunks/CustomUCell.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ for (datasetId in names(seuratObjects)) {
1414

1515
seuratObj <- UCell::AddModuleScore_UCell(seuratObj, features = toCalculate, storeRanks = storeRanks, assay = assayName)
1616
for (n in names(toCalculate)) {
17-
print(Seurat::FeaturePlot(seuratObj, features = paste0(n, '_UCell'), min.cutoff = 'q02', max.cuttoff = 'q98'))
17+
print(Seurat::FeaturePlot(seuratObj, features = paste0(n, '_UCell'), min.cutoff = 'q02', max.cutoff = 'q98'))
1818
}
1919

2020
saveData(seuratObj, datasetId)
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
for (datasetId in names(seuratObjects)) {
2+
printName(datasetId)
3+
seuratObj <- readSeuratRDS(seuratObjects[[datasetId]])
4+
5+
seuratObj <- CellMembrane::RunCsCore(seuratObj, saveFile = 'cscoreResults.rds')
6+
7+
saveData(seuratObj, datasetId)
8+
9+
# Cleanup
10+
rm(seuratObj)
11+
gc()
12+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
for (datasetId in names(seuratObjects)) {
2+
printName(datasetId)
3+
seuratObj <- readSeuratRDS(seuratObjects[[datasetId]])
4+
5+
seuratObj <- CellMembrane::RunEscape(seuratObj, outputAssayName = outputAssayName, doPlot = TRUE)
6+
7+
saveData(seuratObj, datasetId)
8+
9+
# Cleanup
10+
rm(seuratObj)
11+
gc()
12+
}

singlecell/src/org/labkey/singlecell/SingleCellModule.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,8 @@ public static void registerPipelineSteps()
226226
SequencePipelineService.get().registerPipelineStep(new ScoreCellCycle.Provider());
227227
SequencePipelineService.get().registerPipelineStep(new TrainScTour.Provider());
228228
SequencePipelineService.get().registerPipelineStep(new PredictScTour.Provider());
229+
SequencePipelineService.get().registerPipelineStep(new RunEscape.Provider());
230+
SequencePipelineService.get().registerPipelineStep(new RunCsCore.Provider());
229231

230232
SequenceAnalysisService.get().registerReadsetListener(new SingleCellReadsetListener());
231233
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
package org.labkey.singlecell.pipeline.singlecell;
2+
3+
import org.json.JSONObject;
4+
import org.labkey.api.sequenceanalysis.pipeline.AbstractPipelineStepProvider;
5+
import org.labkey.api.sequenceanalysis.pipeline.PipelineContext;
6+
import org.labkey.api.singlecell.pipeline.SeuratToolParameter;
7+
import org.labkey.api.singlecell.pipeline.SingleCellStep;
8+
9+
import java.util.Arrays;
10+
import java.util.Collections;
11+
12+
public class RunCsCore extends AbstractCellMembraneStep
13+
{
14+
public RunCsCore(PipelineContext ctx, Provider provider)
15+
{
16+
super(provider, ctx);
17+
}
18+
19+
public static class Provider extends AbstractPipelineStepProvider<SingleCellStep>
20+
{
21+
public Provider()
22+
{
23+
super("RunCsCore", "CS-CORE", "CS-CORE", "Run CS-CORE on the seurat object to identify gene modules.", Collections.emptyList(), null, null);
24+
}
25+
26+
@Override
27+
public RunCsCore create(PipelineContext ctx)
28+
{
29+
return new RunCsCore(ctx, this);
30+
}
31+
}
32+
33+
@Override
34+
public String getFileSuffix()
35+
{
36+
return "cscore";
37+
}
38+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
package org.labkey.singlecell.pipeline.singlecell;
2+
3+
import org.json.JSONObject;
4+
import org.labkey.api.sequenceanalysis.pipeline.AbstractPipelineStepProvider;
5+
import org.labkey.api.sequenceanalysis.pipeline.PipelineContext;
6+
import org.labkey.api.singlecell.pipeline.SeuratToolParameter;
7+
import org.labkey.api.singlecell.pipeline.SingleCellStep;
8+
9+
import java.util.Arrays;
10+
import java.util.Collections;
11+
12+
public class RunEscape extends AbstractCellMembraneStep
13+
{
14+
public RunEscape(PipelineContext ctx, Provider provider)
15+
{
16+
super(provider, ctx);
17+
}
18+
19+
public static class Provider extends AbstractPipelineStepProvider<SingleCellStep>
20+
{
21+
public Provider()
22+
{
23+
super("RunEscape", "Escape/ssGSEA", "escape", "Runs escape to perform ssGSEA using Hallmark gene sets.", Arrays.asList(
24+
SeuratToolParameter.create("outputAssayName", "Output Assay Name", "The name of the assay to store results", "textfield", new JSONObject(){{
25+
put("allowBank", false);
26+
}}, "escape.ssGSEA")
27+
), null, null);
28+
}
29+
30+
@Override
31+
public RunEscape create(PipelineContext ctx)
32+
{
33+
return new RunEscape(ctx, this);
34+
}
35+
}
36+
37+
@Override
38+
public String getFileSuffix()
39+
{
40+
return "escape";
41+
}
42+
}

0 commit comments

Comments
 (0)