Skip to contents

plot an rna marker heatmap (right) together with an heatmap of fold change of ATAC peaks that are the most correlated to each marker gene (left, using get_genes_atac_fp).

Usage

plot_atac_rna_markers(
  atac_mc,
  n_genes = 100,
  force_cell_type = TRUE,
  plot_legend = TRUE,
  row_names = FALSE,
  ...
)

Arguments

atac_mc

a McPeaks/McTracks object with RNA expression (using add_mc_rna)

n_genes

maximal number of genes to return. Default: 100

force_cell_type

do not split cell types when ordering the metacells. Default: TRUE

plot_legend

TRUE to plot a legend of the cell types (default: TRUE)

row_names

show the row names of the heatmaps. Note that the space each plot takes might become uneven due to genes / peaks with longer names.

...

Arguments passed on to plot_rna_markers_mat

mat

a heatmap of marker genes fold change over metacells (e.g. output of get_rna_marker_matrix)

metacell_types

a data frame with a field called "metacell" and a field called "cell_type" (optional)

cell_type_colors

a data frame with a field called "cell_type" and a field called "color" (optional)

low_color

a color for low fold change

high_color

a color for high fold change

mid_color

a color for mid fold change

midpoint

midpoint for the color scale (default: 0)

min_lfp

minimum log2 fold change (default: -3). Value below this will be set to min_lfp.

max_lfp

maximum log2 fold change (default: 3). Value above this will be set to max_lfp.

top_cell_type_bar

add a cell type annotation also at the top of the heatmap (default: TRUE)

gene_colors

a named list with a color for each marker gene (optional)

col_names

show column names (metacells)

interleave

show the gene names (rows) interleaved

annotation_title

title for cell type annotation. Default: "Cell type"

top_annotation_title

title for top cell type annotation. Default: "Cell type"

title

title for the plot

plot_right

Whether to put the Y-axis labels at the right side of the heatmap (as well as at the left hand side)

col_names_orient

Orientation of the X-axis label

Value

a ggplot object with the heatmap of RNA markers (right) and the heatmap of ATAC peaks (left). The ATAC matrix is ordered by the RNA matrix.

a ggplot object with the heatmaps

Examples

if (FALSE) {
plot_atac_rna_markers(atac_mc)
plot_atac_rna_markers(atac_mc, force_cell_type = FALSE)
plot_atac_rna_markers(atac_mc, n_genes = 200)
}