Skip to content

Commit f19c774

Browse files
committed
Bugfix to seurat description logic
1 parent 6cdb8f3 commit f19c774

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

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

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -960,6 +960,7 @@ public static String getOutputDescription(JobContext ctx, File seuratObj, @Nulla
960960
boolean hashingUsed = true;
961961
while ((line = reader.readNext()) != null)
962962
{
963+
// This will test whether this is the first line or not
963964
if (hashingIdx == -1)
964965
{
965966
hashingIdx = Arrays.asList(line).indexOf("HTO.Classification");
@@ -971,10 +972,6 @@ public static String getOutputDescription(JobContext ctx, File seuratObj, @Nulla
971972
}
972973

973974
saturationIdx = Arrays.asList(line).indexOf("Saturation.RNA");
974-
if (saturationIdx == -1)
975-
{
976-
throw new PipelineJobException("Unable to find Saturation.RNA field in file: " + metaTable.getName());
977-
}
978975
}
979976
else
980977
{
@@ -1004,8 +1001,11 @@ else if ("NotUsed".equals(val))
10041001
}
10051002
}
10061003

1007-
double saturation = Double.parseDouble(line[saturationIdx]);
1008-
totalSaturation += saturation;
1004+
if (saturationIdx >= 0)
1005+
{
1006+
double saturation = Double.parseDouble(line[saturationIdx]);
1007+
totalSaturation += saturation;
1008+
}
10091009
}
10101010
}
10111011

@@ -1029,7 +1029,10 @@ else if ("NotUsed".equals(val))
10291029
descriptions.add("Hashing not used");
10301030
}
10311031

1032-
descriptions.add("Mean RNA Saturation: " + (totalSaturation / (double) totalCells));
1032+
if (totalSaturation > 0)
1033+
{
1034+
descriptions.add("Mean RNA Saturation: " + (totalSaturation / (double) totalCells));
1035+
}
10331036
}
10341037
catch (IOException e)
10351038
{

0 commit comments

Comments
 (0)