aboutsummaryrefslogtreecommitdiff
path: root/tools/gridss-collectGridssMetrics.nix
blob: 86732b8812b2c4d4056ac923c5f243e94070b917 (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
{ bionix
, nixpkgs
, thresholdCoverage ? 10000
, flags ? null
, config ? null
}:

with nixpkgs;
with lib;
with bionix.types;

input:

let
  ref = matchFiletype "gridss-collectGridssMetrics" { bam = x: x.ref; } input;
  sorted = matchFileSorting "gridss-collectGridssMetrics" { name = _: true; } input;
in


stdenv.mkDerivation rec {
  name = "gridss-collectGridssMetrics";
  buildInputs = [ jre ];
  buildCommand = ''
    mkdir $out
    ln -s ${input} input.bam
    java -Xmx1G -cp ${bionix.gridss.jar} \
			gridss.analysis.CollectGridssMetrics \
			${optionalString sorted "ASSUME_SORTED=true"} \
      ${optionalString config ("CONFIGURATION_FILE=" + gridssConfig config)} \
			I=input.bam \
			O=$out \
			THRESHOLD_COVERAGE=${toString thresholdCoverage}
    '';
}