truvari icon indicating copy to clipboard operation
truvari copied to clipboard

Input phased SV missing in merging

Open XLeeHIT opened this issue 5 months ago • 1 comments

Hello, thank you for developing Truvari, such a valuable tool. It has been very helpful to us! But I encountered the following problems while using it. I used Truvari collapse to merge some phased SV but some merging SVs were not phased. These is an example of merged SV from Truvari :

1 10000 INS G . 111 PASS SVTYPE=INS GT ./. ./. ./. 1/0 1/0 0/1 0/1 ./. 1/0 ./. ./. ./. ./. ./. ./. 1|0 1|0 1|0 0/1 ./. 1/1 0/1 1/1 0/1 ./. ./. ./. ./. ./. 1/1 1/1 1/1 1/1 ./. ./. 0/1 0/1

In this merged SV, some GT are phased with "|", but some GT are unphased with "/". Im confused. Why did the difference appear? My all input SVs are phased. How do I use Truvari to confirm the unchanged haplotype of all merged SVs when I input the phased SVs? This is the command I run the Truvari:

bcftools merge --force-samples -m none -o merge.vcf -l merge_list.txt
truvari collapse -i merge.vcf -o merge.truvari.vcf.gz -c merge.truvari.collapse.vcf.gz -r 1000 -p 0 -P 0.7 -s 30 -S 100000

Thanks!

XLeeHIT avatar Jun 26 '25 09:06 XLeeHIT

Hey,

Can you check which version of truvari you're using? I just tested and found that it was working.

% bcftools query -f "[%GT ]\n" test.vcf.gz
./. ./. ./. ./. ./. ./. ./. 0/1 ./. ./. ./. 1|1 ./. ./. ./. ./. 1|1 ./. 1|1 ./.
./. ./. ./. ./. ./. ./. ./. 0/1 ./. ./. ./. ./. ./. ./. 1|1 ./. ./. 1|1 ./. ./.
% truvari collapse -i test.vcf.gz -o collapsed.vcf.gz
% bcftools query -f "[%GT ]\n" collapsed.vcf.gz
./. ./. ./. ./. ./. ./. ./. 0/1 ./. ./. ./. 1|1 ./. ./. 1|1 ./. 1|1 1|1 1|1 ./.

If I'm remembering correctly, the change in the code to preserve phasing was put in a while ago here. But I'd recommend using the latest v5.3.

ACEnglish avatar Jun 26 '25 14:06 ACEnglish

Thank you for response. I update latest Truvari v5.3.0 and the problem has been solevd. Thanks!

XLeeHIT avatar Jun 29 '25 11:06 XLeeHIT