Exercise 2.2: Microtubule catastrophe and ECDFs

Data set download


As a reminder, the empirical cumulative distribution function for a set of data point evaluated at x is

ECDF(x) = fraction of data points ≤ x.

The ECDF is defined on the entire real number line, with \(\mathrm{ECDF}(x\to-\infty) = 0\) and \(\mathrm{ECDF}(x\to\infty) = 1\). However, the ECDF is often plotted as discrete points, \(\{(x_i, y_i)\}\), where for point \(i\), \(x_i\) is the value of the measured quantity and \(y_i\) is \(\mathrm{ECDF}(x_i)\). For example, if I have a set of measured data with values (1.1, –6.7, 2.3, 9.8, 2.3), the points on the ECDF plot are

x

y

–6.7

0.2

1.1

0.4

2.3

0.6

2.3

0.8

9.8

1.0

In this exercise, you will use a data set we will explore throughout the workshop. Gardner, Zanic, and coworkers investigated the dynamics of microtubule catastrophe, the switching of a microtubule from a growing to a shrinking state. In particular, they were interested in the time between the start of growth of a microtubule and the catastrophe event. They monitored microtubules by using tubulin (the monomer that comprises a microtubule) that was labeled with a fluorescent marker. As a control to make sure that fluorescent labels and exposure to laser light did not affect the microtubule dynamics, they performed a similar experiment using differential interference contrast (DIC) microscopy. They measured the time until catastrophe with labeled and unlabeled tubulin.

We will look at the data used to generate Fig. 2a of their paper. In the end, you will generate a plot similar to that figure.

a) Write a function with the call signature ecdfvals(data), which takes a one-dimensional Numpy array (or Pandas Series; the same construction of your function will work for both) of data and returns the x and y values for plotting the ECDF in the “dots” style, as in Fig. 2a of the Gardner, Zanic, et al. paper. As a reminder,

ECDF(x) = fraction of data points ≤ x.

When you write this function, you may only use base Python and the standard library, in addition to Numpy and Pandas. (iqplot has this functionality built-in, but the point here is to build a more concrete understanding of what an ECDF is.)

b) Use the ecdfvals() function that you wrote to plot the ECDFs shown in Fig. 2a of the Gardner, Zanic, et al. paper. By looking this plot, do you think that the fluorescent labeling makes a difference in the onset of catastrophe? (We will do a more careful statistical inference later in the workshop, but for now, does it pass the eye test? Eye tests are an important part of EDA.) You can access the data set here: https://s3.amazonaws.com/bebi103.caltech.edu/data/gardner_time_to_catastrophe_dic_tidy.csv