Inheritance-Linkage

Inheritance-Linkage preview image

1 collaborator

Screen_shot_2018-02-02_at_12.53.50_pm lin xiang (Author)

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by the author
Model was written in NetLogo 6.2.2 • Viewed 405 times • Downloaded 110 times • Run 0 times
Download the 'Inheritance-Linkage' modelDownload this modelEmbed this model

Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)


WHAT IS IT?

This is an inheritance model of genetic linkage, including both X-linkage and autosomal linkage.

HOW TO USE

  1. Select one of five cases
  2. Click on the "Start/reset" button to start or start over .
  3. Click on the "Press and choose 2 parent flies" button.
  4. Choose a male and a female in the simulation window. The males are smaller and have a dark abdomen tip.
  5. Click on the "cross!" button to conduct a test cross.
  6. Examine offspring phenotypes in the simulation window and the "progeny" section.

CREDITS AND REFERENCES

This model was made by Dr. Lin Xiang at Weber State University.If you mention this model in a publication, we ask that you include the citations below.

Xiang, L. (2017). Patterns of Inheritance: Genetic Linkage. Zoology Department, Weber State University, Ogden, UT.

CC BY-NC-SA 4.0

This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 License. To view a copy of this license, visit https://creativecommons.org/licenses/by-nc-sa/4.0/.

Comments and Questions

Please start the discussion about this model! (You'll first need to log in.)

Click to Run Model

globals [x y p1 p2 population-size f-x f-y fly-ID list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9]    ;p1=selected parent 1, p2=selected parent 2,
turtles-own [c1 c2 genotype phenotype gender eye-color wing-shape body-color body-color-1]

breed [sperms sperm]
breed [eggs egg]
breed [flies a-fly]
breed [crosses cross]

to setup
  ca
  set-gametes
  fertilization
  set-tray
  output-results
  reset-ticks
end 

to set-gametes

set population-size 15 + random 16

if Cases = "Case 1" [              ;sex-linked eye color character. In this case, the linkage between eye color and sex can be explored.
  create-sperms population-size
  [gamete-trait
    set c1 item random 3 ["XA" "Xa" "Y"]     ;given the three possoibilities, the gender ratio does not start with 1:1 at the beginning but brias to female
    set c2 "BV"                              ;all flies are long-winged with a light body color
    set genotype word c1 c2                  ;form  genotype of gamete
    ]

  create-eggs population-size
  [gamete-trait
    set c1 item random 2 ["XA" "Xa"]
    set c2 "BV"
    set genotype word c1 c2
    ]
  ]

 if Cases = "Case 2" [             ;dihybrid cross  eye color vs wing shape
   create-sperms population-size
  [gamete-trait
    set c1 item random 2 ["XA" "Y"]         ; A and a are  red-eyed and white-eyed alleles.
    set c2 item random 2 ["BV" "Bv"]        ; V and v are wing shape alleles.
    set genotype word c1 c2
    ]

  create-eggs population-size
  [gamete-trait
    set c1 "XA"
    set c2 item random 2 ["BV" "Bv"]
    set genotype word c1 c2
    ]
  ]


   if Cases = "Case 3" [             ;dihybrid cross eye color vs body color
   create-sperms population-size
  [gamete-trait
    set c1 item random 3 ["XA" "Xa" "Y"]         ; A and a are  red-eyed and white-eyed alleles.
    set c2 item random 2 ["BV" "Bv"]        ; V and v are wing shape color alleles.
    set genotype word c1 c2
    ]

  create-eggs population-size
  [gamete-trait
    set c1 item random 2 ["XA" "Xa"]
    set c2 item random 2 ["BV" "Bv"]
    set genotype word c1 c2
    ]
  ]



 if Cases = "Case 4" [             ;non-sex-linked wing character & linkage characters. This case is more complicated. Students can explore the linkage between wing shape and body color, and the relatinship between the two chracters and the sex ratio.
   create-sperms population-size
  [gamete-trait
    set c1 item random 2 ["XA" "Y"]         ; All flies are red-eyed.
    set c2 item random 2 ["BV" "bv"]        ; genes B and V are linked, not cross-over at the beginning.
    set genotype word c1 c2
    ]

  create-eggs population-size
  [gamete-trait
    set c1 "XA"
    set c2 item random 2 ["BV" "bv"]
    set genotype word c1 c2
    ]
  ]



  if Cases = "Case 5" [             ;sex- and non-sex linkage characters.  White-eyed allele is added in.
   create-sperms population-size
  [gamete-trait
    set c1 item random 3 ["XA" "Xa" "Y"]
    set c2 item random 2 ["BV" "bv"]
    set genotype word c1 c2
    ]

  create-eggs population-size
  [gamete-trait
    set c1 item random 2 ["XA" "Xa"]
    set c2 item random 2 ["BV" "bv"]
    set genotype word c1 c2
    ]
  ]
end 

to gamete-trait
  set shape "dot"
    set size 0.1
    setxy random-xcor random-ycor
end 

to express

  ;;Determine phenotypes based on the allele, then code the phenotypes
  ifelse member? "Y" genotype = true [set gender "male" set size 0.65 set phenotype "m-" ][set gender "female" set size 0.8 set phenotype "f-"]
  ifelse member? "XA" genotype = true [set eye-color "Red-eyed" set phenotype word phenotype "r-"][set eye-color "White-eyed" set phenotype word phenotype "w-"]
  ifelse member? "V" genotype = true [set wing-shape "Long-winged" set phenotype word phenotype "lw-"][set wing-shape "Vestigial-winged" set phenotype word phenotype "vw-"]
  ifelse member? "B" genotype = true [set body-color "Light body" set phenotype word phenotype "lb"][set body-color "Black body" set phenotype word phenotype "bb"]


  ;;Determine the shape and color using phenotype codes
  if phenotype = "m-r-lw-lb" [set shape "fly-m-r-lw"]
  if phenotype = "m-r-lw-bb" [set shape "fly-m-r-lw" set color 20.5]  ;set black body color
  if phenotype = "m-r-vw-lb" [set shape "fly-m-r-vw"]
  if phenotype = "m-r-vw-bb" [set shape "fly-m-r-vw" set color 20.5]
  if phenotype = "m-w-lw-lb" [set shape "fly-m-w-lw"]
  if phenotype = "m-w-lw-bb" [set shape "fly-m-w-lw" set color 20.5]
  if phenotype = "m-w-vw-lb" [set shape "fly-m-w-vw"]
  if phenotype = "m-w-vw-bb" [set shape "fly-m-w-vw" set color 20.5]

  if phenotype = "f-r-lw-lb" [set shape "fly-f-r-lw"]
  if phenotype = "f-r-lw-bb" [set shape "fly-f-r-lw" set color 20.5]
  if phenotype = "f-r-vw-lb" [set shape "fly-f-r-vw"]
  if phenotype = "f-r-vw-bb" [set shape "fly-f-r-vw" set color 20.5]
  if phenotype = "f-w-lw-lb" [set shape "fly-f-w-lw"]
  if phenotype = "f-w-lw-bb" [set shape "fly-f-w-lw" set color 20.5]
  if phenotype = "f-w-vw-lb" [set shape "fly-f-w-vw"]
  if phenotype = "f-w-vw-bb" [set shape "fly-f-w-vw" set color 20.5]
end 

to fertilization

  ask eggs
  [let mate one-of sperms
    if mate != nobody
    [hatch-flies 1
     [set color 28             ;set light body color, some will be overwritten to a black body color in express
       set heading 0
       set genotype word genotype [genotype] of mate
       express
       set-position
      ]
      ask mate [die]
      die
  ]]

  ask sperms [die]
  ask eggs [die]
end 

to set-tray
  ask patches [set pcolor 113 + random-float 0.5]
  ask patches with [pxcor >= max-pxcor - 1] [set pcolor 87]

  create-crosses 1
   [set shape "x"
    setxy max-pxcor - 0.5 max-pycor / 2
    set size 0.5
    set color 35]

  create-crosses 1 [
    set shape "female"
    set heading 45
    setxy max-pxcor + 0.25 5
    set size 0.75
    set color 0]

 create-crosses 1 [
    set shape "male"
    set heading 45
    setxy max-pxcor + 0.25 min-pycor + 0.25
    set size 0.75
    set color 0]
end 

to set-position
  setxy random 10 random 7
  if any? other flies-here [set-position]
end 

;====================================================================================

to go

  ifelse count flies != 2
[user-message "Please choose parent flies at first."]
[
    gametogenesis
    fertilization
]
end 

to pick

;clear-output
  if mouse-inside? [
    if mouse-down? [
      set x round mouse-xcor set y round mouse-ycor
      ask flies with [xcor = x and ycor = y]
        [ if gender = "male"
            [ifelse count flies with [gender = "male" and pxcor >  max-pxcor - 1] > 0
            [set p1 "Opse! You have chosen a male."]
            [set size 1.25 setxy max-pxcor - 0.5 1.5

            let dad flies with [pxcor >= max-pxcor - 1 and gender = "male"]
            set p2 [eye-color] of dad
            set p2 word p2 " "
            set p2 word p2 [wing-shape] of dad
            set p2 word p2 " "
            set p2 word p2 [body-color] of dad
          ]]

          if gender = "female"
            [ifelse count flies with [pxcor > max-pxcor - 1 and gender = "female"] > 0
            [set p2 "Opse! You have chosen a female."]
            [set size 1.25 setxy max-pxcor - 0.5 4.5

             let mom flies with [pxcor >= max-pxcor - 1 and gender = "female"]
             set p1 [eye-color] of mom
             set p1 word p1 " "
             set p1 word p1 [wing-shape] of mom
             set p1 word p1 " "
             set p1 word p1 [body-color] of mom
          ]]
  ]]]


 if count flies with [pxcor >= max-pxcor - 1] = 2 [
  ask flies with [pxcor < max-pxcor - 1 ] [die]
  ask eggs [die]
  ask sperms [die]
  stop
  ]
end 

to gametogenesis

set population-size 4 * (14 + random 4)

  ;set eggs

  let mom one-of flies with [gender = "female"]

  (ifelse       ;set Xa gene
    member? "XA" [genotype] of mom = true and member? "Xa" [genotype] of mom = true
    [create-eggs 0.5 * population-size [set genotype "XA" gamete-trait ]
      create-eggs 0.5 * population-size [set genotype "Xa" gamete-trait ]]

    member? "XA" [genotype] of mom = true and member? "Xa" [genotype] of mom = false
    [create-eggs population-size [set genotype "XA" gamete-trait ]]

    member? "XA" [genotype] of mom = false and member? "Xa" [genotype] of mom = true
    [create-eggs population-size [set genotype "Xa" gamete-trait ]])

  (ifelse        ;Set B and V gene
    member? "BV" [genotype] of mom = true and member? "Bv" [genotype] of mom = false and member? "bV" [genotype] of mom = false and member? "bv" [genotype] of mom = false ;BVBV
    [ask eggs [set genotype word genotype "BV"]]

    member? "Bv" [genotype] of mom = true and member? "BV" [genotype] of mom = false and member? "bV" [genotype] of mom = false and member? "bv" [genotype] of mom = false ;BvBv
    [ask eggs [set genotype word genotype "Bv"]]

    member? "bV" [genotype] of mom = true and member? "BV" [genotype] of mom = false and member? "Bv" [genotype] of mom = false and member? "bv" [genotype] of mom = false ;bVbV
    [ask eggs [set genotype word genotype "bV"]]

    member? "bv" [genotype] of mom = true and member? "BV" [genotype] of mom = false and member? "Bv" [genotype] of mom = false and member? "bV" [genotype] of mom = false ;bvbv
    [ask eggs [set genotype word genotype "bv"]]

    member? "BV" [genotype] of mom = true and member? "Bv" [genotype] of mom = true and member? "bV" [genotype] of mom = false and member? "bv" [genotype] of mom = false ;BVBv
            [ask n-of (0.5 * count eggs with [genotype = "XA"]) eggs with [genotype = "XA"] [set genotype word genotype "BV"]  ; XABV  50%
             ask eggs with [genotype = "XA"] [set genotype word genotype "Bv"]                                                 ; XABv 50%

             ask n-of (0.5 * count eggs with [genotype = "Xa"]) eggs with [genotype = "Xa"] [set genotype word genotype "BV"]  ; XaBV  50%
             ask eggs with [genotype = "Xa"] [set genotype word genotype "Bv"] ]                                               ; XaBv 50%

    member? "BV" [genotype] of mom = true and member? "Bv" [genotype] of mom = false and member? "bV" [genotype] of mom = true and member? "bv" [genotype] of mom = false ;BVbV
            [ask n-of (0.5 * count eggs with [genotype = "XA"]) eggs with [genotype = "XA"] [set genotype word genotype "BV"]  ; XABV  50%
             ask eggs with [genotype = "XA"] [set genotype word genotype "bV"]                                                 ; XAbV 50%

             ask n-of (0.5 * count eggs with [genotype = "Xa"]) eggs with [genotype = "Xa"] [set genotype word genotype "BV"]  ; XaBV  50%
             ask eggs with [genotype = "Xa"] [set genotype word genotype "bV"] ]                                               ; XabV 50%

    member? "BV" [genotype] of mom = false and member? "Bv" [genotype] of mom = true and member? "bV" [genotype] of mom = false and member? "bv" [genotype] of mom = true ;Bvbv
            [ask n-of (0.5 * count eggs with [genotype = "XA"]) eggs with [genotype = "XA"] [set genotype word genotype "Bv"]  ; XABv  50%
             ask eggs with [genotype = "XA"] [set genotype word genotype "bv"]                                                 ; XAbv 50%

             ask n-of (0.5 * count eggs with [genotype = "Xa"]) eggs with [genotype = "Xa"] [set genotype word genotype "Bv"]  ; XaBv  50%
             ask eggs with [genotype = "Xa"] [set genotype word genotype "bv"] ]                                               ; Xabv 50%

     member? "BV" [genotype] of mom = false and member? "Bv" [genotype] of mom = false and member? "bV" [genotype] of mom = true and member? "bv" [genotype] of mom = true ;bVbv
            [ask n-of (0.5 * count eggs with [genotype = "XA"]) eggs with [genotype = "XA"] [set genotype word genotype "bV"]  ; XAbV  50%
             ask eggs with [genotype = "XA"] [set genotype word genotype "bv"]                                                 ; XAbv 50%

             ask n-of (0.5 * count eggs with [genotype = "Xa"]) eggs with [genotype = "Xa"] [set genotype word genotype "bV"]  ; XabV  50%
             ask eggs with [genotype = "Xa"] [set genotype word genotype "bv"] ]                                               ; Xabv 50%

     member? "BV" [genotype] of mom = true and member? "Bv" [genotype] of mom = false and member? "bV" [genotype] of mom = false and member? "bv" [genotype] of mom = true ;BVbv
            [ask n-of (0.5 * count eggs with [genotype = "XA"]) eggs with [genotype = "XA"] [set genotype word genotype "BV"]  ; XABV  50%
             ask eggs with [genotype = "XA"] [set genotype word genotype "bv"]                                                 ; XAbv 50%

             ask n-of (0.5 * count eggs with [genotype = "Xa"]) eggs with [genotype = "Xa"] [set genotype word genotype "BV"]  ; XaBV  50%
             ask eggs with [genotype = "Xa"] [set genotype word genotype "bv"]                                                ; Xabv 50%

             ;cross-over

            ask n-of (0.1 * count eggs with [genotype = "XABV"]) eggs with [genotype = "XABV"] [set genotype "XABv"]  ; 10% of XABV--> XABv
            ask n-of (0.1 * count eggs with [genotype = "XAbv"]) eggs with [genotype = "XAbv"] [set genotype "XAbV"]  ; 10% of XAbv--> XAbV
            ask n-of (0.1 * count eggs with [genotype = "Xabv"]) eggs with [genotype = "Xabv"] [set genotype "XabV"]  ; 10% of Xabv--> XabV
            ask n-of (0.1 * count eggs with [genotype = "XaBV"]) eggs with [genotype = "XaBV"] [set genotype "XaBv"]  ; 10% of XaBV--> XaBv
  ]

     member? "BV" [genotype] of mom = false and member? "Bv" [genotype] of mom = true and member? "bV" [genotype] of mom = true and member? "bv" [genotype] of mom = false ;BvbV
            [ask n-of (0.5 * count eggs with [genotype = "XA"]) eggs with [genotype = "XA"] [set genotype word genotype "Bv"]  ; XABv  50%
             ask eggs with [genotype = "XA"] [set genotype word genotype "bV"]                                                 ; XAbV 50%

             ask n-of (0.5 * count eggs with [genotype = "Xa"]) eggs with [genotype = "Xa"] [set genotype word genotype "Bv"]  ; XaBv  50%
             ask eggs with [genotype = "Xa"] [set genotype word genotype "bV"]                                                ; XabV 50%

             ;cross-over

            ask n-of (0.1 * count eggs with [genotype = "XABv"]) eggs with [genotype = "XABv"] [set genotype "XABV"]  ; 10% of XABv--> XABV
            ask n-of (0.1 * count eggs with [genotype = "XAbV"]) eggs with [genotype = "XAbV"] [set genotype "XAbv"]  ; 10% of XAbV--> XAbv
            ask n-of (0.1 * count eggs with [genotype = "XabV"]) eggs with [genotype = "XabV"] [set genotype "Xabv"]  ; 10% of XabV--> Xabv
            ask n-of (0.1 * count eggs with [genotype = "XaBv"]) eggs with [genotype = "XaBv"] [set genotype "XaBV"]  ; 10% of XaBv--> XaBV
])

   ; set sperms

   let dad one-of flies with [gender = "male"]

   ifelse member? "XA" [genotype] of dad = true     ;set Xa gene
           [create-sperms 0.5 * population-size [set genotype "XA" gamete-trait ] create-sperms 0.5 * population-size [set genotype "Y" gamete-trait ]]
           [create-sperms 0.5 * population-size [set genotype "Xa" gamete-trait ] create-sperms 0.5 * population-size [set genotype "Y" gamete-trait ]]


  (ifelse        ;Set B and V gene
    member? "BV" [genotype] of dad = true and member? "Bv" [genotype] of dad = false and member? "bV" [genotype] of dad = false and member? "bv" [genotype] of dad = false ;BVBV
    [ask sperms [set genotype word genotype "BV"]]

    member? "Bv" [genotype] of dad = true and member? "BV" [genotype] of dad = false and member? "bV" [genotype] of dad = false and member? "bv" [genotype] of dad = false ;BvBv
    [ask sperms [set genotype word genotype "Bv"]]

    member? "bV" [genotype] of dad = true and member? "BV" [genotype] of dad = false and member? "Bv" [genotype] of dad = false and member? "bv" [genotype] of dad = false ;bVbV
    [ask sperms [set genotype word genotype "bV"]]

    member? "bv" [genotype] of dad = true and member? "BV" [genotype] of dad = false and member? "Bv" [genotype] of dad = false and member? "bV" [genotype] of dad = false ;bvbv
    [ask sperms [set genotype word genotype "bv"]]

    member? "BV" [genotype] of dad = true and member? "Bv" [genotype] of dad = true and member? "bV" [genotype] of dad = false and member? "bv" [genotype] of dad = false ;BVBv
            [ask n-of (0.5 * count sperms with [genotype = "XA"]) sperms with [genotype = "XA"] [set genotype word genotype "BV"]  ; XABV  50%
             ask sperms with [genotype = "XA"] [set genotype word genotype "Bv"]                                                 ; XABv 50%

             ask n-of (0.5 * count sperms with [genotype = "Xa"]) sperms with [genotype = "Xa"] [set genotype word genotype "BV"]  ; XaBV  50%
             ask sperms with [genotype = "Xa"] [set genotype word genotype "Bv"]                                                ; XaBv 50%

             ask n-of (0.5 * count sperms with [genotype = "Y"]) sperms with [genotype = "Y"] [set genotype word genotype "BV"]  ; YBV  50%
             ask sperms with [genotype = "Y"] [set genotype word genotype "Bv"] ]                                               ; YBv 50%

    member? "BV" [genotype] of dad = true and member? "Bv" [genotype] of dad = false and member? "bV" [genotype] of dad = true and member? "bv" [genotype] of dad = false ;BVbV
            [ask n-of (0.5 * count sperms with [genotype = "XA"]) sperms with [genotype = "XA"] [set genotype word genotype "BV"]  ; XABV  50%
             ask sperms with [genotype = "XA"] [set genotype word genotype "bV"]                                                 ; XAbV 50%

             ask n-of (0.5 * count sperms with [genotype = "Xa"]) sperms with [genotype = "Xa"] [set genotype word genotype "BV"]  ; XaBV  50%
             ask sperms with [genotype = "Xa"] [set genotype word genotype "bV"]                                                ; XabV 50%

             ask n-of (0.5 * count sperms with [genotype = "Y"]) sperms with [genotype = "Y"] [set genotype word genotype "BV"]  ; YBV  50%
             ask sperms with [genotype = "Y"] [set genotype word genotype "bV"] ]                                               ; YbV 50%

    member? "BV" [genotype] of dad = false and member? "Bv" [genotype] of dad = true and member? "bV" [genotype] of dad = false and member? "bv" [genotype] of dad = true ;Bvbv
            [ask n-of (0.5 * count sperms with [genotype = "XA"]) sperms with [genotype = "XA"] [set genotype word genotype "Bv"]  ; XABv  50%
             ask sperms with [genotype = "XA"] [set genotype word genotype "bv"]                                                 ; XAbv 50%

             ask n-of (0.5 * count sperms with [genotype = "Xa"]) sperms with [genotype = "Xa"] [set genotype word genotype "Bv"]  ; XaBv  50%
             ask sperms with [genotype = "Xa"] [set genotype word genotype "bv"]                                              ; Xabv 50%

             ask n-of (0.5 * count sperms with [genotype = "Y"]) sperms with [genotype = "Y"] [set genotype word genotype "Bv"]  ; YBv  50%
             ask sperms with [genotype = "Y"] [set genotype word genotype "bv"] ]                                               ; Ybv 50%

     member? "BV" [genotype] of dad = false and member? "Bv" [genotype] of dad = false and member? "bV" [genotype] of dad = true and member? "bv" [genotype] of dad = true ;bVbv
            [ask n-of (0.5 * count sperms with [genotype = "XA"]) sperms with [genotype = "XA"] [set genotype word genotype "bV"]  ; XAbV  50%
             ask sperms with [genotype = "XA"] [set genotype word genotype "bv"]                                                 ; XAbv 50%

             ask n-of (0.5 * count sperms with [genotype = "Xa"]) sperms with [genotype = "Xa"] [set genotype word genotype "bV"]  ; XabV  50%
             ask sperms with [genotype = "Xa"] [set genotype word genotype "bv"]                                                ; Xabv 50%

             ask n-of (0.5 * count sperms with [genotype = "Y"]) sperms with [genotype = "Y"] [set genotype word genotype "bV"]  ; YbV  50%
             ask sperms with [genotype = "Y"] [set genotype word genotype "bv"] ]                                               ; Ybv 50%

     member? "BV" [genotype] of dad = true and member? "Bv" [genotype] of dad = false and member? "bV" [genotype] of dad = false and member? "bv" [genotype] of dad = true ;BVbv
            [ask n-of (0.5 * count sperms with [genotype = "XA"]) sperms with [genotype = "XA"] [set genotype word genotype "BV"]  ; XABV  50%
             ask sperms with [genotype = "XA"] [set genotype word genotype "bv"]                                                 ; XAbv 50%

             ask n-of (0.5 * count sperms with [genotype = "Xa"]) sperms with [genotype = "Xa"] [set genotype word genotype "BV"]  ; XaBV  50%
             ask sperms with [genotype = "Xa"] [set genotype word genotype "bv"]                                                ; Xabv 50%

             ask n-of (0.5 * count sperms with [genotype = "Y"]) sperms with [genotype = "Y"] [set genotype word genotype "BV"]  ; YBV  50%
             ask sperms with [genotype = "Y"] [set genotype word genotype "bv"]                                               ; Ybv 50%

             ;cross-over

             ask n-of (0.1 * count sperms with [genotype = "XABV"]) sperms with [genotype = "XABV"] [set genotype "XABv"]  ; 10% of XABV--> XABv
             ask n-of (0.1 * count sperms with [genotype = "XAbv"]) sperms with [genotype = "XAbv"] [set genotype "XAbV"]  ; 10% of XAbv--> XAbV
             ask n-of (0.1 * count sperms with [genotype = "Xabv"]) sperms with [genotype = "Xabv"] [set genotype "XabV"]  ; 10% of Xabv--> XabV
             ask n-of (0.1 * count sperms with [genotype = "XaBV"]) sperms with [genotype = "XaBV"] [set genotype "XaBv"]  ; 10% of XaBV--> XaBv
             ask n-of (0.1 * count sperms with [genotype = "YBV"]) sperms with [genotype = "YBV"] [set genotype "YBv"]     ; 10% of YBV--> YBv
             ask n-of (0.1 * count sperms with [genotype = "Ybv"]) sperms with [genotype = "Ybv"] [set genotype "YbV"]     ; 10% of Ybv--> YbV
  ]

     member? "BV" [genotype] of dad = false and member? "Bv" [genotype] of dad = true and member? "bV" [genotype] of dad = true and member? "bv" [genotype] of dad = false ;BvbV
            [ask n-of (0.5 * count sperms with [genotype = "XA"]) sperms with [genotype = "XA"] [set genotype word genotype "Bv"]  ; XABv  50%
             ask sperms with [genotype = "XA"] [set genotype word genotype "bV"]                                                 ; XAbV 50%

             ask n-of (0.5 * count sperms with [genotype = "Xa"]) sperms with [genotype = "Xa"] [set genotype word genotype "Bv"]  ; XaBv  50%
             ask sperms with [genotype = "Xa"] [set genotype word genotype "bV"]                                                ; XabV 50%

             ask n-of (0.5 * count sperms with [genotype = "Y"]) sperms with [genotype = "Y"] [set genotype word genotype "Bv"]  ; YBv  50%
             ask sperms with [genotype = "Y"] [set genotype word genotype "bV"]                                                 ; YbV 50%


             ;cross-over

            ask n-of (0.1 * count sperms with [genotype = "XABv"]) sperms with [genotype = "XABv"] [set genotype  "XABV"]  ; 10% of XABv--> XABV
            ask n-of (0.1 * count sperms with [genotype = "XAbV"]) sperms with [genotype = "XAbV"] [set genotype  "XAbv"]  ; 10% of XAbV--> XAbv
            ask n-of (0.1 * count sperms with [genotype = "XabV"]) sperms with [genotype = "XabV"] [set genotype  "Xabv"]  ; 10% of XabV--> Xabv
            ask n-of (0.1 * count sperms with [genotype = "XaBv"]) sperms with [genotype = "XaBv"] [set genotype  "XaBV"]  ; 10% of XaBv--> XaBV
            ask n-of (0.1 * count sperms with [genotype = "YBv"]) sperms with [genotype = "YBv"] [set genotype  "YBV"]     ; 10% of YBv--> YBV
            ask n-of (0.1 * count sperms with [genotype = "YbV"]) sperms with [genotype = "YbV"] [set genotype  "Ybv"]     ; 10% of YbV--> Ybv
])


  ask flies [die]
end 

to output-results

 if cases = "Case 1" [
  output-print "Female flies:  Bigger in size without a dark genitalia at the tip of their abdomen."
  output-print "Male flies:  Smaller in size with a dark genitalia at the tip of their abdomen."
  output-print "~~~~~~~~~~~"
  output-print "Use case 1 to explore the inheritance patterns between eye color and gender."
  ]

 if cases = "Case 2" [
  output-print "Female flies:  Bigger in size without a dark genitalia at the tip of their abdomen."
  output-print "Male flies:  Smaller in size with a dark genitalia at the tip of their abdomen."
  output-print "~~~~~~~~~~~"
  output-print "Use case 2 to explore the inheritance patterns between wing shape and gender."
  ]

 if cases = "Case 3" [
  output-print "Female flies:  Bigger in size without a dark genitalia at the tip of their abdomen."
  output-print "Male flies:  Smaller in size with a dark genitalia at the tip of their abdomen."
  output-print "~~~~~~~~~~~"
  output-print "Use case 3 to explore the inheritance patterns between eye color and wing shape."
  ]

  if cases = "Case 4" [
  output-print "Female flies:  Bigger in size without a dark genitalia at the tip of their abdomen."
  output-print "Male flies:  Smaller in size with a dark genitalia at the tip of their abdomen."
  output-print "~~~~~~~~~~~"
  output-print "Use case 4 to explore the inheritance patterns between wing shape and body color."
  ]

  if cases = "Case 5" [
  output-print "Female flies:  Bigger in size without a dark genitalia at the tip of their abdomen."
  output-print "Male flies:  Smaller in size with a dark genitalia at the tip of their abdomen."
  output-print "~~~~~~~~~~~"
  output-print "Use case 5 to explore the inheritance patterns among eye color, gender, wing shape and body color."
  ]
end 

to set-lists
  if any? flies with [xcor <= 9][
         set list-1 [who] of flies with [phenotype = "m-r-lw-lb" and xcor < max-pxcor - 1]
         set list-2 [who] of flies with [phenotype = "m-r-lw-bb" and xcor < max-pxcor - 1]
         set list-1 sentence list-1 list-2

         set list-3 [who] of flies with [phenotype = "m-r-vw-lb" and xcor < max-pxcor - 1]
         set list-4 [who] of flies with [phenotype = "m-r-vw-bb" and xcor < max-pxcor - 1]
         set list-3 sentence list-3 list-4
         set list-1 sentence list-1 list-3

         set list-5 [who] of flies with [phenotype = "m-w-lw-lb" and xcor < max-pxcor - 1]
         set list-6 [who] of flies with [phenotype = "m-w-lw-bb" and xcor < max-pxcor - 1]
         set list-5 sentence list-5 list-6

         set list-7 [who] of flies with [phenotype = "m-w-vw-lb" and xcor < max-pxcor - 1]
         set list-8 [who] of flies with [phenotype = "m-w-vw-bb" and xcor < max-pxcor - 1]
         set list-7 sentence list-7 list-8
         set list-5 sentence list-5 list-7
         set list-9 sentence list-1 list-5

         set list-1 [who] of flies with [phenotype = "f-r-lw-lb" and xcor < max-pxcor - 1]
         set list-2 [who] of flies with [phenotype = "f-r-lw-bb" and xcor < max-pxcor - 1]
         set list-1 sentence list-1 list-2

         set list-3 [who] of flies with [phenotype = "f-r-vw-lb" and xcor < max-pxcor - 1]
         set list-4 [who] of flies with [phenotype = "f-r-vw-bb" and xcor < max-pxcor - 1]
         set list-3 sentence list-3 list-4
         set list-1 sentence list-1 list-3

         set list-5 [who] of flies with [phenotype = "f-w-lw-lb" and xcor < max-pxcor - 1]
         set list-6 [who] of flies with [phenotype = "f-w-lw-bb" and xcor < max-pxcor - 1]
         set list-5 sentence list-5 list-6

         set list-7 [who] of flies with [phenotype = "f-w-vw-lb" and xcor < max-pxcor - 1]
         set list-8 [who] of flies with [phenotype = "f-w-vw-bb" and xcor < max-pxcor - 1]
         set list-7 sentence list-7 list-8
         set list-5 sentence list-5 list-7
         set list-1 sentence list-1 list-5
         set list-1 sentence list-1 list-9

    sorting
      ]
end 

to sorting

   set f-x 0
        set f-y max-pycor
        set fly-ID 0

        repeat length list-1
        [ask flies with [who = item fly-ID list-1] [setxy f-x f-y]
          ifelse f-y > 0 [set f-y f-y - 1][set f-y max-pycor set f-x f-x + 1]
          set fly-ID fly-ID + 1 ]
end 

There are 13 versions of this model.

Uploaded by When Description Download
lin xiang almost 2 years ago Add a case to help distinguish sex-linked alleles and non-sex-linked alleles. Download this version
lin xiang almost 2 years ago Fix info typos Download this version
lin xiang almost 2 years ago Fix the pop-up message issue Download this version
lin xiang almost 2 years ago Refine the Gametogenesis and phenotypic sorting code Download this version
lin xiang almost 2 years ago Add fly sorting button Download this version
lin xiang almost 2 years ago Add subtotal monitors to help data collection Download this version
lin xiang over 2 years ago adjust the interface Download this version
lin xiang over 2 years ago adjust the interface Download this version
lin xiang over 3 years ago adjust the interface Download this version
lin xiang over 3 years ago update license Download this version
lin xiang almost 7 years ago fix bug Download this version
lin xiang almost 7 years ago fix bugs Download this version
lin xiang almost 7 years ago Initial upload Download this version

Attached files

File Type Description Last updated
Inheritance-Linkage.png preview Preview for 'Inheritance-Linkage' almost 7 years ago, by lin xiang Download

This model does not have any ancestors.

This model does not have any descendants.