I would like to convert unphased VCF genotypes into raw genotype data. For example if my REF is C and ALT is T, I would convert 0/0 to CC, 0/1 to CT, 1/0 to TC and 1/1 to TT. Bonus question: Would it also be possible to convert both 0/1 and 1/0 to the same CT instead of converting 1/0 to TC. Does vcftools do this? Possibly another tool? Thanks for your help.
Hi Pierre Lindenbaum,
Thanks a lot for the script.
When I am running the script on file like this one down, it gives error. Any suggesstion how the script could be modified to work also with this format?
Thanks
#CHROM POS REF ALT QUAL FILTER INFO FORMAT atcc2355 cd01 cd02 cd03 cd04 cd05
atcc2355 530 T C 40 PASS NA GT 0 0 0 0 0 0 0 0
atcc2355 531 A T 40 PASS NA GT 0 0 0 0 0 0 0 0
atcc2355 533 A C,T 40 PASS NA GT 0 0 1 2 0 0 0 0
atcc2355 569 G A 40 PASS NA GT 0 0 0 0 0 0 0 0
atcc2355 573 T C,A 40 PASS NA GT 0 1 1 1 1 1 2 1
atcc2355 599 A G 40 PASS NA GT 0 0 0 0 0 0 0 0
Hi Pierre Lindenbaum, Thanks a lot for the script. When I am running the script on file like this one down, it gives error. Any suggesstion how the script could be modified to work also with this format? Thanks