Mercurial > repos > greg > ideas_genome_tracks
changeset 82:cf0a62d084dc draft
Uploaded
author | greg |
---|---|
date | Thu, 04 Jan 2018 14:44:24 -0500 |
parents | dcd4be407063 |
children | 2f49b6bddccc |
files | create_heatmap.R |
diffstat | 1 files changed, 3 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/create_heatmap.R Thu Jan 04 12:31:46 2018 -0500 +++ b/create_heatmap.R Thu Jan 04 14:44:24 2018 -0500 @@ -7,7 +7,7 @@ num_columns = dim(data_frame)[2]; num_rows = dim(data_frame)[1]; p = (sqrt(9 + 8 * (num_columns-1)) - 3) / 2; - data_matrix = as.matrix(data_frame[,1+1:p]/data_frame[,1]); + data_matrix = as.matrix(data_frame[,1+1:p] / data_frame[,1]); colnames(data_matrix) = colnames(data_frame)[1+1:p]; histone_marks = colnames(data_matrix); rownames(data_matrix) = paste(1:num_rows-1, " (", round(data_frame[,1]/sum(data_frame[,1])*10000)/100, "%)", sep=""); @@ -74,9 +74,9 @@ if(regexpr("ctcf", tolower(histone_marks[i])) > 0) { histone_mark_color[i,] = c(200, 0, 250); } - state_color = get_state_color(data_matrix, histone_mark_color)[,]; + state_color = get_state_color(data_matrix, histone_mark_color)[,2]; } - rect(rep(p+0.2, num_rows), 1:num_rows-0.8, rep(p+0.8, num_rows), 1:num_rows-0.2, col=state_color[,2]); + rect(rep(p+0.2, num_rows), 1:num_rows-0.8, rep(p+0.8, num_rows), 1:num_rows-0.2, col=state_color); palette(defpalette); if (!is.null(output_file_name)) { dev.off();