Entering edit mode
7.7 years ago
inkprs
▴
70
Hi,
Can you show an example to extract GT fields from below data (columns starting from 9th position included) using PyVCF?
FORMAT MATERIAL_A MATERIAL_B MATERIAL_C MATERIAL_C
GT:DP:AR:AQ:AMXQ ./.:0:0:.:. 1/1:1:1:31:31 1/0:4:2:30:31 ./.:0:0:.:.
Don't know python solution. But its easy to do by vcftools
--extract-FORMAT-info <string>
. See https://vcftools.github.io/man_latest.htmlPlease choose sensible tags, in this case 'pyvcf' is crucial if you want the developer to find your question. I've edited your post to add this tag.
Ok, any python solution?
You could have a look at https://github.com/brentp/cyvcf2, which I prefer for vcf parsing. The variants have a .genotype attribute.