comparison GO-enrich.R @ 8:b29255864039 draft

planemo upload commit b636a89be85c5695c234abcf4960a731549ddd57-dirty
author proteore
date Fri, 21 Dec 2018 04:12:32 -0500
parents 4609346d8108
children 2f67202ffdb3
comparison
equal deleted inserted replaced
7:4609346d8108 8:b29255864039
150 # Parse arguments 150 # Parse arguments
151 parseArgs <- function(x) strsplit(sub("^--", "", x), "=") 151 parseArgs <- function(x) strsplit(sub("^--", "", x), "=")
152 argsDF <- as.data.frame(do.call("rbind", parseArgs(args))) 152 argsDF <- as.data.frame(do.call("rbind", parseArgs(args)))
153 args <- as.list(as.character(argsDF$V2)) 153 args <- as.list(as.character(argsDF$V2))
154 names(args) <- argsDF$V1 154 names(args) <- argsDF$V1
155
156 #save(args,file="/home/dchristiany/proteore_project/ProteoRE/tools/cluster_profiler/args.Rda")
157 #load("/home/dchristiany/proteore_project/ProteoRE/tools/cluster_profiler/args.Rda")
158
155 plot = unlist(strsplit(args$plot,",")) 159 plot = unlist(strsplit(args$plot,","))
156 go_represent=str2bool(args$go_represent) 160 go_represent=str2bool(args$go_represent)
157 go_enrich=str2bool(args$go_enrich) 161 go_enrich=str2bool(args$go_enrich)
158
159 #save(args,file="/home/dchristiany/proteore_project/ProteoRE/tools/cluster_profiler/args.Rda")
160 #load("/home/dchristiany/proteore_project/ProteoRE/tools/cluster_profiler/args.Rda")
161 162
162 suppressMessages(library(args$species, character.only = TRUE, quietly = TRUE)) 163 suppressMessages(library(args$species, character.only = TRUE, quietly = TRUE))
163 164
164 # Extract OrgDb 165 # Extract OrgDb
165 if (args$species=="org.Hs.eg.db") { 166 if (args$species=="org.Hs.eg.db") {
230 } 231 }
231 universe_header = str2bool(args$uheader) 232 universe_header = str2bool(args$uheader)
232 # Get file content 233 # Get file content
233 universe_file = read_file(universe_filename, universe_header) 234 universe_file = read_file(universe_filename, universe_header)
234 # Extract Protein IDs list 235 # Extract Protein IDs list
235 universe <- sapply(universe_file[,universe_ncol], function(x) rapply(strsplit(x,";"),c),USE.NAMES = FALSE) 236 universe <- unlist(sapply(universe_file[,universe_ncol], function(x) rapply(strsplit(x,";"),c),USE.NAMES = FALSE))
236 } 237 }
237 universe_id_type = args$universe_id_type 238 universe_id_type = args$universe_id_type
238 ##to initialize 239 ##to initialize
239 if (universe_id_type=="Uniprot" & any(check_ids(universe,"uniprot"))) { 240 if (universe_id_type=="Uniprot" & any(check_ids(universe,"uniprot"))) {
240 idFrom<-"UNIPROT" 241 idFrom<-"UNIPROT"