norm normalizing reference ALT is not counted in stats or old-rec-tag

Open
#2,391 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
c
Domain
cli

Research direction

Reproduce the issue with the supplied VCF, reference FASTA, and bcftools norm --multiallelics=- --check-ref=s --old-rec-tag=BCFTOOLS_OLD_VARIANT command. Trace the norm handling that changes a reference-only record and verify that the old-record tag is populated and the statistics report one modified record; assess whether it should also count as realigned or normalized.

Written by the indexing model from the issue text.

Description

Input VCF:

##fileformat=VCFv4.1
##reference=GRCh38>
##contig=<ID=NC_000015.10,length=101991189,assembly=GRCh38>
#CHROM	POS	ID	REF	ALT	QUAL	FILTER	INFO
NC_000015.10	40407805	.	GTTTT	.	.	.	.

Output:

##fileformat=VCFv4.1
##FILTER=<ID=PASS,Description="All filters passed">
##reference=GRCh38>
##contig=<ID=NC_000015.10,length=101991189,assembly=GRCh38>
##INFO=<ID=BCFTOOLS_OLD_VARIANT,Number=1,Type=String,Description="Original variant. Format: CHR|POS|REF|ALT|USED_ALT_IDX">
##bcftools_normVersion=1.21-116-gd7fb0a94+htslib-1.21-42-g6e3588c4
##bcftools_normCommand=norm --multiallelics=- --check-ref=s --old-rec-tag=BCFTOOLS_OLD_VARIANT --fasta-ref=/data/annotation/fasta/GCF_000001405.39_GRCh38.p13_genomic.fna.gz big_ref.vcf; Date=Thu Apr 10 17:32:29 2025
#CHROM	POS	ID	REF	ALT	QUAL	FILTER	INFO
NC_000015.10	40407805	.	G	.	.	.	.
Lines   total/split/joined/realigned/mismatch_removed/dup_removed/skipped:	1/0/0/0/0/0/0
REF/ALT total/modified/added:  	1/0/0

Issue 1 - Missing INFO for old-rec-tag

BCFTOOLS_OLD_VARIANT should be populated if variant is changed - see samtools/bcftools#2357

Issue 2 - Stats

Expected:

REF/ALT total/modified/added:  	1/1/0

I would also argue "realigned" might be better named "normalized" and have it added in this case (otherwise you lose it)

Dominant language
C
Stars
891
Forks
277
Avg merge
2d 23h
Merged PRs (30d)
2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from samtools/bcftools

All issues in samtools/bcftools

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.