aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Bedo <cu@cua0.org>2019-05-02 12:17:24 +1000
committerJustin Bedo <cu@cua0.org>2019-05-02 12:17:24 +1000
commit11b31bdad648c9af92ac6997303bc10849a7a2ef (patch)
treeda66de976952417bfaec0d21b39bf555d1b6b526
parente7a2705bb3818db7647c7a37ef675760c323bd26 (diff)
shard: Implement some basic sharding for FQ files
-rw-r--r--default.nix5
-rw-r--r--test-tnpair.nix5
2 files changed, 9 insertions, 1 deletions
diff --git a/default.nix b/default.nix
index d67f2eb..61f2974 100644
--- a/default.nix
+++ b/default.nix
@@ -68,9 +68,12 @@ let
fetchFastQGZ = attrs: with types; tagFiletype (filetype.gz (filetype.fq {})) (fetchurl attrs);
fetchFastAGZ = attrs: with types; tagFiletype (filetype.gz (filetype.fa {})) (fetchurl attrs);
+ # Turn a multi-output derivation into a list of derivations
+ outputDrvs = drv: map (o: lib.getAttr o drv) drv.outputs;
+
# Export nixpkgs and standard library lib
pkgs = nixpkgs;
- lib = nixpkgs.lib // { types = types; };
+ lib = nixpkgs.lib // { types = types; shard = callBionix ./lib/shard.nix {};};
stage = x@{ name, ... }: { multicore = false; } // nixpkgs.stdenvNoCC.mkDerivation (x // {name = "bionix-" + name;});
# splitting/joining
diff --git a/test-tnpair.nix b/test-tnpair.nix
index f2e84ac..802a2bb 100644
--- a/test-tnpair.nix
+++ b/test-tnpair.nix
@@ -39,6 +39,10 @@ let
variants = callVariants alignments;
glvariants = strelka.call {} (builtins.attrValues alignments);
platypusVars = platypus.call {} (builtins.attrValues alignments);
+ shards = pipe [
+ (shard.fastQPair 2)
+ (map (bwa.align {inherit ref;}))
+ ] normal.files;
};
tnpairResult = processPair tnpair;
@@ -56,6 +60,7 @@ let
(ln (gridss.callVariants {} (with tnpairResult.alignments; [normal tumour])) "gridss")
(ln (gridss.call (with tnpairResult.alignments; [normal tumour])) "gridss2")
(ln (gridss.callAndAssemble (with tnpairResult.alignments; [normal tumour])) "gridss3")
+ (ln (samtools.merge {} tnpairResult.shards) "alignments/merged-shards.bam")
(ln (samtools.merge {} [tnpairResult.alignments.tumour tnpairResult.alignments.normal]) "alignments/merged.bam")
(ln (samtools.merge {} [(nameSort tnpairResult.alignments.tumour) (nameSort tnpairResult.alignments.normal)]) "alignments/merged-namesorted.bam")
(ln (samtools.view { outfmt = types.toCram; } (tnpairResult.alignments.tumour)) "alignments/${tnpair.tumour.name}.cram")