aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;
}