Skip to content

Commit 20569a4

Browse files
authored
Revise PCA function details and DGE analysis explanation
Updated instructions for PCA plot function and clarified statistical analysis for Differential Gene Expression.
1 parent 4d1b7eb commit 20569a4

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

week3/PCA_and_DGE.qmd

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ Based on these three genes, the PCs separate the samples quite well. However, th
172172
::: {#exr-PCA_plot_function}
173173
To see the effect of centering and scaling, complete the make_pca_plot function that performs PCA and plots the samples in PC1 and PC2 for different combinations of centering and scaling. Then plot it using the `patchwork` library to arrange the four plots in a 2x2 grid.
174174

175-
Add the make_pca_plot function to your rnaseq_functions.R script
175+
Add the `make_pca_plot()` function to your **rnaseq_functions.R** script
176176

177177
```{r}
178178
make_pca_plot <- function(logcounts, coldata, center, scale) {
@@ -271,7 +271,9 @@ ggplot(pca_df, aes(PC1, PC2, color = environmental_stress, shape = cluster)) +
271271
theme_bw()
272272
273273
```
274-
But what happens if you try different numbers of PCs?
274+
::: {#exr-clustering_different_PCs}
275+
Try out what happens if you try different numbers of top PCs than 10, does the clustering still match the treatments?
276+
:::
275277

276278
## Differential Gene Expression
277279
Up to now we have been doing true exploratory data analysis (EDA), looking at the data without a strong hypothesis. This is what is typically called unsupervised analysis. We only used the treatment information to interpret the results, not to guide the analysis. Now we will do a supervised analysis, where we take the sample information into account to do the analysis. The question we will address is: **For which genes does the expression significantly change in response to the stress treatments?**. As already mentioned on Monday, these genes are called Differentially Expressed Genes or DEG, and the analysis is called Differential Gene Expression or DGE. For this we group samples based on their treatment. For instance, all three samples that were only treated with heat are replicates of each other where we expect the same genes to be responding to the treatment. You may have noticed the term **significantly**, which implies we do a statistical test and get a *p*-value. The t-test is not appropriate for RNA-seq data, because these are discrete counts instead of continuous values. RNA-seq counts for a gene are generally assumed to follow a negative binomial distribution. Libraries like [edgeR](https://bioconductor.org/packages/devel/bioc/vignettes/edgeR/inst/doc/edgeRUsersGuide.pdf) are specifically developed to use the count information from the replicates to predict the mean and variance for the expression of a gene and use these in a statistical test comparing different treatments or time points. Below the code for this analysis, not need to understand every step.
@@ -351,4 +353,10 @@ draw.triple.venn(
351353
352354
```
353355

354-
Compare this with [figure 3A in the Suzuki et al paper](http://journals.plos.org/plosone/article/figure?id=10.1371/journal.pone.0147625.g003).
356+
::: {#exr-compare_venn_diagrams}
357+
Look at [figure 3A in the Suzuki et al paper](http://journals.plos.org/plosone/article/figure?id=10.1371/journal.pone.0147625.g003).
358+
359+
How do the Venn diagrams from the paper compare to this one?
360+
361+
What would be a good next comparison to make?
362+
:::

0 commit comments

Comments
 (0)