Genes are long strands of DNA, and their function in nature is determined by their three dimensional structure and underlying biochemical processes. For purposes of this simulation, however, we are only interested in one aspect of a genome: how many mutatations does it contain, and which loci contain mutations?
In asexual populations an individual can be represented by a single integer which is a count of the number of mutations it has incurred. Initially all individuals will be completely healthy, that is they will all have 0 mutations.
Things are more complex for sexual reproduction. We have to model each individual locus to take into account the fact that mutations are introduced at a single locus and then either die out in later generations or spread through the population and become fixed.
In nature there may be several different alleles, or gene types, at each locus. For this model, however, we will represent only two alleles: the original form of the gene (called the ``wild'' type) will be represented by a 0, and the mutated gene by a 1.
Individuals in a sexually reproducing population will be represented by two equal-length strings of 1s and 0s. Initially we will assume all individuals are perfectly healthy, which means they are represented by two strings of 0s. For each locus in the genome there are four possibilities:
00 both parents contribute a wild gene 01 one parent contributed a mutated gene 10 the other parent contributed a mutated gene 11 both parents contributed a mutated geneCases 10 and 01 define heterozygous loci, since the contributions from the two parents are different. A 00 locus is homozygous wild and a 11 is a homozygous mutant locus.