Concatenates the 22 per-chr gene-level result CSVs into a single data.frame in genomic order (chr 1..22, then ascending start). Errors loudly if any chr is missing or if column schemas differ across chrs.

read_all_chr_results(results_dir, chroms = 1:22, pattern = "glow_chr%d.csv")

Arguments

results_dir

Character. Directory holding the per-chr CSVs. Required.

chroms

Integer/character vector of chromosomes to read. Default 1:22. Each requested chromosome's file must exist (errors otherwise).

pattern

Character. sprintf pattern (one %d) for the per-chr filename. Default "glow_chr%d.csv".

Value

A data.frame of the requested per-chr rows concatenated and sorted into genomic order.

Details

The per-chr filenames are built as sprintf(pattern, chroms) under results_dir. The default chroms = 1:22 + pattern reproduces the gene-module glow_chr{N}.csv genome-wide behaviour exactly; pass chroms to aggregate only a subset (e.g. a single-chr smoke run). After reading, every file's column schema is compared against the first and the rows are returned ordered by (as.integer(chr), start).