I have marker information of hybrid parents and want to deduce hybrid genotypes based on their parent genotypes. Here is a subset sample of my data parent marker info. In each genotype column: 1) 0 - homozygous of one allele; 2) 1 - homozygous of the other allele; 3) 2 - heterozygous and 4) "999" indicates missing or not confident about the state.
I want to code the hybrid genotypes in this way hybrid marker coding method
How can I write R code to construct the genotypes of hybrids derived from crossing every parent to the other parents without reciprocal crossing, such as parent1/parent2, parent1/parent3 and parent3/parent5?
Here are the codes to generate the subsample.
Marker <- c(1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1012, 1013, 1014)
Parent1 <- c(0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 2, 0)
Parent2 <- c(0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0)
Parent3 <- c(0, 0, 0, 0, 0, 0, 0, 999, 0, 999, 0, 0, 0, 0)
Parent4 <- c(999, 0, 0, 0, 999, 0, 0, 0, 0, 1, 0, 0, 0, 0)
Parent5 <- c(0, 0, 0, 0, 0, 0, 2, 999, 0, 999, 0, 0, 0, 0)
Parent6 <- c(0, 0, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 0)
Parent7 <- c(999, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0)
Parent8 <- c(999, 0, 0, 0, 999, 0, 0, 0, 0, 1, 0, 0, 0, 0)
Genotypes <- cbind(Marker, Parent1, Parent2, Parent3, Parent4, Parent5, Parent6, Parent7, Parent8)
Many thanks,