forked from cb4ds/DGE.Tools2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathedgeR_Notes.txt
42 lines (29 loc) · 1.03 KB
/
edgeR_Notes.txt
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
A typical edgeR analysis might look like the following. Here we assume there are four
RNA-Seq libraries in two groups, and the counts are stored in a tab-delimited text le, with gene symbols in a column called Symbol.
To perform quasi-likelihood F-tests:
> x <- read.delim("fileofcounts.txt",row.names="Symbol")
> group <- factor(c(1,1,2,2))
> y <- DGEList(counts=x,group=group)
> y <- calcNormFactors(y)
> design <- model.matrix(~group)
> y <- estimateDisp(y,design)
> fit <- glmQLFit(y,design)
> qlf <- glmQLFTest(fit,coef=2)
> topTags(qlf)
#JRT magrittr pipeline
#setup
group <- factor(exptdesign$ReplicateGroup)
design <- model.matrix(~group)
coef <- length(unique(group))
dgelist <- counts %>%
DGEList %>%
calcNormFactors(method="TMM") #make method an argument
fit <- estimateDisp(dgelist, design=design)
glmQLFit(design=design)
qlf_toptags <- glmQLFTest(fit, coef=coef) %>%
topTags(n=Inf, sort.by=NULL)
#Return the dgelist, fit and qlf_toptags
#1st look
plotMDS(dgelist, method="bcv")
#specific comparisons
et <- exactTest