comparison create_heatmap.R @ 144:8cd08d0aeb69 draft

Uploaded
author greg
date Thu, 04 Jan 2018 14:45:16 -0500
parents a976dd6fcd1b
children 9e0b4ceba74a
comparison
equal deleted inserted replaced
143:269e7e466b00 144:8cd08d0aeb69
24 defpalette = palette(my_palette); 24 defpalette = palette(my_palette);
25 # Plot the heatmap for the current .para / .state combination. 25 # Plot the heatmap for the current .para / .state combination.
26 plot(NA, NA, xlim=c(0, p+0.7), ylim=c(0, num_rows), xaxt="n", yaxt="n", xlab=NA, ylab=NA, frame.plot=F); 26 plot(NA, NA, xlim=c(0, p+0.7), ylim=c(0, num_rows), xaxt="n", yaxt="n", xlab=NA, ylab=NA, frame.plot=F);
27 axis(1, at=1:p-0.5, labels=colnames(data_matrix), las=2); 27 axis(1, at=1:p-0.5, labels=colnames(data_matrix), las=2);
28 axis(4, at=1:num_rows-0.5, labels=rownames(data_matrix), las=2); 28 axis(4, at=1:num_rows-0.5, labels=rownames(data_matrix), las=2);
29 color = round((t(data_matrix) - min_max_vector[1]) / (min_max_vector[2] - min_max_vector[1]) * 100); 29 col = round((t(data_matrix) - min_max_vector[1]) / (min_max_vector[2] - min_max_vector[1]) * 100);
30 rect(rep(1:p-1, num_rows), rep(1:num_rows-1, each=p), rep(1:p, num_rows), rep(1:num_rows, each=p), col=color); 30 rect(rep(1:p-1, num_rows), rep(1:num_rows-1, each=p), rep(1:p, num_rows), rep(1:num_rows, each=p), col=col);
31 histone_mark_color = t(col2rgb(terrain.colors(ceiling(p))[1:p])); 31 histone_mark_color = t(col2rgb(terrain.colors(ceiling(p))[1:p]));
32 32
33 # Specify a color for common feature names like "h3k4me3". 33 # Specify a color for common feature names like "h3k4me3".
34 # These are histone marks frequently used to identify 34 # These are histone marks frequently used to identify
35 # promoter activities in a cell, and are often displayed 35 # promoter activities in a cell, and are often displayed