Exercise 9.1: Practice with HoloViews


a) In a population or size \(N\) with frequency \(p\) of allele A and frequency \(q\) of allele a (with \(q = 1 - p\)), the variance of allele frequency \(p\) across replicated populations is approximately

\begin{align} V \approx pq\left(1 - \mathrm{e}^{-t/2N}\right), \end{align}

where \(t\) is the number of generations. Use HoloViews to plot this function version \(t\) for some given values of \(p\) and \(N\). If you’re feeling adventurous, you can make widgets to vary \(p\) and \(N\) and investigate how the variance changes.

b) Recall the data set from Exercise 8.2 in which we analyzed the effects of neonicotinoid pesticides on bee sperm. Use HoloViews to make a scatter plot of the number of alive sperm versus number of dead sperm, with each point colored by whether they were treated with pesticide. As a reminder, the data set is stored in ~git/bootcamp/data/bee_sperm.csv.

c) 96 well plates are often used in analyzing biochemical reactions. Some absorbance data from a 96 well plate experiment are in the file ~git/bootcamp/data/96_well.csv. (You will need to git pull upstream master to get the data set.) Use HoloViews’s HeatMap element to make a display of the data. Hint: If you want to display a colorbar, you may need to also include colorbar_opts={'bar_line_color': None} in your opts() because of a possible bug in HoloViews for rendering colorbars.