OSCR

Navigating cell maps by deep learning integration of single-cell and spatially resolved transcriptomics.

Code ↔ Paper

6 matches between paragraphs of the paper and lines of its authors' code, computed by the harvester (lexical-v1). Click a colored paragraph or line to see its counterpart.

The 6 matches
  1. [1] § Materials and methods › Cell-to-spot mapping algorithm ↔ Cell2Map/map_optimizer.py, lines 26–150 · score 0.77 · Mahalanobis distance, Euclidean distance, density term, inverse, cosine, PyTorch
  2. [2] § Materials and methods › Overview of Cell2Map ↔ Cell2Map/map_optimizer.py, lines 26–150 · score 0.62 · distance term, density term, cosine, Mahalanobis, Euclidean, mapping
  3. [3] § Materials and methods › Benchmark datasets and case study for Cell2Map evaluation ↔ uncertainty_quantification.R, lines 1–42 · score 0.59 · pseudo bulk, CytoSPACE, scRNA, single cell, transcriptome, seq
  4. [4] § Materials and methods › Cell-to-spot mapping algorithm ↔ Cell2Map/map_utils.py, lines 56–123 · score 0.57 · mapping matrix, mapped cells, divergence, Mahalanobis, PyTorch, density
  5. [5] § Materials and methods › Data preprocessing and preparation ↔ Cell2Map/map_utils.py, lines 23–51 · score 0.55 · Scanpy, filtering, log1p, pp, intersection, genes
  6. [6] § Results › Cell2Map is robust in mapping different scRNA-seq datasets to breast cancer SRT data ↔ uncertainty_quantification.R, lines 1–42 · score 0.50 · cell assignments, CytoSPACE, breast, scRNA, cancer, transcriptomics

Paper

Loaded from Europe PMC by your browser, not stored by OSCR: doi.org · Europe PMC

The paper is loaded when this pane is shown.

The authors' code

Python · 150 lines · 5.2 KB · GPL-3.0 · 2 matches

  1. import numpy as np
  2. import pandas as pd
  3. import torch
  4. import torch.nn as nn
  5. import logging
  6. from torch.nn.functional import softmax, cosine_similarity
  7. import torch.nn.functional as F
  8. from . import utils as ut
  9. from . import loss as ls
  10. import random
  11. from sklearn.cluster import KMeans
  12. from sklearn.neighbors import NearestNeighbors
  13. from sklearn.metrics import (adjusted_rand_score,
  14. normalized_mutual_info_score,)
  15. def seed_everything(seed_value):
  16. random.seed(seed_value)
  17. np.random.seed(seed_value)
  18. torch.manual_seed(seed_value)
  19. torch.cuda.manual_seed(seed_value)
  20. torch.cuda.manual_seed_all(seed_value)
  21. torch.backends.cudnn.deterministic = True
  22. torch.backends.cudnn.benchmark = True
  23. class Mapper:
  24. def __init__(self,
  25. S,
  26. G,
  27. d,
  28. a,
  29. b,
  30. D,
  31. device='cpu',
  32. lambda_d=0,
  33. lambda_g1=1.0,
  34. lambda_g2=0,
  35. alpha=1,
  36. lambda_mahalanobis=0.7,
  37. lambda_distance=0.01,
  38. adata_map=None,
  39. ):
  40. self.S=torch.tensor(S,device=device, dtype=torch.float32)
  41. self.G=torch.tensor(G,device=device, dtype=torch.float32)
  42. self.target_cell_count=d is not None
  43. if self.target_cell_count:
  44. self.d=torch.tensor(d,device=device, dtype=torch.float32)
  45. self.lambda_d=lambda_d
  46. self.lambda_g1 = lambda_g1
  47. self.lambda_g2 = lambda_g2
  48. self.alpha = alpha
  49. self.lambda_mahalanobis=lambda_mahalanobis
  50. self.lambda_distance=lambda_distance
  51. self.D = torch.tensor(D, device=device, dtype=torch.float32)
  52. self.a = torch.tensor(a, device=device, dtype=torch.float32)
  53. self.b = torch.tensor(b, device=device, dtype=torch.float32)
  54. M0 = a[:, None] * b[None, :] if adata_map is None else (1/np.sum(adata_map)) * adata_map
  55. self.M = torch.tensor(M0, device=device, requires_grad=True, dtype=torch.float32)
  56. self.d_loss = nn.L1Loss()
  57. def _loss_fn(self,verbose=True):
  58. M_probs = F.softmax(F.relu(self.M)+ 1e-10, dim=1)
  59. M_probs = torch.clamp(M_probs, min=1e-10,max=1 - 1e-10)
  60. if self.target_cell_count:
  61. d_pred = torch.log(M_probs.sum(axis=0) / self.M.shape[0])
  62. count_term=self.lambda_d*self.d_loss(d_pred, self.d)
  63. else:
  64. count_term=None
  65. G_pred = torch.matmul(M_probs.t(), self.S)
  66. euclidean_distance_loss = F.pairwise_distance(G_pred, self.G,p=2).mean()
  67. cov_matrix = torch.cov(torch.cat((G_pred, self.G), dim=0).t())
  68. inv_cov_matrix = torch.inverse(cov_matrix)
  69. diff = G_pred - self.G
  70. mahalanobis_distance_loss = torch.sqrt(torch.sum((diff @ inv_cov_matrix) * diff, dim=1)).mean()
  71. combined_distance_loss = (1-self.lambda_mahalanobis) * euclidean_distance_loss + self.lambda_mahalanobis * mahalanobis_distance_loss
  72. distance_term = self.lambda_distance * combined_distance_loss
  73. gv_term = self.lambda_g1 * cosine_similarity(G_pred, self.G, dim=0).mean()
  74. vg_term = self.lambda_g2 * cosine_similarity(G_pred, self.G, dim=1).mean()
  75. expression_term1 = self.alpha * ls.exp_loss(self.D, M_probs/len(self.a))
  76. total_loss =-(gv_term + vg_term)+expression_term1-distance_term
  77. if count_term is not None:
  78. total_loss += count_term
  79. if verbose:
  80. print(
  81. f"Total_loss: {total_loss.item():.3f}, "
  82. f"gv_term: {gv_term.item():.3f}, "
  83. f"vg_term: {vg_term.item():.3f}, "
  84. f"density_term: {count_term.item():.3f}, "
  85. f"expression_term: {expression_term1.item():.3f}, "
  86. f"distance_term:{distance_term.item():.3f},"
  87. )
  88. return total_loss, M_probs
  89. def train(self, num_epochs, learning_rate=0.1, print_each=100):
  90. seed_value = 1000
  91. print("seed:" + str(seed_value))
  92. seed_everything(seed_value)
  93. optimizer = torch.optim.AdamW([self.M], lr=learning_rate,weight_decay=1e-6)
  94. scheduler = torch.optim.lr_scheduler. ReduceLROnPlateau(optimizer, mode='min', factor=0.1, patience=10)
  95. if print_each:
  96. logging.info(f"Printing scores every {print_each} epochs.")
  97. """
  98. {
  99. "total_loss": [],
  100. "main_loss": [],
  101. "vg_reg": [],
  102. "kl_reg": [],
  103. "entropy_reg": []
  104. }
  105. """
  106. for t in range(num_epochs):
  107. if print_each is None or t % print_each != 0:
  108. run_loss = self._loss_fn(verbose=False)
  109. else:
  110. run_loss = self._loss_fn(verbose=True)
  111. loss = run_loss[0]
  112. result=run_loss[-1]
  113. optimizer.zero_grad()
  114. loss.backward()
  115. optimizer.step()
  116. scheduler.step(loss)
  117. with torch.no_grad():
  118. output =result.cpu().numpy()
  119. return output

map_optimizer.py at commit a5b92c2, under GPL-3.0 · at the source

Overview

Authors: Yanan Chen1, Ruoyu Chen2, Shaoqiang Zhang1, Yong Chen3
  1. Department of Data Science, College of Computer and Information Engineering, Tianjin Normal University, 393 Binshui West Road, Xiqing District, Tianjin, Tianjin 300387, China
  2. Department of Physiology, College of Arts and Sciences, University of Pennsylvania, 3600 Market Street, Philadelphia, PA 19104, United States
  3. Department of Biological and Biomedical Sciences, College of Science and Mathematics, Rowan University, 201 Mullica Hill Road, Glassboro, NJ 08028, United States
Institutions: Tianjin Normal University (China); Rowan University (United States); University of Pennsylvania (United States)
Journal: Briefings in bioinformatics, volume 27, issue 4, article bbag404
Dates: received 14 March 2026; accepted 6 July 2026; published online 30 July 2026; in print May 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.1093/bib/bbag404 · PMID 42531062 · PMCID PMC13435232 · OpenAlex W7171839217
Open access: gold, a free copy (OpenAlex)
Status: code verified
Categories: genetics / omics (modality), human (organism), mouse (organism), other condition (population), cellular / molecular (subfield)
Methods: Statistics, Smoothing, state filtering, decompositions, Machine learning
Keywords: spatially resolved transcriptomics, scRNA-seq, unsupervised deep learning, graph attention autoencoder, data integration
MeSH: Deep Learning*, Gene Expression Profiling*, Single-Cell Analysis*, Transcriptome*, Animals, Autoencoder, Humans, Mice, Single-Cell Gene Expression Analysis, Spatial Transcriptomics (* major topic)
Topic: Single-cell and spatial transcriptomics (Molecular Biology, Biochemistry, Genetics and Molecular Biology), according to OpenAlex
Funding: National Science Foundation of China (61572358); Natural Science Foundation of Tianjin City (9JCZDJC35100); NSF CAREER (DBI-2239350)
Citations: not cited yet (Europe PMC); 67 references in the paper

Abstract

Single-cell RNA sequencing (scRNA-seq) enables genome-wide gene expression profiling at single-cell resolution but loses the spatial context essential for interpreting cell identity and tissue organization. In contrast, spatially resolved transcriptomics (SRT) preserves spatial information but typically lacks single-cell resolution or complete transcriptome coverage. To obtain a more comprehensive view of heterogeneous spatial domains and cellular gene expression, we present Cell2Map, an unsupervised deep learning method that integrates scRNA-seq and SRT data from the same tissue region. Cell2Map assigns individual cells to SRT spots using a graph attention autoencoder equipped with a specially designed multi-term objective function that jointly optimizes expression-based, density-based, and embedding-level similarity and distance constraints. On benchmark datasets from mouse cerebellum and hippocampus, Cell2Map achieves higher single-cell mapping precision and overall accuracy than three popular methods (Celloc, CytoSPACE, Tangram) across a range of noise levels and spot cell densities. In real cancer applications, Cell2Map resolves intratumoral heterogeneity by accurately localizing tumor subclones and separating normal epithelial cells from ductal carcinoma in situ regions, and more faithfully reconstructs tumor microenvironments and immune-cell localization than competing approaches. Across breast cancer and myocardial infarction datasets, Cell2Map consistently attains higher sensitivity with fewer false positives, in close agreement with histological and biological annotations.

Reproduced under the paper's license (CC BY), from the paper cited above.

Repositories

Its files are read in the Code ↔ Paper reader above, with 6 matches between paragraphs and lines of code.

digitalcytometry/cytospace

License: other
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Commit: bb7fe12ab4466ef5e38dcac4c3ece07012060d60, 20 February 2025
Languages: Python (11), R (4)
Size: 39 files, 15 scripts
Software Heritage: not archived
Found in: “Data availability”
Holds: README, license file, environment (environment.yml, setup.py)
Not found: CITATION.cff, tests, continuous integration, documentation
Tools: NumPy (5 files), pandas (5 files), Seurat (4 files), SciPy (3 files), data.table (2 files), Matplotlib (1 file), Scanpy (1 file), tidyverse (1 file)
Availability: 1 check, the latest on 27 September 2026: the link answers
  • 27 September 2026: the link answers
17 files

shaoqiangzhang/Cell2Map

License: GPL-3.0
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Commit: a5b92c2e44b9839f53fe2ca8db7c68c7d39c3195, 27 February 2026
Languages: Python (7), Jupyter (6)
Size: 24 files, 13 scripts
Software Heritage: not archived
Found in: “Data availability”
Holds: README, license file, environment (requirements.txt), tests, 6 notebooks
Not found: CITATION.cff, continuous integration, documentation
Tools: NumPy (11 files), pandas (10 files), anndata (9 files), Scanpy (8 files), Matplotlib (7 files), PyTorch (5 files), scikit-learn (4 files), SciPy (3 files), h5py (1 file), PyTorch Geometric (1 file)
Availability: 1 check, the latest on 27 September 2026: the link answers
  • 27 September 2026: the link answers
15 files

The paper's code and data availability statement is in the Data section.

Tracing map

Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.

What the map holds:

  • 2 repositories of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
  • 28 scripts, each with its path and the digest of its content;
  • 6 matches between paragraphs of the paper and lines of the code (method lexical-v1);
  • neither the text of the paper nor the code itself.

Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.

Data

Datasets cited

Data availability

The simulated data of mouse cerebellum and hippocampus can be obtained from https://github.com/digitalcytometry/cytospace. The scRNA-seq data of DCIS1 and DCIS2 of ductal carcinoma can be obtained from the National Center for Biotechnology Information Gene Expression Omnibus (NCBI GEO) with accession numbers GSM5493629 (https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSM5493629) and GSM5493631 (https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSM5493631), respectively. The SRT data of DCIS1 and DCIS2 can be obtained from the Spatial Transcript Omics DataBase with accession numbers STSP0000956 and STSP0000958, respectively. The HER2+ breast cancer scRNA-seq data can be obtained from the GEO with accession number GSE176078 (https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE176078). The Visium breast cancer SRT data are available in https://www.10xgenomics.com/datasets/human-breast-cancer-visium-fresh-frozen-whole-transcriptome-1-standard. The MI scRNA-seq data can be obtained from the GEO with accession number GSE129175 (https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE129175). The SRT data of MI can be obtained from the GEO with accession number GSE165857 (https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE165857). The code for Cell2Map is available at https://github.com/shaoqiangzhang/Cell2Map.

Reproduced under the paper's license (CC BY), from the paper cited above.

Versions

The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.

Version 1, 27 September 2026: the first record

Recorded: type, language, journal, volume, issue, pages, dates, 4 authors, 5 keywords, 10 MeSH terms, 3 funders, 67 references.

Cite

This paper

Chen, Y., Chen, R., Zhang, S., & Chen, Y. (2026). Navigating cell maps by deep learning integration of single-cell and spatially resolved transcriptomics. Briefings in bioinformatics, 27(4), bbag404. https://doi.org/10.1093/bib/bbag404

BibTeX

@article{chen2026navigating,
author = {Chen, Yanan and Chen, Ruoyu and Zhang, Shaoqiang and Chen, Yong},
title = {{Navigating cell maps by deep learning integration of single-cell and spatially resolved transcriptomics}},
journal = {Briefings in bioinformatics},
year = {2026},
month = may,
volume = {27},
number = {4},
pages = {bbag404},
publisher = {Oxford University Press},
issn = {1467-5463},
doi = {10.1093/bib/bbag404},
url = {https://doi.org/10.1093/bib/bbag404},
pmid = {42531062},
pmcid = {PMC13435232}
}

RIS

TY - JOUR
AU - Chen, Yanan
AU - Chen, Ruoyu
AU - Zhang, Shaoqiang
AU - Chen, Yong
TI - Navigating cell maps by deep learning integration of single-cell and spatially resolved transcriptomics
T2 - Briefings in bioinformatics
J2 - Brief Bioinform
PY - 2026
DA - 2026/05/01
VL - 27
IS - 4
SP - bbag404
SN - 1467-5463
PB - Oxford University Press
DO - 10.1093/bib/bbag404
UR - https://doi.org/10.1093/bib/bbag404
LA - en
ER -

CSL-JSON

{
"id": "10.1093/bib/bbag404",
"type": "article-journal",
"title": "Navigating cell maps by deep learning integration of single-cell and spatially resolved transcriptomics",
"container-title": "Briefings in bioinformatics",
"author": [
{
"family": "Chen",
"given": "Yanan"
},
{
"family": "Chen",
"given": "Ruoyu"
},
{
"family": "Zhang",
"given": "Shaoqiang"
},
{
"family": "Chen",
"given": "Yong"
}
],
"container-title-short": "Brief Bioinform",
"volume": "27",
"issue": "4",
"page": "bbag404",
"DOI": "10.1093/bib/bbag404",
"PMID": "42531062",
"PMCID": "PMC13435232",
"ISSN": "1467-5463",
"publisher": "Oxford University Press",
"URL": "https://doi.org/10.1093/bib/bbag404",
"language": "en",
"issued": {
"date-parts": [
[
2026,
5,
1
]
]
}
}

The tracing map gets a citation of its own once an author has validated it and it has a DOI.

Similar papers

The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.

[1] doi:10.21203/rs.3.rs-9676637/v1 [code]
A Comprehensive Benchmarking of Spatial Deconvolution and Domain Detection Methods across Diverse Tissues and Spatial Transcriptomic Technologies
Journal: Research Square (preprint)
In common: PyTorch Geometric, anndata, Scanpy, 10 other tools, genetics / omics, 7 references
[2] doi:10.1093/nar/gkag706 [code]
scDifformer: diffusion-based post-training for virtual cell modeling across large-scale single-cell data.
Journal: Nucleic acids research
In common: PyTorch Geometric, anndata, Scanpy, 9 other tools, 5 references
[3] doi:10.1093/bioinformatics/btag540 [code]
Deciphering spatial heterogeneity by multimodal spatial transcriptomics modelling with SpatialModal.
Journal: Bioinformatics (Oxford, England)
In common: PyTorch Geometric, anndata, Scanpy, 7 other tools, genetics / omics, mouse, 6 references
[4] doi:10.1016/j.isci.2026.117206 [code]
ReliST: A model-agnostic risk layer for spatial transcriptomics deconvolution.
Journal: iScience
In common: anndata, Scanpy, PyTorch, 5 other tools, genetics / omics, mouse, 8 references
[5] doi:10.1038/s41592-026-03194-8 [code]
Beyond benchmarking: an expert-guided consensus approach to spatially aware clustering.
Journal: Nature methods
In common: PyTorch Geometric, anndata, Scanpy, 9 other tools, genetics / omics, 4 references
[6] doi:10.1093/bib/bbag298 [code]
Empowering multifaceted analysis of spatial transcriptomics data with RGAST.
Journal: Briefings in bioinformatics
In common: PyTorch Geometric, anndata, Scanpy, 6 other tools, genetics / omics, mouse, 6 references
[7] doi:10.1038/s42003-026-10259-z [code]
Spatial transcriptomic profiling of developing mouse hearts reveals a spatially patterned signaling environment.
Journal: Communications biology
In common: anndata, Scanpy, Seurat, 8 other tools, genetics / omics, mouse, cellular / molecular, 4 references
[8] doi:10.1002/advs.77003 [code]
SemanticST: A Scalable Multi-Contextual Graph Learning Framework for Uncovering Spatial Niches and Robust Multi-Sample Integration in Spatial Transcriptomics.
Journal: Advanced science (Weinheim, Baden-Wurttemberg, Germany)
In common: PyTorch Geometric, anndata, Scanpy, 7 other tools, genetics / omics, 5 references
[9] doi:10.1038/s41467-026-71759-4 [code]
CellNiche represents cellular microenvironments in atlas-scale spatial omics data with contrastive learning.
Journal: Nature communications
In common: PyTorch Geometric, anndata, Scanpy, 6 other tools, other condition, mouse, cellular / molecular, 5 references
[10] doi:10.1038/s41593-026-02293-1 [code]
Optics-free spatial genomics for mapping mammalian brain aging by IRISeq.
Journal: Nature neuroscience
In common: Scanpy, Seurat, tidyverse, 5 other tools, genetics / omics, mouse, cellular / molecular, 7 references

Contribute

The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.

Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.

Request its removal

To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).

Discussion, reproductions, activity

Discussion: questions and error reports about this paper and its code, from signed-in readers and its authors. It opens with sign-in.

Reproductions: reports from readers who ran the authors' code: what they reproduced, with which environment, commit and data. It opens with sign-in.

Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.