cyvcf2
cyvcf2 copied to clipboard
Accessing Variant num_called property causes segmentation fault
First of all, thanks for the speedy package, @brentp. Much appreciated!
Now, about the issue: whenever I access the num_called
property of a Variant
instance, Python crashes with a segmentation fault. The VCF file was generated by the Strelka SNV and indel caller. I'm not familiar with Cython, so I can't readily submit a pull request. I figured this might be an easy fix. Then again, don't we all start by thinking that...
Steps to reproduce error
Here's a one-variant test VCF file. I had to change the file extension to .txt
to upload it to GitHub.
I'm using cyvcf2 v0.5.1 on Python v3.5.2.
>>> from cyvcf2 import VCF
>>> vcf = VCF('test.txt')
>>> var = next(vcf)
>>> var.num_called
[1] 43035 segmentation fault python
Let me know if you need anything else!
while it shouldn't segfault, you don't have genotypes in your VCF, so num_called
will never return something sensible. I'll add a guard for this scenario, but at best, it will return None.
Hi just to note this still occurs with version '0.30.18' (latest PyPi release)
Pisces 5.2.11.63 VCFs (From Illumina TSO500) define GT in the header but it's not in the FORMAT field for CNV records
The VCF 4.3 specification says "The first key must always be the genotype (GT) if it is present. There are no required keys. "
vcf-validator and bcftools say the Pisces VCF is ok
closed by #262