diff options
Diffstat (limited to 'tools/platypus-callVariants.nix')
-rw-r--r-- | tools/platypus-callVariants.nix | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/tools/platypus-callVariants.nix b/tools/platypus-callVariants.nix index 7b68b28..a3e3a65 100644 --- a/tools/platypus-callVariants.nix +++ b/tools/platypus-callVariants.nix @@ -1,6 +1,5 @@ { bionix , nixpkgs -, ref , indexAttrs ? {} , bamIndexAttrs ? {} , flags ? null @@ -8,16 +7,26 @@ inputs: +with nixpkgs; with lib; +with bionix.types; -let filename = path: last (splitString "/" path); -in stdenv.mkDerivation { +let + filename = path: last (splitString "/" path); + getref = f: matchFiletype "platypus-callVariants" { bam = r: r; } f; + refs = map getref inputs; + ref = head refs; +in + +assert (length (unique refs) == 1); + +stdenv.mkDerivation { name = "platypus"; buildInputs = [ platypus ]; buildCommand = '' - ln -s ${ref.seq} ref.fa - ln -s ${bionix.samtools.faix indexAttrs ref} ref.fa.fai + ln -s ${ref} ref.fa + ln -s ${bionix.samtools.faidx indexAttrs ref} ref.fa.fai ${concatMapStringsSep "\n" (p: "ln -s ${p} ${filename p}.bam") inputs} ${concatMapStringsSep "\n" (p: "ln -s ${bionix.samtools.index bamIndexAttrs p} ${filename p}.bai") inputs} ls -l @@ -28,4 +37,5 @@ in stdenv.mkDerivation { -o $out \ --bamFiles=${concatMapStringsSep "," (p: "${filename p}.bam") inputs} ''; + passthru.filetype = filetype.vcf {ref = ref;}; } |