Skip to content

align.flagstat

Liatir.align.flagstat() computes alignment summary statistics with samtools flagstat over a SAM/BAM file and returns a rendered Liatir ToolOutput.

Signature

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

Arguments

FieldTypeDescription
inputstringPath to the SAM/BAM file.
threadsnumberWorker threads. Omit to let Liatir choose a safe local value.

Example

ts
const output = await Liatir.align.flagstat({ input: "/path/to/aligned.bam" });

Result

Returns a standard Liatir ToolOutput. Throws if samtools exits non-zero.

Requires the samtools binary — check availability with Liatir.deps.check.