Skip to content

Commit

Permalink
Update 05 solutions
Browse files Browse the repository at this point in the history
  • Loading branch information
AshKernow committed Sep 26, 2024
1 parent 8dc8227 commit 3c41f3d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 93 deletions.
39 changes: 1 addition & 38 deletions Markdowns/05_Data_Exploration.Solutions.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ output:
html_document:
toc: yes
toc_float: yes
layout: page
---

### Data
Expand Down Expand Up @@ -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
Expand Down
74 changes: 19 additions & 55 deletions Markdowns/05_Data_Exploration.Solutions.html

Large diffs are not rendered by default.

Binary file modified Markdowns/05_Data_Exploration.Solutions.pdf
Binary file not shown.

0 comments on commit 3c41f3d

Please sign in to comment.