{ "cells": [ { "cell_type": "markdown", "id": "d635f4dd-0c4d-496b-af3e-bfbc7c04e39a", "metadata": {}, "source": [ "# Homework 1.3: Microtubule catastrophe and ECDFs (team problem, 35 pts)\n", "\n", "[Data set download](https://s3.amazonaws.com/bebi103.caltech.edu/data/gardner_time_to_catastrophe_dic_tidy.csv)\n", "\n", "
" ] }, { "cell_type": "markdown", "id": "82e9c39c-ab6d-4efe-8f38-870db77625ae", "metadata": {}, "source": [ "In a [future lesson](../../lessons/07/iqplot.iypnb), you will learn about **emprical cumulative distribution functions**, or ECDFs. These are useful ways to visualize how measured data are distributed. An ECDF evaluated at point _x_ is defined as\n", "\n", "ECDF(_x_) = fraction of data points ≤ _x_.\n", "\n", "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\n", "\n", "| x | y |\n", "|:------:|:---:|\n", "| –6.7 | 0.2 |\n", "| 1.1 | 0.4 |\n", "| 2.3 | 0.6 |\n", "| 2.3 | 0.8 |\n", "| 9.8 | 1.0 |\n", "\n", "In this problem, you will use you newly acquired skills using Numpy and Bokeh to compute ECDFs from a real data set and plot them.\n", "\n", "[Gardner, Zanic, and coworkers](http://dx.doi.org/10.1016/j.cell.2011.10.037) 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.\n", "\n", "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.\n", "\n", "**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, \n", "\n", "> ECDF(*x*) = fraction of data points ≤ x.\n", "\n", "When you write this function, you may only use base Python and the standard library, in addition to Numpy and Pandas.\n", "\n", "**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 course, but for now, does it pass the eye test? Eye tests are an important part of EDA, but certainly not an end point.) You can access the data set here: [https://s3.amazonaws.com/bebi103.caltech.edu/data/gardner_time_to_catastrophe_dic_tidy.csv](https://s3.amazonaws.com/bebi103.caltech.edu/data/gardner_time_to_catastrophe_dic_tidy.csv)" ] }, { "cell_type": "markdown", "id": "ef241587-1fd7-4ee1-b2ab-b0753362625e", "metadata": {}, "source": [ "
" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.11.5" } }, "nbformat": 4, "nbformat_minor": 5 }