Skip to content

Commit

Permalink
Update bash commands used to sort VCFs
Browse files Browse the repository at this point in the history
  • Loading branch information
bbimber committed Feb 20, 2024
1 parent ab43f0e commit bccdbce
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ public static void sortROD(File input, Logger log, Integer startColumnIdx) throw
CommandWrapper wrapper = SequencePipelineService.get().getCommandWrapper(log);
String cat = isCompressed ? "zcat" : "cat";
File tempSorted = new File(input.getParent(), "sorted.tmp");
wrapper.execute(Arrays.asList("/bin/sh", "-c", "{ cat " + tempHeader.getPath() + "; " + cat + " '" + input.getPath() + "' | grep -v '^#' | sort -V -k1,1" + (startColumnIdx == null ? "" : " -k" + startColumnIdx + "," + startColumnIdx + "n" + (isCompressed ? " } | bgzip -c " : ""))), ProcessBuilder.Redirect.to(tempSorted));
wrapper.execute(Arrays.asList("/bin/sh", "-c", "{ cat '" + tempHeader.getPath() + "'; " + cat + " '" + input.getPath() + "' | grep -v '^#' | sort -V -k1,1" + (startColumnIdx == null ? "" : " -k" + startColumnIdx + "," + startColumnIdx + "n") + "; } " + (isCompressed ? " | bgzip -c " : "")), ProcessBuilder.Redirect.to(tempSorted));

//replace the non-sorted output
input.delete();
Expand Down

0 comments on commit bccdbce

Please sign in to comment.