MendelCreature Genetics
Neutral Gender w/Crossover Example

This notebook is an annotated walkthrough of the MendelCreature genetics package, using the MendelBeans package to explore concepts of chromosome crossover.  Note that the fictional MendelBeans have the same traits as MendelPeas, but a different chromosomal arrangement.

Getting started
	To begin, we set the appropriate package directory and import the MendelBeans.m package

SetDirectory["C:\Documents and Settings\grl\My \
Documents\Mathematica"];
<< MendelBeans.m

Type explains a bit about the genome we have just loaded

TYPE

Instead of making an original and new population, we can load one from memory, so it will be the same for the walkthrough (BeanPatch = MakePop[5000] generates a new, random population).

<< MendelBeansEg.mx
Length[BeanPatch]
Sample  =  Take[BeanPatch, 10];
ShowPop[Sample]

Trait Linkages
	Select all individuals from the large population with what appear to be all dominant traits, and choose one of them.

\(\(DomFind\  = \ 
        FindTraitMatches[
          BeanPatch, {"Smooth Seeds", "Yellow Seeds", "Tall Stems", "Inflated Pods", \ "Green Pods", "Purple Flowers", "Axial Flowers"}, And];\)\)
OneDom  =  DomFind[[1]];
ShowOne[OneDom]

We could try the same for recessive traits, but our chances of finding a seven time recessive are small.  How small? Lets see count the recessives for one trait.

CountTrait[BeanPatch, "Wrinkled Seeds"]

For an even (50/50) distribution of recessive and dominant alleles, we would expect 1/4 (.5*.5 = .25) of the individuals to have both and be homozygous recessive, which is essentially what we get. For seven recessive traits, we would expect only one in (4^7), or one in every 16,384 individuals, to be seven times recessive.  Because the BeanPatch only has 5000 individuals, our chances are about 30% that we have such an individual in the population...

\(\(RecFind\  = \ 
        FindTraitMatches[
          BeanPatch, {"Wrinkled Seeds", "Green Seeds", "Dwarf Stems", "Constricted Pods", \ "Yellow Pods", "White Flowers", 
"Terminal Flowers"}, 
          And];\)\)
OneRec  =  RecFind[[1]];
ShowOne[OneRec]

Apparently we were lucky. (Or, more likely, we made a few extra patches and used one with the rare recessive in it...)

We would expect our recessive plant to produce all recessives (100 of 100) when crossed with itself:

RecGen1  =  
        Breed[OneRec, OneRec, 100];
CountTrait[RecGen1, "Wrinkled Seeds"]
CountTrait[RecGen1, "Green Seeds"]
CountTrait[RecGen1, "Dwarf Stems"]
CountTrait[RecGen1, "Constricted Pods"]
CountTrait[RecGen1, "Yellow Pods"]
CountTrait[RecGen1, "White Flowers"]
CountTrait[RecGen1, "Terminal Flowers"]

Our so-called 'dominant', however, could be heterozygous, which will also show itself in a self-fertilization. 100% dominant offspring means homozygous parent, 75% dominant offspring means heterozygous parent.

DomGen1  =  
        Breed[OneDom, OneDom, 100];
ssct = 
      CountTrait[DomGen1, "Smooth Seeds"]
ysct = 
      CountTrait[DomGen1, "Yellow Seeds"]
tsct = CountTrait[DomGen1, "Tall Stems"]
ipct = 
      CountTrait[DomGen1, "Inflated Pods"]
gpct = CountTrait[DomGen1, "Green Pods"]
pfct = 
      CountTrait[DomGen1, "Purple Flowers"]
afct = CountTrait[DomGen1, "Axial Flowers"]

Homozygous: Green Pods, Purple Flowers
	Heterozygous: Smooth Seeds, Yellow Seeds,Tall Stems,Inflated Pods, Axial Flowers
	If traits are independently assorted, then (fraction of population with first trait) * (fraction of population with second trait) = (fraction of population with both traits).  Let's test these traits for independence.

ssct[[3]]*ysct[[3]]
CountTraitMatch[DomGen1, {"Smooth Seeds", "Yellow Seeds"}, 
      And]

Hmm... twice as many Smooth and Yellow as expected.  Looks like these two traits are linked.  Similarly for others:

ssct[[3]]*tsct[[3]]
CountTraitMatch[DomGen1, {"Smooth Seeds", "Tall Stems"}, 
      And]

ssct[[3]]*ipct[[3]]
CountTraitMatch[DomGen1, {"Smooth Seeds", "Inflated Pods"}, 
      And]

ssct[[3]]*gpct[[3]]
CountTraitMatch[DomGen1, {"Smooth Seeds", "Green Pods"}, 
      And]

ssct[[3]]*pfct[[3]]
CountTraitMatch[DomGen1, {"Smooth Seeds", "Purple Flowers"}, 
      And]

ssct[[3]]*afct[[3]]
CountTraitMatch[DomGen1, {"Smooth Seeds", "Axial Flowers"}, 
      And]

Each other trait appears to be linked to the first trait, which, in turn, means they are all linked to each other!  We can explore this linkage more once we have a couple of pure homozygous lines.

Establishing homozygous genotypes
	It is relatively easy to find a homozygous recessive genotype - simply find an individual with the recessive traits, which we already have in OneRec, and can rename as HomRec.

HomRec  =  OneRec;
ShowOne[HomRec]

It is quite a bit harder to find a purely homozygous individual, particularly for lots of traits, because heterozygous individuals look the same!  Our original all dominant selection, OneDom, only had two homozygous traits. We can select from others in the original list, DomFind, breeding each with itself until we find one with at least four or five homozygous traits:

TestDom1  =  DomFind[[11]];
DomGen1 =  
        Breed[TestDom1, TestDom1, 100];
CountTrait[DomGen1, "Smooth Seeds"]
CountTrait[DomGen1, "Yellow Seeds"]
CountTrait[DomGen1, "Tall Stems"]
CountTrait[DomGen1, "Inflated Pods"]
CountTrait[DomGen1, "Green Pods"]
CountTrait[DomGen1, "Purple Flowers"]
CountTrait[DomGen1, "Axial Flowers"]

We select from the dominant trait individuals and repeat the process with the next generation:

DomFind1  =  
        FindTraitMatches[DomGen1, {"Tall Stems", "Inflated Pods"}, 
          And];
TestDom2  =  DomFind1[[1]];
DomGen2 =  
        Breed[TestDom2, TestDom2, 100];
CountTrait[DomGen2, "Smooth Seeds"]
CountTrait[DomGen2, "Yellow Seeds"]
CountTrait[DomGen2, "Tall Stems"]
CountTrait[DomGen2, "Inflated Pods"]
CountTrait[DomGen2, "Green Pods"]
CountTrait[DomGen2, "Purple Flowers"]
CountTrait[DomGen2, "Axial Flowers"]

We now have an individual plant that is homozygous dominant in all seven traits.

HomDom  =  TestDom2;
ShowOne[HomDom]

Observing Crossover
	Crossing homozygous dominant and homozygous recessive lines will yield all heterozygous offspring, so we will expect 100% dominant traits.

DoReGen  =  
        Breed[HomDom, HomRec, 100];
CountTrait[DoReGen, "Smooth Seeds"]
CountTrait[DoReGen, "Yellow Seeds"]
CountTrait[DoReGen, "Tall Stems"]
CountTrait[DoReGen, "Inflated Pods"]
CountTrait[DoReGen, "Green Pods"]
CountTrait[DoReGen, "Purple Flowers"]
CountTrait[DoReGen, "Axial Flowers"]
Heter  =  DoReGen[[1]];

Because the traits are linked, however, a heterozygous parent will be expected to pass all-dominant or all-recessive genes to their offspring.  Looking at a single trait demonstrates the expected 50/50 split between heterozygous and homozygous recessive that we would expect from a cross of heterozygous and homozygous recessive parents.  We make this population big because we want to look at the numbers more closely.

HetRecGen  =  
        Breed[Heter, HomRec, 1000];
CountTrait[HetRecGen, "Smooth Seeds"]
CountTrait[HetRecGen, "Yellow Seeds"]
CountTrait[HetRecGen, "Tall Stems"]
CountTrait[HetRecGen, "Inflated Pods"]
CountTrait[HetRecGen, "Green Pods"]
CountTrait[HetRecGen, "Purple Flowers"]
CountTrait[HetRecGen, "Axial Flowers"]

For linked traits, individuals with one dominant trait should have received all seven dominant traits, and individuals with recessive traits should have all recessive and no dominant traits.  Lets see if this is true. For example, we would expect no individuals with both recessive Wrinkled Seeds and dominant Yellow Seeds, but...

CountTraitMatch[HetRecGen, {"Wrinkled Seeds", "Yellow Seeds"}, 
      And]

And there are even more with recessive Wrinkled Seeds and dominant Tall Stems!

CountTraitMatch[HetRecGen, {"Wrinkled Seeds", "Tall Stems"}, 
      And]

This phenomenon indicates crossover, when two chromosomes inside a parent swap parts of their genetic material before dividing.  For nearly 100 of the heterozygous parent plants there was a switch where the recessive chromosome kept the part with 'seed texture' allele but gave up the part with the 'stem length' allele in a swap with the dominant chromosome. The number of individuals that cross over can be used to tell how far apart two genes are on a chromosome.  If they are close together, they tend to get swapped at the same time, and the crossover is not noticable.  If they are far apart, they will be separated by crossover quite often.
	Genetic distances can be measured in percentage length of the chromosome, i.e. in 'parts out of 100'.  The 'seed texture' and 'stem length' genes cross over about 10 times out of 100, so they are about 10 genetic units apart (assuming single crossovers - double crossovers are not implemented in the MendelBeans model!).  Let's see how far the other genes are from the Wrinkled Seeds gene.

CountTraitMatch[HetRecGen, {"Wrinkled Seeds", "Inflated Pods"}, 
      And]

CountTraitMatch[HetRecGen, {"Wrinkled Seeds", "Green Pods"}, 
      And]

CountTraitMatch[
      HetRecGen, {"Wrinkled Seeds", "Purple Flowers"}, 
      And]

CountTraitMatch[HetRecGen, {"Wrinkled Seeds", "Axial Flowers"}, 
      And]

Apparently the other genes are spaced out at about every 5 genetic units or so, which means the recessive Dwarf Stems should be about 15 units from the dominant Purple Flowers, for about 150 crossovers per 1000.  Let's see...

CountTraitMatch[HetRecGen, {"Dwarf Stems", "Purple Flowers"}, 
      And]

Pretty close! For one last look at crossover, lets look at a sample of the 'crossover' generation.  Remember that without crossover these should be all heterozygous (dominant) or all homozygous recessive.  Can you see one that is not?  Can you identify 'where' crossover occured? (Dominant is Smooth/Yellow/Tall/Inflated/Green/Purple/Axial).

CrossSample  =  Take[HetRecGen, 10];
ShowPop[CrossSample]

The End
	The statement below was used to save the original patch in the file you initially loaded.

DumpSave["MendelBeansEg.mx", {BeanPatch}];

This notebook created by Dr. Garrett R. Love for the Shodor Education Foundation. Copyright 2002