-
Notifications
You must be signed in to change notification settings - Fork 28
/
450k-and-epic.rmd
96 lines (74 loc) · 2.66 KB
/
450k-and-epic.rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
```{r 450k-and-epic-init, echo=FALSE, message=F}
library(knitr)
library(Cairo)
opts_chunk$set(warning=FALSE, fig.width=6, fig.height=6, dev="CairoPNG", stop=TRUE)
library(GEOquery)
```
# Normalize a 450k/EPIC dataset
## Download example data sets
```{r child = 'dataset-450k-demo.rmd'}
```
```{r}
path.450k <- download.450k.demo.dataset()
```
```{r child = 'dataset-epic-demo.rmd'}
```
```{r}
path.epic <- download.epic.demo.dataset()
```
## Normalize dataset
Create samplesheet
```{r}
library(meffil)
options(mc.cores=10)
samplesheet.epic <- meffil.read.samplesheet(path.epic, pattern="Demo_SampleSheet.csv")
samplesheet.450k <- meffil.create.samplesheet(path.450k)[1:10,]
common.columns <- intersect(colnames(samplesheet.epic), colnames(samplesheet.450k))
samplesheet <- rbind(samplesheet.epic[,common.columns],
samplesheet.450k[,common.columns])
```
Parameters.
```{r}
qc.file <- "450k-and-epic/qc-report.html"
author <- "Illumina, et al. and Prickett, et al."
study <- "Normalizing EPIC and 450K microarrays together"
number.pcs <- 5
norm.file <- "450k-and-epic/normalization-report.html"
cell.type.reference <- "blood gse35069"
featureset <- "common" ## select a featureset compatible with both 450k and epic
```
Generate quality control objects.
```{r 450k-and-epic-qc, cache=T}
qc.objects <- meffil.qc(samplesheet, cell.type.reference=cell.type.reference,
featureset=featureset, verbose=T)
```
QC report.
```{r}
qc.summary <- meffil.qc.summary(qc.objects, verbose=T)
meffil.qc.report(qc.summary,
output.file=qc.file,
author=author,
study=study)
```
Normalize dataset.
```{r 450k-and-epic-norm, cache=T}
norm.objects <- meffil.normalize.quantiles(qc.objects, number.pcs=number.pcs, verbose=T)
norm.dataset <- meffil.normalize.samples(norm.objects,
just.beta=F,
cpglist.remove=qc.summary$bad.cpgs$name,
verbose=T)
```
Normalization report.
```{r}
beta <- meffil.get.beta(norm.dataset$M, norm.dataset$U)
pcs <- meffil.methylation.pcs(beta, sites=meffil.get.autosomal.sites("common"), verbose=T)
parameters <- meffil.normalization.parameters(norm.objects)
parameters$batch.threshold <- 0.01
norm.summary <- meffil.normalization.summary(norm.objects=norm.objects,
pcs=pcs,
parameters=parameters, verbose=T)
meffil.normalization.report(norm.summary,
output.file=norm.file,
author=author,
study=study)
```