aboutsummaryrefslogtreecommitdiff
path: root/tools/snpeff-dbnsfp.nix
blob: ec09f14c8f28df023c50a8c74941e87c8ae206a1 (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
{ bionix
, dbnsfp
, heapSize ? "31g"
, fields ? [ ]
, flags ? ""
}:

input:

with bionix;
with lib;
with types;

assert (matchFiletype "snpeff-dbnsfp" { vcf = _: true; } input);

stage {
  name = "snpeff-dbnsfp";
  JAVA_TOOL_OPTIONS = "-Xmx${heapSize}";
  buildCommand = ''
    ln -s ${dbnsfp.db} dbNSFP.txt.gz
    ln -s ${dbnsfp.index} dbNSFP.txt.gz.tbi
    snpsift dbnsfp -db dbNSFP.txt.gz ${optionalString (length fields > 0) "-f ${concatStringsSep "," fields}"} ${flags} ${input} > $out
  '';
  buildInputs = with pkgs; [ snpeff ];
  passthru.filetype = input.filetype;
}