|
1 | 1 | package org.labkey.sequenceanalysis.run.analysis; |
2 | 2 |
|
3 | 3 | import htsjdk.samtools.SAMFileHeader; |
| 4 | +import org.apache.commons.io.FileUtils; |
4 | 5 | import org.labkey.api.pipeline.PipelineJobException; |
5 | 6 | import org.labkey.api.sequenceanalysis.model.AnalysisModel; |
6 | 7 | import org.labkey.api.sequenceanalysis.model.Readset; |
|
20 | 21 | import org.labkey.api.util.Path; |
21 | 22 |
|
22 | 23 | import java.io.File; |
| 24 | +import java.io.IOException; |
23 | 25 | import java.util.ArrayList; |
24 | 26 | import java.util.Arrays; |
25 | 27 | import java.util.List; |
@@ -106,13 +108,25 @@ public Output performAnalysisPerSampleRemote(Readset rs, File inputBam, Referenc |
106 | 108 |
|
107 | 109 | getWrapper().execute(toRun); |
108 | 110 |
|
109 | | - File outFile = FileUtil.appendPath(outputDir, Path.parse("specHLA/hla.result.txt")); |
| 111 | + File spechlaDir = FileUtil.appendName(outputDir, "specHLA"); |
| 112 | + File outFile = FileUtil.appendName(spechlaDir, "hla.result.txt"); |
110 | 113 | if (!outFile.exists()) |
111 | 114 | { |
112 | 115 | throw new PipelineJobException("SpecHLA result file does not exist: " + outFile.getPath()); |
113 | 116 | } |
114 | 117 |
|
115 | | - output.addSequenceOutput(outFile, FileUtil.getBaseName(inputBam) + ": HLA Typing", "specHLA Genotyping", rs.getReadsetId(), null, referenceGenome.getGenomeId(), null); |
| 118 | + output.addIntermediateFile(spechlaDir); |
| 119 | + File copiedFile = FileUtil.appendName(outputDir, outFile.getName()); |
| 120 | + try |
| 121 | + { |
| 122 | + FileUtils.copyFile(outFile, copiedFile); |
| 123 | + } |
| 124 | + catch (IOException e) |
| 125 | + { |
| 126 | + throw new PipelineJobException(e); |
| 127 | + } |
| 128 | + |
| 129 | + output.addSequenceOutput(copiedFile, FileUtil.getBaseName(inputBam) + ": HLA Typing", "specHLA Genotyping", rs.getReadsetId(), null, referenceGenome.getGenomeId(), null); |
116 | 130 |
|
117 | 131 | return output; |
118 | 132 | } |
|
0 commit comments