choose.dir()
choose.files()
datapath<-"F:\\Web_develop\\PHPnow-1.5.6\\htdocs\\RABC\\Public\\data\\alldata\\geneSymbol\\mRNA\\GSE1919_1\\KEGGenrich_GSE1919_1.txt"
go_all<-read.delim(datapath)
go_enrich_df<-go_all[go_all$ONTOLOGY=="KEGG",][1:shownum,]
shownum<-10
go_enrich_df<-go_all[go_all$ONTOLOGY=="KEGG",][1:shownum,]
go_enrich_df$Description <- factor(go_enrich_df$Description,levels=unique(go_enrich_df$Description))
View(go_enrich_df)
go_enrich_df$number <- factor(rev(1:nrow(go_enrich_df)))
go_enrich_df <- na.omit(go_enrich_df)
p1 <- ggplot(data=go_enrich_df, aes(x=Description, y=Count)) +
geom_bar(stat="identity", width=0.8) + coord_flip() +
scale_fill_manual() + theme_test() +
xlab("KEGG term") +
theme(axis.text=element_text(face = "bold", color="gray50")) +
labs(title = "RABC Enriched KEGG Terms ",ID)
require(DOSE)
require(clusterProfiler)
require(org.Hs.eg.db)
library(ggplot2)
library(stringr)
library(GOplot)
p1 <- ggplot(data=go_enrich_df, aes(x=Description, y=Count)) +
geom_bar(stat="identity", width=0.8) + coord_flip() +
scale_fill_manual() + theme_test() +
xlab("KEGG term") +
theme(axis.text=element_text(face = "bold", color="gray50")) +
labs(title = "RABC Enriched KEGG Terms ",ID)
datapath
ID<-GSE1919_1
ID<-"GSE1919_1"
p1 <- ggplot(data=go_enrich_df, aes(x=Description, y=Count)) +
geom_bar(stat="identity", width=0.8) + coord_flip() +
scale_fill_manual() + theme_test() +
xlab("KEGG term") +
theme(axis.text=element_text(face = "bold", color="gray50")) +
labs(title = "RABC Enriched KEGG Terms ",ID)
p1
p1 <- ggplot(data=go_enrich_df, aes(x=Description, y=Count)) +
geom_bar(stat="identity", width=0.8) + coord_flip() +
scale_fill_manual("#d77a61") + theme_test() +
xlab("KEGG term") +
theme(axis.text=element_text(face = "bold", color="gray50")) +
labs(title = "RABC Enriched KEGG Terms ",ID)
p1
p1 <- ggplot(data=go_enrich_df, aes(x=Description, y=Count)) +
geom_bar(stat="identity", width=0.8) + coord_flip() +
scale_fill_manual(c("#d77a61")) + theme_test() +
xlab("KEGG term") +
theme(axis.text=element_text(face = "bold", color="gray50")) +
labs(title = "RABC Enriched KEGG Terms ",ID)
p1
p1 <- ggplot(data=go_enrich_df, aes(x=Description, y=Count)) +
geom_bar(stat="identity", width=0.8) + coord_flip() +
theme_test() +
xlab("KEGG term") +
theme(axis.text=element_text(face = "bold", color="gray50")) +
labs(title = "RABC Enriched KEGG Terms ",ID)
p1
p1 <- ggplot(data=go_enrich_df, aes(x=Description, y=Count,fill="#d77a61")) +
geom_bar(stat="identity", width=0.8) + coord_flip() +
theme_test() +
xlab("KEGG term") +
theme(axis.text=element_text(face = "bold", color="gray50")) +
labs(title = "RABC Enriched KEGG Terms ",ID)
p1
p1 <- ggplot(data=go_enrich_df, aes(x=Description, y=Count)) +
geom_bar(stat="identity", width=0.8, color="#d77a61") + coord_flip() +
theme_test() +
xlab("KEGG term") +
theme(axis.text=element_text(face = "bold", color="gray50")) +
labs(title = "RABC Enriched KEGG Terms ",ID)
p1
p1 <- ggplot(data=go_enrich_df, aes(x=Description, y=Count)) +
geom_bar(stat="identity", width=0.8, fill="#d77a61") + coord_flip() +
theme_test() +
xlab("KEGG term") +
theme(axis.text=element_text(face = "bold", color="gray50")) +
labs(title = "RABC Enriched KEGG Terms ",ID)
p1
bar_path<-str_c(picpath,"/keggbar_",ID,".png")
#
go_enrich_df$genenum = as.numeric(str_split_fixed(go_enrich_df$GeneRatio,'/',2)[,2])
p2<-ggplot(go_enrich_df,aes(Count/genenum,Description))+
geom_point(aes(size=Count,color=p.adjust))+
scale_colour_gradient(low="#718355",high="red",
guide = guide_colorbar(reverse = TRUE))+
labs(x="GeneRatio",title = str_c("RABC Enriched KEGG_",ID))+
theme_bw()+
theme(axis.text = element_text(size=12),
axis.title = element_text(size = 14))+
facet_grid(ONTOLOGY~., scale="free")
p2
choose.files()
datapath<-"F:\\Web_develop\\PHPnow-1.5.6\\htdocs\\RABC\\Public\\data\\alldata\\geneSymbol\\mRNA\\GSE100191\\GOenrich_GSE100191.txt"
datapath<-"F:\\Web_develop\\PHPnow-1.5.6\\htdocs\\RABC\\Public\\data\\alldata\\geneSymbol\\mRNA\\GSE100191\\GOenrich_GSE100191.txt"
go_all<-read.delim(datapath)
go_MF<-go_all[go_all$ONTOLOGY=="MF",][1:shownum,]
shownum<-10
go_MF<-go_all[go_all$ONTOLOGY=="MF",][1:shownum,]
go_CC<-go_all[go_all$ONTOLOGY=="CC",][1:shownum,]
go_BP<-go_all[go_all$ONTOLOGY=="BP",][1:shownum,]
go_enrich_df<-rbind(go_BP,go_CC,go_MF)
go_enrich_df$Description <- factor(go_enrich_df$Description,levels=unique(go_enrich_df$Description))
go_enrich_df$type<-factor(c(rep("biological process", shownum), rep("cellular component", shownum),rep("molecular function",shownum)),levels=c("molecular function", "cellular component", "biological process"))
go_enrich_df$number <- factor(rev(1:nrow(go_enrich_df)))
go_enrich_df <- na.omit(go_enrich_df)
CPCOLS <- c("#3d405b", "#81b29a", "#f2cc8f")
p1 <- ggplot(data=go_enrich_df, aes(x=Description, y=Count, fill=type)) +
geom_bar(stat="identity", width=0.8) + coord_flip() +
scale_fill_manual(values = CPCOLS) + theme_test() +
xlab("GO term") +
theme(axis.text=element_text(face = "bold", color="gray50")) +
labs(title = "RABC Enriched GO Terms ",ID)
ID<-2134
p1 <- ggplot(data=go_enrich_df, aes(x=Description, y=Count, fill=type)) +
geom_bar(stat="identity", width=0.8) + coord_flip() +
scale_fill_manual(values = CPCOLS) + theme_test() +
xlab("GO term") +
theme(axis.text=element_text(face = "bold", color="gray50")) +
labs(title = "RABC Enriched GO Terms ",ID)
p1
datapath<-"F:/Web_develop/PHPnow-1.5.6/htdocs/RABC/public/data/alldata/geneSymbol/mRNA/"
ID<-"GSE100191"
#ggplot bar
datapath<-str_c(path,ID,"/GOenrich_", ID, ".txt")
path
path<-datapath
#ggplot bar
datapath<-str_c(path,ID,"/GOenrich_", ID, ".txt")
datapath
go_all<-read.delim(datapath)
go_MF<-go_all[go_all$ONTOLOGY=="MF",][1:shownum,]
go_CC<-go_all[go_all$ONTOLOGY=="CC",][1:shownum,]
shownum=10
go_MF<-go_all[go_all$ONTOLOGY=="MF",][1:shownum,]
go_CC<-go_all[go_all$ONTOLOGY=="CC",][1:shownum,]
go_BP<-go_all[go_all$ONTOLOGY=="BP",][1:shownum,]
go_enrich_df<-rbind(go_BP,go_CC,go_MF)
go_enrich_df$Description <- factor(go_enrich_df$Description,levels=unique(go_enrich_df$Description))
go_enrich_df$type<-factor(c(rep("biological process", shownum), rep("cellular component", shownum),rep("molecular function",shownum)),levels=c("molecular function", "cellular component", "biological process"))
go_enrich_df$number <- factor(rev(1:nrow(go_enrich_df)))
go_enrich_df <- na.omit(go_enrich_df)
CPCOLS <- c("#3d405b", "#81b29a", "#f2cc8f")
p1 <- ggplot(data=go_enrich_df, aes(x=Description, y=Count, fill=type)) +
geom_bar(stat="identity", width=0.8) + coord_flip() +
scale_fill_manual(values = CPCOLS) + theme_test() +
xlab("GO term") +
theme(axis.text=element_text(face = "bold", color="gray50")) +
labs(title = "RABC Enriched GO Terms ",ID)
p1
picpath<-"F:/Web_develop/PHPnow-1.5.6/htdocs/RABC/public/data/alldata/geneSymbol/mRNA/ F:/Web_develop/PHPnow-1.5.6/htdocs/RABC/public/data/dataset/enrich-go"
bar_path<-str_c(picpath,"/gobar_",ID,".png")
ggsave(plot = p1, filename = bar_path, width = 15, height =10 )
library(ggplot2)
ggsave(plot = p1, filename = bar_path, width = 15, height =10 )
bar_path
View(go_MF)
View(go_all)
