Skip to content

Merge pairs gzip level - #15

Merged
alex-sandercock merged 5 commits into
developmentfrom
merge-pairs-gzip-level
Dec 3, 2026
Merged

alex-sandercock merged 5 commits into
developmentfrom
merge-pairs-gzip-level

Conversation

@alex-sandercock

Copy link
Copy Markdown
Contributor

Adjusted the default compression level to be less (6) than the existing level (9). This leads to slightly more storage space being used when writing merged fastq or cache, but speeds up run times. There is also now a user parameter to control compression levels.

Python's gzip default is level 9. On the 96 delta smelt GT-seq samples
(14.4 million pairs, 8 jobs) merge-pairs took 211 s at level 9 and 120 s
at level 6. The merged reads are identical in all 96 files, and the files
are 3.9% larger (1,088 MB against 1,047 MB).
generate writes its sample caches at gzip level 6 too, and each command
takes the level as an option from 1 (fastest) to 9 (smallest files).

Writing one sample's cache took 1.9 s to 3.3 s at level 9 and 0.7 s to
1.2 s at level 6 on alfalfa, sweetpotato and pecan, for caches 5% to 6%
larger. Back to back with 8 jobs, the alfalfa cohort (356 samples) ran in
422 s with its caches at level 9 and in 363 s at level 6, and merge-pairs
on the 96 delta smelt samples in 210 s and 122 s. Peak memory is the same
at both levels.

The level changes no merged read, cache content or MADC row: the alfalfa
table, variants sidecar, QC file and all 356 cache payloads are the same
at both levels, and so are the 96 merged files. The level is not part of
the cache key, so a run reuses caches written at any level.
@alex-sandercock alex-sandercock self-assigned this Dec 3, 2026
@alex-sandercock alex-sandercock added the enhancement New feature or request label Dec 3, 2026
Copilot AI lite review requested due to automatic review settings December 3, 2026 16:01

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues were identified, and the change is supported by tests and documentation covering configurable compression, validation, and cache reuse.

No open issues 🎉

What changed in this PR

Adds configurable gzip compression levels for merged FASTQs and generated caches, changing the default to level 6 while preserving data and cache reuse behavior.

Changes:

  • Added --gzip-level and --cache-gzip-level options with validation.
  • Propagated compression settings through merge and cache-writing workflows.
  • Added tests and documentation covering compression behavior and cache reuse.
File Description
tests/​test_madcats.py Tests compression levels, validation, and cache reuse behavior.
madcats.py Implements configurable compression defaults, CLI options, validation, and writer integration.
docs/​src/​development/​changelog.md Documents the new compression defaults and behavior.
docs/​src/​development/​architecture.md Documents how compression settings relate to cache keys.
docs/​src/​commands/​merge-pairs.md Documents the --gzip-level option.
docs/​src/​commands/​generate.md Documents the --cache-gzip-level option.
docs/​DEVELOPMENT.md Records compression performance measurements and updated test counts.

Review effort: Lite

Updated help text for gzip compression level arguments to improve clarity.
Copilot AI lite review requested due to automatic review settings December 3, 2026 16:04

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The change contains an unterminated help-string literal that causes a critical syntax error preventing the CLI from starting, along with a remaining default-value interpolation issue.

2 open issues

Review effort: Lite

Comment thread madcats.py Resolved
Comment thread madcats.py Resolved
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings December 3, 2026 16:41
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain, and the changes include corresponding tests and documentation for configurable compression levels and cache reuse.

No open issues 🎉

2 resolved since last review

Review effort: Lite

@alex-sandercock
alex-sandercock merged commit f23b056 into development Dec 3, 2026
17 checks passed
@alex-sandercock
alex-sandercock deleted the merge-pairs-gzip-level branch December 3, 2026 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants