diff options
author | Justin Bedo <cu@cua0.org> | 2020-11-16 11:59:41 +1100 |
---|---|---|
committer | Justin Bedo <cu@cua0.org> | 2020-11-16 11:59:41 +1100 |
commit | 05da61d166d7d4702001510a5eaa1935102d24f0 (patch) | |
tree | c75febaeeaaa79e1bd109ec28d717d13a5b43dd5 /tools/sambamba-sort.nix | |
parent | a50933a96096d53c341b30d487362d0913977574 (diff) |
sambamba: init
Diffstat (limited to 'tools/sambamba-sort.nix')
-rw-r--r-- | tools/sambamba-sort.nix | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/tools/sambamba-sort.nix b/tools/sambamba-sort.nix new file mode 100644 index 0000000..efdd261 --- /dev/null +++ b/tools/sambamba-sort.nix @@ -0,0 +1,29 @@ +{ bionix +, nameSort ? false +, flags ? null +}: + +input: + +with bionix; +with lib; + +let + inherit (bionix.types) matchFiletype coordSort matchFileSorting; +in + +assert (matchFiletype "sambamba-sort" { bam = _: true; } input); + +stage { + name = "sambamba-sort"; + buildInputs = [ pkgs.sambamba ]; + buildCommand = '' + sambamba sort -t $NIX_BUILD_CORES \ + ${optionalString nameSort "-n"} \ + ${optionalString (flags != null) flags} \ + -o $out \ + ${input} + ''; + passthru.filetype = if nameSort then bionix.types.nameSort input.filetype else coordSort input.filetype; + passthru.multicore = true; +} |