From 3c41f3daf04a4f78b9c2cab074ac937c0799b047 Mon Sep 17 00:00:00 2001 From: Ashley Sawle Date: Thu, 26 Sep 2024 12:47:20 +0100 Subject: [PATCH] Update 05 solutions --- Markdowns/05_Data_Exploration.Solutions.Rmd | 39 +--------- Markdowns/05_Data_Exploration.Solutions.html | 74 +++++-------------- Markdowns/05_Data_Exploration.Solutions.pdf | Bin 183662 -> 160561 bytes 3 files changed, 20 insertions(+), 93 deletions(-) diff --git a/Markdowns/05_Data_Exploration.Solutions.Rmd b/Markdowns/05_Data_Exploration.Solutions.Rmd index bf81d75..9366b13 100644 --- a/Markdowns/05_Data_Exploration.Solutions.Rmd +++ b/Markdowns/05_Data_Exploration.Solutions.Rmd @@ -8,7 +8,6 @@ output: html_document: toc: yes toc_float: yes -layout: page --- ### Data @@ -45,43 +44,7 @@ rlogcounts <- rlog(filtCounts) pcDat <- prcomp(t(rlogcounts)) ``` -### Exercise 1 -> -> We have loaded in the raw counts here. These are what we need for the -> differential expression analysis. For other investigations we might want -> counts normalised to library size. `tximport` allows us to import -> "transcript per million" (TPM) scaled counts instead. -> -> 1. Create a new object called `tpm` that contains length scaled TPM -> counts. You will need to add an extra argument to the command. Use the help -> page to determine how you need to change the code: `?tximport`. - -```{r, solutionExercise1} -tpm <- tximport(files, type = "salmon", tx2gene = tx2gene, - countsFromAbundance = "lengthScaledTPM") -``` - -### Exercise 2 -> -> 1. Use the `DESeq2` function `rlog` to transform the count data. This function -> also normalises for library size. -> 2. Plot the count distribution boxplots with this data. -> How has this effected the count distributions? - -```{r, message=FALSE} -rlogcounts <- rlog(filtCounts) - -# Check distributions of samples using boxplots -boxplot(rlogcounts, - xlab="", - ylab="Log2(Counts)", - las=2, - col=statusCols) -# Let's add a blue horizontal line that corresponds to the median logCPM -abline(h=median(as.matrix(rlogcounts)), col="blue") -``` - -### Exercise 3 +### Exercise > > The plot we have generated shows us the first two principle components. This > shows us the relationship between the samples according to the two greatest diff --git a/Markdowns/05_Data_Exploration.Solutions.html b/Markdowns/05_Data_Exploration.Solutions.html index 3090903..7d842fb 100644 --- a/Markdowns/05_Data_Exploration.Solutions.html +++ b/Markdowns/05_Data_Exploration.Solutions.html @@ -14,7 +14,7 @@ Introduction to Bulk RNAseq data analysis - + @@ -29,7 +29,7 @@ h6 {font-size: 12px;} code {color: inherit; background-color: rgba(0, 0, 0, 0.04);} pre:not([class]) { background-color: white } - + @@ -63,6 +63,7 @@ +