aboutsummaryrefslogtreecommitdiff
path: root/tools/star-index.nix
blob: 4bc83990473dd305dda9f1f5b74802814684218d (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
{ bionix
, gtf
, flags ? null
, extractSpliceSitesAttrs ? {}
, extractExonsAttrs ? {}
, overhang ? 100
}:

ref:

with bionix;
with lib;
with types;

assert (matchFiletype "star-index" { fa = _: true; } ref);

stage {
  name = "star-index";
  buildInputs = with pkgs; [ star ];
  buildCommand = ''
    ln -s ${ref} ref.fa
    mkdir $out
    STAR --runMode genomeGenerate \
      --runThreadN $NIX_BUILD_CORES \
      --sjdbGTFfile ${gtf} \
      --genomeDir $out \
      --genomeFastaFiles ${ref} \
      --sjdbOverhang ${toString overhang} \
      ${optionalString (flags != null) flags}
  '';
  passthru.multicore = true;
  stripStorePaths = false;
}