How do I extract GT information from VCF using PyVCF?
0
1
Entering edit mode
7.1 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:.:.
sequencing pyvcf • 3.5k views
ADD COMMENT
1
Entering edit mode

Don't know python solution. But its easy to do by vcftools --extract-FORMAT-info <string>. See https://vcftools.github.io/man_latest.html

ADD REPLY
0
Entering edit mode

Please 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.

ADD REPLY
0
Entering edit mode

Ok, any python solution?

ADD REPLY
0
Entering edit mode

You could have a look at https://github.com/brentp/cyvcf2, which I prefer for vcf parsing. The variants have a .genotype attribute.

ADD REPLY

Login before adding your answer.

Traffic: 1345 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6