Skip to content

Commit a1191a9

Browse files
authored
Merge pull request #40 from stemangiola/fix_plot_sizes
Change figure size from 40 to 70%
2 parents 227c4a1 + 0f73c04 commit a1191a9

File tree

3 files changed

+21
-21
lines changed

3 files changed

+21
-21
lines changed

vignettes/solutions.Rmd

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Questions:
1717

1818
Suggested answers are below. You might have some different code e.g. to customise the volcano plot as you like. Feel free to comment on any of these solutions in the workshop website as described [here](https://github.com/stemangiola/bioc_2020_tidytranscriptomics/blob/master/CONTRIBUTING.md).
1919

20-
```{r out.width = "40%", message=FALSE, warning=FALSE}
20+
```{r out.width = "70%", message=FALSE, warning=FALSE}
2121
# load libraries
2222
2323
# tidyverse core packages
@@ -67,7 +67,7 @@ Answer: PC1: 47%, PC2: 25%
6767

6868
What do PC1 and PC2 represent?
6969

70-
```{r out.width = "40%"}
70+
```{r out.width = "70%"}
7171
counts_scal_PCA %>%
7272
pivot_sample() %>%
7373
ggplot(aes(x=PC1, y=PC2, colour=condition, shape=type)) +
@@ -113,7 +113,7 @@ Answer: FBgn0025111
113113

114114
3. What code can generate a heatmap of variable genes (starting from count_scaled)?
115115

116-
```{r out.width = "40%"}
116+
```{r out.width = "70%"}
117117
counts_scaled %>%
118118
119119
# filter lowly abundant
@@ -134,7 +134,7 @@ counts_scaled %>%
134134

135135
4. What code can you use to visualise expression of the pasilla gene (gene id: FBgn0261552)
136136

137-
```{r out.width = "40%"}
137+
```{r out.width = "70%"}
138138
counts_scaled %>%
139139
140140
# extract counts for pasilla gene
@@ -150,7 +150,7 @@ counts_scaled %>%
150150

151151
5. What code can generate an interactive volcano plot that has gene ids showing on hover?
152152

153-
```{r out.width = "40%"}
153+
```{r out.width = "70%"}
154154
p <- counts_de %>%
155155
pivot_transcript() %>%
156156
@@ -177,7 +177,7 @@ Tip: You can use "text" instead of "label" if you don't want the column name to
177177

178178
6. What code can generate a heatmap of the top 100 DE genes?
179179

180-
```{r out.width = "40%"}
180+
```{r out.width = "70%"}
181181
top100 <-
182182
counts_de %>%
183183
pivot_transcript() %>%

vignettes/supplementary.Rmd

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ counts_tt %>%
6767

6868
We can also check how many counts we have for each sample by making a bar plot. This helps us see whether there are any major discrepancies between the samples more easily.
6969

70-
```{r out.width = "40%"}
70+
```{r out.width = "70%"}
7171
ggplot(counts_tt, aes(x=sample, weight=counts, fill=sample)) +
7272
geom_bar() +
7373
theme_bw()
@@ -77,14 +77,14 @@ As we are using ggplot2, we can also easily view by any other variable that's a
7777

7878
We can colour by dex treatment.
7979

80-
```{r out.width = "40%"}
80+
```{r out.width = "70%"}
8181
ggplot(counts_tt, aes(x=sample, weight=counts, fill=dex)) +
8282
geom_bar() +
8383
theme_bw()
8484
```
8585
We can colour by cell line.
8686

87-
```{r out.width = "40%"}
87+
```{r out.width = "70%"}
8888
ggplot(counts_tt, aes(x=sample, weight=counts, fill=cell)) +
8989
geom_bar() +
9090
theme_bw()
@@ -93,7 +93,7 @@ ggplot(counts_tt, aes(x=sample, weight=counts, fill=cell)) +
9393

9494
## How to examine normalised counts with boxplots
9595

96-
```{r out.width = "40%"}
96+
```{r out.width = "70%"}
9797
# scale counts
9898
counts_scaled <- counts_tt %>% scale_abundance(factor_of_interest = dex)
9999
@@ -111,7 +111,7 @@ counts_scaled %>%
111111

112112
## How to create MDS plot
113113

114-
```{r out.width = "40%"}
114+
```{r out.width = "70%"}
115115
airway %>%
116116
tidybulk() %>%
117117
scale_abundance(factor_of_interest=dex) %>%
@@ -126,7 +126,7 @@ airway %>%
126126

127127
MA plots enable us to visualise amount of expression (logCPM) versus logFC. Highly expressed genes are towards the right of the plot. We can also colour significant genes (e.g. genes with FDR < 0.05)
128128

129-
```{r out.width = "40%"}
129+
```{r out.width = "70%"}
130130
# perform differential testing
131131
counts_de <-
132132
counts_tt %>%
@@ -147,7 +147,7 @@ counts_de %>%
147147

148148
A more informative MA plot, integrating some of the packages in tidyverse.
149149

150-
```{r out.width = "40%", warning=FALSE}
150+
```{r out.width = "70%", warning=FALSE}
151151
counts_de %>%
152152
pivot_transcript() %>%
153153

vignettes/tidytranscriptomics.Rmd

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ Measuring gene expression on a genome-wide scale has become common practice over
9494

9595
There are many steps involved in analysing an RNA sequencing dataset. The main steps for a differential expression analysis are shown in the figure below. Sequenced reads are aligned to a reference genome, then the number of reads mapped to each gene can be counted. This results in a table of counts, which is what we perform statistical analyses on in R. While mapping and counting are important and necessary tasks, today we will be starting from the count data and showing how differential expression analysis can be performed in a friendly way using tidybulk.
9696

97-
```{r, echo=FALSE, out.width = "40%"}
97+
```{r, echo=FALSE, out.width = "70%"}
9898
knitr::include_graphics("../inst/vignettes/bioc2020tidybulkpipeline-01.png")
9999
```
100100

@@ -202,7 +202,7 @@ After we run `scale_abundance` we should see some columns have been added at the
202202

203203
We can visualise the difference of abundance densities before and after scaling. As tidybulk output is compatible with tidyverse, we can simply pipe it into standard tidyverse functions such as `filter`, `pivot_longer` and `ggplot`. We can also take advantage of ggplot's `facet_wrap` to easily create multiple plots.
204204

205-
```{r out.width = "40%"}
205+
```{r out.width = "70%"}
206206
counts_scaled %>%
207207
filter(!lowly_abundant) %>%
208208
pivot_longer(cols = c("counts", "counts_scaled"), names_to = "source", values_to = "abundance") %>%
@@ -302,7 +302,7 @@ counts_scal_PCA %>% pivot_sample()
302302

303303
We can now plot the reduced dimensions.
304304

305-
```{r out.width = "40%"}
305+
```{r out.width = "70%"}
306306
# PCA plot
307307
counts_scal_PCA %>%
308308
pivot_sample() %>%
@@ -319,7 +319,7 @@ The samples separate by treatment on PC1 which is what we hope to see. PC2 separ
319319

320320
An alternative to principal component analysis for examining relationships between samples is using hierarchical clustering. Heatmaps are a nice visualisation to examine hierarchical clustering of your samples. tidybulk has a simple function we can use, `keep_variable`, to extract the most variable genes which we can then plot with tidyHeatmap.
321321

322-
```{r out.width = "40%"}
322+
```{r out.width = "70%"}
323323
counts_scaled %>%
324324
325325
# filter lowly abundant
@@ -461,7 +461,7 @@ topgenes_symbols
461461

462462
Volcano plots are a useful genome-wide plot for checking that the analysis looks good. Volcano plots enable us to visualise the significance of change (p-value) versus the fold change (logFC). Highly significant genes are towards the top of the plot. We can also colour significant genes (e.g. genes with false-discovery rate < 0.05)
463463

464-
```{r out.width = "40%"}
464+
```{r out.width = "70%"}
465465
# volcano plot, minimal
466466
counts_de %>%
467467
filter(!lowly_abundant) %>%
@@ -474,7 +474,7 @@ counts_de %>%
474474

475475
A more informative plot, integrating some of the packages in tidyverse.
476476

477-
```{r out.width = "40%", warning=FALSE}
477+
```{r out.width = "70%", warning=FALSE}
478478
counts_de %>%
479479
pivot_transcript() %>%
480480
@@ -501,7 +501,7 @@ Before following up on the differentially expressed genes with further lab work,
501501

502502
With stripcharts we can see if replicates tend to group together and how the expression compares to the other groups. We'll also add a box plot to show the distribution.
503503

504-
```{r out.width = "40%"}
504+
```{r out.width = "70%"}
505505
strip_chart <-
506506
counts_scaled %>%
507507
@@ -525,7 +525,7 @@ A really nice feature of using tidyverse and ggplot2 is that we can make interac
525525

526526
We can also specify which parameters from the `aes` we want to show up when we hover over the plot with `tooltip`.
527527

528-
```{r, out.width = "40%", warning=FALSE}
528+
```{r, out.width = "70%", warning=FALSE}
529529
strip_chart %>% ggplotly(tooltip = c("label", "y"))
530530
```
531531

0 commit comments

Comments
 (0)