Lesson 37: Practice with pairs bootstrap and Bokeh

(c) 2018 Justin Bois. With the exception of pasted graphics, where the source is noted, this work is licensed under a Creative Commons Attribution License CC-BY 4.0. All code contained herein is licensed under an MIT license.

This document was prepared at Caltech with financial support from the Donna and Benjamin M. Rosen Bioengineering Center.

This lwaaon was generated from a Jupyter notebook. You can download the notebook here.



Practice 1: Heritability

The heritability of a trait in a sexually reproducing animal is defined as follows.

  1. For a given pair of parent, take the mean value of the trait. Call this the parental trait.
  2. Take the mean value of the trait of all of the offspring of the two parents. Call this the offspring trait.
  3. Do this for all parental/offspring pairs.
  4. The heritability is defined as the ratio of the covariance between the parental and offspring traits to the variance of the parental traits.

Compute the heritability of beak depth for both G. fortis and G. scandens from a Grant and Grant data set. The data are contained in ~data/grant_heredity.csv (you will likely need to git pull upstream master). Then, use pairs bootstrap to get a confidence interval for the heritability of beak depth for each species.


Practice 2: Plotting with Bokeh

The bootcamp_utils module has several convenient functions for making plots with Bokeh. To make sure you have the updated version installed, you should

git pull upstream master

You should then cd into the ~/git/bootcamp/modules directory and do

pip install -e bootcamp_utils

You should then restart the kernel of your Jupyter notebook.

To find out what is available, you can try tab completion after typing bootcamp_utils.bokeh_. Then, read the doc strings of the plotting functions, and play around with them. You can use any of the data sets we've used in the bootcamp, but the Darwin finch data set or the frog data set will probably be best.