View source: R/treecor_degheatmap.R
treecor_degheatmap | R Documentation |
Plot heatmap for top n differentially expressed genes
treecor_degheatmap(
sample_meta,
pseudobulk,
deg_result,
top_n = 10,
deg_logFC = "both",
scale = "row",
cluster_rows = F,
cluster_cols = F,
show_colnames = F,
show_rownames = T,
annotation_col = NA,
annotation_colors = NA,
color = colorRampPalette(rev(brewer.pal(n = 7, name = "RdYlBu")))(100),
breaks = NA,
fontsize = 12
)
sample_meta |
A data frame for sample-level metadata, where each row is a sample. Must contain 'sample' column and additional variables such as covariates or outcome of interest. |
pseudobulk |
A sample-level pseudobulk, which can be obtained by running 'limma_expr' pipeline and can be extracted via 'result$pseudobulk.ls[[cell_type_name]]'. |
deg_result |
Differential expression output obtained by running limma_expr' pipeline' and can be extracted via 'result$dge.ls[[phenotype]][[cell_type_name]]'. |
top_n |
A number to extract top n differentially expressed genes. If |
deg_logFC |
Filter 'deg_result' by logFC. One of the following: #'
|
scale |
A character indicates if the values should be centered and scaled in either the 'row' direction or the 'column' direction, or 'none'. |
cluster_rows |
A True of False indicator to determine if rows should be clustered. |
cluster_cols |
A True of False indicator to determine if column names should be displayed. |
annotation_col |
A vector specifying column names to be annotated in the sidebars of a heatmap. |
annotation_colors |
List for manually specifying colors for annotation_col. |
color |
A vector of colors used in heatmap. |
breaks |
A sequence of numbers specifying range of values in the matrix. Must be an element longer than color vector. See more in '?pheatmap'. |
fontsize |
Font size. |
show_rows |
A True of False indicator to determine if row names should be displayed. |
Heatmap with DEGs on the row and samples on the column.
Boyang Zhang <bzhang34@jhu.edu>, Hongkai Ji
# Assume obtain pseudobulk of celltype 'T' from treecor_deg()
result <- treecor_deg(expr,hierarchy_list, cell_meta, sample_meta, response_variable = 'severity')
pseudobulk <- result$pseudobulk.ls[['T']]
deg_result <- result$dge.ls$severity[['T']]
# Top 10 DEGs with logFC>0
treecor_degheatmap(sample_meta,pseudobulk, deg_result, top_n = 10, deg_logFC = 'positive')
# Top 10 DEGs with logFC<0
treecor_degheatmap(sample_meta,pseudobulk, deg_result, top_n = 10, deg_logFC = 'negative')
# Combined the above two options: top 10 positively-associated DEGs and top 10 negatively-associated DEGs
treecor_degheatmap(sample_meta,pseudobulk, deg_result, top_n = 10, deg_logFC = 'both')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.