Learn R Programming

CrossExpression (version 1.0.0)

Cross-Expression Analysis of Spatial Transcriptomics Data

Description

Analyzes spatial transcriptomic data using cells-by-genes and cell location matrices to find gene pairs that coordinate their expression between spatially adjacent cells. It enables quantitative analysis and graphical assessment of these cross-expression patterns. See Sarwar et al. (2025) and for more details.

Copy Link

Version

Install

install.packages('CrossExpression')

Monthly Downloads

147

Version

1.0.0

License

MIT + file LICENSE

Maintainer

Ameer Sarwar

Last Published

July 28th, 2025

Functions in CrossExpression (1.0.0)

bullseye_scores

Calculates bullseye statistics for ALL gene pairs. Counts the number of cells with gene B in those with gene A And in their neighbors Neighbor scores are cumulative and normalized by window size.
rotate_coordinates

This function takes x and y coordinates and rotates them counterclockwise by the specified number of degrees, and mean centers the points.
smooth_cells

Smooths cells' gene expression by averaging its expression by the nearest neighbors. Optionally computes genes by genes Pearson's correlation matrix between cells by genes and neighbors by genes matrices.
expression

Example gene expression matrix
bullseye_plot

Outputs a circular bullseye plot for a gene pair. The central circle is gene B in cells expressing gene A. Rings indicate neighbors with gene B, where the first ring is the first neighbor.
cross_expression

Computes cross-expression and co-expression p-values between all gene pairs.
cross_expression_correlation

Computes gene-gene correlations between cross-expressing cell-neighbor pairs. Cell and neighbor masks are used to consider mutually exclusive expression per gene pair.
correlation

Computes Pearson's correlation between pairs of columns. If one matrix is provided, the output is the pairwise correlations between its columns. If two matrices are provided, the output is the pairwise correlations between their columns.
get_cooccurrence_stats

Calculates the number of elements common between columns of two matrices. This function performs a simple dot product when binarize = FALSE.
spatial_enrichment

Determines whether the supplied genes show spatial enrichment in cross-expression. Spatial enrichment can be interpreted as delineating anatomical boundaries.
tissue_expression_plot

Plots gene expression and cross-expression on tissue by coloring cells.
locations

Example cell location matrix