VCF-Simplify icon indicating copy to clipboard operation
VCF-Simplify copied to clipboard

KeyError: PI

Open vappiah opened this issue 3 years ago • 1 comments

Hi I was trying to convert my vcf to haplotype . I used python3.6 to run vcf-simplify and I got the error message below

Traceback (most recent call last): File "/home/user/apps/VCF-Simplify/VcfSimplify.py", line 58, in main() File "/home/user/apps/VCF-Simplify/VcfSimplify.py", line 53, in main vcf_solver(task, args) File "/home/user/apps/VCF-Simplify/assign_task/perform_operation.py", line 95, in vcf_solver fnc_vcf_to_haplotype(infile, outfile, header_name, pi_tag, pg_tag, include_unphased, gtbase) File "/home/user/apps/VCF-Simplify/metadata_parser/utils.py", line 26, in wrapper result = func(*args, **kwargs) File "/home/user/apps/VCF-Simplify/records_parser/simplifyvcf/to_haplotype.py", line 101, in fnc_vcf_to_haplotype pi_values = [mapped_record[sample][pi_tag] for sample in sample_ids] File "/home/user/apps/VCF-Simplify/records_parser/simplifyvcf/to_haplotype.py", line 101, in pi_values = [mapped_record[sample][pi_tag] for sample in sample_ids] KeyError: 'PI'

vappiah avatar Feb 01 '21 01:02 vappiah

It's because your VCF does not have the "PI" tag in FORMAT field. You may indicate any other equivalent tag or "CHROM" if you want the haplotype representation to be chromosome wide.

everestial avatar Feb 08 '21 04:02 everestial