Plot the gene by celltype loadings for a factor
plot_loadings_annot(
container,
factor_select,
use_sig_only = FALSE,
nonsig_to_zero = FALSE,
annot = "none",
pathways = NULL,
sim_de_donor_group = NULL,
sig_thresh = 0.05,
display_genes = FALSE,
gene_callouts = FALSE,
callout_n_gene_per_ctype = 5,
callout_ctypes = NULL,
specific_callouts = NULL,
le_set_callouts = NULL,
le_set_colormap = NULL,
le_set_num_per = 5,
show_le_legend = FALSE,
show_xlab = TRUE,
show_var_explained = TRUE,
clust_method = "median",
h_w = NULL,
reset_other_factor_plots = FALSE,
draw_plot = TRUE
)
The project container with a heatmap of loadings for one factor put in container$plots$all_lds_plots. The legend for the heatmap is put in container$plots$all_legends. Use draw(<hmap obj>,annotation_legend_list = <hmap legend obj>) to re-render the plot with legend.
environment Project container that stores sub-containers for each cell type as well as results and plots from all analyses
numeric The factor to plot
logical If TRUE, includes only significant genes from jackstraw in the heatmap. If FALSE, includes all the variable genes. (default = FALSE)
logical If TRUE, makes the loadings of all nonsignificant genes 0 (default=FALSE)
character If set to "pathways" then creates an adjacent heatmap showing which genes are in which pathways. If set to "sig_genes" then creates an adjacent heatmap showing which genes were significant from jackstraw. If set to "none" no adjacent heatmap is plotted. (default="none")
character Gene sets to plot if annot is set to "pathways" (default=NULL)
numeric To plot the ground truth significant genes from a simulation next to the heatmap, put the number of the donor group that corresponds to the factor being plotted (default=NULL)
numeric Pvalue significance threshold to use. If use_sig_only is TRUE the threshold is used as a cutoff for genes to include. If annot is "sig_genes" this value is used in the gene significance colormap as a minimum threshold. (default=0.05)
logical If TRUE, displays the names of gene names (default=FALSE)
logical If TRUE, then adds gene callout annotations to the heatmap (default=FALSE)
numeric To use if gene_callouts is TRUE. Sets the number of largest magnitude significant genes from each cell type to include in gene callouts. (default=5)
character To use if gene_callouts is TRUE. Specifies which cell types to get gene callouts for. If NULL, then gets gene callouts for largest magnitude significant genes for all cell types. (default=NULL)
character A vector of gene names to show callouts for (default=NULL)
character Pass a vector of gene set names to show leading edge genes for a select set of gene sets (default=NULL)
character A named vector with names as gene sets and values as colors. If NULL, then selects first n colors of Set3 color palette. (default=NULL)
numeric The number of leading edge genes to show for each gene set (default=5)
logical Set to TRUE to show the color map legend for leading edge genes (default=FALSE)
logical If TRUE, displays the xlabel 'genes' (default=TRUE)
logical If TRUE then shows an anotation with the explained variance for each cell type (default=TRUE)
character The hclust method to use for clustering rows (default='median')
numeric Vector specifying height and width (defualt=NULL)
logical Set to TRUE to set all other loadings plots to NULL. Useful if run get_all_lds_factor_plots but then only want to show one or two plots. (default=FALSE)
logical Set to TRUE to show the plot. Plot is stored regardless. (default=TRUE)
test_container <- plot_loadings_annot(test_container, 1, display_genes=FALSE,
show_var_explained = TRUE)
Run the code above in your browser using DataLab