comparison kegg_maps_visualization.R @ 8:ab697ebe0f41 draft

"planemo upload commit 7e03a2492a127f75ab5d896a8a9dd21d64f7890e-dirty"
author proteore
date Mon, 06 Jan 2020 16:26:09 +0000
parents f4e02d20546b
children 9ac0ade20b3f
comparison
equal deleted inserted replaced
7:940d787535a7 8:ab697ebe0f41
83 return(list) 83 return(list)
84 } 84 }
85 85
86 get_ref_pathways <- function(species){ 86 get_ref_pathways <- function(species){
87 ##all available pathways for the species 87 ##all available pathways for the species
88 pathways <-keggLink("pathway", species) 88 pathways <- keggLink("pathway", species)
89 tot_path<-unique(pathways) 89 tot_path <- unique(pathways)
90 90
91 ##formating the dat into a list object 91 ##formating the dat into a list object
92 ##key= pathway ID, value = genes of the pathway in the kegg format 92 ##key= pathway ID, value = genes of the pathway in the kegg format
93 pathways_list <- sapply(tot_path, function(pathway) names(which(pathways==pathway))) 93 pathways_list <- sapply(tot_path, function(pathway) names(which(pathways==pathway)))
94 return (pathways_list) 94 return (pathways_list)
236 header2 <- str2bool(args$header2) 236 header2 <- str2bool(args$header2)
237 pathway_col <- as.numeric(gsub("c", "" ,args$pathway_col)) 237 pathway_col <- as.numeric(gsub("c", "" ,args$pathway_col))
238 pathways_file = read_file(args$pathways_input,header2) 238 pathways_file = read_file(args$pathways_input,header2)
239 ids <- sapply(rapply(strsplit(clean_bad_character(pathways_file[,pathway_col]),","),c), function(x) remove_kegg_prefix(x),USE.NAMES = FALSE) 239 ids <- sapply(rapply(strsplit(clean_bad_character(pathways_file[,pathway_col]),","),c), function(x) remove_kegg_prefix(x),USE.NAMES = FALSE)
240 } 240 }
241 if (args$native_kegg) { ids <- ids[-grep("04215",ids)] }
241 pathways_list <- read_file(args$pathways_list,F) 242 pathways_list <- read_file(args$pathways_list,F)
242 if (!is.null(args$id_list)) { 243 if (!is.null(args$id_list)) {
243 id_list <- get_list_from_cp(args$id_list) 244 id_list <- get_list_from_cp(args$id_list)
244 } 245 }
245 id_type <- tolower(args$id_type) 246 id_type <- tolower(args$id_type)