bcftools icon indicating copy to clipboard operation
bcftools copied to clipboard

bcftools norm -m+snps not merging adjacents snps

Open lborcard opened this issue 3 months ago • 3 comments

Hi,

I am attempting to merge together variants which are :

NC_000962.3	2289149	.	G	T	221.999	.	DP=7823;VDB=0;SGB=-0.693147;RPBZ=-2.12972;MQBZ=0.426885;MQSBZ=0.0192363;BQBZ=7.81529;SCBZ=-0.69026;MQ0F=0;AF1=1;AC1=2;DP4=29,31,3886,3877;MQ=60;FQ=-281.989;PV4=0.797225,1,1,1	GT:PL:AD	1/1:255,255,0:60,7427
NC_000962.3	2289150	.	A	C	221.999	.	DP=7851;VDB=0;SGB=-0.693147;RPBZ=-6.1597;MQBZ=0.604267;MQSBZ=0.0189611;BQBZ=24.261;SCBZ=-0.236708;MQ0F=0;AF1=1;AC1=2;DP4=245,213,3688,3705;MQ=60;FQ=-281.989;PV4=0.135777,1,1,1	GT:PL:AD	1/1:255,255,0:458,7201
NC_000962.3	2289151	.	T	A	221.999	.	DP=7689;VDB=0;SGB=-0.693147;RPBZ=4.87479;MQBZ=-0.021231;MQSBZ=-0.0397193;BQBZ=16.8115;SCBZ=-0.149699;MQ0F=0;AF1=1;AC1=2;DP4=143,97,3710,3739;MQ=60;FQ=-281.989;PV4=0.0031076,1,0.362227,1	GT:PL:AD	1/1:255,255,0:240,7344

And after using ##bcftools_normCommand=norm -m+ -Oz; Date=Tue Sep 30 13:22:53 2025

they stay as three single mutations ? I have tried -m+both -m+snps but all attempts either does not join or simply removes the snps.

thank you,

Loïc

here are the other steps:

##bcftoolsCommand=mpileup --fasta-ref NC_000962.3.fasta --max-depth 8000 --ff SECONDARY,UNMAP -BI -Q 1 -T all_amplicons.bed variant8.bam
##bcftools_callCommand=call --output-type v -c; Date=Tue Sep 30 13:22:43 2025
##bcftools_normVersion=1.21+htslib-1.21
##bcftools_normCommand=norm -Oz --remove-duplicates -Oz; Date=Tue Sep 30 13:22:43 2025
##bcftools_normCommand=norm -m+ -Oz; Date=Tue Sep 30 13:22:43 2025
##bcftools_viewVersion=1.21+htslib-1.21
##bcftools_viewCommand=view --output-file variant8.vcf.gz --output-type z --exclude-types indels; Date=Tue Sep 30 13:22:43 2025
##bcftools_viewCommand=view --output variant8_filtered.vcf.gz --threads 6 -i INFO/AF>=0.15&&FORMAT/AD>=10&&INFO/DP>=20&&INFO/MQ>50 -f PASS -Oz variant1.vcf.gz; Date=Tue Sep 30 13:22:55 2025

lborcard avatar Sep 30 '25 12:09 lborcard

What you want is the inverse of the --atomize operation. This has not been implemented yet.

Duplicate of https://github.com/samtools/bcftools/issues/2438#issuecomment-3102803133

pd3 avatar Oct 13 '25 08:10 pd3

thank you for your answer , what does -m + does if not multi nucleotide variants ?

lborcard avatar Oct 17 '25 05:10 lborcard

It merges lines with the same position into a multiallelic site. It is not the same as merging, say, two SNPs into one MNP

pd3 avatar Oct 29 '25 15:10 pd3