diff options
author | Justin Bedo <cu@cua0.org> | 2018-10-29 15:33:53 +1100 |
---|---|---|
committer | Justin Bedo <cu@cua0.org> | 2018-10-29 15:36:33 +1100 |
commit | e7cd661d1c5fb4135e3d436e151294e26aef9127 (patch) | |
tree | 71ef7647d15d57bc2db2cf8ec532da794fddb2fa /tools/gridss-computeSamTags.nix | |
parent | 8fb986fd88705fc01be7145b04fa229092c1e69e (diff) |
Split gridss into constituents
Wrap each individual command for GRIDSS so that bionix executed the pipeline
rather than GRIDSS. This patch introduces a "call" function that executed the
whole pipeline in bionix on an arbitrary BAM file.
Resolves #10.
Diffstat (limited to 'tools/gridss-computeSamTags.nix')
-rw-r--r-- | tools/gridss-computeSamTags.nix | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/tools/gridss-computeSamTags.nix b/tools/gridss-computeSamTags.nix new file mode 100644 index 0000000..f75cea0 --- /dev/null +++ b/tools/gridss-computeSamTags.nix @@ -0,0 +1,42 @@ +{ bionix +, nixpkgs +, blacklist ? null +, bwaIndexAttrs ? {} +, faidxAttrs ? {} +, flags ? null +}: + +with nixpkgs; +with lib; +with bionix.types; + +input: + +let + ref = matchFiletype "gridss-computeSamTags" { bam = x: x.ref; } input; + sorted = matchFileSorting "gridss-computeSamTags" { name = _: true; } input; +in + +assert(sorted); + +stdenv.mkDerivation rec { + name = "gridss-computeSamTags"; + buildInputs = [ jre ]; + buildCommand = '' + ln -s ${ref} ref.fa + ln -s ${bionix.samtools.faidx faidxAttrs ref} ref.fa.fai + for f in ${bionix.bwa.index bwaIndexAttrs ref}/*; do + ln -s $f + done + java -Xmx1G \ + -Dsamjdk.create_index=false \ + -cp ${bionix.gridss.jar} gridss.ComputeSamTags \ + REFERENCE_SEQUENCE=ref.fa \ + WORKING_DIR=$TMP_DIR \ + TMP_DIR=$TMP_DIR \ + I=${input} \ + O=$out \ + AS=true + ''; + passthru.filetype = input.filetype; +} |