OSCR

Optimal gene panel selection for targeted spatial transcriptomics experiments.

Code ↔ Paper

2 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.

2 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 2 matches
  1. [1] § Material and methods › Implementation details ↔ reconst/trainer.py, lines 7 to 52 · score 0.57 · weight decay, Adam, penalty, optimizer, loss, autoencoder · block oscr:b:GQ1ZGJ1P6NTKM-9 · Report a mismatch
  2. [2] § Material and methods › Implementation details ↔ reconst/model.py, lines 7 to 38 · score 0.53 · LeakyReLU, dropout, decoder, encoder, model, weight · block oscr:b:KE4FB5Y629E3J-F · 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 · 85 lines · 2.6 KB · no license · 1 match

  1. """Training and evaluation functions"""
  2. import torch
  3. from torch import nn
  4. def train_model(model, train_loader, test_loader, num_epochs=20, lr=1e-3,
  5. weight_decay=1e-5, l_lambda=1e-4, device='cpu'):
  6. """Train the autoencoder model"""
  7. criterion = nn.MSELoss()
  8. optimizer = torch.optim.Adam(model.parameters(), lr=lr, weight_decay=weight_decay)
  9. train_losses = []
  10. test_losses = []
  11. for epoch in range(num_epochs):
  12. model.train()
  13. train_loss = 0
  14. for data in train_loader:
  15. genes = data.to(device)
  16. screened_features, _, outputs = model(genes)
  17. loss = criterion(outputs, genes)
  18. l1_penalty = l_lambda * torch.norm(model.feature_importance, p=1)
  19. total_loss = loss + l1_penalty
  20. optimizer.zero_grad()
  21. total_loss.backward()
  22. optimizer.step()
  23. train_loss += loss.item() * genes.size(0)
  24. train_loss /= len(train_loader.dataset)
  25. train_losses.append(train_loss)
  26. # Evaluate on test data
  27. model.eval()
  28. test_loss = 0
  29. with torch.no_grad():
  30. for data in test_loader:
  31. genes = data.to(device)
  32. _, _, outputs = model(genes)
  33. loss = criterion(outputs, genes)
  34. test_loss += loss.item() * genes.size(0)
  35. test_loss /= len(test_loader.dataset)
  36. test_losses.append(test_loss)
  37. print(f'Epoch [{epoch+1}/{num_epochs}], Train: {train_loss:.4f}, Test: {test_loss:.4f}')
  38. return train_losses, test_losses
  39. def evaluate_model(model, test_loader, gene_mask=None, device='cpu'):
  40. """Evaluate model on test data, optionally with gene filtering"""
  41. criterion = nn.MSELoss()
  42. model.eval()
  43. test_loss = 0
  44. with torch.no_grad():
  45. for data in test_loader:
  46. genes = data.to(device)
  47. if gene_mask is not None:
  48. if not isinstance(gene_mask, torch.Tensor):
  49. gene_mask = torch.tensor(gene_mask)
  50. gene_mask = gene_mask.to(device)
  51. filtered_genes = genes * gene_mask
  52. else:
  53. filtered_genes = genes
  54. _, _, outputs = model(filtered_genes)
  55. loss = criterion(outputs, genes)
  56. test_loss += loss.item() * genes.size(0)
  57. test_loss /= len(test_loader.dataset)
  58. return test_loss
  59. def select_genes(model, threshold=0.001):
  60. """Select genes based on feature importance threshold"""
  61. feature_importances = model.feature_importance.data.cpu().numpy()
  62. genes_mask = feature_importances >= threshold
  63. return genes_mask, feature_importances

trainer.py at commit 7479571, no license · at the source

Overview

Authors: Haoran Lu1, Luyang Fang1, Orlando Zeng1, Wenxuan Zhong1, Guo-Cheng Yuan2, Ping Ma1
  1. Department of Statistics, University of Georgia, Athens, GA 30602, United States
  2. Department of Genetics and Genomic Sciences, Icahn School of Medicine at Mount Sinai, New York, NY 10029, United States
Institutions: University of Georgia (United States); Icahn School of Medicine at Mount Sinai (United States)
Journal: Nucleic acids research, volume 54, issue 11, article gkag621
Dates: received 6 November 2025; accepted 25 May 2026; published online 17 June 2026; in print June 2026
Type: Research article · Language: English
License: CC BY-NC
Identifiers: DOI 10.1093/nar/gkag621 · PMID 42306947 · PMCID PMC13273311 · OpenAlex W4414969382
Open access: gold, a free copy (OpenAlex)
Status: code verified (how the code is found and verified)
Categories: genetics / omics (modality), mouse (organism), cellular / molecular (subfield)
Methods: Machine learning, Connectivity
MeSH: Gene Expression Profiling*, Transcriptome*, Algorithms, Animals, Autoencoder, Brain, Lung, Mice, RNA-Seq, Single-Cell Analysis, Single-Cell Gene Expression Analysis, Software, Spatial Transcriptomics (* major topic)
Topic: Single-cell and spatial transcriptomics (Molecular Biology, Biochemistry, Genetics and Molecular Biology), according to OpenAlex
Funding: National Science Foundation (NSF DMS-1925066, DMS-1903226, DMS-2124493, DMS-2311297, DMS-2319279, DMS-2318809); National Institutes of Health (R01GM152814, RF1MH133703)
Citations: not cited yet (Europe PMC); 60 references in the paper

Abstract

Spatial transcriptomics analysis is a powerful approach for dissecting the structure of tissue microenvironment and uncovering the mechanism of cell–cell communications. However, existing technologies are limited by either spatial resolution or gene coverage. Most single-cell-resolution technologies target only a few hundred preselected genes, whose choice plays an important role in the overall analysis. It remains a challenge to optimally design a gene panel to maximize the utility of spatial transcriptomics profiling. To fill this gap, we introduce a novel method, named ReconST, to automatically design optimal gene panels for spatial transcriptomics profiling. ReconST leverages information from existing scRNA-seq data and identifies the optimal subset of genes by using a gated autoencoder. By using a high-coverage mouse brain MERFISH dataset and a fetal lung dataset as the reference benchmarks, we showed that ReconST outperforms existing methods in terms of reconstruction accuracy, spatial pattern preservation, and computing efficiency. As such, ReconST provides a useful and generally applicable tool for optimal gene panel design, which in turn can significantly enhance the utility of spatial transcriptomics profiling in a wide range of biomedical investigations.

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

Repositories

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

haoranlustat.github.io/reconst

License: none: the authors keep all their rights
State: the link answers, verified on 27 September 2026
Evidence: the link answers
Software Heritage: not checked
Found in: “Data availability”
Not found: README, license file, CITATION.cff, environment file, tests, continuous integration, documentation
Availability: 1 check, the latest on 27 September 2026: the link answers (HTTP 200)
  • 27 September 2026: the link answers (HTTP 200)

Zenodo 20434940

License: CC-BY-4.0
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Size: 1 file
Software Heritage: not checked
Found in: “Data availability”
Not found: README, license file, CITATION.cff, environment file, tests, continuous integration, documentation
Tools: PyTorch (5 files), NumPy (2 files), pandas (2 files), Scanpy (2 files), Matplotlib (1 file)
Availability: 1 check, the latest on 27 September 2026: the link answers (HTTP 200)
  • 27 September 2026: the link answers (HTTP 200)
7 files

haoranlustat/reconst

License: none: the authors keep all their rights
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Commit: 7479571b9e579a00ff31d7b703ac0cb74ad1494c, 3 December 2025
Languages: Python (5), Jupyter (1)
Size: 29 files, 6 scripts
Software Heritage: not archived
Found in: the Zenodo archive record
Holds: README, environment (setup.py), documentation, 1 notebook
Not found: license file, CITATION.cff, tests, continuous integration
Tools: PyTorch (5 files), NumPy (2 files), pandas (2 files), Scanpy (2 files), Matplotlib (1 file)
Availability: 1 check, the latest on 27 September 2026: the link answers
  • 27 September 2026: the link answers
7 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:

  • 3 repositories of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
  • 12 scripts, each with its path and the digest of its content;
  • 2 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

No dataset and no data link were found in the paper.

Data availability

The software of the ReconST method is developed in a python package submitted as Supplementary file and is publicly available at https://haoranlustat.github.io/ReconST/ and https://doi.org/10.5281/zenodo.20434940 with a tutorial.

Reproduced under the paper's license (CC BY-NC), 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, 6 authors, 13 MeSH terms, 2 funders, 51 references.

Cite

This paper

Lu, H., Fang, L., Zeng, O., Zhong, W., Yuan, G.-C., & Ma, P. (2026). Optimal gene panel selection for targeted spatial transcriptomics experiments. Nucleic acids research, 54(11), gkag621. https://doi.org/10.1093/nar/gkag621

BibTeX

@article{lu2026optimal,
author = {Lu, Haoran and Fang, Luyang and Zeng, Orlando and Zhong, Wenxuan and Yuan, Guo-Cheng and Ma, Ping},
title = {{Optimal gene panel selection for targeted spatial transcriptomics experiments}},
journal = {Nucleic acids research},
year = {2026},
month = jun,
volume = {54},
number = {11},
pages = {gkag621},
publisher = {Oxford University Press},
issn = {0305-1048},
doi = {10.1093/nar/gkag621},
url = {https://doi.org/10.1093/nar/gkag621},
pmid = {42306947},
pmcid = {PMC13273311}
}

RIS

TY - JOUR
AU - Lu, Haoran
AU - Fang, Luyang
AU - Zeng, Orlando
AU - Zhong, Wenxuan
AU - Yuan, Guo-Cheng
AU - Ma, Ping
TI - Optimal gene panel selection for targeted spatial transcriptomics experiments
T2 - Nucleic acids research
J2 - Nucleic Acids Res
PY - 2026
DA - 2026/06/01
VL - 54
IS - 11
SP - gkag621
SN - 0305-1048
PB - Oxford University Press
DO - 10.1093/nar/gkag621
UR - https://doi.org/10.1093/nar/gkag621
LA - en
ER -

CSL-JSON

{
"id": "10.1093/nar/gkag621",
"type": "article-journal",
"title": "Optimal gene panel selection for targeted spatial transcriptomics experiments",
"container-title": "Nucleic acids research",
"author": [
{
"family": "Lu",
"given": "Haoran"
},
{
"family": "Fang",
"given": "Luyang"
},
{
"family": "Zeng",
"given": "Orlando"
},
{
"family": "Zhong",
"given": "Wenxuan"
},
{
"family": "Yuan",
"given": "Guo-Cheng"
},
{
"family": "Ma",
"given": "Ping"
}
],
"container-title-short": "Nucleic Acids Res",
"volume": "54",
"issue": "11",
"page": "gkag621",
"DOI": "10.1093/nar/gkag621",
"PMID": "42306947",
"PMCID": "PMC13273311",
"ISSN": "0305-1048",
"publisher": "Oxford University Press",
"URL": "https://doi.org/10.1093/nar/gkag621",
"language": "en",
"issued": {
"date-parts": [
[
2026,
6,
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.1093/nsr/nwaf030 [code]
DSCT: a novel deep-learning framework for rapid and accurate spatial transcriptomic cell typing.
Journal: National science review
In common: Scanpy, PyTorch, pandas, 2 other tools, genetics / omics, cellular / molecular, 12 references
[2] doi:10.1038/s41467-022-35288-0 [code]
Spatial-ID: a cell typing method for spatially resolved transcriptomics via transfer learning and spatial embedding.
Journal: Nature communications
In common: Scanpy, PyTorch, pandas, 2 other tools, genetics / omics, mouse, cellular / molecular, 11 references
[3] doi:10.1038/s41467-023-44367-9 [code]
MENDER: fast and scalable tissue structure identification in spatial omics data.
Journal: Nature communications
In common: Scanpy, PyTorch, pandas, 2 other tools, genetics / omics, 11 references
[4] doi:10.1038/s41467-023-37392-1 [code]
Predictive and robust gene selection for spatial transcriptomics.
Journal: Nature communications
In common: Scanpy, PyTorch, pandas, 2 other tools, genetics / omics, cellular / molecular, 9 references
[5] doi:10.1038/s41467-022-34879-1 [code]
Spatially aware dimension reduction for spatial transcriptomics.
Journal: Nature communications
In common: pandas, Matplotlib, NumPy, genetics / omics, cellular / molecular, 11 references
[6] doi:10.1038/s41592-026-03034-9 [code]
3d-OT: a deep geometry-aware framework for heterogeneous slices alignment of spatial multi-omics.
Journal: Nature methods
In common: Scanpy, PyTorch, pandas, 2 other tools, genetics / omics, mouse, 8 references
[7] doi:10.1038/s41467-022-34867-5 [code]
SOTIP is a versatile method for microenvironment modeling with spatial omics data.
Journal: Nature communications
In common: Scanpy, pandas, Matplotlib, 1 other tool, genetics / omics, mouse, 9 references
[8] doi:10.1093/gigascience/giae103 [code]
Unveiling patterns in spatial transcriptomics data: a novel approach utilizing graph attention autoencoder and multiscale deep subspace clustering network.
Journal: GigaScience
In common: Scanpy, PyTorch, pandas, 2 other tools, genetics / omics, mouse, 8 references
[9] 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: Scanpy, PyTorch, pandas, 2 other tools, genetics / omics, 8 references
[10] doi:10.1073/pnas.2309227120 [code]
Rapid and signal crowdedness-robust in situ sequencing through hybrid block coding.
Journal: Proceedings of the National Academy of Sciences of the United States of America
In common: PyTorch, pandas, Matplotlib, 1 other tool, genetics / omics, mouse, cellular / molecular, 8 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/nar/gkag621.svg)](https://openscicode.org/badge/doi/10.1093/nar/gkag621)
<!-- oscr-badge:end -->
reStructuredText
.. oscr-badge:start

.. image:: https://openscicode.org/badge/doi/10.1093/nar/gkag621.svg
   :target: https://openscicode.org/badge/doi/10.1093/nar/gkag621
   :alt: OSCR

.. oscr-badge:end
HTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.1093/nar/gkag621"><img src="https://openscicode.org/badge/doi/10.1093/nar/gkag621.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.