Question: Numeric genotype to letters
0
waqaskhokhar999 • 100 wrote:
I have an input file like this:
#CHROM START ID Ref Alt 108 139 159 265 350
5 5571 snp_5_5571 C T 0 0 0 1 0
3 11641 snp_3_11641 T G 0 1 1 2 2
3 14240 snp_3_14240 G A,T 0 0 0 0 1
From column 5 onwards if its 0 replace it with ref+ref, if its one replaces it with ref+alt and if its 2 replace it with alt+alt so that the above table should be like that:
#CHROM START ID Ref Alt 108 139 159 265 350
5 5571 snp_5_5571 C T CC CC CC CT CC
3 11641 snp_3_11641 T G TT TG TG GG GG
3 14240 snp_3_14240 G A GG GG GG GG GA
ADD COMMENT
• link
•
modified 19 months ago
by
JC ♦ 12k
•
written
19 months ago by
waqaskhokhar999 • 100