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

ref:

with bionix;
with lib;
with types;

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

stage {
  name = "hisat2-index";
  buildInputs = with pkgs; [ hisat2 ];
  buildCommand = ''
    ln -s ${ref} ref.fa
    mkdir $out
    hisat2-build -p $NIX_BUILD_CORES ${optionalString (flags != null) flags} \
      ${optionalString (gtf != null) "--ss ${hisat2.extractSpliceSites extractSpliceSitesAttrs gtf} --exon ${hisat2.extractExons extractExonsAttrs gtf}"} \
      ref.fa $out/index
  '';
  passthru.multicore = true;
}