Skip to content

Commit d4fe3ad

Browse files
committed
Split RunScGate step to make less confusing
1 parent 30d5a29 commit d4fe3ad

File tree

5 files changed

+65
-25
lines changed

5 files changed

+65
-25
lines changed

singlecell/resources/chunks/RunScGate.R

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@ for (datasetId in names(seuratObjects)) {
22
printName(datasetId)
33
seuratObj <- readRDS(seuratObjects[[datasetId]])
44

5-
if (useRhesusDefaults) {
6-
seuratObj <- RIRA::RunScGateWithRhesusModels(seuratObj, dropAmbiguousConsensusValues = dropAmbiguousConsensusValues, assay = assayName)
7-
} else {
8-
seuratObj <- RIRA::RunScGateForModels(seuratObj, modelNames = modelNames, labelRename = list(Tcell = 'T_NK', NK = 'T_NK'), dropAmbiguousConsensusValues = dropAmbiguousConsensusValues, consensusModels = consensusModels, assay = assayName)
9-
}
5+
seuratObj <- RIRA::RunScGateWithRhesusModels(seuratObj, dropAmbiguousConsensusValues = dropAmbiguousConsensusValues, assay = assayName)
106

117
saveData(seuratObj, datasetId)
128
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
for (datasetId in names(seuratObjects)) {
2+
printName(datasetId)
3+
seuratObj <- readRDS(seuratObjects[[datasetId]])
4+
5+
seuratObj <- RIRA::RunScGateForModels(seuratObj, modelNames = modelNames, dropAmbiguousConsensusValues = dropAmbiguousConsensusValues, consensusModels = consensusModels, assay = assayName)
6+
7+
saveData(seuratObj, datasetId)
8+
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ public static void registerPipelineSteps()
199199
SequencePipelineService.get().registerPipelineStep(new PlotAverageCiteSeqCounts.Provider());
200200
SequencePipelineService.get().registerPipelineStep(new DropCiteSeq.Provider());
201201
SequencePipelineService.get().registerPipelineStep(new RunScGate.Provider());
202+
SequencePipelineService.get().registerPipelineStep(new RunScGateBuiltin.Provider());
202203
SequencePipelineService.get().registerPipelineStep(new RunCelltypist.Provider());
203204
SequencePipelineService.get().registerPipelineStep(new RunCelltypistCustomModel.Provider());
204205
SequencePipelineService.get().registerPipelineStep(new RunRiraClassification.Provider());

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

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,7 @@ public static class Provider extends AbstractPipelineStepProvider<SingleCellStep
1919
{
2020
public Provider()
2121
{
22-
super("RunScGate", "Run scGate", "scGate", "This will run scGate with the default built-in models and create a consensus call.", Arrays.asList(
23-
SeuratToolParameter.create("useRhesusDefaults", "Use Rhesus Default", "If checked, this will use the rhesus defaults, RIRA::RunScGateWithRhesusModels, and ignore the selections below", "checkbox", new JSONObject(){{
24-
put("checked", true);
25-
}}, true),
26-
SeuratToolParameter.create("modelNames", "Model(s)", "The set of scGate modules to test.", "ldk-simplecombo", new JSONObject()
27-
{{
28-
put("multiSelect", true);
29-
put("storeValues", "Bcell;Tcell;NK;Myeloid;Stromal;pDC;Erythrocyte;Epithelial;Platelet_MK");
30-
put("initialValues", "Bcell;Tcell;NK;Myeloid;Stromal;pDC;Epithelial;Epithelial;Platelet_MK");
31-
put("delimiter", ";");
32-
put("joinReturnValue", true);
33-
}}, null, null, true, true),
34-
SeuratToolParameter.create("consensusModels", "Models for Consensus", "The subset of models to be considered for the consensus call.", "ldk-simplecombo", new JSONObject()
35-
{{
36-
put("multiSelect", true);
37-
put("storeValues", "Bcell;Tcell;NK;Myeloid;Stromal;pDC;Erythrocyte;Epithelial;Platelet_MK");
38-
put("initialValues", "Bcell;Tcell;NK;Myeloid;Stromal;pDC;Epithelial");
39-
put("delimiter", ";");
40-
put("joinReturnValue", true);
41-
}}, null, null, true, true),
22+
super("RunScGate", "Run scGate", "scGate", "This will run scGate with the default rhesus RIRA models and create a consensus call.", Arrays.asList(
4223
SeuratToolParameter.create("dropAmbiguousConsensusValues", "Drop Ambiguous Consensus Values", "If checked, any consensus calls that are ambiguous will be set to NA", "checkbox", new JSONObject(){{
4324
put("checked", true);
4425
}}, true),
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
package org.labkey.singlecell.pipeline.singlecell;
2+
3+
import org.json.old.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+
11+
public class RunScGateBuiltin extends AbstractRiraStep
12+
{
13+
public RunScGateBuiltin(PipelineContext ctx, RunScGateBuiltin.Provider provider)
14+
{
15+
super(provider, ctx);
16+
}
17+
18+
public static class Provider extends AbstractPipelineStepProvider<SingleCellStep>
19+
{
20+
public Provider()
21+
{
22+
super("RunScGateBuildin", "Run scGate (built-in)", "scGate", "This will run scGate with the default built-in models and create a consensus call.", Arrays.asList(
23+
SeuratToolParameter.create("modelNames", "Model(s)", "The set of scGate modules to test.", "ldk-simplecombo", new JSONObject()
24+
{{
25+
put("multiSelect", true);
26+
put("storeValues", "Bcell;Tcell;NK;Myeloid;Stromal;pDC;Erythrocyte;Epithelial;Platelet_MK");
27+
put("initialValues", "Bcell;Tcell;NK;Myeloid;Stromal;pDC;Epithelial;Epithelial;Platelet_MK");
28+
put("delimiter", ";");
29+
put("joinReturnValue", true);
30+
}}, null, null, true, true),
31+
SeuratToolParameter.create("consensusModels", "Models for Consensus", "The subset of models to be considered for the consensus call.", "ldk-simplecombo", new JSONObject()
32+
{{
33+
put("multiSelect", true);
34+
put("storeValues", "Bcell;Tcell;NK;Myeloid;Stromal;pDC;Erythrocyte;Epithelial;Platelet_MK");
35+
put("initialValues", "Bcell;Tcell;NK;Myeloid;Stromal;pDC;Epithelial");
36+
put("delimiter", ";");
37+
put("joinReturnValue", true);
38+
}}, null, null, true, true),
39+
SeuratToolParameter.create("dropAmbiguousConsensusValues", "Drop Ambiguous Consensus Values", "If checked, any consensus calls that are ambiguous will be set to NA", "checkbox", new JSONObject(){{
40+
put("checked", true);
41+
}}, true),
42+
SeuratToolParameter.create("assayName", "Assay Name", "Passed directly to UCell::AddModuleScore_UCell.", "textfield", new JSONObject(){{
43+
44+
}}, "RNA")
45+
), null, null);
46+
}
47+
48+
@Override
49+
public RunScGateBuiltin create(PipelineContext ctx)
50+
{
51+
return new RunScGateBuiltin(ctx, this);
52+
}
53+
}
54+
}

0 commit comments

Comments
 (0)