Skip to content

Cache Phred error probabilities during BAM QC - #66

Merged
kaichop merged 1 commit into
WGLab:mainfrom
DylanCosto:cache-bam-quality-probabilities
Oct 1, 2026
Merged

kaichop merged 1 commit into
WGLab:mainfrom
DylanCosto:cache-bam-quality-probabilities

Conversation

@DylanCosto

Copy link
Copy Markdown
Contributor

BAM QC currently calls pow for every base when calculating each read's mean quality. Cache the 256 possible byte-valued qualities in a function-local static table, using the same pow(10, -quality / 10.0) expression.

HG002 input Original Patched Less wall time
ONT whole-genome BAM (10.14 GB) 57.73 s 48.34 s 16.3%
HiFi chromosome 22 BAM (0.87 GB) 8.47 s 5.56 s 34.3%

Summary JSON matched across all runs

@kaichop
kaichop merged commit fcce66e into WGLab:main Oct 1, 2026
1 check passed
@kaichop

kaichop commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Thank you!

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.

2 participants