Skip to content

qc.fastp

Liatir.qc.fastp() trims and quality-filters FASTQ reads with fastp, writes the trimmed reads, and returns the parsed before/after QC report.

Signature

ts
fastp(args: {
  r1: string;
  r2?: string;
  outDir?: string;
  threads?: number;
}): Promise<FastpResult>

Arguments

FieldTypeDescription
r1stringPath to the R1 FASTQ file.
r2stringPath to the R2 FASTQ file (paired-end only).
outDirstringDirectory for the trimmed output. Defaults to a temp dir.
threadsnumberWorker threads. Omit to let Liatir choose a safe local value.

Result

ts
type FastpResult = {
  output: ToolOutput;   // rendered before/after QC stats
  trimmedR1: string;    // path to trimmed R1
  trimmedR2?: string;   // path to trimmed R2 (paired-end only)
};

Example

ts
const { output, trimmedR1, trimmedR2 } = await Liatir.qc.fastp({
  r1: "/path/to/R1.fastq.gz",
  r2: "/path/to/R2.fastq.gz",
});

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