linkGenesAndPeaks: Linking genes to putative regulatory elements

View source: R/rliger.R

linkGenesAndPeaksR Documentation

Linking genes to putative regulatory elements

Description

Evaluate the relationships between pairs of genes and peaks based on specified distance metric.

Usage

linkGenesAndPeaks(
  gene_counts,
  peak_counts,
  genes.list = NULL,
  dist = "spearman",
  alpha = 0.05,
  path_to_coords,
  verbose = TRUE
)

Arguments

gene_counts

A gene expression matrix (genes by cells) of normalized counts. This matrix has to share the same column names (cell barcodes) as the matrix passed to peak_counts

peak_counts

A peak-level matrix (peaks by cells) of normalized accessibility values, such as the one resulting from imputeKNN. This matrix must share the same column names (cell barcodes) as the matrix passed to gene_counts.

genes.list

A list of the genes symbols to be tested. If not specified, this function will use all the gene symbols from the matrix passed to gmat by default.

dist

This indicates the type of correlation to calculate – one of “spearman” (default), "pearson", or "kendall".

alpha

Significance threshold for correlation p-value. Peak-gene correlations with p-values below this threshold are considered significant. The default is 0.05.

path_to_coords

Path to the gene coordinates file.

verbose

Print messages (TRUE by default)

Value

a sparse matrix with peak names as rows and gene symbols as columns, with each element indicating the correlation between peak i and gene j (or 0 if the gene and peak are not significantly linked).

Examples

## Not run: 
# Only runable for ATAC datasets, see tutorial on GitHub
# some gene counts matrix: gmat.small
# some peak counts matrix: pmat.small
regnet <- linkGenesAndPeaks(gmat.small, pmat.small, dist = "spearman",
alpha = 0.05, path_to_coords = 'some_path')

## End(Not run)

rliger documentation built on Nov. 9, 2023, 1:07 a.m.