pyranges-peak-gene-linkage

Correlate scATAC peak accessibility with nearby gene expression in paired multiome data.

1|Updated Nov 20, 2025
One-click install
npx skills add https://github.com/tony-zhelonkin/scio --skill pyranges-peak-gene-linkage-tony-zhelonkin
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: pyranges-peak-gene-linkage
Source: https://github.com/tony-zhelonkin/scio/tree/main/skills/pyranges-peak-gene-linkage
Command: npx skills add https://github.com/tony-zhelonkin/scio --skill pyranges-peak-gene-linkage-tony-zhelonkin

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires snapatac2, muon, numpy, pandas, scipy, pyranges.

What problem does it solve? Identifying which open chromatin peaks regulate which genes is a core question in single-cell multiome analysis. This Skill tests whether a peak's accessibility tracks a nearby gene's expression across cells in a paired 10x Multiome dataset, producing candidate cis-regulatory links without manual statistical plumbing. ## Core Features & Use Cases - Gene Activity Matrices: Collapse peak counts into per-gene scores using SnapATAC2's make_gene_matrix or muon's gene_activity, enabling label transfer from RNA and marker sanity checks in the ATAC modality. - Peak-Gene Correlation: Compute Pearson correlations between each peak and nearby genes within configurable windows (±2 kb promoter, ±100 kb standard cis, ±500 kb long-range), with pyranges for genome-wide interval arithmetic. - Use Case: Given a paired multiome MuData object, find which peaks within 100 kb of the MS4A1 gene correlate with its expression, filter by p-value, and rank candidate regulatory elements. ## Quick Start Correlate ATAC peaks within 100 kb of gene MS4A1 with its RNA expression in my paired multiome MuData object and return the significant peak-gene pairs.

Frequently Asked Questions about pyranges-peak-gene-linkage

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I link ATAC peaks to genes in single-cell multiome data?▼

Compute Pearson correlation between each peak's accessibility and each nearby gene's expression across cells sharing both modalities. Restrict peaks to a genomic window around each gene, then filter by p-value and rank by correlation coefficient.

How to compute a gene activity matrix from scATAC-seq data?▼

Use snap.pp.make_gene_matrix from SnapATAC2 with a genome annotation and upstream window, or mu.atac.pp.gene_activity from muon. Both sum peak counts over gene bodies plus flanking regions to produce per-gene ATAC scores.

What window size should I use for peak-gene correlation?▼

Use ±2 kb around the TSS for promoter-only linkage, ±100 kb for standard cis-regulatory analysis, or ±500 kb to include long-range enhancers. Novel analyses should sweep multiple windows and report sensitivity.

Why are all my peak-gene correlations near zero?▼

Near-zero correlations usually mean peaks are too sparse. Aggregate peaks into broader bins, restrict to highly variable peaks, or correlate within individual cell types to remove cell-type-driven noise.

Can I use peak-gene linkage on unpaired RNA and ATAC data?▼

No, this approach requires paired cells with both modalities. For unpaired RNA and ATAC datasets, first integrate them with an unpaired multiomics integration method such as scglue before attempting linkage.

How do I correct for multiple testing in peak-gene linkage?▼

Apply Benjamini-Hochberg correction across all tested peak-gene pairs in the window. Raw p-value filtering without correction inflates false positives when testing thousands of pairs genome-wide.