aboutsummaryrefslogtreecommitdiff
path: root/tools/star-index.nix
diff options
context:
space:
mode:
authorJustin Bedo <cu@cua0.org>2020-11-02 11:11:42 +1100
committerJustin Bedo <cu@cua0.org>2020-11-02 11:11:55 +1100
commita719ec06337643949bb0a9cbbecb7425340c49af (patch)
tree32a5403417583fa70910908d04d633f9dacd8b44 /tools/star-index.nix
parentfe1ac7b64a2a56bcd2d71dd3fd4f55912c277a86 (diff)
star: init
Diffstat (limited to 'tools/star-index.nix')
-rw-r--r--tools/star-index.nix33
1 files changed, 33 insertions, 0 deletions
diff --git a/tools/star-index.nix b/tools/star-index.nix
new file mode 100644
index 0000000..4bc8399
--- /dev/null
+++ b/tools/star-index.nix
@@ -0,0 +1,33 @@
+{ bionix
+, gtf
+, flags ? null
+, extractSpliceSitesAttrs ? {}
+, extractExonsAttrs ? {}
+, overhang ? 100
+}:
+
+ref:
+
+with bionix;
+with lib;
+with types;
+
+assert (matchFiletype "star-index" { fa = _: true; } ref);
+
+stage {
+ name = "star-index";
+ buildInputs = with pkgs; [ star ];
+ buildCommand = ''
+ ln -s ${ref} ref.fa
+ mkdir $out
+ STAR --runMode genomeGenerate \
+ --runThreadN $NIX_BUILD_CORES \
+ --sjdbGTFfile ${gtf} \
+ --genomeDir $out \
+ --genomeFastaFiles ${ref} \
+ --sjdbOverhang ${toString overhang} \
+ ${optionalString (flags != null) flags}
+ '';
+ passthru.multicore = true;
+ stripStorePaths = false;
+}