aboutsummaryrefslogtreecommitdiff
path: root/tools/ascat-callCNV.nix
blob: f74bb18a8b572c11c2331b43fc5b83162b8df273 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
{ 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
  '';
  passthru.multicore = true;
}