Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError: PI #10

Open
vappiah opened this issue Feb 1, 2021 · 1 comment
Open

KeyError: PI #10

vappiah opened this issue Feb 1, 2021 · 1 comment

Comments

@vappiah
Copy link

vappiah commented Feb 1, 2021

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'

@everestial
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants