aboutsummaryrefslogtreecommitdiff
path: root/tools/ascat-callCNV.nix
diff options
context:
space:
mode:
authorJustin Bedo <cu@cua0.org>2019-03-01 09:04:05 +1100
committerJustin Bedo <cu@cua0.org>2019-03-01 09:04:05 +1100
commit3530396ec646a5c9c5f69e1e8dccc93f3744d114 (patch)
treeb475d28d93e8c6bd54f28f060d7e7f963498b523 /tools/ascat-callCNV.nix
parent6fc75fdea7b6265fc05b1ad43d76bb55e0d8591e (diff)
ascat: init
Diffstat (limited to 'tools/ascat-callCNV.nix')
-rw-r--r--tools/ascat-callCNV.nix37
1 files changed, 37 insertions, 0 deletions
diff --git a/tools/ascat-callCNV.nix b/tools/ascat-callCNV.nix
new file mode 100644
index 0000000..357ab8a
--- /dev/null
+++ b/tools/ascat-callCNV.nix
@@ -0,0 +1,37 @@
+{ bionix
+, ref
+, gc
+, indexAttrs ? {}
+, bamIndexAttrs ? {}
+, flags ? null
+}:
+
+{tumour, normal, gender}:
+
+with bionix;
+with lib;
+with types;
+
+stage rec {
+ name = "ascat-callCNV";
+ buildInputs = with pkgs; [ ascat.app ];
+ buildCommand = ''
+ mkdir $out
+ ln -s ${tumour} tumour.bam
+ ln -s ${bionix.samtools.index bamIndexAttrs tumour} tumour.bai
+ ln -s ${normal} normal.bam
+ ln -s ${bionix.samtools.index bamIndexAttrs normal} normal.bai
+ ln -s ${ref} ref.fa
+ ln -s ${samtools.faidx indexAttrs ref} ref.fa.fai
+ ascat.pl \
+ -outdir $out \
+ -tumour tumour.bam \
+ -normal normal.bam \
+ -reference ref.fa \
+ -snp_gc ${gc} \
+ -gender ${gender} \
+ -genderChr Y \
+ -protocol WGS \
+ -cpus $NIX_BUILD_CORES
+ '';
+}