The function is intended to be called within the custom_heatmap_wrapper
The function creates a segmented heatmap where rows are samples/patients and columns are genes. The heatmap is column segmented based on the number of differential expression analyses contained within it. A log2foldChange histogram is attached to the bottom of the heatmap to indicate significance of the genes being visualized.
The column/segment legend is given at the bottom of the heatmap with the number of genes in each group being also provided.
The gradient legend of the values within the heatmap is given on the right hand side.
The heatmap is saved in both png and svg format.
plot_custom_DE_heatmap(
heat_mat,
col_split,
row_splits,
l2fc_col,
log_transform,
color_vect,
legend_value = "counts",
plot_file_name = "custom_heatmap",
custom_width = 15,
custom_height = 5,
do_SVG = TRUE
)
The main count matrix of the heatmap
The named vector used to split the columns into it's segments
The named vector used to split the rows into the two groups
The log2foldchange vector used to create the histogram
boolean indicating if the results were log transformed or not
A vector for the colors to be used in the heatmap
string indicating the type of value used (counts for RNAseq, intensity value for microarray)
The name given to the saved heatmap
The width of the heatmap
The height of the heatmap
Boolean to check if the SVG file should be created or not
none or heatmap plot
TS_object<-create_example_object_for_R()
TS_object <- normalize_timeSeries_with_deseq2(time_object=TS_object)
#> converting counts to integer mode
#Perform conditional differential gene expression analysis
TS_object<-conditional_DE_wrapper(TS_object,vignette_run=TRUE)
heat_dta<-create_conditional_heatmap_matrix(TS_object)
heat_dta<-prepare_heat_data(heat_dta,log_transform=TRUE)
log_l2fc<-log_transform_l2fc_vect(heat_dta[['l2fc_vector']])
heat_plot<- plot_custom_DE_heatmap(heat_dta[['heat_matrix']],heat_dta[['region_split']],
heat_dta[['group_split']],log_l2fc,log_transform = TRUE,
legend_value='counts', plot_file_name = NULL,
do_SVG=FALSE)
#> Error in plot_custom_DE_heatmap(heat_dta[["heat_matrix"]], heat_dta[["region_split"]], heat_dta[["group_split"]], log_l2fc, log_transform = TRUE, legend_value = "counts", plot_file_name = NULL, do_SVG = FALSE): argument "color_vect" is missing, with no default