comparison PathView.R @ 9:560541195c3f draft

planemo upload commit 30488ad6185a754fd69dc983eddd171f615d26fb-dirty
author proteore
date Wed, 12 Sep 2018 10:21:26 -0400
parents 33c9bd75882a
children e8d6e50f5d38
comparison
equal deleted inserted replaced
8:33c9bd75882a 9:560541195c3f
104 return(string) 104 return(string)
105 } 105 }
106 106
107 args <- get_args() 107 args <- get_args()
108 108
109 ###save and load args in rda file for testing
110 #save(args,file="/home/dchristiany/proteore_project/ProteoRE/tools/pathview/args.Rda")
111 #load("/home/dchristiany/proteore_project/ProteoRE/tools/pathview/args.Rda")
112
113 ###setting variables 109 ###setting variables
114 if (!is.null(args$pathways_id)) { 110 if (!is.null(args$pathways_id)) {
115 ids <- sapply(rapply(strsplit(clean_bad_character(args$pathways_id),","),c), function(x) remove_kegg_prefix(x),USE.NAMES = FALSE) 111 ids <- sapply(rapply(strsplit(clean_bad_character(args$pathways_id),","),c), function(x) remove_kegg_prefix(x),USE.NAMES = FALSE)
116 }else if (!is.null(args$pathways_input)){ 112 }else if (!is.null(args$pathways_input)){
117 header2 <- str2bool(args$header2) 113 header2 <- str2bool(args$header2)
200 #mat <- exp1[1:nrow(tab)] 196 #mat <- exp1[1:nrow(tab)]
201 #names(mat) <- geneID 197 #names(mat) <- geneID
202 198
203 199
204 #####mapping geneID (with or without expression values) on KEGG pathway 200 #####mapping geneID (with or without expression values) on KEGG pathway
205 plot.col.key=!is.null(tab$e1) #if there's no exrepession data, we don't show the color key 201 plot.col.key= TRUE
202 low_color = "green"
203 mid_color = "#F3F781" #yellow
204 high_color = "red"
205 if (is.null(tab$e1)) {
206 plot.col.key= FALSE #if there's no exrepession data, we don't show the color key
207 high_color = "#81F7F3" #blue
208 }
206 209
207 for (id in ids) { 210 for (id in ids) {
208 pathview(gene.data = mat, 211 pathview(gene.data = mat,
209 #gene.idtype = "geneID",
210 #cpd.data = uniprotID,
211 #cpd.idtype = "uniprot",
212 pathway.id = id, 212 pathway.id = id,
213 #pathway.name = "",
214 species = species, 213 species = species,
215 kegg.dir = ".", 214 kegg.dir = ".",
216 gene.idtype = "entrez", 215 gene.idtype = "entrez",
217 #gene.annotpkg = NULL,
218 #min.nnodes = 3,
219 kegg.native = native_kegg, 216 kegg.native = native_kegg,
220 #map.null = TRUE, 217 low = list(gene = low_color, cpd = "blue"),
221 #expand.node = FALSE, 218 mid = list(gene = mid_color, cpd = "transparent"),
222 #split.group = FALSE, 219 high = list(gene = high_color, cpd = "yellow"),
223 #map.symbol = TRUE, 220 na.col="#A4A4A4", #gray
224 #map.cpdname = TRUE, 221 cpd.data=NULL,
225 #node.sum = "sum",
226 #discrete=list(gene=FALSE,cpd=FALSE),
227 #limit = list(gene = 1, cpd = 1),
228 #bins = list(gene = 10, cpd = 10),
229 #both.dirs = list(gene = T, cpd = T),
230 #trans.fun = list(gene = NULL, cpd = NULL),
231 #low = list(gene = "green", cpd = "blue"),
232 #mid = list(gene = "gray", cpd = "gray"),
233 #high = list(gene = "red", cpd = "yellow"),
234 #na.col = "transparent",
235 #sign.pos="bottomleft",
236 plot.col.key = plot.col.key, 222 plot.col.key = plot.col.key,
237 #high = "lightgreen",
238 #key.pos="topright",
239 #new.signature=TRUE,
240 #rankdir="LB",
241 #cex=0.3,
242 #text.width=15,
243 #res=300,
244 pdf.size=c(9,9)) 223 pdf.size=c(9,9))
245 #is.signal=TRUE)
246 } 224 }
247 225
248 ########using keggview.native 226 ########using keggview.native
249 227
250 #xml.file=system.file("extdata", "hsa00010.xml", package = "pathview") 228 #xml.file=system.file("extdata", "hsa00010.xml", package = "pathview")