Skip to content

Commit b570b31

Browse files
committed
Bugfix bgzip compression after sorting BED file
1 parent 44158cf commit b570b31

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,12 @@ public static void sortROD(File input, Logger log, Integer startColumnIdx) throw
451451
//then sort/append the records
452452
CommandWrapper wrapper = SequencePipelineService.get().getCommandWrapper(log);
453453
String cat = isCompressed ? "zcat" : "cat";
454-
wrapper.execute(Arrays.asList("/bin/sh", "-c", cat + " '" + input.getPath() + "' | grep -v '^#' | sort -s -V -k1,1f" + (startColumnIdx == null ? "" : " -k" + startColumnIdx + "," + startColumnIdx + "n") + (isCompressed ? " | bgzip -f " : "")), ProcessBuilder.Redirect.appendTo(sorted));
454+
wrapper.execute(Arrays.asList("/bin/sh", "-c", cat + " '" + input.getPath() + "' | grep -v '^#' | sort -s -V -k1,1f" + (startColumnIdx == null ? "" : " -k" + startColumnIdx + "," + startColumnIdx + "n")), ProcessBuilder.Redirect.appendTo(sorted));
455+
456+
if (isCompressed)
457+
{
458+
sorted = bgzip(sorted, log);
459+
}
455460

456461
//replace the non-sorted output
457462
input.delete();

0 commit comments

Comments
 (0)