Mercurial > repos > proteore > proteore_pathview_mapping
comparison PathView.R @ 7:b617d4bbebf8 draft
planemo upload commit 41ba6f74dfad14f894dbe396fc765893b971b5ae-dirty
| author | proteore |
|---|---|
| date | Mon, 27 Aug 2018 11:21:34 -0400 |
| parents | 097bb3ed2b4d |
| children | 33c9bd75882a |
comparison
equal
deleted
inserted
replaced
| 6:059f17f98ab5 | 7:b617d4bbebf8 |
|---|---|
| 61 ./PathView.R --input 'input.csv' --pathway_id '05412' --id_type 'uniprotID' --id_column 'c1' --header TRUE \n\n") | 61 ./PathView.R --input 'input.csv' --pathway_id '05412' --id_type 'uniprotID' --id_column 'c1' --header TRUE \n\n") |
| 62 | 62 |
| 63 q(save="no") | 63 q(save="no") |
| 64 } | 64 } |
| 65 | 65 |
| 66 | |
| 67 #save(args,file="/home/dchristiany/proteore_project/ProteoRE/tools/pathview/args.Rda") | |
| 68 #load("/home/dchristiany/proteore_project/ProteoRE/tools/pathview/args.Rda") | |
| 69 parseArgs <- function(x) strsplit(sub("^--", "", x), "=") | 66 parseArgs <- function(x) strsplit(sub("^--", "", x), "=") |
| 70 argsDF <- as.data.frame(do.call("rbind", parseArgs(args))) | 67 argsDF <- as.data.frame(do.call("rbind", parseArgs(args))) |
| 71 args <- as.list(as.character(argsDF$V2)) | 68 args <- as.list(as.character(argsDF$V2)) |
| 72 names(args) <- argsDF$V1 | 69 names(args) <- argsDF$V1 |
| 73 | 70 |
| 86 | 83 |
| 87 is.letter <- function(x) grepl("[[:alpha:]]", x) | 84 is.letter <- function(x) grepl("[[:alpha:]]", x) |
| 88 | 85 |
| 89 #### hsa00010 -> 00010 | 86 #### hsa00010 -> 00010 |
| 90 remove_kegg_prefix <- function(x){ | 87 remove_kegg_prefix <- function(x){ |
| 88 x = gsub(":","",x) | |
| 89 if (substr(x,1,4) == 'path'){ | |
| 90 x=substr(x,5,nchar(x)) | |
| 91 } | |
| 91 if (is.letter(substr(x,1,3))){ | 92 if (is.letter(substr(x,1,3))){ |
| 92 x <- substr(x,4,nchar(x)) | 93 x <- substr(x,4,nchar(x)) |
| 93 } | 94 } |
| 94 return(x) | 95 return(x) |
| 95 } | 96 } |
| 119 | 120 |
| 120 | 121 |
| 121 #read input file or list | 122 #read input file or list |
| 122 if (!is.null(args$input)){ | 123 if (!is.null(args$input)){ |
| 123 tab <- read_file(args$input,header) | 124 tab <- read_file(args$input,header) |
| 124 tab <- tab[!apply(is.na(tab) | tab == "", 1, all),] #delete empty rows | 125 tab <- data.frame(tab[which(tab[ncol]!=""),]) |
| 125 } else { | 126 } else { |
| 126 tab <- data.frame(id_list) | 127 tab <- data.frame(id_list) |
| 127 ncol=1 | 128 ncol=1 |
| 128 } | 129 } |
| 129 | 130 |
