Hi,
I'm working with a data frame of genotypes produced from multiallelic indels, an example would be
Column 1 Column 2
0/3 0/0
0/2 0/1
1/1 0/2
0/0 0/2
The possible genotypes depends on how many alternative alleles there are for that indel (I have this data)
I need to recode the 0/0 into a single digit format so for example if an indel has 1 reference allele and 2 alternative alleles the possible genotypes would be 0/0 0/1 0/2 1/1 1/2 2/2.
I tried recoding them in bulk but as each column has a different number of alleles it doesn't work correctly, so I need to code the columns independently of one another.
Any help would be great thanks
I don't understand the question:
0/0, 0/1, 0/2 are not single digits. Can you make an complete example of how the table you posted should look like after the recoding?
Original table
Recoded table
So in the example of 2 alternatives
0/0
= 10/1
= 20/2
= 31/1
= 41/2
= 52/2
= 6