Skip to content

Commit cd83bdf

Browse files
committed
Include SubjectId for file description
1 parent 6393ae5 commit cd83bdf

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -963,6 +963,7 @@ public static String getOutputDescription(JSONObject jsonParams, Logger log, Fil
963963
int lowOrNegative = 0;
964964
int totalDoublet = 0;
965965
double totalSaturation = 0.0;
966+
Set<String> subjectIds = new HashSet<>();
966967

967968
int hashingIdx = -1;
968969
int saturationIdx = -1;
@@ -972,6 +973,7 @@ public static String getOutputDescription(JSONObject jsonParams, Logger log, Fil
972973
int trbIdx = -1;
973974
int trdIdx = -1;
974975
int trgIdx = -1;
976+
int subjectIdIdx = -1;
975977

976978
int totalTNK = 0;
977979
int cellsWithTRA = 0;
@@ -998,6 +1000,7 @@ public static String getOutputDescription(JSONObject jsonParams, Logger log, Fil
9981000
trdIdx = Arrays.asList(line).indexOf("TRD");
9991001
trgIdx = Arrays.asList(line).indexOf("TRG");
10001002
riraIdx = Arrays.asList(line).indexOf("RIRA_Immune_v2.cellclass");
1003+
subjectIdIdx = Arrays.asList(line).indexOf("SubjectIdId");
10011004
}
10021005
else
10031006
{
@@ -1085,6 +1088,15 @@ else if ("NotUsed".equals(val))
10851088
}
10861089
}
10871090
}
1091+
1092+
if (subjectIdIdx > 0)
1093+
{
1094+
String subjectId = StringUtils.trimToNull(line[subjectIdIdx]);
1095+
if (subjectId != null && !"NA".equals(subjectId))
1096+
{
1097+
subjectIds.add(subjectId);
1098+
}
1099+
}
10881100
}
10891101
}
10901102

@@ -1126,6 +1138,11 @@ else if (riraIdx == -1 || traIdx == -1)
11261138
{
11271139
descriptions.add("TCR information not present");
11281140
}
1141+
1142+
if (!subjectIds.isEmpty())
1143+
{
1144+
descriptions.add("Distinct SubjectIds: " + subjectIds.size());
1145+
}
11291146
}
11301147
catch (IOException e)
11311148
{

0 commit comments

Comments
 (0)