aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tools/gridss-callVariants.nix50
-rw-r--r--tools/gridss.nix7
2 files changed, 57 insertions, 0 deletions
diff --git a/tools/gridss-callVariants.nix b/tools/gridss-callVariants.nix
new file mode 100644
index 0000000..9d78896
--- /dev/null
+++ b/tools/gridss-callVariants.nix
@@ -0,0 +1,50 @@
+{ stdenv
+, lib
+, callPackage
+, fetchurl
+, jre
+, R
+, bwa
+, ref
+, blacklist ? null
+, bwaIndex ? callPackage ./bwa-index.nix { inherit stdenv bwa lib; }
+, faidx ? callPackage ./samtools-faidx.nix { inherit stdenv; }
+, flags ? null}:
+
+with lib;
+
+inputs:
+
+stdenv.mkDerivation rec {
+ name = "gridss-callVariants";
+ buildInputs = [ jre R bwa ];
+ jar = fetchurl {
+ url = "https://github.com/PapenfussLab/gridss/releases/download/v2.0.0/gridss-2.0.0-gridss-jar-with-dependencies.jar";
+ sha256 = "01srl3qvv060whqg1y1fpxjc5cwga5wscs1bmf1v3z87dignra7k";
+ };
+ buildCommand = ''
+ ln -s ${ref} ref.fa
+ ln -s ${faidx ref} ref.fa.fai
+ for f in ${bwaIndex ref}/*; do
+ ln -s $f
+ done
+ mkdir $out
+ java -ea -Xmx31g \
+ -Dreference_fasta="ref.fa" \
+ -Dsamjdk.create_index=true \
+ -Dsamjdk.use_async_io_read_samtools=true \
+ -Dsamjdk.use_async_io_write_samtools=true \
+ -Dsamjdk.use_async_io_write_tribble=true \
+ -Dgridss.gridss.output_to_temp_file=true \
+ -cp ${jar} gridss.CallVariants \
+ WORKER_THREADS=$NIX_BUILD_CORES \
+ TMP_DIR=. \
+ WORKING_DIR=. \
+ REFERENCE_SEQUENCE="ref.fa" \
+ ${concatMapStringsSep " " (i: "INPUT=\"${i}\"") inputs} \
+ OUTPUT="$out/gridss.vcf" \
+ ASSEMBLY="$out/gridss.bam" \
+ ${optionalString (blacklist != null) ("BLACKLIST=" + blacklist)} \
+ ${optionalString (flags != null) flags}
+ '';
+}
diff --git a/tools/gridss.nix b/tools/gridss.nix
new file mode 100644
index 0000000..fa52606
--- /dev/null
+++ b/tools/gridss.nix
@@ -0,0 +1,7 @@
+{bionix, nixpkgs}:
+
+with nixpkgs;
+
+{
+ callVariants = attrs: callPackage ./gridss-callVariants.nix attrs;
+}