Skip to content

Commit d5b1363

Browse files
committed
Improve validation of VDJ calls
1 parent 8711ae5 commit d5b1363

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

singlecell/src/org/labkey/singlecell/CellHashingServiceImpl.java

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -974,7 +974,29 @@ public File generateCellHashingCalls(File citeSeqCountOutDir, File outputDir, St
974974
{
975975
try (BufferedReader reader = Readers.getReader(callsFile))
976976
{
977-
callFileValid = reader.readLine() != null;
977+
int lineIdx = 0;
978+
String line;
979+
while ((line = reader.readLine()) != null)
980+
{
981+
lineIdx++;
982+
line = StringUtils.trimToNull(line);
983+
if (line == null)
984+
{
985+
callFileValid = false;
986+
break;
987+
}
988+
989+
if (lineIdx == 1 && !line.startsWith("cellbarcode"))
990+
{
991+
callFileValid = false;
992+
break;
993+
}
994+
995+
if (lineIdx > 1)
996+
{
997+
break;
998+
}
999+
}
9781000
}
9791001
catch (IOException e)
9801002
{

0 commit comments

Comments
 (0)