Plot a phenotype x phenotype correlation matrix based on genetic overlap.
correlation_heatmap(
top_targets,
row_side_vars = c("ancestor_name", "ontLvl"),
col_side_vars = c("n_celltypes", "n_genes"),
row_labels = "hpo_name",
phenotype_to_genes = HPOExplorer::load_phenotype_to_genes(),
col = pals::gnuplot(),
show_plot = TRUE,
save_path = tempfile(fileext = "correlation_heatmap.pdf"),
height = 10,
width = height * 1.3,
fontsize = 7,
seed = 2023,
verbose = TRUE
)
data.table of prioritised targets generated by prioritise_targets.
Variables to include in row-side metadata annotations.
Variables to include in column-side metadata annotations.
Optional row labels which are put as row names in the heatmap.
Output of load_phenotype_to_genes mapping phenotypes to gene annotations.
A vector of colors if the color mapping is discrete or a color mapping function if the matrix is continuous numbers (should be generated by colorRamp2
). If the matrix is continuous, the value can also be a vector of colors so that colors can be interpolated. Pass to ColorMapping
. For more details and examples, please refer to https://jokergoo.github.io/ComplexHeatmap-reference/book/a-single-heatmap.html#colors .
Show the plot.
Path to save interactive plot to as a self-contained HTML file.
Height of the heatmap body.
Width of the heatmap body.
Axis labels font size.
Set the seed for reproducible clustering.
Print messages.
Plot
top_targets <- MSTExplorer::example_targets$top_targets[seq(100),]
hm <- correlation_heatmap(top_targets = top_targets)
#> Constructing HPO gene x phenotype matrix.
#> Reading cached RDS file: phenotype_to_genes.txt
#> + Version: v2024-12-12
#> Annotating gene-disease associations with Evidence Score
#> Gathering data from GenCC.
#> Importing cached file.
#> Evidence scores for:
#> - 10514 diseases
#> - 5171 genes
#> + Version: 2024-12-19
#> Computing all parwise correlations.
#> Aggregating results by group_var='hpo_name'/'hpo_id'/'ancestor_name'/'ontLvl'
#> Warning: argument is not numeric or logical: returning NA
#> Warning: argument is not numeric or logical: returning NA
#> Warning: argument is not numeric or logical: returning NA
#> Warning: argument is not numeric or logical: returning NA
#> Warning: argument is not numeric or logical: returning NA
#> Warning: argument is not numeric or logical: returning NA
#> Warning: argument is not numeric or logical: returning NA
#> Warning: argument is not numeric or logical: returning NA
#> Warning: argument is not numeric or logical: returning NA
#> Warning: argument is not numeric or logical: returning NA
#> Warning: argument is not numeric or logical: returning NA
#> Warning: argument is not numeric or logical: returning NA
#> Creating heatmap: ComplexHeatmap
#> Using palette: okabe
#> Using palette: tol
#> Using palette: okabe
#> Using palette: tol
#> Saving plot --> /tmp/RtmpMmVOaL/file2ffc4c13ebe2correlation_heatmap.pdf