aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/samtools-queryRegion.nix22
-rw-r--r--tools/samtools.nix1
2 files changed, 23 insertions, 0 deletions
diff --git a/tools/samtools-queryRegion.nix b/tools/samtools-queryRegion.nix
new file mode 100644
index 0000000..650e4f4
--- /dev/null
+++ b/tools/samtools-queryRegion.nix
@@ -0,0 +1,22 @@
+{ bionix
+, flags ? null
+, regions ? []
+}:
+
+input:
+
+with bionix;
+with lib;
+with types;
+
+assert (matchFiletype "samtools-queryRegion" { fa = _: true; } input);
+
+stage {
+
+ name = "samtools-faidx";
+ buildInputs = with pkgs; [ samtools ];
+ buildCommand = ''
+ ln -s ${input} input.fasta
+ samtools faidx ${optionalString (flags != null) flags} input.fasta ${concatStringsSep " " regions} > $out
+ '';
+}
diff --git a/tools/samtools.nix b/tools/samtools.nix
index e0c45dd..32a563c 100644
--- a/tools/samtools.nix
+++ b/tools/samtools.nix
@@ -13,4 +13,5 @@ with bionix;
markdup = callBionixE ./samtools-markdup.nix;
fixmate = callBionixE ./samtools-fixmate.nix;
tabix = callBionixE ./samtools-tabix.nix;
+ queryRegion = callBionixE ./samtools-queryRegion.nix;
}