Skip to content

Commit a403c8b

Browse files
committed
small updates to day 4
1 parent 438d5ad commit a403c8b

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

vignettes/day4_batcheffects-vis.Rmd

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,10 @@ plot(
146146
```{r eda1}
147147
library(GSE5859Subset)
148148
data(GSE5859Subset) ##this loads three tables
149-
c(class(geneExpression), class(sampleInfo))
150-
rbind(dim(geneExpression), dim(sampleInfo))
149+
class(geneExpression)
150+
dim(geneExpression)
151+
class(sampleInfo)
152+
dim(sampleInfo)
151153
head(sampleInfo)
152154
```
153155

@@ -165,7 +167,7 @@ Note that these 8,793 tests are done in about 0.01s
165167

166168
## Volcano plots: Example
167169

168-
```{r vp2, fig.height=3, fig.width=6}
170+
```{r vp2, echo = FALSE, fig.height=5, fig.width=5}
169171
par(mar = c(4, 4, 0, 0))
170172
plot(results$dm,
171173
-log10(results$p.value),
@@ -217,7 +219,7 @@ hist(permresults$p.value)
217219
## P-value histograms: Summary
218220

219221
- Give a quick look at how many significant p-values there may be
220-
- When using permuted labels, can exposes non-independence among the samples
222+
- When using permuted labels, can expose non-independence among the samples
221223
+ can be due to batch effects or family structure
222224
- Most common approaches for correcting batch effects are:
223225
+ `ComBat`: corrects for known batch effects by linear model), and
@@ -249,7 +251,7 @@ plot((geneExpression[, 1] + pseudo) / 2, (geneExpression[, 1] - pseudo))
249251
## Heatmaps
250252

251253
* Detailed representation of high-dimensional dataset.
252-
- `ComplexHeatmap` package is the best as of 2023: large datasets, interactive heatmaps, simple defaults but many customizations possible
254+
- `ComplexHeatmap` package is the best as of 2024: large datasets, interactive heatmaps, simple defaults but many customizations possible
253255

254256
```{r ma1, fig.width=12, echo=FALSE}
255257
suppressPackageStartupMessages(library(ComplexHeatmap))
@@ -271,7 +273,7 @@ Heatmap(ge, use_raster = FALSE, top_annotation = column_ha, right_annotation = r
271273

272274
## Heatmaps: Summary
273275

274-
- Clustering becomes slow and memory-intensivefor thousands of rows
276+
- Clustering becomes slow and memory-intensive for thousands of rows
275277
- probably too detailed for thousands of rows
276278
- can show co-expressed genes, groups of samples
277279

@@ -320,7 +322,7 @@ RColorBrewer::display.brewer.all(n = 7)
320322
```{r ge, message=FALSE}
321323
library(Biobase)
322324
library(genefilter)
323-
library(GSE5859) ## BiocInstaller::biocLite("genomicsclass/GSE5859")
325+
library(GSE5859)
324326
data(GSE5859)
325327
geneExpression = exprs(e)
326328
sampleInfo = pData(e)
@@ -347,6 +349,9 @@ table(year, sampleInfo$ethnicity)
347349

348350
```{r ge4, cache=TRUE, warning=FALSE}
349351
pc <- prcomp(t(geneExpression), scale. = TRUE)
352+
```
353+
354+
```{r, echo=FALSE, warning=FALSE}
350355
boxplot(
351356
pc$x[, 1] ~ month,
352357
varwidth = TRUE,
@@ -419,7 +424,7 @@ table(hcclass, year)
419424

420425
## Exercises
421426

422-
* OSCA Multi-sample [Chapter 1: Correcting batch effects](http://bioconductor.org/books/3.17/OSCA.multisample/integrating-datasets.html)
427+
* OSCA Multi-sample [Chapter 1: Correcting batch effects](http://bioconductor.org/books/release/OSCA.multisample/integrating-datasets.html)
423428

424429
## Links
425430

0 commit comments

Comments
 (0)