Skip to content

Commit d777369

Browse files
committed
Catch errors and throw exceptions earlier
1 parent 3d75537 commit d777369

File tree

4 files changed

+12
-3
lines changed

4 files changed

+12
-3
lines changed

SequenceAnalysis/src/org/labkey/sequenceanalysis/analysis/CellHashingHandler.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -805,7 +805,11 @@ private HtoMergeResult possiblyMergeHtoFastqs(Readset htoReadset, File outdir, L
805805
File file1;
806806
File file2;
807807

808-
if (htoReadset.getReadData().size() != 1)
808+
if (htoReadset.getReadData().isEmpty())
809+
{
810+
throw new PipelineJobException("No HTO fastqs exist for readset: " + htoReadset.getName());
811+
}
812+
else if (htoReadset.getReadData().size() != 1)
809813
{
810814
log.info("Merging HTO data");
811815
file1 = new File(outdir, FileUtil.makeLegalName(htoReadset.getName() + "hto.R1.fastq.gz"));

SequenceAnalysis/src/org/labkey/sequenceanalysis/pipeline/SequenceJobSupportImpl.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@ public void cacheReadset(int readsetId, User u)
8888

8989
public void cacheReadset(SequenceReadsetImpl m)
9090
{
91+
if (m.hasArchivedData())
92+
{
93+
throw new IllegalArgumentException("Readset has archived data, cannot be used for pipeline jobs");
94+
}
95+
9196
m.cacheForRemoteServer();
9297
if (m.existsInDatabase())
9398
{

SequenceAnalysis/src/org/labkey/sequenceanalysis/util/FastqMerger.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ private void mergeUsingCat(File output, List<File> inputs) throws PipelineJobExc
8484
writer.write("{\n");
8585
bashCommands.forEach(x -> writer.write(x + '\n'));
8686

87-
writer.write("} | gzip -c > " + output + "\n");
87+
writer.write("} | gzip -c > " + output.getPath() + "\n");
8888
}
8989

9090
SimpleScriptWrapper wrapper = new SimpleScriptWrapper(_logger);

SequenceAnalysis/src/org/labkey/sequenceanalysis/util/SequenceUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ else if (!samples.equals(header.getGenotypeSamples()))
508508
threads = Math.max(1, threads - 1);
509509
}
510510

511-
writer.write("} | bgzip -f" + (compressionLevel == null ? "" : " --compress-level 9") + (threads == null ? "" : " --threads " + threads) + " > " + outputGzip + "\n");
511+
writer.write("} | bgzip -f" + (compressionLevel == null ? "" : " --compress-level 9") + (threads == null ? "" : " --threads " + threads) + " > " + outputGzip.getPath() + "\n");
512512
}
513513

514514
SimpleScriptWrapper wrapper = new SimpleScriptWrapper(log);

0 commit comments

Comments
 (0)