Identifying Synergistic Gene Pairs in Single-Cell and Spatial Transcriptomics
Overview
Discovers synergistic gene pairs in single-cell RNA-seq and spatial transcriptomics data. Unlike conventional pairwise co-expression analyses that rely on a single correlation metric, scPairs integrates 14 complementary metrics across five orthogonal evidence layers to compute a composite synergy score with optional permutation-based significance testing. The five evidence layers span cell-level co-expression (Pearson, Spearman, biweight midcorrelation, mutual information, ratio consistency), neighbourhood-aware smoothing (KNN-smoothed correlation, neighbourhood co-expression, cluster pseudo-bulk, cross-cell-type, neighbourhood synergy), prior biological knowledge (GO/KEGG co-annotation Jaccard, pathway bridge score), trans-cellular interaction, and spatial co-variation (Lee's L, co-location quotient). This multi-scale design enables researchers to move beyond simple co-expression towards a comprehensive characterisation of cooperative gene regulation at transcriptomic and spatial resolution. For more information, see the package documentation at https://github.com/zhaoqing-wang/scPairs.
Summary
First CRAN submission release. Addresses all reviewer feedback from the initial
check, introduces a built-in test dataset, completes function documentation,
and extends the test suite. Package structure has been overhauled to follow
established CRAN bioinformatics conventions.
------------------------------------------------------------------------
CRAN Compliance
- **Added reference URL** to the
Descriptionfield ofDESCRIPTION(<https://github.com/zhaoqing-wang/scPairs>), as required. - **Added
\valuetags** to all three exportedprint()S3 methods (print.scPairs_result,print.scPairs_gene_result,print.scPairs_pair_result); each returns its input object invisibly.
Show all changes in 0.1.8Hide the rest of the changes in 0.1.8
- **Rationalised examples**: nine exported functions now run plain R examples during
R CMD check. Two functions (AssessGenePair,PlotPairSummary) are wrapped in\donttest{}because their examples exceed the five-second threshold on the check servers. Three functions retain\dontrun{}because they require software not guaranteed to be present:PlotPairSpatial(spatial-assay Seurat object),PlotBridgeNetworkandPlotPairSynergy(Bioconductor annotation packagesorg.Hs.eg.db/org.Mm.eg.db). - **Removed
set.seed()** from inside.plot_bridge_network_enhanced()(R/plot_synergy.R); the package no longer modifies the user's RNG state. - **Fixed Unicode in documentation**: replaced non-ASCII characters (U+2248 approximately-equal, U+00D7 multiplication sign, U+2013/U+2014 dashes) in
scpairs_testdataRd documentation with ASCII equivalents, resolving the LaTeX PDF-manual build error. - **Fixed invalid URI in
README.md**: theLICENSE.mdhyperlink now points to the full GitHub URL rather than a bare file path, removing the URI validity note. - **Added
inst/WORDLIST** listing domain-specific terms (Jaccard, KEGG, KNN, midcorrelation, transcriptomics, etc.) to suppress false-positive spell-check notes.
------------------------------------------------------------------------
Built-in Test Dataset
- **New dataset
scpairs_testdata** (data/scpairs_testdata.rda, 26 KB): a synthetic Seurat object (100 cells, 20 genes, 3 balanced clusters, 5-component PCA, 2-D UMAP) with two injected co-expression patterns: - **GENE3 & GENE4**: globally correlated across all cells (Pearson r approximately 0.89 in normalised data).
- **GENE1 & GENE2**: moderately correlated within cluster 1 only.
- All remaining pairs: near-independent noise.
- Generation script provided in
data-raw/make_testdata.R(set.seed(7391));data-raw/is excluded from the CRAN build via.Rbuildignore. - All runnable examples reference
scpairs_testdatadirectly, eliminating the need for inline Seurat-object construction in any function documentation. - Dataset documented in
R/scpairs_testdata.Rwith@format,@details,@usage,@source,@seealso, and@family Section_0_Datatags.
------------------------------------------------------------------------
Documentation Improvements
- **Completed documentation** for
PlotPairSummary()(added@examples, improved@return) andPlotPairSynergy()(added@exampleswith\dontrun{}, expanded@returnfor all four panels). - **Added
@familytags** grouping all exported functions into three help families: Section_0_Data--scpairs_testdataSection_1_Discovery--FindAllPairs,FindGenePairs,AssessGenePairSection_2_Visualization-- all elevenPlotPair*andPlotBridgeNetworkfunctions- **Added
@seealsocross-references** throughout, linking each function to its most closely related counterparts. - **Improved
@returndescriptions** forPlotPairDimplot,PlotPairViolin,PlotPairScatter,PlotPairSmoothed,PlotPairSummary,PlotPairCrossType,PlotPairSpatial,PlotPairNetwork, andPlotPairHeatmap.
------------------------------------------------------------------------
Package Structure
R/data.Rrenamed toR/scpairs_testdata.R, following the convention of naming dataset documentation files after the dataset itself.tests/README.mdadded: documents test categories, expected behaviour, coverage targets, and a contribution template.- Six demonstration plots saved to
docs/fromscpairs_testdata:scpairs_network.png,scpairs_heatmap.png,scpairs_dimplot.png,scpairs_smoothed.png,scpairs_violin.png,scpairs_scatter.png. README.mdrestructured: CRAN/GitHub badges, right-aligned logo, full table of contents, collapsible dependency section, Visualization Gallery embedding the six demo images, and an expanded Functions reference table.
------------------------------------------------------------------------
Test Suite
- All seven test files updated to use
scpairs_testdatadirectly, removing per-test Seurat pipeline construction and improving reproducibility.create_test_seurat()is retained inhelper-test_data.Rfor edge-case tests requiring custom configurations (single-cluster data, spatial coordinates, unusual gene counts). - **Two latent test warnings resolved**:
test-assess-pair.R: then_perm = 49call is now wrapped insuppressWarnings()-- the low-permutation advisory is intentional package behaviour, not a test defect.test-consolidated-functions.R: the third matrix row in the.compute_ratio_consistencybatch test now usesabs(rnorm(n))to preventlog2(mat + 1)from receiving negative inputs.- **115 tests passing**, 0 failures, 0 warnings, 0 skips.
------------------------------------------------------------------------
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-04
- NOTE12 OK, 1 NOTE2026-08-01
- OK13 OK2026-06-09
- ERROR12 OK, 1 ERROR2026-06-08
- OK12 OK2026-04-25
Show 3 earlier changesHide 3 earlier changes
- NOTE13 OK, 1 NOTE2026-04-10
- ERROR12 OK, 1 NOTE, 1 ERROR2026-04-09
- NOTE12 OK, 1 NOTE2026-03-10
Documentation
- Help pages
- 97 (79 internal)
- Examples that run
- 67%10 run in a plain check · 2 only when donttest examples are enabled (R CMD check --as-cran) · 3 never run
- Exported functions with examples
- 100%
- Documented parameters
- 98%
- Return-value docs
- 100%
- Help pages citing references
- 2%
Downloads
Repository
Stars over time
1 development-tooling and community-health practice detected across 1 family in the upstream repository
Checks run against github.com/zhaoqing-wang/scpairs on 2026-10-18.
Dependencies
Code & Tests
Datasets
People & History
- RR 4.6.0 released · 2026-04-24
- 0.1.8Latest2026-03-05 · current release
- RR 4.5.0 released · 2025-04-11
Package metadata
- First published
- 2026-03-05
- Total releases
- 1 / 1 yrs
- License
- MIT + file LICENSE OSI
- Minimum R
- ≥ 4.1.0
- Bundled data
- 25 KB / 1 file
- Download size
- 136 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("scPairs")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-22, which the citation names so these numbers can be found later. More on citing and the projects behind them.