Verifies that every expected genome chunk produced its result file, so the genome-wide summary does not silently aggregate a partial scan (which would shrink the Bonferroni denominator and inflate the count of significant windows).

check_scan_completeness(output_dir, output_format = "csv")

Arguments

output_dir

Character. The run's outputs/ directory.

output_format

Character. "csv" (default) or "fst"; selects the result-file extension.

Value

A list with: complete (TRUE iff every expected chunk has a result file), n_expected, n_present, missing_ids, not_done_ids (result exists but log never reached "Done"; advisory), n_window_errors (total n_error across finished chunks), and status (per-chunk data.frame: chunk_id, has_result, reached_done, n_error).

Details

Expected chunk ids come from <output_dir>/shared/01-genome_chunks.rds; present chunks are those with a results/scan_chunk_<id>.<ext> file. For every expected chunk, the per-chunk log (if present) is parsed via parse_chunk_log to detect whether the run reached "Done" and how many per-window errors it had.

See also