Repository navigation
stats: shortcut diploid 0/0 genotypes in do_sample_stats - #2619
Open
BenjaminDEMAILLE wants to merge 1 commit into
Open
BenjaminDEMAILLE wants to merge 1 commit into
BenjaminDEMAILLE wants to merge 1 commit into
Conversation
A diploid int8 0/0 only bumps smpl_homRR and the HWE ref count, so do that directly instead of bcf_gt_type() + sample_gt_stats(). Output is unchanged. stats -s - on 1000G chr22 (287k sites, 500 samples): BCF 1.09s -> 0.47s, VCF.gz 2.65s -> 1.84s. Idea from pasta (https://github.com/DylanCosto/pasta, MIT). Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Benjamin Demaille <benjamin.demaille@icloud.com>
BenjaminDEMAILLE
force-pushed
the
perf/stats-homref-shortcut
branch
2 times, most recently
from
November 24, 2026 09:46
34e662d to
597ab03
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For diploid int8 GT, I noticed that a 0/0 only increments
smpl_homRRand the HWE ref count, and the AD/VAF part does nothing for it. So I count it directly instead of going throughbcf_gt_type()andsample_gt_stats(). The output doesn't change.With
stats -s -on 1000G chr22 (287k sites, 500 samples), I went from 1.09s to 0.47s on BCF and from 2.65s to 1.84s on VCF.gz.make testpasses.I adapted it from pasta (https://github.com/DylanCosto/pasta, MIT).
I've listed this with my other performance PRs in samtools/htslib#2175.
Assisted-by: Claude:claude-opus-5-5