Session Ready
Exercise

Compute cell coverage

To find genes that are expressed in each cell, we can look at the values in the cell's column in the counts matrix: if the read count for a gene is greater than 0, then the gene is expressed.

The cell coverage is the proportion of expressed genes for the cell. As we'll see later in the course, it is an important feature in scRNA-Seq. The aim of this exercise is to plot the cell coverage using ggplot2.

The counts matrix from the previous exercise is available for you in your workspace. We also created a dataframe cell_info whose names column contains the names of the cells.

Instructions
100 XP
  • Create a new column coverage of the dataframe cell_info that contains the cell coverage for each cell.

You can do that by identifying cells with positive counts and computing proportion of those cells column-wise using colMeans().

  • Load the ggplot2 package using library().

  • Use ggplot() to make a bar plot using the cell_info matrix, with the cell coverage on the y-axis and cell names on the x-axis.