OSCR

Interpretable learning of temporal cellular dynamics from single-cell data.

Code ↔ Paper

8 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 8 matches · 1 of them tie a paragraph to a whole file, not to given lines: a weak match, whose lines are not tinted
  1. [1] § STAR★Methods › Method details › RNA velocity ↔ scvelo/core/_models.py, the whole file · a weak match · score 0.75 · spliced RNA, degradation rate, splicing rate, transcription rate, abundance, unspliced
  2. [2] § STAR★Methods › Method details › RNA velocity ↔ scvelo/inference/_metabolic_labeling.py, lines 381–491 · score 0.75 · mRNA, splicing kinetics, degradation rate, transcription rate, inference
  3. [3] § STAR★Methods › Method details › Neural ODE ↔ neurovelo/model.py, lines 11–40 · score 0.72 · hidden layer, neural ODE, cellular dynamics, latent space, dimensional
  4. [4] § STAR★Methods › Method details › Encoder/decoder architecture ↔ neurovelo/module.py, lines 95–131 · score 0.63 · linear decoder, latent representation, latent space, encoder, reconstruction, gene
  5. [5] § STAR★Methods › Method details › Model architecture ↔ neurovelo/model.py, lines 11–40 · score 0.61 · auto encoder, neural ODEs, latent space, NeuroVelo, Model, dynamics
  6. [6] § STAR★Methods › Method details › Model architecture ↔ neurovelo/module.py, lines 95–131 · score 0.60 · auto encoder, latent representation, latent space, linear, NeuroVelo
  7. [7] § STAR★Methods › Method details › Neural ODE ↔ neurovelo/train.py, lines 20–77 · score 0.53 · hidden layer, latent space, ODEs, dimensional, Linear, cells
  8. [8] § Results › Reconstructing dynamical mechanisms from scRNA-seq data ↔ scvelo/datasets/_datasets.py, lines 278–302 · score 0.51 · immune cell, bone marrow, scVelo

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 · 168 lines · 5.8 KB · BSD-3-Clause · 2 matches

  1. import torch
  2. import torch.nn as nn
  3. import torch.nn.functional as F
  4. from torchdiffeq import odeint
  5. from typing import Optional
  6. from typing_extensions import Literal
  7. from .module import LatentODE, Encoder, Decoder
  8. class TNODE(nn.Module):
  9. """
  10. Class to automatically infer treatment wise cellular dynamics using autoencoder and neural ODE.
  11. Parameters
  12. ----------
  13. n_int
  14. Number of genes.
  15. n_latent
  16. Dimension of latent space.
  17. (Default: 20)
  18. n_sample
  19. Number of samples or treatment as independant ODEs
  20. (Default: 1)
  21. n_ode_hidden
  22. The dimensionality of the hidden layer for the ODE function.
  23. (Default: 128)
  24. n_vae_hidden
  25. The dimensionality of the hidden layer for the AutoEncoder.
  26. (Default: 128)
  27. batch_norm
  28. Whether to include `BatchNorm` layer.
  29. (Default: 'False')
  30. ode_method
  31. ODE Solver method.
  32. (Default: 'euler')
  33. same_ode
  34. Whether to initialize all ODEs with same initialization
  35. (Default: 'False')
  36. """
  37. def __init__(
  38. self,
  39. n_int: int,
  40. n_latent: int = 20,
  41. n_sample: int = 1,
  42. n_ode_hidden: int = 128,
  43. n_vae_hidden: int = 128,
  44. batch_norm: bool = False,
  45. ode_method: str = 'dopri5',
  46. same_ode: bool = False,
  47. pre_ptime: bool = False,
  48. reconstruct_xt: bool = False,
  49. ):
  50. super().__init__()
  51. self.n_int = n_int
  52. self.n_latent = n_latent
  53. self.n_ode_hidden = n_ode_hidden
  54. self.n_vae_hidden = n_vae_hidden
  55. self.batch_norm = batch_norm
  56. self.ode_method = ode_method
  57. self.n_sample = n_sample
  58. self.same_ode = same_ode
  59. self.pre_ptime = pre_ptime
  60. self.reconstruct_xt = reconstruct_xt
  61. self.lode_func = nn.ModuleDict({f'node_{i}': LatentODE(n_latent, n_ode_hidden) for i in range(self.n_sample)})
  62. self.encoder = Encoder(n_int, n_latent, n_vae_hidden, batch_norm)
  63. self.decoder = Decoder(n_int, n_latent, n_vae_hidden, batch_norm)
  64. self.beta, self.lam = torch.nn.Parameter(torch.Tensor(self.n_latent), requires_grad=True), torch.nn.Parameter(torch.Tensor(self.n_latent), requires_grad=True)
  65. nn.init.uniform_(self.beta)
  66. nn.init.uniform_(self.lam)
  67. def forward(self, s: torch.Tensor, u: torch.Tensor, Pt: torch.Tensor, g: torch.Tensor) -> tuple:
  68. """
  69. Given the transcriptomes and the treatments of cells, this function predicts the time, latent space and dynamics of the cells.
  70. Parameters
  71. ----------
  72. s
  73. Spliced reads.
  74. u
  75. Unspliced reads.
  76. Pt
  77. Pseudotime tensor (Only if you want your velocity to follow specific pseudotime)
  78. g
  79. Sample/Treatment index.
  80. Returns
  81. ----------
  82. 5-tuple of :class:`torch.Tensor`
  83. Tensors for loss, including:
  84. 1) total loss,
  85. 2) reconstruction loss from encoder-derived latent space,
  86. 3) reconstruction loss from ODE-solver latent space,
  87. """
  88. if self.pre_ptime:
  89. Ts, z_s = self.encoder(s)
  90. _, z_u = self.encoder(u)
  91. Ts = Ts.ravel()
  92. index = torch.argsort(Ts)
  93. Ts = Ts[index]
  94. s = s[index]
  95. z_s = z_s[index]
  96. u = u[index]
  97. z_u = z_u[index]
  98. g = g[index]
  99. Pt = Pt[index]
  100. index2 = (Ts[:-1] != Ts[1:])
  101. index2 = torch.cat((index2, torch.tensor([True]).to(index2.device))) ## index2 is used to get unique time points as odeint requires strictly increasing/decreasing time points
  102. Ts = Ts[index2]
  103. s = s[index2]
  104. z_s = z_s[index2]
  105. z_u = z_u[index2]
  106. u = u[index2]
  107. g = g[index2]
  108. Pt = Pt[index2]
  109. pt_loss = F.mse_loss(Pt, Ts, reduction='mean')
  110. else:
  111. Ts, z_s = self.encoder(s)
  112. _, z_u = self.encoder(u)
  113. Ts = Ts.ravel()
  114. index = torch.argsort(Ts)
  115. Ts = Ts[index]
  116. s = s[index]
  117. z_s = z_s[index]
  118. u = u[index]
  119. z_u = z_u[index]
  120. g = g[index]
  121. index2 = (Ts[:-1] != Ts[1:])
  122. index2 = torch.cat((index2, torch.tensor([True]).to(index2.device))) ## index2 is used to get unique time points as odeint requires strictly increasing/decreasing time points
  123. Ts = Ts[index2]
  124. s = s[index2]
  125. z_s = z_s[index2]
  126. z_u = z_u[index2]
  127. u = u[index2]
  128. g = g[index2]
  129. pt_loss = 0
  130. pred_z = torch.empty(s.size(0), self.n_latent).to(s.device)
  131. z_div = torch.Tensor([0]).to(s.device)
  132. for i in range(self.n_sample):
  133. mask = g == i
  134. if mask.sum() == 0:
  135. continue
  136. zsm = z_s[mask]
  137. zum = z_u[mask]
  138. Tm = Ts[mask]
  139. z0 = zsm[0]
  140. pred_z[mask] = odeint(self.lode_func[f'node_{i}'], z0, Tm, method = self.ode_method).view(-1, self.n_latent)
  141. z_div += F.mse_loss(self.lode_func[f'node_{i}'](Tm, pred_z[mask]), (torch.exp(self.beta)*zum-torch.exp(self.lam)*zsm), reduction='mean')
  142. pred_x_s = self.decoder(z_s)
  143. pred_x_u = self.decoder(z_u)
  144. if self.reconstruct_xt:
  145. pred_x_t = self.decoder(pred_z)
  146. recon_loss_xt = F.mse_loss(s, pred_x_t, reduction='mean')
  147. else:
  148. recon_loss_xt = F.mse_loss(z_s, pred_z, reduction='mean')
  149. recon_loss_ec = F.mse_loss(s, pred_x_s, reduction='mean')
  150. recon_loss_ec_u = F.mse_loss(u, pred_x_u, reduction='mean')
  151. loss =recon_loss_ec + recon_loss_ec_u + z_div + recon_loss_xt + pt_loss
  152. return loss, recon_loss_ec, recon_loss_ec_u, z_div

model.py at commit 0f069ba, under BSD-3-Clause · at the source

Overview

Authors: Idris Kouadri Boudjelthia1,2, Salvatore Milite3, Nour El Kazwini1, Yuanhua Huang4, Andrea Sottoriva3, Guido Sanguinetti1,5
  1. Theoretical and Scientific Data Science, International School for Advanced Studies, Trieste, Italy
  2. Abdus Salam International Centre for Theoretical Physics, Trieste, Italy
  3. Computational Biology Research Centre, Human Technopole, Milan, Italy
  4. School of Biomedical Sciences, University of Hong Kong, Hong Kong, China
  5. School of Informatics, University of Edinburgh, Edinburgh, UK
Journal: Cell reports methods, volume 6, issue 3, article 101342
Dates: received 30 October 2025; accepted 9 February 2026; published online 23 March 2026; in print March 2026
Type: Research article · Language: English
License: CC BY-NC-ND
Identifiers: DOI 10.1016/j.crmeth.2026.101342 · PMID 41875867 · PMCID PMC13030976 · OpenAlex W7140088902
Open access: gold, a free copy (OpenAlex)
Status: code verified
Categories: genetics / omics (modality), human (organism), cellular / molecular (subfield)
Methods: Machine learning
Keywords: single-cell transcriptomics, RNA velocity, neural networks, dynamical systems
MeSH: Computational Biology*, Single-Cell Analysis*, Algorithms, Animals, Gene Regulatory Networks, Humans, Neural Networks, Computer, Single-Cell Gene Expression Analysis (* major topic)
Topic: Single-cell and spatial transcriptomics (Molecular Biology, Biochemistry, Genetics and Molecular Biology), according to OpenAlex
Funding: European Research Council (101125077); Associazione Italiana per la Ricerca sul Cancro (28961, 27631)
Citations: cited by 1 paper (Europe PMC); 30 references in the paper

Abstract

The abstract is not reproduced here: the paper's license (CC BY-NC-ND) does not allow it. Read it in the paper, at the publisher or on Europe PMC.

Repositories

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

idriskb/NeuroVelo

License: BSD-3-Clause
State: the link answers, verified on 30 September 2026
Evidence: files inventoried
Commit: 0f069baf23e64b1184af70b9983060d28d9fb6a3, 10 May 2025
Languages: Python (8), Jupyter (4)
Size: 102 files, 12 scripts
Software Heritage: not archived
Found in: “Data and code availability”
Holds: README, license file, environment (environment.yml, setup.py), 4 notebooks
Not found: CITATION.cff, tests, continuous integration, documentation
Tools: NumPy (7 files), PyTorch (6 files), scVelo (5 files), Matplotlib (4 files), anndata (3 files), Scanpy (3 files), SciPy (3 files), seaborn (3 files), pandas (2 files), scikit-learn (2 files), NetworkX (1 file)
Availability: 1 check, the latest on 30 September 2026: the link answers
  • 30 September 2026: the link answers
14 files

Zenodo 18358806

License: BSD-3-Clause
State: the link answers, verified on 30 September 2026
Evidence: files inventoried
Size: 1 file
Software Heritage: not checked
Found in: “Data and code availability”
Not found: README, license file, CITATION.cff, environment file, tests, continuous integration, documentation
Availability: 1 check, the latest on 30 September 2026: the link answers (HTTP 200)
  • 30 September 2026: the link answers (HTTP 200)

theislab/scvelo

License: BSD-3-Clause
State: the link answers, verified on 30 September 2026
Evidence: files inventoried
Commit: f63c0e70596ced2f1bee8cf07e8ab66037cf86b2, 25 February 2026
Languages: Python (81)
Size: 397 files, 81 scripts
Software Heritage: archived
Found in: the text, “Key resources table”
Holds: README, license file, environment (pyproject.toml), tests, continuous integration, documentation
Not found: CITATION.cff
Tools: NumPy (56 files), scVelo (51 files), SciPy (34 files), pandas (21 files), anndata (19 files), Matplotlib (19 files), Scanpy (10 files), scikit-learn (7 files), NetworkX (2 files), igraph (1 file), rpy2 (1 file), seaborn (1 file), UMAP (1 file)
Availability: 1 check, the latest on 30 September 2026: the link answers
  • 30 September 2026: the link answers
83 files

scverse/scanpy

License: BSD-3-Clause
State: the link answers, verified on 28 September 2026
Evidence: files inventoried
Commit: 7db89c60639ed01c027ae8a10af65ff972232cda, 27 September 2026
Languages: Python (215), Jupyter (11), R (2)
Size: 886 files, 228 scripts
Software Heritage: archived
Found in: the text, “Key resources table”
Holds: README, license file, environment (pyproject.toml), tests, continuous integration, documentation, 11 notebooks
Not found: CITATION.cff
Tools: anndata (50 files), NumPy (40 files), Scanpy (27 files), pandas (26 files), Matplotlib (15 files), SciPy (12 files), scikit-learn (9 files), Numba (6 files), h5py (5 files), igraph (4 files), seaborn (2 files), UMAP (1 file)
Availability: 1 check, the latest on 28 September 2026: the link answers
  • 28 September 2026: the link answers
106 files

rtqichen/torchdiffeq

License: MIT
State: the link answers, verified on 30 September 2026
Evidence: files inventoried
Commit: 657943acefa826ef04c025ebeb1ff5e9d60dc268, 3 April 2025
Languages: Python (35)
Size: 47 files, 35 scripts
Software Heritage: archived
Found in: the text, “Key resources table”
Holds: README, license file, CITATION.cff, environment (setup.py), tests
Not found: continuous integration, documentation
Tools: PyTorch (30 files), NumPy (7 files), Matplotlib (6 files), SciPy (4 files), Pillow (1 file), scikit-learn (1 file)
Availability: 1 check, the latest on 30 September 2026: the link answers
  • 30 September 2026: the link answers
37 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:

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

Code and data availability statement

The paper has a code and data availability statement. Its license (CC BY-NC-ND) does not allow reproducing it here; in short, from what the harvester recognized in it:

Read it in the paper: doi.org/10.1016/j.crmeth.2026.101342.

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, 30 September 2026: the first record

Recorded: type, language, journal, volume, issue, pages, dates, 6 authors, 4 keywords, 8 MeSH terms, 2 funders, 30 references.

Cite

This paper

Kouadri Boudjelthia, I., Milite, S., El Kazwini, N., Huang, Y., Sottoriva, A., & Sanguinetti, G. (2026). Interpretable learning of temporal cellular dynamics from single-cell data. Cell reports methods, 6(3), 101342. https://doi.org/10.1016/j.crmeth.2026.101342

BibTeX

@article{kouadriboudjelthia2026interpretable,
author = {Kouadri Boudjelthia, Idris and Milite, Salvatore and El Kazwini, Nour and Huang, Yuanhua and Sottoriva, Andrea and Sanguinetti, Guido},
title = {{Interpretable learning of temporal cellular dynamics from single-cell data}},
journal = {Cell reports methods},
year = {2026},
month = mar,
volume = {6},
number = {3},
pages = {101342},
publisher = {Elsevier},
issn = {2667-2375},
doi = {10.1016/j.crmeth.2026.101342},
url = {https://doi.org/10.1016/j.crmeth.2026.101342},
pmid = {41875867},
pmcid = {PMC13030976}
}

RIS

TY - JOUR
AU - Kouadri Boudjelthia, Idris
AU - Milite, Salvatore
AU - El Kazwini, Nour
AU - Huang, Yuanhua
AU - Sottoriva, Andrea
AU - Sanguinetti, Guido
TI - Interpretable learning of temporal cellular dynamics from single-cell data
T2 - Cell reports methods
J2 - Cell Rep Methods
PY - 2026
DA - 2026/03/01
VL - 6
IS - 3
SP - 101342
SN - 2667-2375
PB - Elsevier
DO - 10.1016/j.crmeth.2026.101342
UR - https://doi.org/10.1016/j.crmeth.2026.101342
LA - en
ER -

CSL-JSON

{
"id": "10.1016/j.crmeth.2026.101342",
"type": "article-journal",
"title": "Interpretable learning of temporal cellular dynamics from single-cell data",
"container-title": "Cell reports methods",
"author": [
{
"family": "Kouadri Boudjelthia",
"given": "Idris"
},
{
"family": "Milite",
"given": "Salvatore"
},
{
"family": "El Kazwini",
"given": "Nour"
},
{
"family": "Huang",
"given": "Yuanhua"
},
{
"family": "Sottoriva",
"given": "Andrea"
},
{
"family": "Sanguinetti",
"given": "Guido"
}
],
"container-title-short": "Cell Rep Methods",
"volume": "6",
"issue": "3",
"page": "101342",
"DOI": "10.1016/j.crmeth.2026.101342",
"PMID": "41875867",
"PMCID": "PMC13030976",
"ISSN": "2667-2375",
"publisher": "Elsevier",
"URL": "https://doi.org/10.1016/j.crmeth.2026.101342",
"language": "en",
"issued": {
"date-parts": [
[
2026,
3,
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.7554/elife.108950 [code]
Comprehensive RNA velocity by modeling the cascade of gene regulation, transcription, and splicing from single-cell RNA sequencing data with TSvelo.
Journal: eLife
In common: scVelo, anndata, Scanpy, 7 other tools, genetics / omics, cellular / molecular, 13 references
[2] doi:10.1093/bioinformatics/btag652 [code]
mmVelo: a deep generative model for estimating cell state-dependent dynamics across multiple modalities.
Journal: Bioinformatics (Oxford, England)
In common: scVelo, UMAP, anndata, 9 other tools, genetics / omics, 9 references
[3] doi:10.1016/j.xcrm.2026.102766 [code]
A longitudinal single-cell and spatial multiomic atlas of pediatric high-grade glioma.
Journal: Cell reports. Medicine
In common: scVelo, rpy2, UMAP, 13 other tools, genetics / omics, cellular / molecular, 3 references
[4] doi:10.1038/s41467-026-74000-4 [code]
ArchVelo: archetypal velocity modeling for single-cell multi-omic trajectories.
Journal: Nature communications
In common: scVelo, anndata, Numba, 7 other tools, genetics / omics, cellular / molecular, 7 references
[5] doi:10.1016/j.isci.2026.116055 [code]
Mapping the transcriptional diversity of calcium signaling in the mouse and human brain.
Journal: iScience
In common: rpy2, UMAP, anndata, 12 other tools, genetics / omics, 1 reference
[6] doi:10.1038/s41586-026-10629-x [code]
Whole-genome duplication shaped cell-type evolution in the vertebrate brain.
Journal: Nature
In common: scVelo, UMAP, anndata, 10 other tools, genetics / omics, cellular / molecular, 2 references
[7] doi:10.64898/2026.03.30.714220 [code]
An integrated single cell and spatial omics atlas of human prenatal development
Journal: bioRxiv (preprint)
In common: scVelo, UMAP, anndata, 11 other tools, 1 reference
[8] doi:10.1038/s41593-026-02267-3 [code]
Spatial proteomic analysis in human Alzheimer's disease brains enables identification of microenvironment-dependent microglial cell states.
Journal: Nature neuroscience
In common: rpy2, UMAP, anndata, 11 other tools, genetics / omics, cellular / molecular
[9] doi:10.1038/s41586-026-10490-y [code]
Lineage and organ signals sequentially build organ intrinsic nervous systems.
Journal: Nature
In common: scVelo, UMAP, anndata, 9 other tools, 2 references
[10] doi:10.1371/journal.pcbi.1014346 [code]
StPedf: Cell trajectory inference of spatial transcriptomics via spatial proximity embedding and spatial density-adaptive fusion.
Journal: PLoS computational biology
In common: rpy2, anndata, Scanpy, 8 other tools, genetics / omics, 2 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.