PyVCF icon indicating copy to clipboard operation
PyVCF copied to clipboard

DP should be None if no call is made

Open Redmar-van-den-Berg opened this issue 7 years ago • 0 comments

I ran into the following problem using the latest pyvcf from pip. I should note that this is for the following haploid record.

#CHROM	POS	ID	REF	ALT	QUAL	FILTER	INFO	FORMAT	sample1	sample2
gi|194447306|ref|NC_011083.1|	299078	.	T	A	178.77	.	AC=1;AF=1.0;AN=1;DP=8;FS=0.0;MLEAC=1;MLEAF=1.0;MQ=28.13;QD=28.35;SOR=3.611	GT:AD:DP:GQ:PL:FT	1:0,5:5:99:207,0:G_dp10	.:0,0:.:.:.:.

When no call is made, I expected the DP to be set to None, so that I could do if call.data.GT: do somthing. However, this doesn't work, because the call.data.GT gets set to . instead of None. Is this the expected behaviour? As you can see from the print output, the other fields that have . in the vcf file are converted to None.

    # No call made
    if call.data.GT == '.':
        print(call.data)

CallData(GT=., AD=[0, 0], DP=None, GQ=None, PL=None, FT=None)

Redmar-van-den-Berg avatar Jul 17 '17 11:07 Redmar-van-den-Berg