Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

On Python 2 In the Wright-Fisher Model, assuming no mutation, migration or selection, the number of alleles in generation t+1, given the number of alleles

On Python 2

image text in transcribed

In the Wright-Fisher Model, assuming no mutation, migration or selection, the number of alleles in generation t+1, given the number of alleles in generation t follows a binomial distribution, i.e, in which N is the population size, and Hence, the random variable X_ft+1 follows a binomial distribution. This can be implemented using np.random.binomial. P1 1. Using binomial random function in python, write a function that given an initial frequency of allele A and a given population size N, simulates the population history (i.e., an array of counts of allele A over different genereations) for a given number of generations. For example a possible output of your function wF mode1(N,f,t), in which N and t are integers and f is a float, for N-10e,f-0.1,t-18 could be the array [10,5,4,8,11,15,19,20,22,27] 2. Modify your function so that if allele A goes to fixation before reaching the specified number of generations t, i.e, fA-0 or fA-1, the iteration stops and only returns the history up to the point when the allele got fixed 3. Plot results of 10 different runs of this simulation

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2016 Riva Del Garda Italy September 19 23 2016 Proceedings Part 1 Lnai 9851

Authors: Paolo Frasconi ,Niels Landwehr ,Giuseppe Manco ,Jilles Vreeken

1st Edition

3319461273, 978-3319461274

More Books

Students also viewed these Databases questions

Question

How do parent-infant attachment bonds form?

Answered: 1 week ago