Code Monkey home page Code Monkey logo

allele_genotype_simulation's Introduction

Allele-genotype_Simulation

The code is a simulation of genetic inheritance and population dynamics. It explores how allele and genotype frequencies change over multiple reproductive cycles. The code is divided into two sections: a static model and a dynamic model.

Static Model:

  • In the static model, the starting allele frequencies are defined for two alleles (T and M) using the variables T_freq and M_freq.
  • Genotype frequencies are calculated based on the starting allele frequencies.
  • The simulate_offspring function simulates the production of offspring based on the genotype frequencies of the parents. Offspring genotypes are randomly assigned according to the genotype frequencies.
  • The update_frequencies function updates the allele and genotype frequencies based on the offspring produced.
  • The simulate_cycles function simulates a given number of breeding cycles. It initializes the starting population of parents, and then iteratively simulates offspring production and frequency updates.
  • The resulting allele and genotype frequencies are plotted over time using matplotlib.

Dynamic Model:

  • The dynamic model extends the static model by introducing outcrossing between progeny.
  • In this model, the starting genotype frequencies are defined for two parents using the variables TT_freq, MM_freq, and MT_freq.
  • The simulate_offspring and update_frequencies functions are similar to the static model.
  • The simulate_cycles function is modified to account for changes in allele frequencies due to outcrossing between progeny.
  • The resulting allele and genotype frequencies are plotted over time using matplotlib.

By calling the simulate_cycles function with appropriate parameters (e.g., the number of starting pairs and the number of cycles), you can observe how allele and genotype frequencies change over time in the population.

allele_genotype_simulation's People

Contributors

rollercoaster1899 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.