Hi,
I have a vcf files with multiple samples. I want get the genotype data from the vcf file. I do not know how to do it. Could you tell me how I can get it.
Thanks,
Fuyou
Thank you everybody.
It is my fault I did not say clearly what I want to do.
For example, I have get my vcf file is
#CHROM  POS     ID      REF     ALT     QUAL    FILTER  INFO    FORMAT  sample1   sample 2      sample3
Chr01   1353    .       T       C       2385.77 PASS    FS=0;MQ=51.64;MQ0=0;QD=29.02;SOR=0.818;BaseQRankSum=1.468;ClippingRankSum=-0.886;MQRankSum=-2.172;ReadPosRankSum=-1.03;DP=666;AF=1;MLEAC=2;MLEAF=1;AN=70;AC=67  GT:AD:DP:GQ:PL  1/1:0,15:15:48:707,48,0 0/1:36,28:64:99:1147,0,11882   1/1:0,14:14:42:630,42,0 1/1:0,29:29:87:1299,87,0
I want to get a file like as:
#CHROM  POS     ID      REF     ALT    sample1   sample 2      sample3
Chr01        1353    .            T       C         CT              CC              CC
Thanks,
Fuyou
You're not giving us much to work with. What genotypes? Why do you want the genotypes?
Thanks Zev,
It is my fault I did not say clearly what I want to do.
For example, I have get my vcf file is
I want to get a file like as:
Thanks,
Fuyou
Thank you everybody.
It is my fault I did not say clearly what I want to do.
For example, I have get my vcf file is
I want to get a file like as:
Thanks,
Fuyou
It is better if you include this as an Update to your original post and not add it as an answer (you can hit the edit button to edit your original post and add to the bottom, typically after putting in that it is an Update that follows). All you are doing is stripping out some fields. You can use linux tools to cut out columns from tabular data. Any of the programming options I mentioned in my post will also let you do this by iterating over the VCF records and only outputting the desired fields to a new output file.
Thank you very much!
If my answer solves your problem please upvote and accept as the answer. Much appreciated