I am currently developing an online horse game where players can breed horses using real-to-life genetics. In the past, I have distributed the alleles in separate columns (allele 1 and allele two, for each locus), but this time I'm having to work with another developer's code which places the two alleles under one table column (so at the locus agouti, for example [which is a column], it displays two alleles in the form of AA).
I've now come to having to code the breeding script, which combines the genetics for both the sire and the dam of the resulting foal. But, I've run into a problem - since I could in the past pull each half of the gene from each parent, and combine randomly to come up with genetically accurate offspring, I'm not to sure how to go about it with this new database structure. If all the genes had one letter alleles it would be fine - however, some genes have two, or even three characters in the allele code (For example, Rnr is one allele variety for the Roan gene and). How, then, can I combine the genes of the parents, explode them (like I normally would) into separate strings, then recombine them into one? I cannot clear the database and start over - there are paying members already training and showing their horses and it would be unfair to delete and start over.
Hopefully that's somewhat clear - I'm sorry if there's too much technical genetics jargon!