Closed mbhall88 closed 5 years ago
Hi @mbhall88, you can force scikit-allel to read FORMAT fields even if they are not declared in the header. E.g.:
In [18]: callset = allel.read_vcf('callset.vcf', fields=['calldata/GT'], types={'calldata/GT': 'i1'})
/home/aliman/malariagen/binder/conda/envs/vector-ops-13624de/lib/python3.6/site-packages/allel/io/vcf_read.py:1257: UserWarning: 'GT' FORMAT header not found
warnings.warn('%r FORMAT header not found' % name)
In [19]: callset
Out[19]:
{'calldata/GT': array([[[-1, -1],
[-1, -1],
[-1, -1],
[ 0, -1]]], dtype=int8)}
Ah cool! This worked. Thank you for the quick response.
Great, no worries!
On Tue, 6 Aug 2019, 15:56 Michael Hall, notifications@github.com wrote:
Closed #283 https://github.com/cggh/scikit-allel/issues/283.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/cggh/scikit-allel/issues/283?email_source=notifications&email_token=AAFLYQVPBWVO42LHIFSF7YLQDGGIRA5CNFSM4IJU7IW2YY3PNVWWK3TUL52HS4DFWZEXG43VMVCXMZLOORHG65DJMZUWGYLUNFXW5KTDN5WW2ZLOORPWSZGOS44NARI#event-2537082949, or mute the thread https://github.com/notifications/unsubscribe-auth/AAFLYQTUQSFUOBH6QVJ5M33QDGGIRANCNFSM4IJU7IWQ .
The FORMAT header is not a requirement of the VCF (v4.2) specifications
As such, it would be great if
scikit-allel
was able to read the FORMAT field from the FORMAT column instead (if it is present). As an example of a VCF, I am currently working with