Mercurial > repos > proteore > proteore_heatmap_visualization
comparison heatmap_viz.R @ 1:b8a5139cf5b9 draft
planemo upload commit 5dd4a8814abf4a735409189a4c7cfe3ffd207c62-dirty
author | proteore |
---|---|
date | Mon, 18 Feb 2019 05:58:08 -0500 |
parents | edbb84a94a36 |
children | 2a04fffda914 |
comparison
equal
deleted
inserted
replaced
0:edbb84a94a36 | 1:b8a5139cf5b9 |
---|---|
78 #} | 78 #} |
79 return(uto) | 79 return(uto) |
80 } | 80 } |
81 | 81 |
82 get_cols <-function(input_cols) { | 82 get_cols <-function(input_cols) { |
83 input_cols <- gsub("c","",input_cols) | 83 input_cols <- gsub("c","",gsub("C","",gsub(" ","",input_cols))) |
84 if (grepl(":",input_cols)) { | 84 if (grepl(":",input_cols)) { |
85 first_col=unlist(strsplit(input_cols,":"))[1] | 85 first_col=unlist(strsplit(input_cols,":"))[1] |
86 last_col=unlist(strsplit(input_cols,":"))[2] | 86 last_col=unlist(strsplit(input_cols,":"))[2] |
87 cols=first_col:last_col | 87 cols=first_col:last_col |
88 } else { | 88 } else { |
100 header=str2bool(args$header) | 100 header=str2bool(args$header) |
101 output <- rapply(strsplit(args$output,"\\."),c) #remove extension | 101 output <- rapply(strsplit(args$output,"\\."),c) #remove extension |
102 output <- paste(output[1:length(output)-1],collapse=".") | 102 output <- paste(output[1:length(output)-1],collapse=".") |
103 output <- paste(output,args$type,sep=".") | 103 output <- paste(output,args$type,sep=".") |
104 cols = get_cols(args$cols) | 104 cols = get_cols(args$cols) |
105 rownames_col = as.integer(gsub("c","",args$row_names)) | 105 rownames_col = as.integer(gsub("c","",gsub("C","",gsub(" ","",args$row_names)))) |
106 if (length(cols) <=1 ){ | 106 if (length(cols) <=1 ){ |
107 stop("You need several colums to build a heatmap") | 107 stop("You need several colums to build a heatmap") |
108 } | 108 } |
109 dist=args$dist | 109 dist=args$dist |
110 clust=args$clust | 110 clust=args$clust |
114 uto <- read_file(args$input,header) | 114 uto <- read_file(args$input,header) |
115 uto <- clean_df(uto,cols,rownames_col) | 115 uto <- clean_df(uto,cols,rownames_col) |
116 uto <- uto[rowSums(is.na(uto)) != ncol(uto), ] #remove emptylines | 116 uto <- uto[rowSums(is.na(uto)) != ncol(uto), ] #remove emptylines |
117 | 117 |
118 if (header) { | 118 if (header) { |
119 col_names = names(data) | 119 col_names = names(uto) |
120 } else { | 120 } else { |
121 col_names = cols | 121 col_names = cols |
122 } | 122 } |
123 | 123 |
124 #building heatmap | 124 #building heatmap |