Session Ready
Exercise

Compute adjusted p-values

In the previous exercise, we performed J separate hypothesis tests where J is the number of genes. In a typical single cell analysis where J is about 10,000 and if we use a standard p-value cut-off of 0.05, we'd expect about 500 genes to be deemed significant just by chance. To correct for multiple testing, we want to calculate the adjusted p-values. To do so, we can to use the function p.adjust().

In this exercise, you'll use the object fit created in the previous exercise, which is of class data.table. The use of the package data.table is out of the scope of this course, but we need to use it here to calculate adjusted p-values.

Instructions
100 XP
  • Add a column padjusted to the table fit using the function p.adjust() with the fdr (false discovery rate) method to compute the adjusted p-values. Only alter the arguments of p.adjust().

  • Create a data.frame called res with the following columns: gene with the gene names, pvalue with the p-values (fit[,'Pr(>Chisq)']), padjusted with the adjusted p-values, and logFC with the log fold change.

  • Print head of res.