Virtual Courseware Project, ScienceCourseware.org
Introduction to FlyLab JS

FlyLab JS is an educational application for learning the principles of genetic inheritance. Users design crosses between female and male fruit flies carrying one or more genetic mutations. They can make hypotheses for the mode of inheritance of genetic traits and test their hypotheses by selecting fruit flies with different visible mutations, mating them, and analyzing the phenotypic ratios of the offspring. Results can be recorded into an online notebook which can be exported as a web page for later use.
With FlyLab JS, it is possible to study multiple generations of offspring, and perform testcrosses and backcrosses. FlyLab JS is a versatile program; it can be used to learn elementary genetic principles such as dominance and recessive alleles, and Mendelian ratios, or more complex concepts such as sexlinkage, epistasis, recombination, and genetic mapping.

The purpose of this activity is to:
 understand the relationship between an organism’s genotype and its phenotype;
 understand and apply the principles of genetic inheritance;
 demonstrate the importance of statistical analysis;
 apply recombination data to map the location of genes on a chromosome.
Additionally, FlyLab JS can be used to demonstrate the scientific method. Using this application, one can:
 make observations and propose hypotheses;
 design experiments to test hypotheses;
 perform statistical analyses on experimental data;
 interpret the results of an experiment and decide whether the hypothesis is supported or rejected.

Before using FlyLab JS, users should be familiar with the following concepts:
 chromosome structure, and the stages of gamete formation by meiosis;
 the basic terminology and principles of Mendelian genetics, including genes and alleles, recessive and dominant traits, sexlinked inheritance, epistasis, lethal mutations, crossovers, and recombination;
 the use of a Punnett square to predict the results of genetic crosses;
 how epistasis and lethality can alter Mendelian ratios;
 cis and trans arrangements of alleles on homologous chromosomes;
 computation of chromosomal map distances using recombination data;
 chisquared statistical analysis.

Let’s take a quick tour of FlyLab JS. We will conduct a short experiment where we examine the pattern of inheritance of two traits, sepia eyes and curved wings, through two generations. Follow the stepbystep instructions below.
 Open a new browser tab or window and go to the FlyLab JS application.
 If it’s not already selected, click on the Design tab.
 Click on the button for Eye Color on the left side of the view. The available eye color mutations will be displayed.
 Select the radio button below the sepia option. The eye color of the designed fly will change.
 Click the Select Fly for Mating button in the lower right corner of the Design view. The view will change to the Mate view. We have now selected a female fly with sepia eye color for mating.
 Click the Design Fly button below the grey image of a male fly. The view will change back to the Design view.
 Click on the button for Wing Shape on the left side of the view. The available wing shape mutations will be displayed.
 Select the radio button below the curved option. The wing shape of the designed fly will change.
 Click the Select Fly for Mating button in the lower right corner of the Design view. The view will change to the Mate view. We have now selected a male fly with curved wings for mating.
 Click the Mate Flies button in the center of the view. The two flies will be mated and a cross will appear in the Crosses view. The parents and offspring are shown. All the offspring are wild type flies.
 Let’s select a female and male fly from the offspring for mating. Click the Select to Mate button below the female offspring. A green check mark will appear on the fly image.
 Click the Select to Mate button below the male offspring. The view will change to the Mate view showing the wild type female and male flies that we selected.
 Click the Mate Flies button in the center of the view. The two flies will be mated and a second cross will appear in the Crosses view. The parents and offspring are shown. You will need to scroll down to see all the offspring.
 Let’s add an image of an offspring fly with both mutations. Scroll to the bottom of the view and click on the small button with a magnifier icon below the female fly with both the sepia eye (SE) and curved wing (C) mutations. A large image of the fly will appear.
 Click on the Add Fly Image to Lab Notes button below the magnified fly image. The view will change to the Lab Notes view. We have added an image of the fly to our lab notebook. There is a box to type comments.
 Click on the Analyze tab above the lab notes view. A table will be displayed with the numbers and proportions of each phenotype among the offspring. These are the data from our experiment.
 The number of females and males are similar for each phenotype. Click the check box option to Ignore sex of flies. The data are now organized only by phenotype.
 Let’s test the hypothesis that these phenotypes follow a 6:2:2:1 ratio. (See the section below on Statistical Analyses for an explanation of the chisquared test.) Click the check box option to Include a Test of Hypothesis. The table will expand to low you to enter your hypothesis and test it.
 In the four text fields in the hypothesis column enter 6, 2, 2, and 1 and then click the Test Your Hypothesis button. The results of your test are displayed below the table. If the level of significance is less than 0.05 we should reject the hypothesis.
 Let’s add the results of this test to our lab notebook. Click the Add Results to Lab Notes button at the bottom the view. A copy of the table appears in the lab notebook. There is a box to type comments or conclusions.
 Let’s export the lab notes to a web page that we can bookmark, copy, or print. This is necessary because all our results will be lost if we close or navigate away from the FlyLab JS web page. Click the Export as Web Page button at the top of the Lab Notes view. A web page with a copy of our lab notes will open in a new browser tab. Save the URL for this page if you want to return to it later.
For more details on how to use FlyLab JS, click on the Help menu item at the top of FlyLab JS.

Traits are organized into groups such as “bristles” and “body colors.” These are listed on the left side of the Design View. Traits within a group are controlled by different genes (genetic loci); they are not variations of the same gene. To keep things simple, FlyLab JS restricts you to selecting only one mutation from each group. However, this is a software restriction, not a restriction imposed by nature! For example, in FlyLab JS a fly cannot have the alleles for both brown eyes and purple eyes. However, in nature it is possible for a real fruit fly to be heterozygous for both those genes.
The following assumptions must be considered when using FlyLab JS:
 If the wild type trait within a group is selected, all the genes within that group will be homozygous for the wild type alleles.
 If you select a mutation that is not lethal, the fly will be homozygous for the selected mutation. All the other traits within that group will be homozygous for the wild type allele.
 If you select a lethal mutation, the fly is made heterozygous for that mutation. (A homozygous fly would be dead!) All the other traits within that group will be homozygous for the wild type allele.
 If you select two lethal mutations which are on the same chromosome, then the mutant alleles will be placed on different homologous chromosomes; this is called the “trans” arrangement.
 If you select three or more lethal mutations on the same chromosome, FlyLab JS will divide the mutant alleles as evenly as possible between the two homologous chromosomes.
 Males are achiasmatic; that is, there is no recombination in males during meiosis. This is a peculiar attribute of Drosophila fruit flies (and some other insects) and FlyLab JS adheres to it. Crossing over and recombination can occur only in female flies.
 Crossover events occur at random between two genes on the same chromosome. If two genes are one centimorgan apart, the probability of a crossover event is 0.01.
 Multiple crossover events can occur between genes on the same chromosome. The farther apart two genes are on a chromosome, the higher the average number of crossover events between them.
 If one selects a fly for mating from a group of offspring flies, and that group of flies is a mixture of homozygous dominant genotypes and heterozygous genotypes, then the probability that the selected fly will homozygous dominant or heterozygous is based on the expected proportion of the genotypes in the offspring group. For example, if paisley eyes is a recessive trait, and a group of wild type male offspring has an expected composition of 1/3 homozygous dominant and 2/3 heterozygous genotypes, then the single fly that is selected for mating will be either homozygous dominant, with a probability of 1/3, or heterozygous with a probability of 2/3. The same rule applies when there are two or more genetic loci involved.

FlyLab JS give you the option of conducting a statistical analysis of a proposed hypothesis for the ratios among the different types of offspring.
For example, based on some genetic mechanism that you are proposing, you believe that there should be a 4 to 1 ratio of wild type flies to flies with paisley eyes. Of course, the ratio won't be exactly 4 to 1; one must allow for random error. The question is: do the results differ “significantly” from a 4 to 1 ratio? To put it differently, if the 4 to 1 ratio is true, what is the probability that you would get deviations from a 4 to 1 ratio that are as large (or larger) than the deviations which you observe in the data? Statisticians call this probability the level of significance.
So how do calculate the level of significance? Statisticians have derived a test statistic called “chisquared” that can be used compute the level of significance. The chisquared test statistic measures the deviations of the observed values from the “expected values” that you would get if your hypothesis is true. The formula for calculating the test statistic is
$${\chi}^{2}={\displaystyle \sum _{i=1}^{n}\frac{{\left({O}_{i}{E}_{i}\right)}^{2}}{{E}_{i}}}$$where O_{i} represents the observed values for each group and E_{i} represents the expected values for each group. In this formula, you take observed number for each phenotype, subtract the expected number, square the difference, and divide the squared difference by the expected number. You sum the chisquared terms for all the phenotypes to obtain your test statistic.
So how do you get the expected numbers? The expected numbers are the values you would get if the data exactly matched your hypothesis. For example, if you are expecting a 4 to 1 ratio of wild type flies to flies with paisley eyes, then 4/5 or 80% of the flies should be wild type and 1/5 or 20% should have paisley eyes. If you multiply the total number of flies by 0.8 and 0.2, you get the expected numbers for wild type and paisley eyes, respectively. A ratio of 8:4:3:1 really means that you expect the phenotypes to be divided into proportions of 8/16, 4/16, 3/16, and 1/16 because 8+4+3+1=16. Multiplying these probabilities by the total number of flies would give you your expected values.
Look closely at the formula above for the chisquared test statistic. If your hypothesis is true, then the squared deviations between the observed and expected values will most likely be small and so will the test statistic. If your hypothesis is false, then the squared deviations between the observed and expected values will most likely be large and so will the test statistic. The larger the value of the test statistic, the smaller the probability that your hypothesis is true. In other words, large values of the test statistic lead to small values for the level of significance.
The test statistic can be compared with a theoretical probability distribution to obtain the level of significance. This probability distribution depends on the "degrees of freedom" which equals number of phenotypic groups used in the calculation minus one. One degree of freedom is lost because the sum of the expected values equals the total for the observed values. Statistical tables can be used to look up the level of significance. Many software programs, such as FlyLab JS, calculate the level of significance for you. You can also obtain the level of significance using the MS Excel function CHISQ.DIST.RT(X,v), where X is the value of the chisquared test statistics and v is the degrees of freedom.
If the level of significance is small, it is not likely (low probability) that the deviations from your hypothesis are due to random error alone, therefore, your hypothesis is likely wrong. At this point you would want to work out a new ratio based on a different genetic hypothesis. On the other hand, if the level of significance is large, there is a good chance (high probability) that the deviations from your hypothesis are simply due to random error. In other words, there is no evidence to reject your hypothesis. At this point you should congratulate yourself; your hypothesis fits the data. However, you should also continue to challenge your hypothesis by designing other crosses.
What is a “small” level of significance? At what point do you reject your hypothesis? Scientists have agreed on a cutoff value of 0.05 for the level of significance. In other words, if there is a less than a 5% chance that the deviations from your hypothesis are due to random error, then you should reject your hypothesis. Your hypothesis is inconsistent with the data.
Let’s consider a numerical example. Assume that for a certain genetic cross you are expecting wild type flies, flies with banana wings, flies with paisley eyes, and flies with both banana wings and paisley eyes. Let’s assume that based on your hypothesis for the genetic characteristics of the mutations and the genotypes of the parents, you are expecting these four phenotypes to occur in a ratio of 8:4:3:1. You conduct the experiment and obtain the following number of flies: 551 wild type, 215 with banana wings, 197 with paisley eyes, and 66 with both banana wings and paisley eyes. You want to know if these data agree with your hypothesis. The following table shows the calculation of the chisquared test statistic:
Phenotype Observed Numbers Expected Ratio Probability Expected Numbers ChiSquared Term wild type 551 8 0.5000 514.50 2.59 banana wings 215 4 0.2500 257.25 6.94 paisley eyes 197 3 0.1875 192.94 0.09 banana wings & paisley eyes 66 1 0.0625 64.31 0.04 Totals 1029 16 1.0000 1029.00 9.66 Results for the Chisquared Test Chisquared test statistic: 9.66 Degrees of freedom: 3 Level of significance: 0.0217 The chisquared test statistic is the value in the last row and column. Since there are four phenotypic groups, the degrees of freedom are 41=3. If the 8:4:3:1 hypothesis is true, then the probability that you would get a chisquared value of 9.66 or larger due to random chance alone is only 0.0217, which falls below the 0.05 level of significance. Since it is unlikely that the deviations of the observed and expected values are due to random chance alone, you should reject the hypothesis that led you to the 8:4:3:1 ratio.
Try recomputing the above example using the hypothesis of a 9:3:3:1 ratio for the phenotypes. Use Excel to get the level of significance. (Answer: chisquared test statistic = 3.99, degrees of freedom = 3, level of significance = 0.2626, do not reject the 9:3:3:1 hypothesis.)