Skip to contents

Match every gene with the k ATAC peaks most correlated to it

Usage

rna_atac_cor_knn(
  atac_mc,
  k = 1,
  genes = NULL,
  rm_zeros = TRUE,
  spearman = TRUE,
  pairwise.complete.obs = TRUE
)

Arguments

atac_mc

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

k

number of peaks to match for each gene. Default: 1

genes

list of genes to match. Default (NULL): all genes

rm_zeros

remove genes with no RNA expression in any metacell. Default: TRUE

spearman

if 'TRUE' Spearman correlation is computed, otherwise Pearson

pairwise.complete.obs

see below

Value

a tibble with the following columns:

  • gene: Gene name

  • peak: ATAC peak name

  • cor: Correlation between ATAC and RNA

  • rank: Rank of the correlation (for the gene)

Examples

if (FALSE) {
rna_atac_cor_knn(atac_mc, k = 1)
rna_atac_cor_knn(atac_mc, k = 1, genes = c("MESP1", "MESP2", "PF4"))
}