aboutsummaryrefslogtreecommitdiff
path: root/tools/platypus-callVariants.nix
diff options
context:
space:
mode:
authorJustin Bedo <cu@cua0.org>2018-10-05 16:16:20 +1000
committerJustin Bedo <cu@cua0.org>2018-10-05 16:19:06 +1000
commit871ef64f3c43199dfa01216ac86db56650c2c8a2 (patch)
tree7053b4533d7306b3fc0eed8f9bc25e8e2abb6d6e /tools/platypus-callVariants.nix
parentdd3666f6a069105e61f8889665cf55eed9a14e51 (diff)
implement types
Diffstat (limited to 'tools/platypus-callVariants.nix')
-rw-r--r--tools/platypus-callVariants.nix20
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;};
}