From 20e0914170001eccb93290dade1900dd057f8830 Mon Sep 17 00:00:00 2001 From: Yuanhua Huang Date: Thu, 14 Sep 2023 17:37:59 +0800 Subject: [PATCH] Update 01-introR-exercises.Rmd --- notebooks/chapter1-R/01-introR-exercises.Rmd | 25 ++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/notebooks/chapter1-R/01-introR-exercises.Rmd b/notebooks/chapter1-R/01-introR-exercises.Rmd index 208ecb5..18054a7 100644 --- a/notebooks/chapter1-R/01-introR-exercises.Rmd +++ b/notebooks/chapter1-R/01-introR-exercises.Rmd @@ -101,6 +101,13 @@ Please try both the basic `plot()` function and `ggplot2`. * Q13: Now, manipulate the dataframe by adding two columns: - Add a column `log2FC_clip` for clipping log2FoldChange to `[-5, +5]` - Add a column `is_DE` for `padj < 0.05` + + + + + + + * Q14: Try the `summary()` function with the above `df_DEG` data frame, and also `table()` function for the `is_DE` column. @@ -149,12 +156,30 @@ simply Google and find examples. and multiply by 1000000, and assign it to a new matrix named `TF_mat_norm`. You may further consider transformation by log1p(), i.e., log(TF_mat_norm + 1). + + * Q21: calculate the log fold change on the first gene TP73 in `TF_mat_norm` between NPC (row 1 to 7) and NLH (row 8 to 10) and perform t-test return the `p` value and log fold change. + + + + + + * Q22: perform t-test on the *all* gene in `TF_mat_norm` between NPC (row 1 to 7) and NLH (row 8 to 10). *Hint*: think of for loop or `apply()` function. + + + + + + + + + +