-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDE_HEK_edgeR_TDP43_ADARv1.txt
51 lines (37 loc) · 1.16 KB
/
DE_HEK_edgeR_TDP43_ADARv1.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
43
44
45
46
47
48
49
50
51
#edgeR script
library("edgeR")
datafile <- file.path("DE_EGFPvTDP43-ADAR_filter.txt")
x <- read.delim(datafile,row.names="Gene")
group <- factor(c("control", "control", "treatment", "treatment"))
y <- DGEList(counts=x,group=group)
y <- calcNormFactors(y)
y <- estimateCommonDisp(y)
y <- estimateTagwiseDisp(y)
et <- exactTest(y)
topTags(et)
write.csv(as.data.frame(et$table), file="DE_TDP43_Adar_Apobec.txt")
# running glm based models
design <- model.matrix(~group)
y <- estimateGLMCommonDisp(y,design)
y <- estimateGLMTrendedDisp(y,design)
y <- estimateGLMTagwiseDisp(y,design)
fit <- glmFit(y,design)
lrt <- glmLRT(fit,coef=2)
topTags(lrt)
write.csv(as.data.frame(lrt$table), file="DE_TDP43_Adar_Apobec_result_edgeR_glm.txt")
jpeg("plotBCV_glm.jpg")
plotBCV(y)
dev.off()
jpeg("plotMDS.jpg")
plotMDS(y)
dev.off()
jpeg("plotSmear.jpg")
summary(de <- decideTestsDGE(lrt, adjust.method="BH", p.value=0.05))
detags <- rownames(y)[as.logical(de)]
plotSmear(lrt, de.tags=detags,ylim=c(-5,5))
abline(h=c(-1, 1), col="blue")
dev.off()
#-------------------------------------------------------------------------
#Useful to to look at this to study the data structure
head(cpm(y))
y