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.

4 blocks of code here have a permanent identifier (oscr:b:…), listed with the matches below: citable for good, with a page of its own. Select a match and press Cite to copy it. What a block identifier is.

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

Paper

Loaded from Europe PMC by your browser; OSCR does not store it: 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 (how the code is found and 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.1038/s41467-026-70090-2 [code]
Reconstructing single-cell resolution from spatial transcriptomics with CellRefiner.
Journal: Nature communications
In common: PyTorch Geometric, anndata, Scanpy, 9 other tools, genetics / omics, mouse, cellular / molecular, 9 references
[2] doi:10.1093/bib/bbae250 [code]
Benchmarking mapping algorithms for cell-type annotating in mouse brain by integrating single-nucleus RNA-seq and Stereo-seq data.
Journal: Briefings in bioinformatics
In common: PyTorch Geometric, anndata, Scanpy, 10 other tools, genetics / omics, mouse, 9 references
[3] doi:10.1186/s13059-025-03677-5 [code]
Systematic assessment of microenvironment-dependent transcriptional patterns and intercellular communication.
Journal: Genome biology
In common: Scanpy, Seurat, tidyverse, 5 other tools, NCBI GEO GSE176078, genetics / omics, other condition, cellular / molecular, 8 references
[4] 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
[5] doi:10.1038/s41467-023-38121-4 [code]
Reconstruction of the cell pseudo-space from single-cell RNA sequencing data with scSpace.
Journal: Nature communications
In common: anndata, Scanpy, Seurat, 8 other tools, genetics / omics, other condition, cellular / molecular, 9 references
[6] doi:10.1038/s42003-024-06349-5 [code]
SpatialPrompt: spatially aware scalable and accurate tool for spot deconvolution and domain identification in spatial transcriptomics.
Journal: Communications biology
In common: anndata, Scanpy, Seurat, 8 other tools, genetics / omics, mouse, 9 references
[7] doi:10.1038/s41467-023-36796-3 [code]
Spatially informed clustering, integration, and deconvolution of spatial transcriptomics with GraphST.
Journal: Nature communications
In common: anndata, Scanpy, Seurat, 9 other tools, genetics / omics, cellular / molecular, 8 references
[8] doi:10.1038/s41467-023-44367-9 [code]
MENDER: fast and scalable tissue structure identification in spatial omics data.
Journal: Nature communications
In common: PyTorch Geometric, anndata, Scanpy, 8 other tools, genetics / omics, 9 references
[9] doi:10.1371/journal.pbio.3003477 [code]
Cell2Spatial is a computational framework that maps single cells to spatial transcriptomic spots to reconstruct tissue architecture.
Journal: PLoS biology
In common: Seurat, data.table, tidyverse, 4 other tools, genetics / omics, mouse, cellular / molecular, 11 references
[10] doi:10.1093/bib/bbaf657 [code]
SpaTM: topic models for inferring spatially informed transcriptional programs.
Journal: Briefings in bioinformatics
In common: PyTorch Geometric, anndata, Scanpy, 10 other tools, genetics / omics, 5 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.

Add the badge to the code's README

OSCR: the badge of this paper

If you are an author or a maintainer of this paper's code, you can add this badge. It says what OSCR knows of the paper (its code, its validated tracing map) and links the code to this page. Paste one of these snippets under the README's title. Keep the two marks around it, so that the badge can be replaced in place and is never added twice. OSCR changes nothing in your repository.

Markdown
<!-- oscr-badge:start -->
[![OSCR](https://openscicode.org/badge/doi/10.1093/bib/bbag404.svg)](https://openscicode.org/badge/doi/10.1093/bib/bbag404)
<!-- oscr-badge:end -->
reStructuredText
.. oscr-badge:start

.. image:: https://openscicode.org/badge/doi/10.1093/bib/bbag404.svg
   :target: https://openscicode.org/badge/doi/10.1093/bib/bbag404
   :alt: OSCR

.. oscr-badge:end
HTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.1093/bib/bbag404"><img src="https://openscicode.org/badge/doi/10.1093/bib/bbag404.svg" alt="OSCR"></a>
<!-- oscr-badge:end -->

On GitHub, open the README, choose Edit (the pencil), paste the snippet under the title, then "Commit changes".

If you choose to, you can have the badge kept up to date for you, with oscr badge --write from the command line or with the GitHub Action in your repository's workflows. Every other form and option (a card, AsciiDoc, LaTeX, shields.io) is on the badge 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: code errors and mismatches between the code and the paper about this paper and its code, from readers and its authors, beside the paper and its tracing map.

Report a mismatch between the code and the paper · Report a code error (signed in)

Reproductions: reports from readers who ran the authors' code and did not get the paper's result, what they ran, with which environment, commit and data.

Report a reproduction failure (signed in)

Versions of its code: the releases of its code tied to a version of this paper (the preprint, the accepted manuscript, the version of record…), each with the tracing map versioned with it.

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