Skip to content

Commit ec05a79

Browse files
committed
Support more options for celltypist
1 parent 8f61e90 commit ec05a79

File tree

4 files changed

+30
-3
lines changed

4 files changed

+30
-3
lines changed

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

5-
seuratObj <- RIRA::RunCellTypist(seuratObj)
5+
seuratObj <- RIRA::RunCellTypist(seuratObj, convertAmbiguousToNA = convertAmbiguousToNA, columnPrefix = columnPrefix, pThreshold = pThreshold, minProp = minProp)
66

77
saveData(seuratObj, datasetId)
88
}

singlecell/resources/chunks/TrainCelltypist.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ datasetId <- names(seuratObjects)[[1]]
66
printName(datasetId)
77
seuratObj <- readRDS(seuratObjects[[datasetId]])
88

9-
RIRA::TrainCellTypist(seuratObj, labelField = labelField, minCellsPerClass = minCellsPerClass, modelFile = modelFile, tempFileLocation = '/work')
9+
RIRA::TrainCellTypist(seuratObj, labelField = labelField, minCellsPerClass = minCellsPerClass, excludedClasses = excludedClasses, modelFile = modelFile, tempFileLocation = '/work')

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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
package org.labkey.singlecell.pipeline.singlecell;
22

3+
import org.json.JSONObject;
34
import org.labkey.api.sequenceanalysis.pipeline.AbstractPipelineStepProvider;
45
import org.labkey.api.sequenceanalysis.pipeline.PipelineContext;
6+
import org.labkey.api.singlecell.pipeline.SeuratToolParameter;
57
import org.labkey.api.singlecell.pipeline.SingleCellStep;
68

79
import java.util.Arrays;
@@ -18,7 +20,26 @@ public static class Provider extends AbstractPipelineStepProvider<SingleCellStep
1820
public Provider()
1921
{
2022
super("RunCelltypist", "Run Celltypist (Built-In Model)", "Celltypist", "This will run Celltypist with the Immune_All_Low.pkl model.", Arrays.asList(
23+
SeuratToolParameter.create("convertAmbiguousToNA", "Convert Ambiguous To NA", "If true, any values for majority_voting with commas (indicating they are ambiguous) will be converted to NA", "checkbox", new JSONObject()
24+
{{
25+
put("checked", false);
26+
}}, false),
27+
SeuratToolParameter.create("columnPrefix", "Column Prefix", "If provided, this string will be added to the beginning of all output column names.", "textfield", new JSONObject()
28+
{{
2129

30+
}}, null),
31+
SeuratToolParameter.create("pThreshold", "pThreshold", "This is passed to the --p-thres argument.", "ldk-numberfield", new JSONObject()
32+
{{
33+
put("minValue", 0);
34+
put("maxValue", 1);
35+
put("decimalPrecision", 3);
36+
}}, 0.5),
37+
SeuratToolParameter.create("minProp", "minProp", "This is passed to the --min-prop argument.", "ldk-numberfield", new JSONObject()
38+
{{
39+
put("minValue", 0);
40+
put("maxValue", 1);
41+
put("decimalPrecision", 3);
42+
}}, 0)
2243
), null, null);
2344
}
2445

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,13 @@ public Provider()
4848
SeuratToolParameter.create("minCellsPerClass", "Min Cells Per Class", "Any classes with fewer than this many cells will be dropped", "ldk-integerfield", new JSONObject()
4949
{{
5050
put("minValue", 0);
51-
}}, 100)
51+
}}, 100),
52+
SeuratToolParameter.create("excludedClasses", "Excluded Classes", "Any cells with these labels will be dropped. Note: NA can be used to drop NA values as well.", "textarea", new JSONObject()
53+
{{
54+
put("width", 400);
55+
put("height", 200);
56+
put("delimiter", ";");
57+
}}, "NA", "excludedClasses", true, true)
5258
), null, null);
5359
}
5460

0 commit comments

Comments
 (0)