aboutsummaryrefslogtreecommitdiff
path: root/tools/aa-call.nix
blob: 1c6a1219a315d270864618cd1c94e6b88e75d0fc (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
{
  bionix,
  seeds,
  license,
  flags ? "",
  downsample ? 0.1,
  ...
}: input:
with bionix; let
  indexedBam = linkOutputs {
    "input.bam" = input;
    "input.bam.bai" = samtools.index {} input;
  };
in
  stage {
    name = "aa-call";
    MOSEKLM_LICENSE_FILE = license;
    buildInputs = [bionix.ampliconarchitect.app];
    buildCommand = ''
      mkdir $out
      export AA_DATA_REPO=$TMPDIR
      tar -xzf ${self.aa.ref}
      AmpliconArchitect.py \
        --bam ${indexedBam}/input.bam \
        --bed ${seeds} \
        --ref GRCh38 \
        --out $out/out \
        --downsample ${toString downsample} \
        $flags
    '';
  }