View source: R/model_result_interaction.r
HeatmapDiag | R Documentation |
HeatmapDiag utility function for 'pheatmap' using 'slanter' to order the maximum values across the matrix diagonal
HeatmapDiag(matrix, ...)
matrix |
an R matrix as input to 'pheatmap'. Could be the object returned by 'scglmmr::GetGeneMatrix' |
a pheatmap object
## Not run:
# make gene plot of top 50 ranked genes within each subst
# fit1 = dreamMixedModel(...)
r1 = ExtractResult(model.fit.list = fit1, coefficient.number = 1,coef.name = 'L1', what = 'gene.t.ranks')
rank = lapply(r1,function(x) names(x[1:50]))
top50ranks = unlist(rank) %>% unique()
res1 = ExtractResult(model.fit.list = fit1, coefficient.number = 1,coef.name = 'L1')
mtx = GetGeneMatrix(result.list = res1, gene_subset = top50ranks, stat_for_matrix = 'logFC', pvalfilter = 1, logfcfilter = -Inf)
pdf(file = paste0(figpath, 'geneplot.pdf'), width = 3.5 ,height = 5)
HeatmapDiag(matrix = mtx, fontsize_row = 1)
dev.off()
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.