|
1 | 1 | package org.labkey.singlecell.pipeline.singlecell; |
2 | 2 |
|
| 3 | +import au.com.bytecode.opencsv.CSVReader; |
3 | 4 | import htsjdk.samtools.util.IOUtil; |
4 | 5 | import org.apache.commons.io.FileUtils; |
5 | 6 | import org.apache.commons.lang3.StringUtils; |
|
9 | 10 | import org.labkey.api.pipeline.PipelineJob; |
10 | 11 | import org.labkey.api.pipeline.PipelineJobException; |
11 | 12 | import org.labkey.api.pipeline.RecordedAction; |
| 13 | +import org.labkey.api.reader.Readers; |
12 | 14 | import org.labkey.api.sequenceanalysis.SequenceAnalysisService; |
13 | 15 | import org.labkey.api.sequenceanalysis.SequenceOutputFile; |
14 | 16 | import org.labkey.api.sequenceanalysis.pipeline.AbstractParameterizedOutputHandler; |
@@ -365,10 +367,38 @@ else if (outFiles.length > 1) |
365 | 367 | so.setName(inputFiles.get(0).getName() + ": Vireo Demultiplexing"); |
366 | 368 | } |
367 | 369 | so.setCategory("Vireo Demultiplexing"); |
| 370 | + StringBuilder description = new StringBuilder(); |
368 | 371 | if (vcfFile > -1) |
369 | 372 | { |
370 | | - so.setDescription("Reference VCF ID: " + vcfFile); |
| 373 | + description.append("Reference VCF ID: \n").append(vcfFile); |
371 | 374 | } |
| 375 | + |
| 376 | + File summary = new File(ctx.getOutputDir(), "summary.tsv"); |
| 377 | + if (!summary.exists()) |
| 378 | + { |
| 379 | + throw new PipelineJobException("Missing file: " + summary.getPath()); |
| 380 | + } |
| 381 | + |
| 382 | + description.append("Results:\n"); |
| 383 | + try (CSVReader reader = new CSVReader(Readers.getReader(summary))) |
| 384 | + { |
| 385 | + String[] line; |
| 386 | + while ((line = reader.readNext()) != null) |
| 387 | + { |
| 388 | + if ("Var1".equals(line[0])) |
| 389 | + { |
| 390 | + continue; |
| 391 | + } |
| 392 | + |
| 393 | + description.append(line[0]).append(": ").append(line[1]).append("\n"); |
| 394 | + } |
| 395 | + } |
| 396 | + catch (IOException e) |
| 397 | + { |
| 398 | + throw new PipelineJobException(e); |
| 399 | + } |
| 400 | + |
| 401 | + so.setDescription(StringUtils.trimToEmpty(description.toString())); |
372 | 402 | ctx.addSequenceOutput(so); |
373 | 403 | } |
374 | 404 |
|
|
0 commit comments