-
Notifications
You must be signed in to change notification settings - Fork 0
/
profile.r
77 lines (69 loc) · 2.77 KB
/
profile.r
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
setwd("F:/R_wenjian/deeptools/profile/")
library(ggplot2)
library(openxlsx)
library(reshape2)
#klf5_repress
rm(list=ls())
data <- t(read.xlsx("klf5_depend.xlsx", rowNames = TRUE, colNames = FALSE))
#rownames(data) <- seq(-3000, 2990, 10)
#wt_tmp <- data[c(201:401), c(5:10)]
#kras_tmp <- data[c(201:401), c(11:16)]
rownames(data) <- seq(-3000, 2990, 10)
wt_tmp <- data[, c(5:10)]
kras_tmp <- data[, c(11:16)]
D0_WT <- rowMeans(wt_tmp[, c(1:2)])
D2_WT <- rowMeans(wt_tmp[, c(3:4)])
D7_WT <- rowMeans(wt_tmp[, c(5:6)])
D0_Kras <- rowMeans(kras_tmp[, c(1:2)])
D2_Kras <- rowMeans(kras_tmp[, c(3:4)])
D7_Kras <- rowMeans(kras_tmp[, c(5:6)])
wt <- data.frame(D0_WT, D2_WT, D7_WT)
#wt <- wt[c(1:600), ]
wt <- apply(wt, 2, function(x) (x-min(x)))
wt <- as.data.frame(wt)
wt$bin <- as.numeric(rownames(wt))
wt_mat <- melt(wt, id = "bin")
names(wt_mat)[2] <- "sample"
pdf("kras_repress_wt.pdf")
ggplot(wt_mat, aes(x = bin, y = value, color = sample)) + geom_line(size = 1) +
theme_bw() + theme(panel.grid.major=element_blank(),panel.grid.minor=element_blank()) +
xlab("peaks center") + ylab("ATAC-seq intensity") + scale_x_continuous(breaks=c(-3000, 3000), labels = c("-3kb", "3kb"))
dev.off()
###ks_test
test1<-ks.test(wt[50:150,2],wt[50:150,1])
test2<-ks.test(wt[50:150,3],wt[50:150,2])
test3<-ks.test(wt[50:150,3],wt[50:150,1])
max(wt[50:150,2])/max(wt[50:150,1])
max(wt[50:150,3])/max(wt[50:150,2])
max(wt[50:150,3])/max(wt[50:150,1])
test1<-ks.test(wt[201:401,2],wt[201:401,1])
test2<-ks.test(wt[201:401,3],wt[201:401,2])
test3<-ks.test(wt[201:401,3],wt[201:401,1])
max(wt[201:401,2])/max(wt[201:401,1])
max(wt[201:401,3])/max(wt[201:401,2])
max(wt[201:401,3])/max(wt[201:401,1])
###klf5_kras mutation
kras <- data.frame(D0_Kras, D2_Kras, D7_Kras)
#kras <- kras[c(1:600), ]
kras <- apply(kras, 2, function(x) (x-min(x)))
kras <- as.data.frame(kras)
kras$bin <- as.numeric(rownames(kras))
kras_mat <- melt(kras, id = "bin")
names(kras_mat)[2] <- "sample"
pdf("kras_repress_kras_mu.pdf")
ggplot(kras_mat, aes(x = bin, y = value, color = sample)) + geom_line(size = 1) +
theme_bw() + theme(panel.grid.major=element_blank(),panel.grid.minor=element_blank()) +
xlab("peaks center") + ylab("ATAC-seq intensity") + scale_x_continuous(breaks=c(-3000, 3000), labels = c("-3.0kb", "3.0kb"))
dev.off()
test1<-ks.test(kras[50:150,2],kras[50:150,1])
test2<-ks.test(kras[50:150,3],kras[50:150,2])
test3<-ks.test(kras[50:150,3],kras[50:150,1])
max(kras[50:150,2])/max(kras[50:150,1])
max(kras[50:150,3])/max(kras[50:150,2])
max(kras[50:150,3])/max(kras[50:150,1])
test1<-ks.test(kras[201:401,2],kras[201:401,1])
test2<-ks.test(kras[201:401,3],kras[201:401,2])
test3<-ks.test(kras[201:401,3],kras[201:401,1])
max(kras[201:401,2])/max(kras[201:401,1])
max(kras[201:401,3])/max(kras[201:401,2])
max(kras[201:401,3])/max(kras[201:401,1])