aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJustin Bedo <cu@cua0.org>2018-10-29 15:32:26 +1100
committerJustin Bedo <cu@cua0.org>2018-10-29 15:32:26 +1100
commit3ad53248deca12bda8351f187f322fd9bf6351a1 (patch)
tree2aaee4f17fba72f9db3d5df485012e2d5a6ca613 /tools
parent2c706aaad54aeec0f224ab7c313ac22aebe0bb9e (diff)
init: samtools-fixmate
Diffstat (limited to 'tools')
-rw-r--r--tools/samtools-fixmate.nix25
-rw-r--r--tools/samtools.nix1
2 files changed, 26 insertions, 0 deletions
diff --git a/tools/samtools-fixmate.nix b/tools/samtools-fixmate.nix
new file mode 100644
index 0000000..6cb31bb
--- /dev/null
+++ b/tools/samtools-fixmate.nix
@@ -0,0 +1,25 @@
+{ bionix
+, nixpkgs
+, mateScore ? false
+, flags ? null
+}:
+
+input:
+
+with nixpkgs;
+with lib;
+with bionix.types;
+
+assert (matchFiletype "samtools-fixmate" { bam = _: true; } input);
+assert (matchFileSorting "samtools-fixmate" { name = _: true; } input);
+
+stdenv.mkDerivation {
+ name = "samtools-fixmate";
+ buildInputs = [ samtools ];
+ buildCommand = ''
+ samtools fixmate \
+ ${optionalString mateScore "-m"} \
+ ${optionalString (flags != null) flags} -O bam ${input} $out
+ '';
+ passthru.filetype = input.filetype;
+}
diff --git a/tools/samtools.nix b/tools/samtools.nix
index ea773eb..e26d996 100644
--- a/tools/samtools.nix
+++ b/tools/samtools.nix
@@ -10,4 +10,5 @@ with bionix;
dict = callBionix ./samtools-dict.nix;
sort = callBionix ./samtools-sort.nix;
merge = callBionix ./samtools-merge.nix;
+ fixmate = callBionix ./samtools-fixmate.nix;
}