aboutsummaryrefslogtreecommitdiff
path: root/tools/gridss-assemble.nix
diff options
context:
space:
mode:
authorJustin Bedo <cu@cua0.org>2020-09-02 16:24:37 +1000
committerJustin Bedo <cu@cua0.org>2020-09-02 16:24:37 +1000
commit9cf1724895f001c625fba37d78f517acb6938e07 (patch)
treecef3900c0ffd13a3e71763d38bd85d893a3ce3ec /tools/gridss-assemble.nix
parentf3dc7987e0e841b97fd43160c68f8d09265083bc (diff)
gridss: shard assembly into 10 pieces by default
Diffstat (limited to 'tools/gridss-assemble.nix')
-rw-r--r--tools/gridss-assemble.nix15
1 files changed, 13 insertions, 2 deletions
diff --git a/tools/gridss-assemble.nix b/tools/gridss-assemble.nix
index a532f4b..f0a2693 100644
--- a/tools/gridss-assemble.nix
+++ b/tools/gridss-assemble.nix
@@ -6,6 +6,9 @@
, flags ? null
, config ? null
, heapSize ? "31g"
+, workdirs ? []
+, jobIndex ? null
+, jobNodes ? null
}:
with bionix;
@@ -37,7 +40,8 @@ assert (homoRef);
stage rec {
name = "gridss-assemble";
- buildInputs = with pkgs; [ jre bwa ];
+ buildInputs = with pkgs; [ jre bwa rsync ];
+ outputs = [ "out" "work" ];
buildCommand = ''
TMPDIR=$(pwd)
ln -s ${ref} ref.fa
@@ -46,7 +50,8 @@ stage rec {
ln -s $f
done
${concatMapStringsSep "\n" linkInput inputs}
- java -Xmx${heapSize} -Dsamjdk.create_index=true \
+ ${concatMapStringsSep "\n" (w: "rsync -a --ignore-existing ${w}/ ./") workdirs}
+ java -Xmx${heapSize} -Dsamjdk.create_index=true \
-cp ${bionix.gridss.jar} gridss.AssembleBreakends \
VERBOSITY=WARNING \
REFERENCE_SEQUENCE=ref.fa \
@@ -56,7 +61,13 @@ stage rec {
${optionalString (config != null) ("OPTIONS_FILE=" + bionix.gridss.gridssConfig config)} \
WORKING_DIR=$TMPDIR/ \
TMP_DIR=$TMPDIR/ \
+ ${optionalString (jobIndex != null) "JOB_INDEX=${toString jobIndex}"} \
+ ${optionalString (jobIndex != null) "JOB_NODES=${toString jobNodes}"} \
${optionalString (flags != null) flags}
+ rm -rf tmp
+ touch $out
+ cp -r $TMPDIR $work
+ chmod u+rwX -R $work
'';
passthru.filetype = filetype.bam { ref = ref; sorting = sort.name {}; };
passthru.multicore = true;