Skip to content

Per-species scaffolds in stats, progress reporting, and a fetch BED pre-check - #6

Merged
gwct merged 2 commits into
mainfrom
scaffolds-progress-bedcheck
Oct 22, 2026
Merged

gwct merged 2 commits into
mainfrom
scaffolds-progress-bedcheck

Conversation

@gwct

@gwct gwct commented Oct 22, 2026

Copy link
Copy Markdown
Collaborator

stats: per-species source scaffolds

  • New <prefix>.species_scaffolds.tsv: one row per species/scaffold present in the MAF, with its length (srcSize), blocks, aligned bases and aligned fraction.
  • species.tsv gains scaffolds_in_maf and scaffold_bases_in_maf, appended as the last columns; overall.tsv gains scaffold_size_parse_errors.
  • These describe scaffolds present in the MAF, not the whole assembly. Unaligned scaffolds never appear.
  • Dashboard: a collapsible "largest scaffolds" list per species (--dashboard-top-scaffolds, default 10).
  • A scaffold reporting two different srcSize values stops the run with an error.
  • Fixed the "Processed N blocks in M tasks" log line undercounting tasks.

Progress reporting (index, stats, gc, fetch)

  • Progress lines with rate and estimated time left, every 60 s by default.
  • New --progress-interval SECONDS on each command: 60 is the default and the minimum, and 0 turns progress off.
  • fetch workers report through a shared-memory counter: no locks and no messages between processes.
  • Parameter logs now align their colons.

fetch

  • BED pre-check before any work: unusable lines, -b id regions without names, and regions that would overwrite each other's output files. Problems are reported in one error, then it exits 1.
  • maf_fetch_summary.tsv is written in batch (genomic) order, so it is identical across runs and -p values.
  • Scaffold mode logs each scaffold as it finishes.

Behaviour changes

  • fetch now stops on BEDs it used to half-process:
    • malformed lines, which previously crashed it;
    • inverted or empty intervals, which were previously reported only as "no overlap";
    • -b id with missing or duplicate names;
    • duplicate regions under -b coords.
  • index now prints a start line, progress lines and a final summary, to the screen only.
  • Test fixture fix: chimp.chr4 in tests/example.maf had inconsistent srcSize values (1000 and 998) since the first commit. It is now 1000, with the compressed copies and indexes regenerated.

Testing

  • 257 tests, up from 148.
  • Checked against the 42.7 GB hamster MAF:
    • the scaffold table matches an independent awk pass exactly;
    • index, gc and fetch show no measurable slowdown in timed comparisons with the previous code, and their outputs are byte-identical.

🤖 Generated with Claude Code

@gwct
gwct merged commit e65e547 into main Oct 22, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant