Lab#

Learning Objectives#

At the end of this learning activity you will be able to:

  • Practice creating statistical figures to answer biological questions.

  • Practice writing figure legends for statistical figures.

  • Practice writing descriptive reasonings about a figure.

Note: It is difficult to automatically grade figures as they are many “correct” answers. So, most questions will accept any figure or axis and then ask you to answer a question that should be obvious from a properly generated figure. For all questions, assume a 95% interval.

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns

%matplotlib inline
cell_level_data = pd.read_csv('pHrodo_DMEM.csv')
cell_level_data.head()

How full is each cell?#

The strategy of using the number of beads in a cell as our count is that it is impacted by the size of the cell. Small cells can only eat a few beads, large cells can eat many. To address this we’ll create a new measurement, the fraction of the cell containing beads. This way, small cells that are ‘stuffed’ with beads will beat out large cells with only a few beads.

For this analysis we’ll use:

  • ObjectAreaCh1 - The area of the entire cell.

  • SpotTotalAreaCh2 - The area of the cell containing beads.

Q1: Create an fraction_area_covered column#

Checked variables:

  • cell_level_data['fraction_area_covered'] - The fraction of the area of each cell covered by pH responsive beads

  • q1_plot - A barplot showing the mean area of each cell covered split by well.

Points

5

Public Checks

2

Hidden Tests

1

Points: 5

# What fraction of the cell's area is covered by phrodo beads

cell_level_data['fraction_area_covered'] = ...
# Create a barplot of the fraction_area_covered in each well
# Your answers should be between 0 and 1.

q1_plot = ...
grader.check("q1_area_covered")

Q2: Merge well_level_data with plate-map and visualize#

Checked variables:

  • plate_map - Reading the plate_map.csv file.

  • well_level_data - A pd.DataFrame where each well is an index (row) and has 3 columns, mean, sem, and count calculated from the fraction_area_covered of the cells in the well.

  • sample_level_data - A pd.DataFrame that is the merging of the plate_map and well_level_data.

  • q2a - Which experimental condition (pHrodo_conc_ug) had less noise in the measurement?

  • q2b- Does this graph show evidence that dopamine increases the percentage of the cell that contains beads?

  • q2_plot - Any plot that justifies your answers for q2a and q2b.

Points

5

Public Checks

2

Hidden Tests

1

Points: 5

# Load in plate map
plate_map = ...
# Group the cell level data by well and for each well calculate the mean, standard-error of the mean, and the number of cells

well_level_data = ...
well_level_data.head()
# Merge well_level_data with the platemap

sample_level_data = ...
sample_level_data.head()
### Visualize merged dataset
# Create any visualization which answers the questions below.
# Feel free to explore other functions like `lineplot` & `pointplot`.


q2_plot = ...
# Which experimental condition (pHrodo_conc_ug) had less noise in the measurement?
# Answer 5.0 or 7.5
q2a = ...

# Write your reasoning in a Markdown cell after this.
# Does this graph show evidence that dopamine increases 
# the percentage of the cell that contains beads?
# Anwser 'yes' or 'no'
q2b = ...

# Write your reasoning in a Markdown cell after this.
grader.check("q2_merge")

This week we explored how to summarize large datasets by sample. This aggregation is often important for downstream inferential tests like t-tests and ANOVAs. However, this technique also looses a significant amount of information; ~525 numbers are compressed to a single value. We will also explore more nuanced techniques like regression which allows us to use each of these points individually.


Submission#

Check:

  • That all tables and graphs are rendered properly.

  • Code completes without errors by using Restart & Run All.

  • All checks pass.

Then save the notebook and the File -> Download -> Download .ipynb. Upload this file to BBLearn.