Entering edit mode
8.3 years ago
star
▴
350
I have a table like as below. I like to replace each sample value base on comparing with third first columns and code each value with(0,1,2,3). For example, if sample value in each row = REF_REF -> 1 ; if sample value in each row = REF_ALT -> 2 ; if sample value in each row = ALT_ALT -> 3 and for 0/0 -> 0. REF_REF REF_ALT ALT_ALT sample1 sample2 sample3 A/A A/G G/G 0/0 A/G G/G T/T T/C C/C T/T T/C T/C C/C C/G G/G 0/0 C/G C/G I like to make a table like as: REF_REF REF_ALT ALT_ALT sample1 sample2 sample3 A/A A/G G/G 0 2 3 T/T T/C C/C 1 2 2 C/C C/G G/G 0 2 2