Skip to content

Commit 8b225fb

Browse files
committed
Include RIRA/Unknown in seurat description
1 parent 86605c9 commit 8b225fb

3 files changed

Lines changed: 18 additions & 4 deletions

File tree

singlecell/resources/chunks/RunRiraClassification.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 <- RIRA::Classify_ImmuneCells(seuratObj, maxBatchSize = maxBatchSize, retainProbabilityMatrix = retainProbabilityMatrix)
5+
seuratObj <- RIRA::Classify_ImmuneCells(seuratObj, maxBatchSize = maxBatchSize, retainProbabilityMatrix = retainProbabilityMatrix, maxAllowedUnknown = maxAllowedUnknown)
66
seuratObj <- RIRA::Classify_TNK(seuratObj, maxBatchSize = maxBatchSize, retainProbabilityMatrix = retainProbabilityMatrix)
77

88
seuratObj <- RIRA::Classify_Myeloid(seuratObj, maxBatchSize = maxBatchSize, retainProbabilityMatrix = retainProbabilityMatrix)

singlecell/src/org/labkey/singlecell/analysis/AbstractSingleCellHandler.java

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -948,6 +948,7 @@ public static String getOutputDescription(JSONObject jsonParams, Logger log, Fil
948948
int totalDiscordant = 0;
949949
int lowOrNegative = 0;
950950
int totalDoublet = 0;
951+
int totalUnknown = 0;
951952
double totalSaturation = 0.0;
952953
Set<String> subjectIds = new HashSet<>();
953954

@@ -1073,6 +1074,10 @@ else if ("NotUsed".equals(val))
10731074
cellsLackingCDR3++;
10741075
}
10751076
}
1077+
else if ("Unknown".equals(line[riraIdx]))
1078+
{
1079+
totalUnknown++;
1080+
}
10761081
}
10771082

10781083
if (subjectIdIdx > 0)
@@ -1122,12 +1127,15 @@ else if ("NotUsed".equals(val))
11221127
}
11231128
else if (riraIdx == -1 || traIdx == -1)
11241129
{
1125-
descriptions.add("TCR information not present");
1130+
if (riraIdx != -1)
1131+
{
1132+
descriptions.add("TCR information not present");
1133+
}
11261134
}
11271135

1128-
if (!subjectIds.isEmpty())
1136+
if (riraIdx != -1)
11291137
{
1130-
descriptions.add("Distinct SubjectIds: " + subjectIds.size());
1138+
descriptions.add("% RIRA/Unknown: " + pf.format((double)totalUnknown / (double)totalCells));
11311139
}
11321140
}
11331141
catch (IOException e)

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ public Provider()
2727
SeuratToolParameter.create("retainProbabilityMatrix", "Retain Probability Matrix", "If true, the celltypist probability_matrix with per-class probabilities will be stored in meta.data", "checkbox", new JSONObject()
2828
{{
2929
put("checked", true);
30+
}}, true),
31+
SeuratToolParameter.create("maxAllowedUnknown", "Max Allowed Unknown", "If provided, ", "ldk-numberfield", new JSONObject()
32+
{{
33+
put("minValue", 0);
34+
put("maxValue", 1);
35+
put("decimalPrecision", 2);
3036
}}, true)
3137
), null, null);
3238
}

0 commit comments

Comments
 (0)