| Title: | Building Gene-Peak Network for ATAC-RNA Integration |
|---|---|
| Description: | GPlinksR constructs gene-peak regulatory networks for ATAC-RNA integration by combining enhancer-based, promoter-based, and proximity (closest-gene) mappings. The package accepts direct peak and gene vectors as well as container-based inputs through a wrapper for common Bioconductor object classes. Enhancer-gene links are obtained from the PEREGRINE enhancer-gene datasets provided by AnnoQ, while promoter and gene coordinates are retrieved from EnsDb.Hsapiens.v86. |
| Authors: | Xinran Wang [aut, cre] (ORCID: <https://orcid.org/0009-0000-1805-3280>), Kelly Street [ctb], Huaiyu Mi [ctb], Bryan Queme [ctb] |
| Maintainer: | Xinran Wang <xwang210@usc.edu> |
| License: | MIT + file LICENSE |
| Version: | 0.99.2 |
| Built: | 2026-09-30 07:41:26 UTC |
| Source: | https://github.com/bioc/GPlinksR |
Build Gene-Peak Network (Enhancer, Promoter, Closest)
build_gp_links( pk, gn, ver = 19, enh_file = NULL, enh_coords_file = NULL, gene_map = NULL, mart = NULL )build_gp_links( pk, gn, ver = 19, enh_file = NULL, enh_coords_file = NULL, gene_map = NULL, mart = NULL )
pk |
Either: (1) A character vector of genomic coordinates ("chr1:1000-1200"), or (2) A data.frame containing peak coordinates with columns "chr","start","end" or a "PeakRegion" column ("chr1:1000-1200" style). |
gn |
Character vector of gene symbols (HGNC official symbols, e.g. "TP53", "FMNL2"). Each input peak is linked to the nearest transcript TSS among these genes. |
ver |
Integer (17, 18, or 19) - PANTHER enhancer-gene link version. |
enh_file |
Optional local path to enhancer-gene link file (.tsv). |
enh_coords_file |
Optional local path to the corresponding PEREGRINE
enhancer-coordinate file. The file must contain chromosome, start, end, and
enhancer identifier columns without a header. If |
gene_map |
Optional data.frame with columns |
mart |
Optional |
A data.frame with columns: Peak, Gene, Src. Closest-gene mappings
assign each peak center to its single nearest transcript TSS across the
genes in gn. When a peak-gene pair has multiple evidence sources, each
source is returned as a separate row.
data("gp_example_inputs", package = "GPlinksR") pk <- gp_example_inputs$pk[seq_len(3)] gn <- gp_example_inputs$gn[seq_len(4)] enh_file <- system.file( "extdata", "gp_example_enhancer_links.tsv", package = "GPlinksR", mustWork = TRUE ) enh_coords_file <- system.file( "extdata", "gp_example_enhancer_coordinates.tsv", package = "GPlinksR", mustWork = TRUE ) gene_map <- data.frame( hgnc_symbol = c("TTLL10", "SAMD11"), hgnc_id = c("HGNC:26693", "HGNC:28706") ) gp <- build_gp_links( pk, gn, enh_file = enh_file, enh_coords_file = enh_coords_file, gene_map = gene_map ) gp if (interactive()) { mirror_mart <- biomaRt::useEnsembl( biomart = "genes", dataset = "hsapiens_gene_ensembl", mirror = "useast" ) gp <- build_gp_links(pk, gn, mart = mirror_mart) head(gp) }data("gp_example_inputs", package = "GPlinksR") pk <- gp_example_inputs$pk[seq_len(3)] gn <- gp_example_inputs$gn[seq_len(4)] enh_file <- system.file( "extdata", "gp_example_enhancer_links.tsv", package = "GPlinksR", mustWork = TRUE ) enh_coords_file <- system.file( "extdata", "gp_example_enhancer_coordinates.tsv", package = "GPlinksR", mustWork = TRUE ) gene_map <- data.frame( hgnc_symbol = c("TTLL10", "SAMD11"), hgnc_id = c("HGNC:26693", "HGNC:28706") ) gp <- build_gp_links( pk, gn, enh_file = enh_file, enh_coords_file = enh_coords_file, gene_map = gene_map ) gp if (interactive()) { mirror_mart <- biomaRt::useEnsembl( biomart = "genes", dataset = "hsapiens_gene_ensembl", mirror = "useast" ) gp <- build_gp_links(pk, gn, mart = mirror_mart) head(gp) }
Wrapper around build_gp_links() that extracts peak coordinates and gene
symbols from a MultiAssayExperiment or SingleCellExperiment,
then runs the standard GPlinksR workflow.
build_gp_links_wrapper( x, peak_experiment = NULL, gene_experiment = NULL, peak_col = NULL, gene_col = NULL, ver = 19, enh_file = NULL, enh_coords_file = NULL, gene_map = NULL, mart = NULL )build_gp_links_wrapper( x, peak_experiment = NULL, gene_experiment = NULL, peak_col = NULL, gene_col = NULL, ver = 19, enh_file = NULL, enh_coords_file = NULL, gene_map = NULL, mart = NULL )
x |
A |
peak_experiment |
For |
gene_experiment |
For |
peak_col |
Optional |
gene_col |
Optional |
ver |
Integer (17, 18, or 19). PEREGRINE enhancer-gene link version. |
enh_file |
Optional local path to enhancer-gene link file ( |
enh_coords_file |
Optional local path to the corresponding PEREGRINE
enhancer-coordinate file passed to |
gene_map |
Optional data.frame with columns |
mart |
Optional |
Peak features are extracted from rowRanges(), rowData(), or row
names. Gene symbols are extracted from rowData() or row names.
A data.frame with columns returned by build_gp_links().
if (requireNamespace("SingleCellExperiment", quietly = TRUE) && requireNamespace("SummarizedExperiment", quietly = TRUE)) { sce <- SingleCellExperiment::SingleCellExperiment( assays = list(counts = matrix(seq_len(12), nrow = 3)), rowData = S4Vectors::DataFrame(symbol = c("TP53", "GATA1", "SPI1")) ) SingleCellExperiment::altExp(sce, "ATAC") <- SummarizedExperiment::SummarizedExperiment( assays = list(counts = matrix(seq_len(12), nrow = 3)), rowData = S4Vectors::DataFrame( PeakRegion = c( "chr1:1000-1200", "chr1:5000-5200", "chr2:9000-9300" ) ) ) sce # Example wrapper call: # build_gp_links_wrapper( # x = sce, peak_experiment = "ATAC", gene_col = "symbol" # ) }if (requireNamespace("SingleCellExperiment", quietly = TRUE) && requireNamespace("SummarizedExperiment", quietly = TRUE)) { sce <- SingleCellExperiment::SingleCellExperiment( assays = list(counts = matrix(seq_len(12), nrow = 3)), rowData = S4Vectors::DataFrame(symbol = c("TP53", "GATA1", "SPI1")) ) SingleCellExperiment::altExp(sce, "ATAC") <- SummarizedExperiment::SummarizedExperiment( assays = list(counts = matrix(seq_len(12), nrow = 3)), rowData = S4Vectors::DataFrame( PeakRegion = c( "chr1:1000-1200", "chr1:5000-5200", "chr2:9000-9300" ) ) ) sce # Example wrapper call: # build_gp_links_wrapper( # x = sce, peak_experiment = "ATAC", gene_col = "symbol" # ) }
Download Enhancer-Gene Link File from PANTHER Peregrine Database
get_peregrine_file(version = 19)get_peregrine_file(version = 19)
version |
Integer (17, 18, or 19). Which PANTHER enhancer-gene link version to download. |
The full path to the downloaded .tsv file stored in the
BiocFileCache.
if (interactive()) { f <- get_peregrine_file(19) f readLines(f, n = 3) }if (interactive()) { f <- get_peregrine_file(19) f readLines(f, n = 3) }
A small example dataset for demonstrating GPlinksR workflows.
The object contains 300 peak coordinates and 100 gene symbols selected from a
KPMP-derived kidney single-cell analysis. The first few entries yield
enhancer-, promoter-, and closest-based links in the executable examples.
data(gp_example_inputs)data(gp_example_inputs)
A list with two elements:
pkA character vector of 300 peak coordinates in
"chr:start-end" format.
gnA character vector of 100 gene symbols.
data(gp_example_inputs) length(gp_example_inputs$pk) length(gp_example_inputs$gn)data(gp_example_inputs) length(gp_example_inputs$pk) length(gp_example_inputs$gn)
A reference gene-peak link table corresponding to the leading entries in
gp_example_inputs. The table contains the expected enhancer-, promoter-,
and closest-based links from the package's executable offline example.
data(gp_example_links)data(gp_example_links)
A data.frame with 7 rows and 3 columns:
PeakPeak coordinate in "chr:start-end" format.
GeneGene symbol linked to the peak.
SrcLink source, one of "enh", "prom", or
"clo".
data(gp_example_links) head(gp_example_links) table(gp_example_links$Src)data(gp_example_links) head(gp_example_links) table(gp_example_links$Src)