Discover our new platform: Learn more

GPU-Accelerated Spatial Weighted Gene Co-expression Network Analysis for Spatial Domain Detection in Ovarian Cancer

BioTuring Team
BioTuring Team
January 10, 2025

Authors: BioTuring Team

Spatial omics have revolutionized our understanding of gene expression patterns across tissues and organs, enabling the study of spatial domains—regions defined by distinct biological processes and cell type compositions. Here, we present a novel approach for detecting spatial domains using Weighted Gene Co-expression Network Analysis (WGCNA-https://bmcbioinformatics.biomedcentral.com/articles/10.1186/1471-2105-9-559) adapted for spatial data. By incorporating spatially correlated genes, we extend traditional WGCNA to identify spatial gene modules and delineate spatial domains. To address computational challenges inherent to spatial data analysis, we implemented GPU acceleration via cuBLAS and cuSPARSE.

Using this method, we analyzed ovarian cancer samples from the 10x Genomics Xenium platform, demonstrating the ability to identify spatial domains corresponding to annotated tissue structures with a better resolution. Our approach offers a scalable solution for spatial domain detection, advancing spatial omics analysis in complex tissues.

Methods

Extending WGCNA to Spatial Data

To detect spatial domains, we adapted WGCNA to incorporate spatial gene correlations. The workflow involves the following steps:

Step 1. Pairwise Spatial Gene Correlation: Calculate pairwise spatial correlations between genes based on spatially resolved expression data.

\(I(x,y) = \frac{n}{W} \cdot \frac{\sum_{i=1}^{n} \sum_{j=1}^{n} w_{ij} (x_i – \bar{x})(y_j – \bar{y})}{\sqrt{\sum_{i=1}^{n} (x_i – \bar{x})^2\cdot\sum_{j=1}^{n} (y_i – \bar{y})^2}}\)

Step 2. Construct Correlation Graph: Represent genes as nodes and spatial correlation values as weighted edges.

Step 3. Clustering for Spatial Gene Modules: Apply clustering algorithms to the spatial correlation graph to identify spatial gene modules.

Step 4. Spatial Domain Detection: Use AUCell scoring to assign spatial domains based on the activity of spatial gene modules.

GPU Acceleration

We aim to calculate the spatial correlation for every pair of genes. The core computation involves evaluating the following matrix:

\(I = (X – \bar{X})^TW(X – \bar{X})\)

where
X is the expression matrix of n cells and m genes.
W is the weighted adjacency matrix of the spatial graph, where nodes represent cells, and edges correspond to distances between cells

For n = 1 million cells, and m = 5000 genes, naive computation cost is

\(O(n^2m + m^2n).\)

To perform the matrix multiplication efficiently, we used several optimized linear algebra library. In particular, we used cuBLAS + cuSPARSE through cupy.

The primary challenge was the memory limitation, particularly, given the size of the matrices. To address this, we divided the matrix into manageable chunks, processing each chunk sequentially to ensure the peak memory usage stayed within system constrains. As a result, for a million cells dataset, the package finished within 130 seconds with memory usage of 11.6GB.

Results

Application to Ovarian Cancer

To demonstrate the practical application of our method, we analyzed the ovarian cancer slides from 10X Genomics Xenium Prime FFPE Human Ovarian Cancer. The provided data annotation by 10X colors on the H&E image are: red = tumor, black = necrosis, blue = smooth muscle, dark green = fallopian tube, and light green = ovary.

Figure 1. Pathology annotation provided by 10XGenomics (https://www.10xgenomics.com/datasets/xenium-prime-ffpe-human-ovarian-cancer)

Our spatial WGCNA framework identified three tumor sub-regions:

  1. Region 1 – Cancer
    • Characteristics: Composed predominantly of tumor cells (>90%), including proliferative tumor cells, VEGFA+ tumor cells, tumor-associated fibroblasts, and inflammatory tumor cells.
    • Pathways: Enriched for teratoma- and telomere-related pathways.
      • Relevance: Ovarian teratomas are the most common type of ovarian germ cell tumor, while telomere shortening facilitates indefinite cell division in cancer cells.
Figure 2. Red: Cancer region with more than 90% composed predominantly of tumor cells.
  1. Region 2 – Invasive
    • Characteristics: Comprised 65% of tumor-associated fibroblasts (CAFs), highlighting epithelial-mesenchymal transition (EMT) and angiogenesis.
    • Pathways and Mechanisms:
      • EMT: Facilitates the acquisition of invasive and migratory capabilities in cancer cells, critical for metastasis.
      • CAF Activity: CAFs mediate key tumor-environment interactions. Genes such as COL11A1 and CTHRC1 activate pathways (e.g., EGFR/ERK1/2/AKT, ERK, TGF-β1-MMP3 axis) that promote tumor growth, proliferation, and metastasis.
      • Periostin (POSTN): Influences OC cell invasiveness through PI3K/Akt pathway activation.
Figure 3. Blue: Invasive region with 65% of tumor-associated fibroblasts (CAFs).
  1. Region 3 – Tumor-Infiltrating
    • Characteristics: Small, scattered segments enriched with immune cells (25% macrophages, NK cells, and T cells).
    • Pathways:
      • Interferon (IFN) Signaling: High expression of IFN-α-responsive genes (e.g., OAS1, IFIT1, IFI44L) and IFN-γ-induced chemokines (e.g., CXCL10), which attract activated T cells to tumors.
      • Guanylate-Binding Protein 1 (GBP1): Stimulated by IFN-γ, GBP1 inhibits cell proliferation and angiogenesis.
      • T Cell Activation: Identified processes such as CD4-positive T cell activation, alpha-beta T cell activity, and regulation of T-helper 2 cytokine production, suggesting active tumor-infiltrating immune responses.
Figure 4. Yellow: Tumor-infiltrating region with 25% macrophages, NK cells, and T cells.

References:

https://bmcbioinformatics.biomedcentral.com/articles/10.1186/1471-2105-9-559
https://www.10xgenomics.com/datasets/xenium-prime-ffpe-human-ovarian-cancer

0 comments