This is absolutely what bcftools query was designed for. Thank you very much, it helps a lot:)
Convert a VCF-file in a user specific Format
Hello everyone,
I am curious if it is possible to convert a VCF-File (with multiple samples) in a Format whith 5 columns.
- Column should be Sample ID
- Column: Position on the chromosome
- Genotyp
- Number of reads covering site
- QUAL phred-scaled quality score for the assertion made in ALT.
May there is allready a tool which can perform this, or if I need to do it myself may you can recommend me a good programm (like awk or sed) and recommend me a code.
Aim of this should be that afterwards i can filter variants via Quality score and number of reads covering site.
Thanks a lot in advance
• 2,201 views
•
link
1 answer
That's precisely what bcftools query was designed for. You just have to build your desired output format using the existing VCF variables. I'm guessing from your query that this command should be helpful:
bcftools query -f '[%SAMPLE\t%POS\t%GT\t%DP\t%QUAL\n]' file.vcf.gz
• 0 views
•
link
• 0 views
•
link
Log in to answer this question.
Can you post a few (2-3 lines of your .vcf + all of the header?). I can give you a solution then.
Thank you very much Jorges answer was allready very helpful