# HG changeset patch # User proteore # Date 1535623971 14400 # Node ID 33c9bd75882a533c1ce27855a0526b9f50610c93 # Parent b617d4bbebf894b4b1cf582254ce37aa5ca7062d planemo upload commit 1953798eb28b6e45c78342ed4c6a6a978d096fca diff -r b617d4bbebf8 -r 33c9bd75882a PathView.R --- a/PathView.R Mon Aug 27 11:21:34 2018 -0400 +++ b/PathView.R Thu Aug 30 06:12:51 2018 -0400 @@ -56,6 +56,9 @@ --expression_values3 Column containing expression values (third condition) --native_kegg TRUE : native KEGG graph, FALSE : Graphviz graph --species KEGG species (hsa, mmu, ...) + --pathways_input Tab with pathways in a column, output format of find_pathways + --pathway_col Column of pathways to use + --header2 Boolean, TRUE if header FALSE if not Example: ./PathView.R --input 'input.csv' --pathway_id '05412' --id_type 'uniprotID' --id_column 'c1' --header TRUE \n\n") @@ -108,7 +111,14 @@ #load("/home/dchristiany/proteore_project/ProteoRE/tools/pathview/args.Rda") ###setting variables -if (!is.null(args$pathways_id)) { ids <- sapply(rapply(strsplit(clean_bad_character(args$pathways_id),","),c), function(x) remove_kegg_prefix(x),USE.NAMES = FALSE)} +if (!is.null(args$pathways_id)) { + ids <- sapply(rapply(strsplit(clean_bad_character(args$pathways_id),","),c), function(x) remove_kegg_prefix(x),USE.NAMES = FALSE) +}else if (!is.null(args$pathways_input)){ + header2 <- str2bool(args$header2) + pathway_col <- as.numeric(gsub("c", "" ,args$pathway_col)) + pathways_file = read_file(args$pathways_input,header2) + ids <- sapply(rapply(strsplit(clean_bad_character(pathways_file[,pathway_col]),","),c), function(x) remove_kegg_prefix(x),USE.NAMES = FALSE) +} #if (!is.null(args$pathways_name)) {names <- as.vector(sapply(strsplit(args$pathways_name,","), function(x) concat_string(x),USE.NAMES = FALSE))} if (!is.null(args$id_list)) {id_list <- as.vector(strsplit(clean_bad_character(args$id_list),","))} id_type <- tolower(args$id_type) @@ -117,6 +127,10 @@ #output <- args$output native_kegg <- str2bool(args$native_kegg) species=args$species +#org list used in mapped2geneID +org <- c('Hs','Mm') +names(org) <- c('hsa','mmu') + #read input file or list @@ -140,7 +154,7 @@ if (id_type == "uniprotid") { uniprotID = tab[,ncol] - mapped2geneID = id2eg(ids = uniprotID, category = "uniprot", org = "Hs", pkg.name = NULL) + mapped2geneID = id2eg(ids = uniprotID, category = "uniprot", org = org[[species]], pkg.name = NULL) geneID = mapped2geneID[,2] tab = cbind(tab,geneID) @@ -188,6 +202,8 @@ #####mapping geneID (with or without expression values) on KEGG pathway +plot.col.key=!is.null(tab$e1) #if there's no exrepession data, we don't show the color key + for (id in ids) { pathview(gene.data = mat, #gene.idtype = "geneID", @@ -217,6 +233,8 @@ #high = list(gene = "red", cpd = "yellow"), #na.col = "transparent", #sign.pos="bottomleft", + plot.col.key = plot.col.key, + #high = "lightgreen", #key.pos="topright", #new.signature=TRUE, #rankdir="LB", diff -r b617d4bbebf8 -r 33c9bd75882a Pathview.xml --- a/Pathview.xml Mon Aug 27 11:21:34 2018 -0400 +++ b/Pathview.xml Thu Aug 30 06:12:51 2018 -0400 @@ -1,4 +1,4 @@ - + bioconductor-pathview @@ -11,10 +11,12 @@ --id_column="$input.ncol" --header="$input.header" #end if - #if $species.pathways.pathways_id == "pathways_ids" + #if $species.pathways.pathways_id != "pathways_file" --pathways_id="$species.pathways.pids" #else - --pathways_id="$species.pathways.pids" + --pathways_input="$species.pathways.file" + --header2="$species.pathways.header2" + --pathway_col="$species.pathways.ncol2" #end if --id_type="$id_type" --native_kegg="$native" @@ -36,6 +38,10 @@ ]]> + + + + @@ -55,8 +61,8 @@ - - + + @@ -81,11 +87,6 @@ - - - - - @@ -96,6 +97,7 @@ + @@ -106,7 +108,7 @@ - + @@ -117,6 +119,11 @@ + + + + + @@ -124,6 +131,7 @@ + @@ -134,7 +142,7 @@ - + @@ -145,6 +153,11 @@ + + + + + @@ -194,13 +207,17 @@