SHEEP BREEDING SIMULATION PROGRAM


SUMMARY: This program was inspired by a discussion on the Jacob Sheep List Server about the heritability of the number of horns in Jacob sheep. Written in MicroSoft QBasic, it simulates the breeding of 100 flocks of sheep, each flock through 12 generations, following the trait of four horns or two horns. The program allows the operator to input a bias against the rams used in breeding based on their number of horns so that the results of various breeding preferences can be projected. The results for the final generation of each flock are shown on the screen and stored in a text file which can be imported to a spreadsheet or database for further analysis. When the program is run under the same assumptions several times, there is only a slight variation on the final results, which seems to validate the soundness of the program. Although written in reference to horn number, any genetic trait (such as eye color) could be substituted in interpreting the results.

INDEX:
  1. Assumptions made.
  2. Downloading the program.
  3. Running the program.
  4. Output only final generation.
  5. Output all generations.
  6. Sample results.
ASSUMPTIONS: It was necessary to make several broad assumptions to the breeding scenario, as all of the genetic factors of the situation are not clearly known. Certain parameters and limitations are set to simplify the situation; an exact definition of the myriad possibilities of the breeding process through many generations is beyond the scope of this program. The assumptions are:
  1. Number of horns are inherited by strict Mendelian genetics. For an introductory genetics lesson, go to the OSU genetics page.
  2. The four-horn trait is dominant and the two-horn trait is recessive. We ignore five- and six-horn sheep in this version of the program.
  3. Each flock starts with 48 rams and 48 ewes, each sex having the standard distribution of genotypes, i.e., 25% with two dominant genes, 50% with one dominant gene and one recessive gene, and 25% with two recessive genes. Note that under these assumptions the mixed-gene sheep will show the dominant trait and have four horns.
  4. The operator can set rejection parameters on rams based on their horn number. This is where you can estimate the relative quality of rams by horn number.
  5. Two rams which meet those criteria are picked from the initial flock, each being bred to half of the ewes.
  6. Each ewe produces twins in every breeding, one ram lamb and one ewe lamb.
  7. From each generation of lambs, two of the rams are chosen to breed all of the ewes of their generation, thus producing the next generation.
Having 96 sheep in a flock may seem too high, but this is necessary. I originally started with flocks of six rams and six ewes, but with such small groups the results are easily skewed to meaninglessness. This reflects reality, as a small breeding pool will deviate from the norms much more readily than a large one.

For a detailed explanation of the processing and logic of the program, go to rambiasg.html. This will give QBasic programmers information on how they can modify the program to reflect assumptions other than I built into the program. For example, you could modify the program to breed the same two rams for three generations, then choose two new rams for the next three generations. It was mentioned on the list server that multiple horns might be caused by splitting horn buds. I hope to modify the program to follow two genetic traits, horn number and split horn buds, where the split horn bud gene must be present for more than two horns to form. We can then check these results against historical breeding patterns to see if there is any validity to that claim.

DOWNLOADING THE PROGRAM: First, see if you have a C:\Dos directory on your hard drive; if not, create one. Then go to page rambiasg.bas to see the program source code. Save it to your Dos directory under that name; it needs the bas suffix to be recognized by QBasic. Then click back to this page.

If you're running a recent Windows operating system, it's possible that QBasic is not installed on your computer. To get a copy, go to http://combi.agri.ch/tvp/qbasic/faq.htm and follow the directions, unzipping the downloaded file to the Dos directory. They also have a QBasic tutorial there, in case you need a refresher course for doing your own program modifications.

RUNNING THE PROGRAM: When you run the program, it will first ask you to enter a small letter "y" to see the results for each generation or a small letter "n" to see only the results for only the twelfth (final) generation of each flock. While seeing the results of each generation is interesting for a while, it can get tedious after the first dozen flocks.

You are then asked to enter the rejection rate for four-horned rams. This is where you can try different breeding assumptions. If you feel that half of the four-horned rams will be rejected for asymmetrical or fused horns, type 50 (for 50%) and hit enter. If you're trying to increase the number of four-horned animals, you might be less fussy and only reject 10%; in that case, type 10.

Now you will be asked to enter the rejection rate for two-horned rams. Assuming that they will have less undesirable characteristics than the four-horns, and thus be less likely to be rejected, you can enter 5 for 5%. You can also enter a 0 for no rejection or 100 for total rejection for either type of ram.

The program picks a random ram then generates a random value between 0 and 1 for that ram; if the random value is greater than your rejection rate, that ram breeds half of the next generation. If the random value is less than your rejection rate, he's put back into the flock and another ram is chosen and tested. This is how the rejection rates you input will act as the shepherd's breeding preferences for all 100 flocks.

FINAL GENERATION OUTPUT: If you chose n to see only the final generation results for each flock, the output on the screen will be in the following format:

FLOCK 1     F=20    M=50    T=26     (F+M)=70

This means that in this case, after 12 generations of breeding under the assumptions above and your input as to ram preferences, the first flock will have 20 sheep with two dominant genes (F), 50 sheep with one of each gene (M), and 26 sheep with two recessive genes (T). The final number adds the F and M sheep and shows that you will have 70 sheep which have four horns; added to the 26 having two horns, we have the required 96 per generation.

Each flock will be reported this way; after all 100 flocks are reported, the average percentage genotype distribution for all 100 flocks will be shown. If you're unfamiliar with QBasic, you will be surprised when the output blinks off after a few seconds, replaced by the source code on your screen. Don't panic, just hit the F4 key to toggle between the output screen and the program.

The twelfth generation distribution for each generation has been saved to a text file called "jacob". This can be easily imported into Excel or Lotus for further analysis. The columns in the resulting spreadsheet are:
  1. the four-horn rejection rate
  2. the two-horn rejection rate
  3. generation number
  4. number of F sheep
  5. number of M sheep
  6. number of T sheep
Warning! If you run the program again, it will overwrite the first jacob file with the new results. If you want to save the results of various rejection rates, exit QBasic and rename the jacob file to indicate the test it contains. I named the file for the 50%/5% test as jacb5005, and for the 5%/50% test as jacb0550.

ALL GENERATION OUTPUT: If you chose y to see every generation, the program will show twelve lines of output for each flock:

FLOCK 1  GENERATION 1    F=20    M=50    T=26     (F+M)=70
FLOCK 1  GENERATION 2    F=18    M=43    T=35     (F+M)=61

and so on, for all twelve generations. The program will pause at this point; you have to hit enter to go on to the next flock. Only the twelfth generation of each flock is stored in the jacob file and the final generation average for all 100 flocks is shown after Flock 100 is reported, the same as in the "n" output option.

SOME RESULTS I've made many runs on this program in the development but haven't done a lot of analysis yet. The results which follow may give you some ideas on how to use this program in analyzing possible outcomes of various breeding biases. If you come up with some interesting results, I'd be interested in hearing about them.

Zero-Zero I first ran the program with zero bias towards either type of ram. Expecting to get the standard 25%-50%-25% "bell shape" distribution of genotypes, I was surprised to find that it came out 42%-24%-34%, an inverted bell curve! I did several more runs, but it was always in that range. I imported the jacob file into Excel and examined the results.

The reason for the inverted results is that with the small population of 96 sheep per flock and total inbreeding each generation, it is easy to breed out certain genes. I ran five tests at the 0%-0% rejection rates. The average test had 12 flocks end up with all 96 sheep having two four-horn genes, no sheep with either mixed genes or two two-horn genes. At the other extreme, it averaged 10 flocks with pure two-horns. Thus, 22 of 100 flocks inbreed to genetic exclusiveness in twelve generations. A number of flocks were heading in that direction, with only 2 or 3 sheep having either pure recessive or pure dominant. When I removed the results for the flocks with no exclusively dominant or exclusively recessive animals, the distribution came out to a more reasonable 28% F, 43% M, 29% T.

The lesson that I learned from this exercise is that I need to get some new genes into my flock every few generations. I realized that the same pattern is occuring with all the other genetic traits, like wool quality and color, size, etc.

5-50 versus 50-5 I then ran tests for two different scenarios. The first scenario is breeding for four-hornedness, rejecting only 5% of the four-horn rams while rejecting 50% of the two-horn rams, only allowing the exceptional ones to breed. The next column reverses the objective and those rejection levels, keeping only the best four-horn rams and giving the higher preference to the two-horn rams. The results are shown in the following table:

Test: 5-50 50-5
4-horn Rejection 5% 50%
2-horn Rejection 50% 5%
Pure 4-Horn Sheep 61% 12%
Mixed Gene Sheep 27% 13%
All Four-Horn Sheep 88% 25%
Pure Two-Horn Sheep 12% 75%
Flocks All 4-Horn Genes 19 1
Flocks All 2-Horn Genes 1 41

The first two rows of this chart give the odds that a ram will be rejected based on his number of horns. The third row shows the percentage of sheep in the final generation of the 100 flocks who have two four-horn genes. Not surprisingly, this is a high 61% when we selected for four-horns in the first scenario and drops to only 12% when we selected against them in the second scenario.

The fourth row shows the percentage of sheep with one of each gene. These sheep will have four horns, showing the trait of the dominant gene. The fifth row is the percentage of animals showing four horns, which is the sum of the last two rows. The sixth row is the percentage of two-horn sheep.

Although we kept the same rejection percentages in each test, the dominant gene has a bit of an edge. Where selecting against two-horn results in only 12% two-horn animals, selecting against four-horn results in 25% four-horned animals because the mixed-gene animals show four horns.

The final two rows show a more subtle bias which was obtained by examining the jacob file in Excel. The second-last row shows the number of the 100 flocks under each scenario in which every animal has two four-horn genes. The final row shows the number of the 100 flocks in which every animal has two two-horn genes. I ran both tests five times and found that in every case the results were very similar to those shown here. In the case where we bias against the two-horns, 19 flocks end up with exclusively four-horn genes but only 1 flock ended up with exclusively two-horn genes. When we bias against the four-horns, there is only 1 flocks which end up with exclusively four-horn genes, but an overwhelming 41 flocks end up exclusively two-horned.

The reason for this disparity in the relative numbers of "pure" flocks is that when you bias against two-horns in the initial generation, two-thirds of the four-horned rams have mixed genes, meaning that half of the genes they pass on to the next generation will be two-horn genes. So although we had just 1 flock with only two-horn genes, only about one out of five flocks had exclusively four-horn genes. The mixed-gene animals helped to keep the two-horn gene in the pool.

But when you bias against four-horns, the sheep with mixed genes are also more likely to be excluded from the gene pool, so you tend to get more "pure" two-horns. After a few generations, it is highly likely that you will be pulling only two-horn rams, ensuring that at least half of the genes of the next generation are two-horn. In about two out of five cases, they squeeze out the four-horn genes entirely.

Although this seems contrary to reason, these results show that the dominant trait is more easily removed from the gene pool by adverse selection than is the recessive trait. In terms of the Jacob flocks, assuming four-horn dominance, we could easily breed out the four-hornedness if we do not make a special effort to include sufficient four-horned rams in our breeding stock.

Back to the index.

Return to Main Sheep Page