aboutsummaryrefslogtreecommitdiff
path: root/tools/hisat2-index.nix
diff options
context:
space:
mode:
Diffstat (limited to 'tools/hisat2-index.nix')
-rw-r--r--tools/hisat2-index.nix27
1 files changed, 27 insertions, 0 deletions
diff --git a/tools/hisat2-index.nix b/tools/hisat2-index.nix
new file mode 100644
index 0000000..82935eb
--- /dev/null
+++ b/tools/hisat2-index.nix
@@ -0,0 +1,27 @@
+{ bionix
+, gtf ? null
+, flags ? null
+, extractSpliceSitesAttrs ? {}
+, extractExonsAttrs ? {}
+}:
+
+ref:
+
+with bionix;
+with lib;
+with types;
+
+assert (matchFiletype "hisat2-index" { fa = _: true; } ref);
+
+stage {
+ name = "hisat2-index";
+ buildInputs = with pkgs; [ hisat2 ];
+ buildCommand = ''
+ ln -s ${ref} ref.fa
+ mkdir $out
+ hisat2-build -p $NIX_BUILD_CORES ${optionalString (flags != null) flags} \
+ ${optionalString (gtf != null) "--ss ${hisat2.extractSpliceSites extractSpliceSitesAttrs gtf} --exon ${hisat2.extractExons extractExonsAttrs gtf}"} \
+ ref.fa $out/
+ '';
+ passthru.multicore = true;
+}