Plot a cross-correlation matrix between RNA metacells and ATAC metacell scores
Source:R/plot.R
plot_atac_rna_cor.Rd
use peak gene annotations to match between RNA metacells and ATAC metacells and plot a cross-correlation matrix.
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
orclosest_exon_gene
-- field names inatac_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
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")
}