BOBO /, d H H H H H H H f Z - j F LOM! ` vE x H H @Rg( H H ( d h $ l / b 7 7@ H / H / h b 7@ @L \ @ DSET = = =
4 P 1
d
s
m
n {
T
U
V e
n {
V e f
F h P I. Hypothesis
This project was designed to produce a simple program that could simulate genetic drift given an arbitrary set of environmental and reproductive rules. Genetic drift occurs in an isolated population over time. It is the often-overlooked counterpart of natural selection, wherein the collective genepool of a population begins to favor a certain trait over other traits, or completely eliminates a certain trait. This can occur because of several environmental influences, including disease, lack of a certain resource, abundance of an as-of-yet unexploited resource, natural disaster, and so on.
According to the Hardy-Weinberg principle, the frequency of all genes in a gene pool can be modelled with this equation: p^2 + 2pq + p^2 = 1, where p represents the frequency of dominant alleles, and q represents the frequency of recessive alleles. Thus, p^2 represents the total number of organisms in a population with a homozygous dominant gene, 2pq a heterozygous gene, and q^2 a recessive gene. This equation holds true for all values of p and q greater than zero such that p+q = 1. When drift occurs, the values of p and q change, but still add up to be equal to one.
So, the hypothesis of this project is simply this: genetic drift can be simulated, and possibly even predicted, using an accurate computer model. A program can be written to simulate the genetic drift in populations of nearly arbitrary size with fairly liberal limitations on the rules and accuracy of the simulation.
II. Method
The program design for this application is fairly simple. We create a small data object that well call an organism, capable of breeding, dying, aging, and all the other natural processes that are relevant to this experiment. When the program is run, it will allocate memory for a given number of organisms. The maximum number of organisms that can be allocated is dependent on the available amount of memory on the machine.
The organism structure contains three variables, the minimum we could use in a simulation. The fi rst is age, represented by an unsigned 16-bit integer, with a maximum value of 65535 and a minimum value of zero, which indicates a dead organism (and a memory region available for population by a new organism).
The other two variables are unsigned 8-bit integers. The maximum and minimum values for these values are irrelevant; instead of using them to represent numbers, the program sets the individual bits to represent the different alleles on each complimentary chromosome (these variables are named ls and rs, standing for left side and right side). The first seven bits represent the alleles for traits. Whatever traits these alleles represent are arbitrary, and unimportant to the program. They could represent hair color, protein shape, or anything of a similar nature. If the bit representing an allele has a value of one, then that allele is said to be dominant. If the bit is zero, the allele is said to be recessive. Thus, if both bits are equal to one (dominant), the trait is said to be homozygous d ominant. If they one but not the other is dominant, then the trait is heterozygous dominant. If both bits are equal to zero, then the trait is said to be recessive.
The eighth bit is reserved for the representation of gender. If both bits are set to 1, then the gender is female. If one bit is set to 1 and the other to 0, the gender is male. The gender is undefined when both bits are equal to 0, but such an anomaly should not occur within natural execution of the program.
After the memory for the organisms is allocated, the program prompts for rules to govern the simulation. First, the program asks for the number of traits to include in the simulation. This number is set to at least one but not more than seven.
Next, the program asks for all of the genetic restrictions on mother organisms. This means that for any organism to be used as a mother, it must be both female and meet the restrictions on each of the traits specified in the simulation. Restrictions for each trait can be one of the following: fully d ominant, meaning that the trait for the mother is homozygous and dominant; partially dominant, meaning that the trait is heterozygous; recessive, meaning that the trait is homozygous recessive; and finally, null, meaning that there is no particular restriction for the mother on that particular trait. Breeding restrictions for father organisms work in the same fashion.
Lastly, the program asks for kill rules. There can be at least zero and at most eight of these. They work in a similar fashion to the breeding rules mentioned in the preceeding paragraph, except that they take the age of the organism and its gender into account (though both variables can be neglected).
As the program runs, it steps through a loop for a user-determined number of times. For each loop, the program breeds new organisms from existing male and female organisms that meet the relevant breeding criteria. Then the organism evaluates kill-rules, killing off the organisms that match the kill criteria. Finally, the program compiles statist ical data- the number of organisms with each trait that are homozygous dominant, heterozygous dominant, or recessive, as well as the total number of organisms and the number of males and females. This data is then written out to a file that can be opened by a spreadsheet application, and consequently graphed to produce a more human-readable presentation of data.
III. Results
The program was run with several different configurations, and then the output was graphed. The most notable feature of the graphs was the flat-lining on many simulations; that is, not enough creatures died via the kill rules, so no new creatures were created, and therefore the lines representing the trait statistics flattened out and remained flat until certain organisms were killed, freeing up memory for new organisms to occupy and thus change the statistical data.
IV. Conclusion
This program has demonstrat ed that is possible to create a simple simulation of genetic drift in a given population. However, the simulation is overly simplistic, and does not compensate for mutation or other anomalies that occur naturally. It does, however, provide a relatively accurate model for genetic drift when a certain trait has been proven as being critical to the breeding habits and genetic drift of a population.
Features the program could use include compensation for mutation, and a more realistic model of the killing and breeding rules. The ability to save the progress of the program would be useful, because it is so computationally intensive that the user may need to pause the program in order to do other work. Also, embedding a timer in the program to measure the time each iteration takes would be very interesting, just to see what kind of mathematical model could be used to evaluate the time requirements of the applications for a given set of parameters. Z N DSET 2 H ӡ
6 * DSET 2 H @ J $
6 * DSUM HDNI STYL F 6 J STYL /p /t +
!
p HASH
$ . . .
.* .. .. :.
:.* L:Q h ja zo }Bod N
CHAR "
F HASH
R
CELL " HASH
GRPH 7
( HASH v l
RULR @ HASH @
KSEN " HASH 2 LKUP
0 $ NAME Default
Default SS
Default TB Header Body Footer Footnote Footnote Index D FNTM Helvetica Geneva
Lucida Grande Times New Roman MCRO MCRO oBlN MARK MRKS MOBJWMBT SNAP zz H H
H H @ #co{R^o{sR o{ 3^o{BJRZ=NsBF1JRRF15BF1Ns5=Rc 3^^sJRVkZJRo{F1VNs^F1F1BF1g9F1JRkZV so{wg9 }kZg9w{{wws{w
{{o{wws{wso{w
o{w{swwo{{w{so{wo{o{{wo{o{{w{o{kZwcw o{g9RVcZRNsVo{ZRF1g9NsNsJR&Zo{VsNsRVRNsNsg9cNsRRVRkZRRJRNsNsZo{RNsg9ZVNsRcZRJRNsRZRVRo{R^Zo{ 3w{ s wwskZ s Uw{{kZ{w { w w kZs{wwo{sw JZBRF1g9=JRNsBBZ5VRZJRcF1^V=Z=JRF1B=F1R9cF1Bc=NsNsF1=F1JRNsR^NsBNsJRcJRJR=^=kZBBZcF1ZF1Bg9B^5g99F1F1BNs= o{s w s E { w { kZ{{{ s{{ { { kZRRVRRNsZVkZRNskZg9RRg9o{cg9cg9F1kZRNsR^cRVZRNsNso{^VRRVg9RkZVRNsZNskZJRVNsVZRkZsF1ZVJR^^g9F1g9 o{wo{wsswws{{w{sw{
w{{w{ww{s{wsw{w{swwg9wsw{ww{sw{{s{{swo{{sw{w{ { {
sccRg9Rcg9V^V^
VsRkZo{^^Z^VZ^.cVZZkZZkZZR^^skZcZ^R^kZg9Rg9kZZ^kZ^g9Nscg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=JRBJRF1F1BVF1F1g9JRNs^F1F1= )o{{so{ w{{ w sw {ޯ 7cVRZRZVVRckZVkZNsVg9NsVVZNsRRZֳ 3{sswsso{s{ws{wo{wo{wssw 'g9kZ^^wg9o{{c c +Vo{JRcNsF1g9F1ZZ1ZV^VB +R^BkZZJRNsZ9g9JR9=F1JRJRB Qo{o{ {o{{ wo{{{wsso{{ { { &g9cJRwNsNsF1RJRF1g9F1NsJRF1kZJRNsg9ZF1g9JRNsJRRRF1RNsg9NskZF1NsJRVkZRNsZ{VVg9VVJRF1kZg9NsF1JRJRg9=VZNsRNsVcg9BB 1so{sssss s s s 'w{ { w { { o{R^kZc^Vg9Ro{Z^RZ^^VZRVg9Zc^ZV^VVg9o{ZNsZwVZg9Z^g9NskZ^NsZ^o{VZZV^kZZ^ZZRZ^g9VJR {w{sswswsg9^so{sswwg9s{sw+so{kZNso{o{sNswkZVsJR{ss{ss{s{wwss{swwssg9sw{sw{wo{w TNAM 6979D755356672EE623C983052C6A0CPRT /
com.apple.print.DocumentTicket.PMSpoolFormat
com.apple.print.ticket.creator
com.apple.printingmanager
com.apple.print.ticket.itemArray
com.apple.print.DocumentTicket.PMSpoolFormat
application/pdf
com.apple.print.ticket.client
com.apple.printingmanager
com.apple.print.ticket.modDate
2005-09-18T18:34:05Z
com.apple.print.ticket.stateFlag
0
com.apple.print.PrintSettings.PMColorSyncProfileID
com.apple.print.ticket.creator
com.apple.printingmanager
com.apple.print.ticket.itemArray
com.apple.print.PrintSettings.PMColorSyncProfileID
1
com.apple.print.ticket.client
com.apple.printingmanager
com.apple.print.ticket.modDate
2005-09-18T18:34:05Z
com.apple.print.ticket.stateFlag
0
com.apple.print.PrintSettings.PMCopies
com.apple.print.ticket.creator
com.apple.printingmanager
com.apple.print.ticket.itemArray
com.apple.print.PrintSettings.PMCopies
1
com.apple.print.ticket.client
com.apple.printingmanager
com.apple.print.ticket.modDate
2005-09-18T18:34:05Z
com.apple.print.ticket.stateFlag
0
com.apple.print.PrintSettings.PMCopyCollate
com.apple.print.ticket.creator
com.apple.printingmanager
com.apple.print.ticket.itemArray
com.apple.print.PrintSettings.PMCopyCollate
com.apple.print.ticket.client
com.apple.printingmanager
com.apple.print.ticket.modDate
2005-09-18T18:34:05Z
com.apple.print.ticket.stateFlag
0
com.apple.print.PrintSettings.PMFirstPage
com.apple.print.ticket.creator
com.apple.printingmanager
com.apple.print.ticket.itemArray
com.apple.print.PrintSettings.PMFirstPage
1
com.apple.print.ticket.client
com.apple.printingmanager
com.apple.print.ticket.modDate
2005-09-18T18:34:05Z
com.apple.print.ticket.stateFlag
0
com.apple.print.PrintSettings.PMLastPage
com.apple.print.ticket.creator
com.apple.printingmanager
com.apple.print.ticket.itemArray
com.apple.print.PrintSettings.PMLastPage
2147483647
com.apple.print.ticket.client
com.apple.printingmanager
com.apple.print.ticket.modDate
2005-09-18T18:34:05Z
com.apple.print.ticket.stateFlag
0
com.apple.print.PrintSettings.PMPageRange
com.apple.print.ticket.creator
com.apple.printingmanager
com.apple.print.ticket.itemArray
com.apple.print.PrintSettings.PMPageRange
1
2147483647
com.apple.print.ticket.client
com.apple.printingmanager
com.apple.print.ticket.modDate
2005-09-18T18:34:05Z
com.apple.print.ticket.stateFlag
0
com.apple.print.ticket.APIVersion
00.20
com.apple.print.ticket.privateLock
com.apple.print.ticket.type
com.apple.print.PrintSettingsTicket
com.apple.print.PageFormat.PMHorizontalRes
com.apple.print.ticket.creator
com.apple.printingmanager
com.apple.print.ticket.itemArray
com.apple.print.PageFormat.PMHorizontalRes
72
com.apple.print.ticket.client
com.apple.printingmanager
com.apple.print.ticket.modDate
2005-09-18T18:34:02Z
com.apple.print.ticket.stateFlag
0
com.apple.print.PageFormat.PMOrientation
com.apple.print.ticket.creator
com.apple.printingmanager
com.apple.print.ticket.itemArray
com.apple.print.PageFormat.PMOrientation
1
com.apple.print.ticket.client
com.apple.printingmanager
com.apple.print.ticket.modDate
2005-09-18T18:34:02Z
com.apple.print.ticket.stateFlag
0
com.apple.print.PageFormat.PMScaling
com.apple.print.ticket.creator
com.apple.printingmanager
com.apple.print.ticket.itemArray
com.apple.print.PageFormat.PMScaling
1
com.apple.print.ticket.client
com.apple.printingmanager
com.apple.print.ticket.modDate
2005-09-18T18:34:02Z
com.apple.print.ticket.stateFlag
0
com.apple.print.PageFormat.PMVerticalRes
com.apple.print.ticket.creator
com.apple.printingmanager
com.apple.print.ticket.itemArray
com.apple.print.PageFormat.PMVerticalRes
72
com.apple.print.ticket.client
com.apple.printingmanager
com.apple.print.ticket.modDate
2005-09-18T18:34:02Z
com.apple.print.ticket.stateFlag
0
com.apple.print.PageFormat.PMVerticalScaling
com.apple.print.ticket.creator
com.apple.printingmanager
com.apple.print.ticket.itemArray
com.apple.print.PageFormat.PMVerticalScaling
1
com.apple.print.ticket.client
com.apple.printingmanager
com.apple.print.ticket.modDate
2005-09-18T18:34:02Z
com.apple.print.ticket.stateFlag
0
com.apple.print.subTicket.paper_info_ticket
com.apple.print.PageFormat.PMAdjustedPageRect
com.apple.print.ticket.creator
com.apple.printingmanager
com.apple.print.ticket.itemArray
com.apple.print.PageFormat.PMAdjustedPageRect
0.0
0.0
734
576
com.apple.print.ticket.client
com.apple.printingmanager
com.apple.print.ticket.modDate
2005-09-18T18:34:02Z
com.apple.print.ticket.stateFlag
0
com.apple.print.PageFormat.PMAdjustedPaperRect
com.apple.print.ticket.creator
com.apple.printingmanager
com.apple.print.ticket.itemArray
com.apple.print.PageFormat.PMAdjustedPaperRect
-18
-18
774
594
com.apple.print.ticket.client
com.apple.printingmanager
com.apple.print.ticket.modDate
2005-09-18T18:34:02Z
com.apple.print.ticket.stateFlag
0
com.apple.print.PaperInfo.PMPaperName
com.apple.print.ticket.creator
com.apple.print.pm.PostScript
com.apple.print.ticket.itemArray
com.apple.print.PaperInfo.PMPaperName
na-letter
com.apple.print.ticket.client
com.apple.print.pm.PostScript
com.apple.print.ticket.modDate
2003-07-01T17:49:36Z
com.apple.print.ticket.stateFlag
1
com.apple.print.PaperInfo.PMUnadjustedPageRect
com.apple.print.ticket.creator
com.apple.print.pm.PostScript
com.apple.print.ticket.itemArray
com.apple.print.PaperInfo.PMUnadjustedPageRect
0.0
0.0
734
576
com.apple.print.ticket.client
com.apple.printingmanager
com.apple.print.ticket.modDate
2005-09-18T18:34:02Z
com.apple.print.ticket.stateFlag
0
com.apple.print.PaperInfo.PMUnadjustedPaperRect
com.apple.print.ticket.creator
com.apple.print.pm.PostScript
com.apple.print.ticket.itemArray
com.apple.print.PaperInfo.PMUnadjustedPaperRect
-18
-18
774
594
com.apple.print.ticket.client
com.apple.printingmanager
com.apple.print.ticket.modDate
2005-09-18T18:34:02Z
com.apple.print.ticket.stateFlag
0
com.apple.print.PaperInfo.ppd.PMPaperName
com.apple.print.ticket.creator
com.apple.print.pm.PostScript
com.apple.print.ticket.itemArray
com.apple.print.PaperInfo.ppd.PMPaperName
US Letter
com.apple.print.ticket.client
com.apple.print.pm.PostScript
com.apple.print.ticket.modDate
2003-07-01T17:49:36Z
com.apple.print.ticket.stateFlag
1
com.apple.print.ticket.APIVersion
00.20
com.apple.print.ticket.privateLock
com.apple.print.ticket.type
com.apple.print.PaperInfoTicket
com.apple.print.ticket.APIVersion
00.20
com.apple.print.ticket.privateLock
com.apple.print.ticket.type
com.apple.print.PageFormatTicket
ETBL hDSUM (HDNI (STYL (MCRO 5$oBlN 54MARK 5@WMBT 5fSNAP 5rTNAM MCPRT N ETBL }tU