(************** Content-type: application/mathematica ************** Mathematica-Compatible Notebook This notebook can be used with any Mathematica-compatible application, such as Mathematica, MathReader or Publicon. The data for the notebook starts with the line containing stars above. To get the notebook into a Mathematica-compatible application, do one of the following: * Save the data starting with the line of stars above into a file with a name ending in .nb, then open the file inside the application; * Copy the data starting with the line of stars above to the clipboard, then use the Paste menu command inside the application. Data for notebooks contains only printable 7-bit ASCII and can be sent directly in email or through ftp in text mode. Newlines can be CR, LF or CRLF (Unix, Macintosh or MS-DOS style). NOTE: If you modify the data for this notebook not in a Mathematica- compatible application, you must delete the line below containing the word CacheID, otherwise Mathematica-compatible applications may try to use invalid cache data. For more information on notebooks and Mathematica-compatible applications, contact Wolfram Research: web: http://www.wolfram.com email: info@wolfram.com phone: +1-217-398-0700 (U.S.) Notebook reader applications are available free of charge from Wolfram Research. *******************************************************************) (*CacheID: 232*) (*NotebookFileLineBreakTest NotebookFileLineBreakTest*) (*NotebookOptionsPosition[ 28015, 800]*) (*NotebookOutlinePosition[ 28858, 829]*) (* CellTagsIndexPosition[ 28770, 823]*) (*WindowFrame->Normal*) Notebook[{ Cell["\<\ MendelCreature Genetics Instructor Tutorial\ \>", "Subtitle", TextAlignment->Center], Cell[TextData[{ "\tThis notebook provides instruction on how to use the ", StyleBox["MendelCreature ", FontSlant->"Italic"], "genetics packages to construct genomes of fictional (and non-fictional) \ creatures for exploration by genetics students, much in the fashion of a \ fruit-fly laboratory exercise. You should have three template packages, \ MendelPeas.m, MendelBeans.m, and MendelDragon.m. The MendelPeas and \ MendelBeans packages represent genderless genomes with the capability of \ self-fertilization (as is typical of many plants). Although the two fictional \ plants exhibit the same traits, they have a different genetic structure - the \ MendelPeas have mostly independent traits and no crossover, while the \ MendelBeans exhibit fully linked traits with crossover. The Mendel Dragon \ package incorporates the complexity of gender, thus requiring the mating of \ opposite-gender individuals, as well as adding the possibility for sex-linked \ traits.\n", StyleBox["Building a MendelCreature Package\n", "Section"], "\tWe will start by building our own MendelCreature, which in this case \ will be a variety of clover. MendelClover will have two trait types - number \ of leaves and color of flowers. In this clover, four-leaves will be \ recessive to three-leaves, but genes for purple flowers and for white flowers \ will combine in the heterozygous plants to make pink flowers.\n\t(If you do \ not wish to be able to construct your own MendelCreature packages, you can \ simply download the MendelClover.m package and skip this section).\n\tIn \ order to build our MendelClover, we will use MendelPeas as a template. Open \ the package MendelPeas.m, which you have hopefully downloaded into the same \ directory as this tutorial notebook. You will likely have to select \ 'Packages (*.m)' from the menu denoting 'Files of type:' The package should \ begin with the line ", StyleBox["BeginPackage[\"MendelPeas`\"]", FontWeight->"Bold"], ".\n\tBecause we don't want to change the original MendelPeas package, we \ will go ahead and save this version with a new name. Click onto the package \ screen, then select ", StyleBox["File", FontWeight->"Bold"], " followed by ", StyleBox["Save as Special", FontWeight->"Bold"], ", and then ", StyleBox["Package Format", FontWeight->"Bold"], ". Edit the file name from 'MendelPeas' to 'MendelClover' and click ", StyleBox["Save", FontWeight->"Bold"], ". (if it starts as 'MendelTutor', you are trying to save *this* notebook - \ ", StyleBox["Cancel", FontWeight->"Bold"], " and try again, making sure to click on the MendelPeas window before \ trying the save).\n\tClose the MendelPeas.m window and open your newly \ created package, MendelClover.m, which you should again find among files of \ type 'package'. Note that the file should still look exactly like MendelPeas. \ Begin by editing the ", StyleBox["BeginPackage", FontWeight->"Bold"], " line, changing ", StyleBox["MendelPeas", FontWeight->"Bold"], " to ", StyleBox["MendelClover", FontWeight->"Bold"], ". Notice that the apostrophe at the end is important! Your first line \ should thus be edited to read ", StyleBox["BeginPackage[\"MendelClover`\"]\n\t", FontWeight->"Bold"], "The next segment describes the ", StyleBox["TYPE", FontWeight->"Bold"], " of the genome, which we don't need to change. This is followed by a list \ of ", StyleBox["usage", FontWeight->"Bold"], " commands (eg. ", StyleBox["MakePop::usage = \"", FontWeight->"Bold"], StyleBox["etc...", FontSlant->"Italic"], StyleBox["\"", FontWeight->"Bold"], ") which describe for the user how the various commands in the package work \ - these do not need to be changed either. Continue to the line ", StyleBox["Begin[\"`Private`\"]", FontWeight->"Bold"], ". Immediately following this line begins the definition for the genome, \ which is a ", StyleBox["Mathematica", FontSlant->"Italic"], " list of the form ", StyleBox["Peas = {{...},{...},...,{...}}", FontWeight->"Bold"], ". This is the primary section to edit for the definition of our genome.\n\t\ Start by editing the variable ", StyleBox["Peas", FontWeight->"Bold"], " to ", StyleBox["Clover", FontWeight->"Bold"], ". Nine lines below is another statement, ", StyleBox["GENOME = Peas;", FontWeight->"Bold"], ", in which ", StyleBox["Peas", FontWeight->"Bold"], " should again be edited to ", StyleBox["Clover", FontWeight->"Bold"], ". The following line reads ", StyleBox["COPCT = 0;", FontWeight->"Bold"], ". This variable represents the crossover frequency for our plant, and \ should be set to a number from zero to one. As we are not interested in a \ crossover study of our clover, especially given that we will presume our two \ traits are not linked on the same chromosome, we will not edit the zero \ setting.\n\tReturn back to the line that now reads ", StyleBox["Clover = { ", FontWeight->"Bold"], ", which is followed by seven lines of brackets, numbers and commas and \ then a final line with a closing bracket and a semicolon(", StyleBox["};", FontWeight->"Bold"], "). ", StyleBox["Mathematica", FontSlant->"Italic"], " uses the curly brackets to represent lists, and in this case, each \ element of our ", StyleBox["Clover", FontWeight->"Bold"], " genome is itself a list, enclosed by brackets on its own line, each of \ which represents a trait in the genome. Each trait list, as can be seen from \ the leftover ", StyleBox["Peas", FontWeight->"Bold"], " genome, consists of three numbers and four quoted strings:\n\t", StyleBox["{1, 6, .50, \"Seeds\", \"Smooth\", \"Smooth\", \"Wrinkled\"},\n\t\ ", FontWeight->"Bold"], "The first number represents which chromosome a particular trait is \ associated with. If we wish to link traits, we would give each trait the \ same chromosome number. Numbers 1 and 2 actually have a special \ representation as sex-linked genes for gendered genomes, but in this case, \ they have no special meaning. We will arbitrarily designate chromosome 5 as \ the home for the three/four leaf trait, and so change the ", StyleBox["1", FontWeight->"Bold"], " to a ", StyleBox["5", FontWeight->"Bold"], ".\n\tThe second number represents the location of a gene on a chromosome, \ as measured in genetic units from the center of the chromosome outward, and \ is a number from 0 to 50. This number is meaningless except in crossover \ calculations, so we can choose any value - we'll say the three/four leaf \ trait lives near the end of the chromosome, at location 47, so we change the \ ", StyleBox["6", FontWeight->"Bold"], " to a ", StyleBox["47", FontWeight->"Bold"], ".\n\tThe third number represents the frequency (from 0.0 to 1.0) of \ 'dominant' genes in a sample population of MendelCreatures. A good number to \ use is ", StyleBox[".50", FontWeight->"Bold"], ", which means that when the user of the package creates a starting \ population using ", StyleBox["MakePop", FontWeight->"Bold"], ", half of the genes in the population will be the first (dominant) gene, \ and half will be the second (recessive) gene. If you wish to generate more \ recessive trait individuals in the starting population, you would make this \ number lower. Clover will retain the default ", StyleBox[".50", FontWeight->"Bold"], " value.\n\tThe first string is generally a noun describing where the trait \ manifests itself. In the case of our clover, this gene affects the number of \ ", StyleBox["\"Leaves\"", FontWeight->"Bold"], ", which we encase in quotes to represent as a word string (replacing ", StyleBox["\"Seeds\"", FontWeight->"Bold"], "). The second and fourth strings are generally adjectives describing the \ phenotype associated with homozygous individuals, with the dominant trait \ expressed first, where applicable. The third string describes the \ heterozygous phenotype, and will match the dominant trait or describe the \ combined genetic effect. ", StyleBox["\"Three\"", FontWeight->"Bold"], ", ", StyleBox["\"Three\"", FontWeight->"Bold"], ", and ", StyleBox["\"Four\"", FontWeight->"Bold"], " describe the homozygous dominant, heterozygous and homozygous recessive \ number of leaves for our clover, which should now have the following trait \ description in the first line of the list:\n\t", StyleBox["{5, 47, .50, \"Leaves\", \"Three\", \"Three\", \"Four\"},\n\t", FontWeight->"Bold"], "If we place the second trait on chromosome 1, position 12, again with a \ 50-50 gene distribution, the edit for the second trait becomes\n\t", StyleBox["{1, 12, .50, \"Flowers\", \"Purple\", \"Pink\", \"White\" }", FontWeight->"Bold"], "\n\tBecause this is the last trait ", StyleBox["we eliminate the comma at the end", FontSlant->"Italic"], ", which is meant to separate elements of the list (note that it is missing \ after the last of the ", StyleBox["Peas", FontWeight->"Bold"], " traits). We can then eliminate the remaining leftover traits. The full \ ", StyleBox["Clover", FontWeight->"Bold"], " genome definition should thus look like this:\n", StyleBox["Clover={\n \ {5,47,.50,\"Leaves\",\"Three\",\"Three\",\"Four\"},\n \ {1,12,.50,\"Flowers\",\"Purple\", \"Pink\",\"White\"}\n };", FontWeight->"Bold"], "\n\tYou should now be able to click on the MendelClover package and ", StyleBox["Save", FontWeight->"Bold"], " it, now that it is complete." }], "Text", FontSize->14], Cell[TextData[{ StyleBox["Working with a MendelCreature\n", "Section"], "\tNow that we have created a package for MendelClover, let's run some \ 'genetics' experiments! You will first want to open a ", StyleBox["New", FontWeight->"Bold"], " ", StyleBox["Mathematica", FontSlant->"Italic"], " window under the ", StyleBox["File", FontWeight->"Bold"], " menu.\n\tIn order for ", StyleBox["Mathematica", FontSlant->"Italic"], " to find our package, we first ensure that ", StyleBox["Mathematica", FontSlant->"Italic"], " knows which directory to find packages in. We enclose the entire ", StyleBox["path", FontSlant->"Italic"], " (the list of folders/directories from outside in) in quotes inside the ", StyleBox["SetDirectory", "Input"], " function. Use the Windows search function (Start-Search-For Files or \ Folders) or the Mac finder to search for 'MendelPeas.m', and then click on \ the file to reveal the list of directories or folders. The following line is \ a Windows2000 example (grl is a username - your path will be different!):" }], "Text", FontSize->14], Cell[BoxData[ \(\(SetDirectory["\"];\)\)], "Input"], Cell[TextData[{ "\tWe then load the package of interest using ", StyleBox["<<", "Input"], ", which is shorthand for the ", StyleBox["Get", "Input"], " function and loads in a file from the specified directory." }], "Text", FontSize->14], Cell[BoxData[ \(<< MendelClover.m\)], "Input"], Cell[TextData[{ "\tIf you remember, at the beginning of our package there were a set of ", StyleBox["usage", "Input"], " statements, which, when a package has been loaded, will provide us with \ help information about statements in the package. For example, if we are \ uncertain as to how the function ", StyleBox["MakePop", "Input"], " works, we can 'ask', using the question mark help syntax." }], "Text", FontSize->14], Cell[CellGroupData[{ Cell[BoxData[ \(\(?MakePop\)\)], "Input"], Cell[BoxData[ \("MakePop[size] creates a population, i.e. a list of size creatures, \ each represented by a genetic code randomly generated from traits in \ the current genome."\)], "Print", CellTags->"Info3214030185-2142144"] }, Open ]], Cell[TextData[{ "\tLets make a population of three clover plants, and save it in a variable \ ", StyleBox["ThePatch", "Input"], ".The input for ", StyleBox["MakePop", "Input"], " is a number representing the desired number of individuals in the newly \ created population." }], "Text", FontSize->14], Cell[CellGroupData[{ Cell[BoxData[ \(ThePatch = MakePop[3]\)], "Input"], Cell[BoxData[ \({{"Neutral Gender", 4585375, 1170242}, {"Neutral Gender", 4585511, 1170151}, {"Neutral Gender", 4585420, 1170242}}\)], "Output"] }, Open ]], Cell[TextData[{ "\tHmmm. not very interesting - just a list of 'Neutral Gender' statements \ and some coded numbers. To see the list of traits (or", StyleBox[" phenotype", FontSlant->"Italic"], "), we will need to use the ", StyleBox["ShowPop", "Input"], " function, which takes a coded population list as an argument." }], "Text", FontSize->14], Cell[CellGroupData[{ Cell[BoxData[ \(ShowPop[ThePatch]\)], "Input"], Cell[BoxData[ TagBox[GridBox[{ {"\<\"Neutral Gender\"\>", "\<\"Neutral Gender\"\>", "\<\"Neutral \ Gender\"\>"}, {"\<\"Four Leaves\"\>", "\<\"Three Leaves\"\>", "\<\"Three Leaves\"\ \>"}, {"\<\"Pink Flowers\"\>", "\<\"White Flowers\"\>", "\<\"Pink Flowers\ \"\>"} }, RowSpacings->1, ColumnSpacings->3, RowAlignments->Baseline, ColumnAlignments->{Left}], Function[ BoxForm`e$, TableForm[ BoxForm`e$]]]], "Output"] }, Open ]], Cell[TextData[{ "\tOur clover population (", StyleBox["ThePatch", "Input"], ") is a ", StyleBox["Mathematica", FontSlant->"Italic"], " list, from which we can select an individual, either by using the ", StyleBox["Mathematica", FontSlant->"Italic"], " index notation, or by the package function ", StyleBox["PickOne", "Input"], ", which takes a population list and a position number and gives the code \ of a particular individual at that position. The traits belonging with a \ single individual code can be viewed using ", StyleBox["ShowOne", "Input"], "." }], "Text", FontSize->14], Cell[CellGroupData[{ Cell[BoxData[{ \(\(SecondPlant\ = \ PickOne[ThePatch, 2];\)\), "\[IndentingNewLine]", \(\(ThirdPlant\ = \ ThePatch[\([3]\)];\)\), "\[IndentingNewLine]", \(ShowOne[SecondPlant]\), "\[IndentingNewLine]", \(ShowOne[ThirdPlant]\)}], "Input"], Cell[BoxData[ InterpretationBox[GridBox[{ {"\<\"Neutral Gender\"\>"}, {"\<\"Three Leaves\"\>"}, {"\<\"White Flowers\"\>"} }, RowSpacings->1, ColumnSpacings->3, RowAlignments->Baseline, ColumnAlignments->{Left}], TableForm[ {"Neutral Gender", "Three Leaves", "White Flowers"}]]], "Output"], Cell[BoxData[ InterpretationBox[GridBox[{ {"\<\"Neutral Gender\"\>"}, {"\<\"Three Leaves\"\>"}, {"\<\"Pink Flowers\"\>"} }, RowSpacings->1, ColumnSpacings->3, RowAlignments->Baseline, ColumnAlignments->{Left}], TableForm[ {"Neutral Gender", "Three Leaves", "Pink Flowers"}]]], "Output"] }, Open ]], Cell[TextData[{ "\t", StyleBox["We can now do a genetic recombination using the ", FontSize->14], StyleBox["Breed", "Input", FontSize->14], StyleBox[" command, which requires two individuals and a number of desired \ offspring, and generates a new population.", FontSize->14] }], "Text", FontSize->14], Cell[CellGroupData[{ Cell[BoxData[{ \(\(NewPatch = Breed[SecondPlant, ThirdPlant, 4];\)\), "\[IndentingNewLine]", \(ShowPop[NewPatch]\)}], "Input"], Cell[BoxData[ TagBox[GridBox[{ {"\<\"Neutral Gender\"\>", "\<\"Neutral Gender\"\>", "\<\"Neutral \ Gender\"\>", "\<\"Neutral Gender\"\>"}, {"\<\"Three Leaves\"\>", "\<\"Three Leaves\"\>", "\<\"Three \ Leaves\"\>", "\<\"Three Leaves\"\>"}, {"\<\"Pink Flowers\"\>", "\<\"White Flowers\"\>", "\<\"White \ Flowers\"\>", "\<\"Pink Flowers\"\>"} }, RowSpacings->1, ColumnSpacings->3, RowAlignments->Baseline, ColumnAlignments->{Left}], Function[ BoxForm`e$, TableForm[ BoxForm`e$]]]], "Output"] }, Open ]], Cell["\<\ \tNotice that a genderless MendelCreature can self-fertilize, if \ desired\ \>", "Text", FontSize->14], Cell[CellGroupData[{ Cell[BoxData[{ \(\(NewPatch2\ = \ Breed[SecondPlant, SecondPlant, 2];\)\), "\[IndentingNewLine]", \(ShowPop[NewPatch2]\)}], "Input"], Cell[BoxData[ TagBox[GridBox[{ {"\<\"Neutral Gender\"\>", "\<\"Neutral Gender\"\>"}, {"\<\"Three Leaves\"\>", "\<\"Three Leaves\"\>"}, {"\<\"White Flowers\"\>", "\<\"White Flowers\"\>"} }, RowSpacings->1, ColumnSpacings->3, RowAlignments->Baseline, ColumnAlignments->{Left}], Function[ BoxForm`e$, TableForm[ BoxForm`e$]]]], "Output"] }, Open ]], Cell[TextData[{ "\tIf we would like to generate a new population by random pairings, we can \ ", StyleBox["BreedPop", "Input"], ", which takes a population, and two numbers, the first of which is the \ number of random pairings to make, and the second of which represents the \ number of offspring from each pairing. Notice self-pairing is possible in the \ genderless case." }], "Text", FontSize->14], Cell[CellGroupData[{ Cell[BoxData[{ \(\(PatchKids\ = \ BreedPop[ThePatch, 4, 4];\)\), "\[IndentingNewLine]", \(ShowPop[PatchKids]\)}], "Input"], Cell[BoxData[ TagBox[GridBox[{ {"\<\"Neutral Gender\"\>", "\<\"Neutral Gender\"\>", "\<\"Neutral \ Gender\"\>", "\<\"Neutral Gender\"\>", "\<\"Neutral Gender\"\>", "\<\"Neutral \ Gender\"\>", "\<\"Neutral Gender\"\>", "\<\"Neutral Gender\"\>", "\<\"Neutral \ Gender\"\>", "\<\"Neutral Gender\"\>", "\<\"Neutral Gender\"\>", "\<\"Neutral \ Gender\"\>", "\<\"Neutral Gender\"\>", "\<\"Neutral Gender\"\>", "\<\"Neutral \ Gender\"\>", "\<\"Neutral Gender\"\>"}, {"\<\"Three Leaves\"\>", "\<\"Four Leaves\"\>", "\<\"Four \ Leaves\"\>", "\<\"Three Leaves\"\>", "\<\"Three Leaves\"\>", "\<\"Three \ Leaves\"\>", "\<\"Three Leaves\"\>", "\<\"Three Leaves\"\>", "\<\"Three \ Leaves\"\>", "\<\"Three Leaves\"\>", "\<\"Three Leaves\"\>", "\<\"Three \ Leaves\"\>", "\<\"Three Leaves\"\>", "\<\"Three Leaves\"\>", "\<\"Three \ Leaves\"\>", "\<\"Three Leaves\"\>"}, {"\<\"White Flowers\"\>", "\<\"Purple Flowers\"\>", "\<\"Pink \ Flowers\"\>", "\<\"Pink Flowers\"\>", "\<\"White Flowers\"\>", "\<\"White \ Flowers\"\>", "\<\"White Flowers\"\>", "\<\"White Flowers\"\>", "\<\"Pink \ Flowers\"\>", "\<\"Pink Flowers\"\>", "\<\"White Flowers\"\>", "\<\"Pink \ Flowers\"\>", "\<\"Pink Flowers\"\>", "\<\"White Flowers\"\>", "\<\"White \ Flowers\"\>", "\<\"Pink Flowers\"\>"} }, RowSpacings->1, ColumnSpacings->3, RowAlignments->Baseline, ColumnAlignments->{Left}], Function[ BoxForm`e$, TableForm[ BoxForm`e$]]]], "Output"] }, Open ]], Cell[TextData[{ "\tThe last three commands are useful for gathering statistics on larger \ populations. ", StyleBox["CountTrait", "Input"], " takes a population and a given trait and returns the number of \ individuals with that trait, as well as the total number in the population \ and the ratio of the two numbers." }], "Text", FontSize->14], Cell[CellGroupData[{ Cell[BoxData[{ \(\(BigPatch\ = \ MakePop[1000];\)\), "\[IndentingNewLine]", \(CountTrait[BigPatch, "\"]\), "\[IndentingNewLine]", \(CountTrait[BigPatch, "\"]\), "\[IndentingNewLine]", \(CountTrait[BigPatch, "\"]\), "\[IndentingNewLine]", \(CountTrait[BigPatch, "\"]\), "\[IndentingNewLine]", \(CountTrait[BigPatch, "\"]\)}], "Input"], Cell[BoxData[ \({717, 1000, 717\/1000}\)], "Output"], Cell[BoxData[ \({283, 1000, 283\/1000}\)], "Output"], Cell[BoxData[ \({223, 1000, 223\/1000}\)], "Output"], Cell[BoxData[ \({243, 1000, 243\/1000}\)], "Output"], Cell[BoxData[ \({534, 1000, 267\/500}\)], "Output"] }, Open ]], Cell[TextData[{ "\tAssuming and even frequency of alleles, it looks like 'Three Leaves' is \ dominant to 'Four Leaves', while 'White Flowers' and 'Purple Flowers' are \ homozygous traits that combine for heterozygous 'Pink Flowers'.\n\t", StyleBox["CountTraitMatch", "Input"], " is useful for determining linkage of traits. It requires input of a \ population, a list of traits (contained by brackets and separated by commas), \ and an operator, designating whether you are looking for an individual with \ the first trait ", StyleBox["And", "Input"], " each of the others, or looking for creatures with one trait ", StyleBox["Or", "Input"], " another." }], "Text", FontSize->14], Cell[CellGroupData[{ Cell[BoxData[ \(CountTraitMatch[BigPatch, {"\", "\"}, And]\)], "Input"], Cell[BoxData[ \({122, 1000, 61\/500}\)], "Output"] }, Open ]], Cell[TextData[{ "\tSo in this case, about 1/8 of the ", StyleBox["BigPatch", "Input"], " population has four leaves and pink flowers, which is an expected result \ for an independent distribution (1/4 \"Four Leaves\" times 1/2 \"Pink Flowers\ \"). This would indicate that the traits are on different chromosomes.\n\tIf \ we wish to pick a portion of a population with a given set of traits, we can \ use ", StyleBox["FindTraitMatches", "Input"], ", which takes the same arguments as ", StyleBox["CountTraitMatch", "Input"], ", but returns a population subset. " }], "Text", FontSize->14], Cell[CellGroupData[{ Cell[BoxData[{ \(\(PurpleFours\ = \ FindTraitMatches[BigPatch, {"\", "\"}, And];\)\), "\[IndentingNewLine]", \(\(WhiteThrees\ = \ \ FindTraitMatches[ BigPatch, {"\", "\"}, And];\)\), "\[IndentingNewLine]", \(ShowOne[PurpleFours[\([1]\)]]\), "\[IndentingNewLine]", \(ShowOne[WhiteThrees[\([1]\)]]\)}], "Input"], Cell[BoxData[ InterpretationBox[GridBox[{ {"\<\"Neutral Gender\"\>"}, {"\<\"Four Leaves\"\>"}, {"\<\"Purple Flowers\"\>"} }, RowSpacings->1, ColumnSpacings->3, RowAlignments->Baseline, ColumnAlignments->{Left}], TableForm[ {"Neutral Gender", "Four Leaves", "Purple Flowers"}]]], "Output"], Cell[BoxData[ InterpretationBox[GridBox[{ {"\<\"Neutral Gender\"\>"}, {"\<\"Three Leaves\"\>"}, {"\<\"White Flowers\"\>"} }, RowSpacings->1, ColumnSpacings->3, RowAlignments->Baseline, ColumnAlignments->{Left}], TableForm[ {"Neutral Gender", "Three Leaves", "White Flowers"}]]], "Output"] }, Open ]], Cell[TextData[{ "\tOur population numbers seem to indicate that purple, white and four are \ all homozygous traits, but three could be heterozygous or homozygous. If we \ breed ", StyleBox["PurpleFours", "Input"], " to ", StyleBox["WhiteThrees", "Input"], ", we would expect all offspring to be heterozygous for flower color, and \ thus have 'pink flowers'." }], "Text", FontSize->14], Cell[CellGroupData[{ Cell[BoxData[{ \(\(Hetero\ = \ Breed[PurpleFours[\([1]\)], WhiteThrees[\([1]\)], 100];\)\), "\[IndentingNewLine]", \(CountTrait[Hetero, "\"]\), "\[IndentingNewLine]", \(CountTrait[Hetero, "\"]\)}], "Input"], Cell[BoxData[ \({100, 100, 1}\)], "Output"], Cell[BoxData[ \({47, 100, 47\/100}\)], "Output"] }, Open ]], Cell[TextData[{ "\tOne of two things will happen with leaves - there will either be all \ three-leaved plants or about 50% three leaved plants. What does each \ possible result mean about the ", StyleBox["WhiteThrees", "Input"], " individual selected for the breeding?\n\tWith the MendelCreature \ commands, you should be able to combine creatures in the same fashion as you \ would for live genetics experiments. Be sure to name populations as they are \ created, as each time ", StyleBox["MakePop", "Input"], ",", StyleBox["Breed", "Input"], ",and ", StyleBox["BreedPop", "Input"], " are executed, they generate new, randomized populations.\n\tA final, \ useful command is ", StyleBox["DumpSave", "Input"], ", which allows you to save the information currently held in the kernel \ memory for use when you come back to ", StyleBox["Mathematica", FontSlant->"Italic"], " later on.\n", StyleBox["DumpSave", "Input"], " requires a filename (in quotes, usually with the suffix .mx) and a list \ of variables whose values are to be stored." }], "Text", FontSize->14], Cell[BoxData[ \(\(DumpSave["\", {BigPatch, ThePatch}];\)\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[{ \(BigPatch\ = \ {}\), "\[IndentingNewLine]", \(ThePatch\ = \ {}\)}], "Input"], Cell[BoxData[ \({}\)], "Output"], Cell[BoxData[ \({}\)], "Output"] }, Open ]], Cell[TextData[{ "\tNotice the values of ", StyleBox["BigPatch", "Input"], " and ", StyleBox["ThePatch", "Input"], " have been eliminated, and the lists are empty. We can 'reload' the \ information with the ", StyleBox["<<", "Input"], " input command, which will restore the values originally in the patch \ variables." }], "Text", FontSize->14], Cell[BoxData[ \(<< CloverSave.mx\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(BigPatch[\([1]\)]\)], "Input"], Cell[BoxData[ \({"Neutral Gender", 4585375, 1170287}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(ThePatch\)], "Input"], Cell[BoxData[ \({{"Neutral Gender", 4585375, 1170242}, {"Neutral Gender", 4585511, 1170151}, {"Neutral Gender", 4585420, 1170242}}\)], "Output"] }, Open ]], Cell[TextData[{ "\t", StyleBox["This notebook created by Dr. Garrett R. Love for the Shodor \ Education Foundation. Copyright 2001", "SmallText"] }], "Text", FontSize->14] }, FrontEndVersion->"4.1 for Microsoft Windows", ScreenRectangle->{{0, 800}, {0, 527}}, WindowSize->{576, 490}, WindowMargins->{{60, Automatic}, {Automatic, -5}}, StyleDefinitions -> "Classroom.nb" ] (******************************************************************* Cached data follows. If you edit this Notebook file directly, not using Mathematica, you must remove the line containing CacheID at the top of the file. The cache data will then be recreated when you save this file from within Mathematica. *******************************************************************) (*CellTagsOutline CellTagsIndex->{ "Info3214030185-2142144"->{ Cell[13556, 345, 242, 4, 130, "Print", CellTags->"Info3214030185-2142144"]} } *) (*CellTagsIndex CellTagsIndex->{ {"Info3214030185-2142144", 28658, 816} } *) (*NotebookFileOutline Notebook[{ Cell[1705, 50, 96, 4, 66, "Subtitle"], Cell[1804, 56, 9694, 225, 2127, "Text"], Cell[11501, 283, 1123, 28, 223, "Text"], Cell[12627, 313, 114, 2, 107, "Input"], Cell[12744, 317, 248, 7, 51, "Text"], Cell[12995, 326, 50, 1, 55, "Input"], Cell[13048, 329, 435, 9, 92, "Text"], Cell[CellGroupData[{ Cell[13508, 342, 45, 1, 55, "Input"], Cell[13556, 345, 242, 4, 130, "Print", CellTags->"Info3214030185-2142144"] }, Open ]], Cell[13813, 352, 311, 9, 72, "Text"], Cell[CellGroupData[{ Cell[14149, 365, 54, 1, 55, "Input"], Cell[14206, 368, 157, 2, 104, "Output"] }, Open ]], Cell[14378, 373, 361, 9, 71, "Text"], Cell[CellGroupData[{ Cell[14764, 386, 50, 1, 55, "Input"], Cell[14817, 389, 503, 14, 93, "Output"] }, Open ]], Cell[15335, 406, 617, 17, 113, "Text"], Cell[CellGroupData[{ Cell[15977, 427, 258, 4, 133, "Input"], Cell[16238, 433, 379, 11, 93, "Output"], Cell[16620, 446, 377, 11, 93, "Output"] }, Open ]], Cell[17012, 460, 323, 10, 51, "Text"], Cell[CellGroupData[{ Cell[17360, 474, 144, 3, 107, "Input"], Cell[17507, 479, 579, 14, 93, "Output"] }, Open ]], Cell[18101, 496, 114, 4, 30, "Text"], Cell[CellGroupData[{ Cell[18240, 504, 151, 3, 107, "Input"], Cell[18394, 509, 425, 11, 93, "Output"] }, Open ]], Cell[18834, 523, 409, 9, 91, "Text"], Cell[CellGroupData[{ Cell[19268, 536, 141, 3, 81, "Input"], Cell[19412, 541, 1497, 26, 93, "Output"] }, Open ]], Cell[20924, 570, 352, 8, 71, "Text"], Cell[CellGroupData[{ Cell[21301, 582, 440, 6, 185, "Input"], Cell[21744, 590, 56, 1, 69, "Output"], Cell[21803, 593, 56, 1, 69, "Output"], Cell[21862, 596, 56, 1, 69, "Output"], Cell[21921, 599, 56, 1, 69, "Output"], Cell[21980, 602, 55, 1, 69, "Output"] }, Open ]], Cell[22050, 606, 695, 14, 165, "Text"], Cell[CellGroupData[{ Cell[22770, 624, 111, 2, 81, "Input"], Cell[22884, 628, 54, 1, 69, "Output"] }, Open ]], Cell[22953, 632, 604, 13, 144, "Text"], Cell[CellGroupData[{ Cell[23582, 649, 433, 8, 237, "Input"], Cell[24018, 659, 379, 11, 93, "Output"], Cell[24400, 672, 379, 11, 93, "Output"] }, Open ]], Cell[24794, 686, 396, 10, 92, "Text"], Cell[CellGroupData[{ Cell[25215, 700, 271, 5, 133, "Input"], Cell[25489, 707, 47, 1, 54, "Output"], Cell[25539, 710, 52, 1, 69, "Output"] }, Open ]], Cell[25606, 714, 1101, 26, 269, "Text"], Cell[26710, 742, 89, 1, 81, "Input"], Cell[CellGroupData[{ Cell[26824, 747, 103, 2, 81, "Input"], Cell[26930, 751, 36, 1, 54, "Output"], Cell[26969, 754, 36, 1, 54, "Output"] }, Open ]], Cell[27020, 758, 361, 11, 72, "Text"], Cell[27384, 771, 49, 1, 55, "Input"], Cell[CellGroupData[{ Cell[27458, 776, 50, 1, 55, "Input"], Cell[27511, 779, 70, 1, 54, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[27618, 785, 41, 1, 55, "Input"], Cell[27662, 788, 157, 2, 104, "Output"] }, Open ]], Cell[27834, 793, 177, 5, 30, "Text"] } ] *) (******************************************************************* End of Mathematica Notebook file. *******************************************************************)