Skip to contents

use peak gene annotations to match between RNA metacells and ATAC metacells and plot a cross-correlation matrix.

Usage

plot_atac_rna_cor(atac_mc, rna_mat, gene_field = NULL, tss_dist = 500)

Arguments

atac_mc

McPeaks object

rna_mat

an RNA metacell count matrix, where metacells are in columns and genes are in rows

gene_field

(optional) either closest_tss or closest_exon_gene -- field names in atac_mc@peaks which contain gene names. If NULL - the peaks would be transformed to promoter peaks and the gene names would be taken from the promoter gene names.

tss_dist

(optional) maximal absolute distance to a TSS to be considered a promoter peak

Value

a pheatmap object

Examples

if (FALSE) {
# Plot correlation of ATAC promoter peaks vs. log2 gene expression fraction (regularized)
arc_prom <- plot_atac_rna_cor(atac_mc = atac_mc, rna_mat = log2(atac_mc@rna_egc + 1e-05))

# Plot correlation of all available ATAC peaks (whose nearest TSS is of an expressed gene) vs. log2 gene expression fraction (regularized) of that gene
arc_tss <- plot_atac_rna_cor(atac_mc = atac_mc, rna_mat = log2(atac_mc@rna_egc + 1e-05), gene_field = "closest_tss")

# Plot correlation of all available ATAC peaks (whose nearest exon is of an expressed gene) vs. log2 gene expression fraction (regularized) of that gene
arc_exon <- plot_atac_rna_cor(atac_mc = atac_mc, rna_mat = log2(atac_mc@rna_egc + 1e-05), gene_field = "closest_exon_gene")
}