odelaneau / shapeit5

Segmented HAPlotype Estimation and Imputation Tool
https://odelaneau.github.io/shapeit5/
MIT License
61 stars 9 forks source link

Error phasing(phase_common):AC field is needed in file #23

Closed jikhashkya closed 1 year ago

jikhashkya commented 1 year ago

Hi,

I'm using shapeit5 to phase HGDP chr14 VCF file and I get the following error:

Reading genotype data:
  * VCF/BCF scanning ...
ESC[31mERROR: ESC[0mAC field is needed in file

Not entirely sure, where the AC field is missing. Any help would be appreciated.

VNakhonsri commented 1 year ago

I have encountered the same problem when using static v5.1.0. I tried using BCFtools +fill-tag to add AC,AN,MAF to my VCF input file. But the error still exists. Here are my command;

bcftools +fill-tags myVCF.vcf.gz|head -1000|bcftools view -Oz -o myVCF.filtag.vcf.gz bcftools index myVCF.filtag.vcf.gz

phase_commonstatic --input myVCF.filtag.vcf.gz \ --scaffold ${Scaffold}/myscaffold${chr_no}.vcf.gz \ --region $chr_no \ --map ${map}/${chr_no}.b38.gmap.gz \ --reference myRef.${chr_no}.vcf.gz \ --output ~/target.phased.bcf \ --thread 1

VNakhonsri commented 1 year ago

I found this is problem with v5.1.0. I tried downloading SHAPEIT5_phase_common_static_v1.0.0 and it works just fine with my data.

odelaneau commented 1 year ago

Hi,

Version 5.1 requires that ALL input VCF/BCF files have the fields AC and AN present (main, scaffold and reference). Of note the VCF header need to be correct too. Adding this fields can be done using:

I bet that if the software complains, it is because of the scaffold or the reference in your case.

Best,

Olivier Delaneau

http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail Sans virus.www.avg.com http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

Le mar. 18 avr. 2023 à 13:04, VNakhonsri @.***> a écrit :

I have encountered the same problem when using static v5.1.0. I tried using BCFtools +fill-tag to add AC,AN,MAF to my VCF input file. But the error still exists. Here are my command;

bcftools +fill-tags myVCF.vcf.gz|head -1000|bcftools view -Oz -o myVCF.filtag.vcf.gz bcftools index myVCF.filtag.vcf.gz

phase_commonstatic --input myVCF.filtag.vcf.gz --scaffold ${Scaffold}/myscaffold${chr_no}.vcf.gz --region $chr_no --map ${map}/${chr_no}.b38.gmap.gz --reference myRef.${chr_no}.vcf.gz --output ~/target.phased.bcf --thread 1

— Reply to this email directly, view it on GitHub https://github.com/odelaneau/shapeit5/issues/23#issuecomment-1512883393, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD4XTIKKSUVG3WNSCLBZ7CLXBZYMTANCNFSM6AAAAAAWYL6FZQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

GiulioCentorame commented 1 year ago

Hi, Thank you for writing this! I was just wondering: how is AC and AN used by SHAPEIT5? I am asking as I am interested in phasing only a subset of individuals, and I am unsure whether to annotate before or after filtering by samples. Thank you in advance for the information!