grenaud / glactools

command-line tools for the management of genotype likelihoods and allele counts
http://grenaud.github.io/glactools/
GNU General Public License v3.0
29 stars 2 forks source link

problems about vcfm2acf #21

Open LiShuhang-gif opened 3 years ago

LiShuhang-gif commented 3 years ago

Hi, I used glactools to convert multiple sample vcf file to acf format. However, a problem has occured as follows:

(base) [shali@vm-login02 test]$ glactools vcfm2acf --onlyGT --fai /public/home/fan_lab/shali/reference/hg38.fa.fai chr22.vcf.gz > chr22.acf.gz
SimpleVCF: cannot observed both GL and PL

My vcf file was generated by PEPPER-Margin-DeepVariant pipeline, regenotyped by whatshap and filtered by vcftools. Two lines of this file are shown below, and I think it do contains GL at least:

chr22   10510059        .       G       C       .       PASS    .       GT:GQ:DP:AD:VAF:PL:GL   0/0:7:.:.:.:.:-0.0992291,-0.689859,-4.68986     0/0:7:.:.:.:.:-0.0992291,-0.689859,-4.68986     0/0:9:.:.:.:.:-0.0536517,-0.93475,-9.23491      0/0:13:.:.:.:.:-0.0234915,-1.27857,-13.7954     0/0:9:.:.:.:.:-0.0536517,-0.93475,-9.23491      0/0:36:.:.:.:.:-0.000114312,-3.57975,-9.18137   .:.:.:.:.:.:-0.477121,-0.477121,-0.477121       0/1:6:.:.:.:.:-0.560206,-0.139841,-5.15084      0/0:42:.:.:.:.:-2.9343e-05,-4.17029,-13.7719    .:.:.:.:.:.:-0.477121,-0.477121,-0.477121       0/0:42:.:.:.:.:-2.9343e-05,-4.17029,-13.7719    .:.:.:.:.:.:-0.477121,-0.477121,-0.477121       .:.:.:.:.:.:-0.477121,-0.477121,-0.477121       .:.:.:.:.:.:-0.477121,-0.477121,-0.477121       0/0:7:.:.:.:.:-0.0992291,-0.689859,-4.68986     .:.:.:.:.:.:-0.477121,-0.477121,-0.477121       0/0:36:.:.:.:.:-0.000114312,-3.57975,-9.18137   1/1:7:.:.:.:.:-4.68986,-0.689859,-0.0992291     0/0:9:.:.:.:.:-0.0536517,-0.93475,-9.23491      .:.:.:.:.:.:-0.477121,-0.477121,-0.477121       .:.:.:.:.:.:-0.477121,-0.477121,-0.477121       0/0:7:.:.:.:.:-0.0992291,-0.689859,-4.68986     0/0:7:.:.:.:.:-0.0992291,-0.689859,-4.68986     0/0:9:.:.:.:.:-0.0536044,-0.93511,-9.23486
chr22   10510248        .       G       A       .       PASS    .       GT:GQ:DP:AD:VAF:PL:GL   0/0:7:.:.:.:.:-0.0992291,-0.689859,-4.68986     0/0:7:.:.:.:.:-0.0992291,-0.689859,-4.68986     0/0:42:.:.:.:.:-2.9343e-05,-4.17029,-13.7719    0/0:13:.:.:.:.:-0.0234915,-1.27857,-13.7954     0/0:9:.:.:.:.:-0.0536517,-0.93475,-9.23491      0/0:42:.:.:.:.:-2.9343e-05,-4.17029,-13.7719    .:.:.:.:.:.:-0.477121,-0.477121,-0.477121       0/0:42:.:.:.:.:-2.9343e-05,-4.17029,-13.7719    0/1:4:.:.:.:.:-0.370817,-0.24092,-9.55208       0/0:7:.:.:.:.:-0.0992291,-0.689859,-4.68986     0/0:45:.:.:.:.:-1.50329e-05,-4.46075,-18.3625   .:.:.:.:.:.:-0.477121,-0.477121,-0.477121       0/0:7:.:.:.:.:-0.0992291,-0.689859,-4.68986     .:.:.:.:.:.:-0.477121,-0.477121,-0.477121       0/0:7:.:.:.:.:-0.0992291,-0.689859,-4.68986     .:.:.:.:.:.:-0.477121,-0.477121,-0.477121       0/0:42:.:.:.:.:-2.9343e-05,-4.17029,-13.7719    0/0:7:.:.:.:.:-0.0992291,-0.689859,-4.68986     0/0:9:.:.:.:.:-0.0536517,-0.93475,-9.23491      .:.:.:.:.:.:-0.477121,-0.477121,-0.477121       1/1:7:.:.:.:.:-4.68986,-0.689859,-0.0992291     0/0:7:.:.:.:.:-0.0992
291,-0.689859,-4.68986     0/0:7:.:.:.:.:-0.0992291,-0.689859,-4.68986     0/0:9:.:.:.:.:-0.0536044,-0.93511,-9.23486

May I have some help from anybody? Thanks!

grenaud commented 3 years ago

Hello! Thank you for your interest in my software! My apologies for the delay in replying I'm currently on paternity leave.

This is not really a bug, it is more like a feature. I did not expect that it caller would simultaneously produce PL and GL. It does not make much sense. If I had more time I could add a flag to accept such format. However, I have very little time during the day.

Could you try to modify the input file to remove the pl field?

LiShuhang-gif commented 3 years ago

Thanks for your reply! I used bcftools to remove the PL field. And after I did so, the glactools began to work successfully. I'll put my code here to help others who may encounter the similar problems. And you can close this issue. Thanks one more time.

bcftools view --header-only chr22.vcf.gz >> chr22.vcf
bcftools query -f '%CHROM\t%POS\t%ID\t%REF\t%ALT\t%QUAL\t%FILTER\t%INFO\tGT:GQ:DP:AD:VAF:GL[\t%GT:%GQ:%DP:%AD:%VAF:%GL]\n' chr22.vcf.gz >> chr22.vcf