A brief note on Genetics by Computer: gametes as letters, sorted genotypes, Punnett squares with loops and Counter, two genes with itertools.product and the 9:3:3:1 ratio, the test cross, and simulated crosses with random.choice. With practice, a program and questions.
A brief note on Genetics by Computer. Read it before a test. Try each question at the end before you open its answer.
list("Tt") gives ['T', 't']."".join(sorted(a + b)); the capital, dominant letter comes first.Counter(kids) counts genotypes. Tt with Tt gives 1 TT : 2 Tt : 1 tt, which is 3 tall to 1 short.product("Rr", "Yy") gives the four gametes RY, Ry, rY and ry.random.choice(parent) picks one gamete; one choice from each parent makes a child.random.seed(k) makes every run repeat the same numbers.What does this print?
It prints Counter({'round': 2, 'wrinkled': 2}), a 1:1 ratio.
The program crosses Pp with pp and then Pp with Pp, and counts the flower colours each time.
tT and Tt are counted as two genotypes."".join(sorted(a + b)) used instead of a + b?Log in to join the discussion.
Loading…