Parses one log_chrN.txt (written by the per-chr GLOW runner) into a one-row summary data.frame of run statistics plus a sub-data.frame of error rows for regions that errored.

parse_chr_log(log_path)

Arguments

log_path

Character. Path to a log_chrN.txt file.

Value

A list with:

$summary

one-row data.frame: chr, n_samples, trait, gene_list_n, filter, attempted, results, skipped, errors, runtime_sec.

$errors

data.frame with columns chr, label, source, message (0 rows if no errors).

Details

The chromosome id is parsed from the filename. The gene-list count regex accepts both "(\d+) coding genes" and "(\d+) genes". Each error line's optional leading word ("STAAR ERROR in ..." vs the bare "ERROR in ..." main-pipeline catch-all) is parsed into the source column; an absent prefix is labelled "GLOW".

Two per-chr summary vocabularies are accepted: the legacy "Done. genes_attempted=..." line (pre-2026-06 inline driver) and the run_scan_unit line "Done gene unit chrN. n=..., n_ok=..., n_skip_empty=..., n_staar_skip_single=..., n_error=..., <t>s", mapped as n \(\to\) attempted (and gene_list_n when no gene-list line exists), n_ok + n_staar_skip_single \(\to\) results, n_skip_empty \(\to\) skipped, n_error \(\to\) errors. results counts the result rows the unit wrote: glow_scan_chunk() appends a row for a staar_skip_single gene as well as for an ok one, because such a gene has its GLOW result and only the STAAR sub-step was skipped. The identity attempted == results + skipped + errors therefore holds for both vocabularies.