aboutsummaryrefslogtreecommitdiff
path: root/tools/hisat2-index.nix
diff options
context:
space:
mode:
authorJustin Bedo <cu@cua0.org>2019-08-15 14:27:43 +1000
committerJustin Bedo <cu@cua0.org>2019-08-15 14:27:43 +1000
commit92da3257c6867b6f54943e39345ab295703a30c4 (patch)
tree2335f6bcf107bea657b21386eaeda194d969c7ec /tools/hisat2-index.nix
parent3e037c4d706f5ac02c663a8d7f56703373785d29 (diff)
hisat2: init
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;
+}