-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreturn_exp_table.R
27 lines (26 loc) · 2 KB
/
return_exp_table.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
y<-cbind("CIITA","CD74","HLA-DPA1","HLA-DPB1","HLA-DPB2","HLA-DQA1","HLA-DRB1","HLA-DRB5","HLA-DRB6","HLA-DRA","HLA-DMA","HLA-DMB ","CD274","B2M","KDM1A")
xl=subset(x,Risk=="0")
xh=subset(x,Risk=="1")
ret<-function(m){
ml <- round(log(quantile(xl[,k], probs = c(0.5)),2),2)
mh <- round(log(quantile(xh[,k], probs = c(0.5)),2),2)
p <- t.test(xl[,k],xh[,k])$p.value
stats <- cbind(m,ml,mh,p)
return(stats)
}
for (k in 1:ncol(y)){
m=y[1,k]
print(ret(m))
}
exp<-read.table("immu_genes2_exp")
x<-as.data.frame(t(exp))
rs<-read.table("metaunicox")
x$Risk <- as.character(rs$Risk_Scor_rg)
p<-ggplot(x, aes(x=Risk, y=CTLA4,fill=Risk),palette=c("red","blue")) +theme_classic() + scale_fill_manual(values=c("red","blue"))+stat_compare_means(comparisons = list(c("1","0")),method = "t.test",label = "p.signif", label.y=c(140000,150000))+ylab("CTLA4")+coord_cartesian(ylim=c(0, 200000))+geom_boxplot(outlier.shape = NA)
ggsave(paste("CTLA4",".pdf"),p)
p<-ggplot(x, aes(x=Risk, y=LAG3,fill=Risk),palette=c("red","blue")) +theme_classic() + scale_fill_manual(values=c("red","blue"))+stat_compare_means(comparisons = list(c("1","0")),method = "t.test",label = "p.signif",label.y=c(140000,150000))+ylab("LAG3")+coord_cartesian(ylim=c(0, 200000))+geom_boxplot(outlier.shape = NA)
ggsave(paste("LAG3",".pdf"),p)
p<-ggplot(x, aes(x=Risk, y=PDCD1,fill=Risk),palette=c("red","blue")) +theme_classic() + scale_fill_manual(values=c("red","blue"))+stat_compare_means(comparisons = list(c("1","0")),method = "t.test",label = "p.signif", label.y=c(140000,150000))+ylab("PDCD1")+coord_cartesian(ylim=c(0, 200000))+geom_boxplot(outlier.shape = NA)
ggsave(paste("PDCD1",".pdf"),p)
p<-ggplot(x, aes(x=Risk, y=PDCD1LG2,fill=Risk),palette=c("red","blue")) +theme_classic() + scale_fill_manual(values=c("red","blue"))+stat_compare_means(comparisons = list(c("1","0")),method = "t.test",label = "p.signif", label.y=c(140000,150000))+ylab("PDCD1LG2")+coord_cartesian(ylim=c(0, 200000))+geom_boxplot(outlier.shape = NA)
ggsave(paste("PDCD1LG2",".pdf"),p)