aboutsummaryrefslogtreecommitdiff
path: root/tools/last-align.nix
blob: 064341938032fba4dc16ff6853b843a9f1308152 (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
35
{ bionix
, ref
, flags ? null
, trainFlags ? null
, indexAttrs ? { }
}:

input:

with bionix;
with lib;
with types;

let
  fq = f: matchFiletype "last-input" { fq = _: f; } f;
in
stage {
  name = "last-align";
  buildInputs = with pkgs; [ last ];
  buildCommand = ''
      last-train -P $NIX_BUILD_CORES \
        ${optionalString (trainFlags != null) flags} \
        ${bionix.lastal.index indexAttrs ref}/index \
        ${fq input} -Q 1\
        > train
      lastal -P $NIX_BUILD_CORES \
        ${optionalString (flags != null) flags} \
        ${bionix.lastal.index indexAttrs ref}/index \
        -p train \
        ${fq input} -Q 1 \
        > tmp
    cp tmp $out
 '';
  passthru.multicore = true;
}