Skip to content

align.faidx

Liatir.align.faidx() indexes a FASTA reference with samtools faidx. The index is written next to the input as <input>.fai.

Signature

ts
faidx(args: { input: string; threads?: number }): Promise<FaidxResult>

Arguments

FieldTypeDescription
inputstringPath to the FASTA reference.
threadsnumberWorker threads. Omit to let Liatir choose a safe local value.

Result

ts
type FaidxResult = {
  faiPath: string;   // path of the produced index (`<input>.fai`)
};

Example

ts
const { faiPath } = await Liatir.align.faidx({ input: "/path/to/genome.fa" });

Throws if samtools exits non-zero. Requires the samtools binary — check availability with Liatir.deps.check.