blob: c0204dce7195bea5cf97ba2494bfea910b03d535 (
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
, nixpkgs
, ref
, indexAttrs ? {}
, bamIndexAttrs ? {}
, flags ? null
}:
inputs:
with lib;
let filename = path: last (splitString "/" path);
in stdenv.mkDerivation {
name = "platypus";
buildInputs = [ platypus ];
buildCommand = ''
ln -s ${ref} ref.fa
ln -s ${bionix.samtools.faix indexAttrs ref} ref.fa.fai
${concatMapStringsSep "\n" (p: "ln -s ${p} ${filename p}.bam") inputs}
${concatMapStringsSep "\n" (p: "ln -s ${bionix.samtools.index bamIndexAttrs p} ${filename p}.bai") inputs}
ls -l
platypus callVariants \
--nCPU=$NIX_BUILD_CORES \
--refFile=ref.fa \
${optionalString (flags != null) flags} \
-o $out \
--bamFiles=${concatMapStringsSep "," (p: "${filename p}.bam") inputs}
'';
}
|