Skip to content

Commit eae13d3

Browse files
author
Tom Smith
authored
Merge pull request #7 from bioinformatics-core-shared-training/ts_update_06_07
removes %>% explanation, uses file.path in place of str_c and minor tweak to associated slides.
2 parents 7145092 + 1491fe5 commit eae13d3

6 files changed

+37
-33
lines changed

Markdowns/06_Introduction_to_RNAseq_Analysis_in_R.Rmd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
---
22
title: "Introduction to RNAseq analysis in R"
3-
date: "April 2021"
3+
date: "May 2022"
44
output:
55
ioslides_presentation:
66
css: css/stylesheet.css
77
logo: images/CRUK_Cambridge_Institute.png
88
smaller: yes
99
widescreen: yes
10-
beamer_presentation: default
1110
slidy_presentation: default
1211
---
1312
<!--
@@ -131,7 +130,8 @@ Length, GC content, sequence
131130
margin-left: 27%">
132131
<span style="color: #2e3192;">**Library composition**</span>
133132

134-
Highly expressed genes overrepresented at the cost of lowly expressed genes
133+
Quantification is relative - changes in
134+
relative abundance for one gene will affect the relative abundances of other genes
135135

136136
"Composition Bias"
137137

Markdowns/06_Introduction_to_RNAseq_Analysis_in_R.html

Lines changed: 11 additions & 7 deletions
Large diffs are not rendered by default.

Markdowns/07_Data_Exploration.Rmd

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,7 @@ need for the analysis today: name, cell type, status.
8282
```{r loadSampleInfo, message = FALSE}
8383
# Read the sample information into a data frame
8484
sampleinfo <- read_tsv("data/samplesheet.tsv", col_types = c("cccc"))
85-
sampleinfo %>%
86-
arrange(Status, TimePoint, Replicate)
85+
arrange(sampleinfo, Status, TimePoint, Replicate)
8786
```
8887

8988
## Reading in the count data
@@ -102,9 +101,8 @@ The Salmon quantification results are per transcript, we'll want to summarise
102101
to gene level. To this we need a table that relates transcript IDs to gene IDs.
103102

104103
```{r readSalmon}
105-
files <- str_c("salmon/", sampleinfo$SampleName, "/quant.sf")
104+
files <- file.path("salmon", sampleinfo$SampleName, "quant.sf")
106105
files <- set_names(files, sampleinfo$SampleName)
107-
108106
tx2gene <- read_tsv("references/tx2gene.tsv")
109107
110108
txi <- tximport(files, type = "salmon", tx2gene = tx2gene)
@@ -138,8 +136,7 @@ saveRDS(txi, file = "salmon_outputs/txi.rds")
138136
One of the most complex aspects of learning to work with data in `R` is
139137
getting to grips with subsetting and manipulating data tables. The package
140138
`dplyr` [@Wickham2018] was developed to make this process more intuitive than it
141-
is using standard base `R` processes. It also makes use of a new symbol `%>%`,
142-
called the "pipe", which makes the code a bit tidier.
139+
is using standard base `R` processes.
143140

144141
In particular we will use the commands:
145142

Markdowns/07_Data_Exploration.Solutions.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ library(ggfortify)
2525
# Read the sample information into R
2626
sampleinfo <- read_tsv("data/samplesheet.tsv", col_types = c("cccc"))
2727
# Read the data into R
28-
files <- str_c("salmon/", sampleinfo$SampleName, "/quant.sf")
28+
files <- file.path("salmon", sampleinfo$SampleName, "quant.sf")
2929
files <- set_names(files, sampleinfo$SampleName)
3030
3131
tx2gene <- read_tsv("references/tx2gene.tsv")

Markdowns/07_Data_Exploration.html

Lines changed: 19 additions & 16 deletions
Large diffs are not rendered by default.

Markdowns/07_Data_Exploration.pdf

14.3 KB
Binary file not shown.

0 commit comments

Comments
 (0)