OSCR

Temporal drift of sleep-wake representations in hypothalamic neuronal ensembles.

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.

One block of code here has 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 · all tie a paragraph to a whole file without given lines: weak matches, whose lines are not tinted
  1. [1] § Methods › Calcium traces extraction ↔ Yan Y. 2026 Temporal drift of sleep-wake representations in hypothalamic neuronal ensembles/Code/f_directEnvNorm.m, the whole file · a weak match · score 0.71 · envelope normalization, calcium traces, Gaussian, fitted, intensity, fluorescence · block oscr:b:60WV54WMB9DJS-7 · Report a mismatch
  2. [2] § Methods › Calcium traces extraction ↔ Yan Y. 2026 Temporal drift of sleep-wake representations in hypothalamic neuronal ensembles/Code/f_directEnvNorm.m, the whole file · a weak match · score 0.62 · fluorescence intensity, raw calcium, frames, traces · block oscr:b:60WV54WMB9DJS-7 · 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

MATLAB · 95 lines · 3.7 KB · no license · 2 matches

  1. function [dataArrayEnv, F0Weight] = f_directEnvNorm(filePath, clusterNum, numWorkers);
  2. %[dataArrayEnv, F0Weights] = f_directEnvNorm(filePath, clusterNum,numWorkers);
  3. %
  4. %This function is designed to align the raw calcium traces stored in the
  5. %text file with name 'filePath' to zero using an F0 estimated by fitting a number of Gaussian
  6. %distributions (clusterNum) and normalize them using the envelope
  7. %normalization. For more infos refer to Lukas.
  8. %
  9. %INPUTS (all optional):
  10. % filePath: The path and name to the file where the raw data is stored.
  11. % Make sure that each column represents a cell and its rows the different
  12. % time points.
  13. % clusterNum: The number of Guassisans the fluorescence intensities should
  14. % be clustered into to find F0 (default = 3).
  15. % numWorkers: Number of parallel workers for the estimation of the
  16. % Gaussians (default = 55).
  17. %
  18. %OUTPUTS:
  19. %dataArrayEnv: The normalized calcium time series.
  20. %F0Weights: The estimated baseline F0 and the Weight, that is, the
  21. % percentage of explained data by the distribution.
  22. %
  23. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  24. %%
  25. %---------Convenience-------
  26. addpath(genpath('Z:\Lab_resources\calcium_imaging_toolbox'));
  27. if ~exist('filePath')|| isempty(filePath) %only tifs specified so far, h5 could easily be implemented
  28. [FileName,PathName] = uigetfile({'*.txt'},'Select the text file for fluorescence normalization');
  29. filePath = [PathName FileName];
  30. end
  31. if ~exist('clusterNum')|| isempty(clusterNum)
  32. clusterNum = 3;
  33. end
  34. if ~exist('numWorkers')|| isempty(numWorkers)
  35. numWorkers = 5;
  36. end
  37. %%
  38. %---------Loading data and generating sessionStarts
  39. tracesRaw = importdata(filePath, '\t'); %load in the data from text file
  40. % tracesRaw = importdata(filePath, ','); %load in the data from text file
  41. if isa(tracesRaw, 'struct') %check whether the text file still contains the header information and if so...
  42. tracesRaw = tracesRaw.data; % ... retrieve the data
  43. tracesRaw = tracesRaw(:,2:end); %and delete the first column (frame numbering)
  44. end
  45. sessionStarts = [0 size(tracesRaw,1)];
  46. %% Find the F0 and re-zero the traces with the Gaussian fitting (probably optional)
  47. tracesZeroed = NaN(size(tracesRaw)); %pre-allocation
  48. F0Weight = NaN(2,length(sessionStarts)-1,size(tracesZeroed,2));
  49. % pObject = parpool('Castor',numWorkers); %define the pool of workers
  50. % parfor j=1:size(tracesRaw,2)
  51. for j=1:size(tracesRaw,2)
  52. subst = tracesRaw(:,j);
  53. substi = NaN(2,length(sessionStarts)-1);
  54. for k=1:length(sessionStarts)-1
  55. [W,M,V,L] = EM_GM(subst(sessionStarts(k)+1:sessionStarts(k+1)),clusterNum);
  56. [F0,idx] = min(M);
  57. substi(:,k) = [F0; W(idx)];
  58. % F0Weight(1:2,k,j) = [F0; W(idx)];
  59. % F0Weight(1,k,j) = F0;
  60. % F0Weight(2,k,j) = W(idx);
  61. subst(sessionStarts(k)+1:sessionStarts(k+1)) = subst(sessionStarts(k)+1:sessionStarts(k+1))-F0;
  62. end
  63. tracesZeroed(:,j) = subst;
  64. F0Weight(:,:,j) = substi;
  65. end
  66. % delete(pObject);
  67. %% Do envelope normalizations
  68. dataArrayEnv = NaN(size(tracesZeroed)); % pre-allocate space
  69. Diff = [];
  70. y = [];
  71. env = [];
  72. for i=1:size(tracesZeroed,2)
  73. Diff(:,i) = diff(tracesZeroed(:,i));
  74. y = hilbert(Diff(:,i));
  75. env(:,i) = abs(y);
  76. for j=1:length(sessionStarts)-1
  77. dataArrayEnv(sessionStarts(j)+1:sessionStarts(j+1),i) = tracesZeroed(sessionStarts(j)+1:sessionStarts(j+1),i)/(median(env(sessionStarts(j)+1:sessionStarts(j+1)-1,i)));
  78. end
  79. clear y;
  80. %sNorm(:,i) = tracesRaw(:,i)/std(Diff(:,i)); %alternatively normalize to
  81. %the standard deviation of the distribution of Diff.
  82. end
  83. F0Weight = squeeze(F0Weight);
  84. end

f_directEnvNorm.m at commit 50030a7, no license · at the source

Overview

Authors: Yudong Yan1,2, Niccolò Calcini1,2,3, Thomas Rusterholz1,2, Carolina Gutierrez1,2, Antoine Adamantidis1,2
  1. Zentrum für Experimentelle Neurologie, Department of Neurology, Inselspital University Hospital Bern, University of Bern, Bern, Switzerland
  2. Department of Biomedical Research, University of Bern, Bern, Switzerland
  3. Present Address: Department of Neuroscience, Yale School of Medicine, Yale University, New Haven, CT USA
Institutions: University of Bern (Switzerland); University Hospital of Bern (Switzerland); Yale University (United States)
Journal: Nature communications, volume 17, issue 1, article 9137
Dates: received 24 July 2025; accepted 10 July 2026; published online 28 July 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.1038/s41467-026-75792-1 · PMID 42649166 · PMCID PMC13519010 · OpenAlex W7171536033
Open access: gold, a free copy (OpenAlex)
Status: code verified (how the code is found and verified)
Categories: mouse (organism), systems (subfield)
Methods: Connectivity, Statistics, Machine learning, Preprocessing, Evoked potentials, fMRI & imaging, Single-unit activity, calcium imaging, Spectral & time-frequency, Physiology & signal measures, Smoothing, state filtering, decompositions
Keywords: Hypothalamus, Sleep
MeSH: Hypothalamus*, Neurons*, Sleep*, Wakefulness*, Animals, Diazepam, Hypothalamic Hormones, Male, Melanins, Mice, Mice, Inbred C57BL, Orexins, Pituitary Hormones, Sleep Deprivation, Sleep, REM (* major topic)
Topic: Sleep and Wakefulness Research (Cognitive Neuroscience, Neuroscience), according to OpenAlex
Funding: Swiss National Science Foundation (310030, 188761, 310030_188761, 4082_0_218604, 218604)
Citations: not cited yet (Europe PMC); 76 references in the paper

Abstract

Correlative and causal evidence implicates distinct genetically-defined and evolutionary-conserved hypothalamic neurons in regulating wakefulness, non-rapid eye movement (NREM), and rapid eye movement (REM) sleep. The prevailing view is that these circuits govern sleep-wake states by recruiting stable, invariant neuronal substrates, yet, this remains unknown. Here, we show that inhibitory, excitatory, hypocretins/orexins-, and melanin concentrating hormone-expressing neurons in hypothalamus did not exhibit stable state-specific activities using longitudinal single cell calcium imaging in freely-moving, sleeping male mice. Instead, their activity patterns shift across sleep-wake states over time, while the distribution of active neurons in each sleep state remains stable. While sleep deprivation minimally affected the selectivity of these activity patterns, we found that the sleep-promoting drug diazepam recruited NREM sleep-active cells that were previously inactive or wake-active. These findings indicate that while individual neurons exhibit dynamic, state-dependent shifts of their activity, the overall organization of sleep-wake neural populations remains stable.

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 2 matches between paragraphs and lines of code.

ZENLabCode

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: “Code 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)
At the source: github.com/ZENLabCode

Zenodo 20747987

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: “Code 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)
4 files
At the source:

zenlabcode/calciumimaging

License: none: the authors keep all their rights
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Commit: 50030a73adad21a951c535b6df4ec13becb02622, 3 March 2026
Languages: MATLAB (3)
Size: 92 files, 3 scripts
Software Heritage: not archived
Found in: the Zenodo archive record
Holds: README
Not found: license file, CITATION.cff, environment file, tests, continuous integration, documentation
Availability: 1 check, the latest on 27 September 2026: the link answers
  • 27 September 2026: the link answers
4 files

Code availability

All the MATLAB scripts used for data processing and statistical analysis, together with a representative sample dataset, are publicly available at the GitHub repository: https://github.com/ZENLabCode and accessible via 10.5281/zenodo.20747987.

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

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;
  • 6 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

Datasets cited

Data availability

Source data are provided with this paper. The processed datasets used for neuron activity longitudinal tracking have been deposited in Figshare under an open-access license CC BY 4.0. 10.6084/m9.figshare.31441240. Additional raw miniscope imaging, EEG/EMG data are available under restricted access because of their large file size. Access can be requested from the corresponding authors for academic purposes. Source data are provided with this paper.

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, 5 authors, 2 keywords, 15 MeSH terms, 1 funder, 74 references.

Cite

This paper

Yan, Y., Calcini, N., Rusterholz, T., Gutierrez, C., & Adamantidis, A. (2026). Temporal drift of sleep-wake representations in hypothalamic neuronal ensembles. Nature communications, 17(1), 9137. https://doi.org/10.1038/s41467-026-75792-1

BibTeX

@article{yan2026temporal,
author = {Yan, Yudong and Calcini, Niccolò and Rusterholz, Thomas and Gutierrez, Carolina and Adamantidis, Antoine},
title = {{Temporal drift of sleep-wake representations in hypothalamic neuronal ensembles}},
journal = {Nature communications},
year = {2026},
month = jul,
volume = {17},
number = {1},
pages = {9137},
publisher = {Nature Portfolio},
issn = {2041-1723},
doi = {10.1038/s41467-026-75792-1},
url = {https://doi.org/10.1038/s41467-026-75792-1},
pmid = {42649166},
pmcid = {PMC13519010}
}

RIS

TY - JOUR
AU - Yan, Yudong
AU - Calcini, Niccolò
AU - Rusterholz, Thomas
AU - Gutierrez, Carolina
AU - Adamantidis, Antoine
TI - Temporal drift of sleep-wake representations in hypothalamic neuronal ensembles
T2 - Nature communications
J2 - Nat Commun
PY - 2026
DA - 2026/07/28
VL - 17
IS - 1
SP - 9137
SN - 2041-1723
PB - Nature Portfolio
DO - 10.1038/s41467-026-75792-1
UR - https://doi.org/10.1038/s41467-026-75792-1
LA - en
ER -

CSL-JSON

{
"id": "10.1038/s41467-026-75792-1",
"type": "article-journal",
"title": "Temporal drift of sleep-wake representations in hypothalamic neuronal ensembles",
"container-title": "Nature communications",
"author": [
{
"family": "Yan",
"given": "Yudong"
},
{
"family": "Calcini",
"given": "Niccolò"
},
{
"family": "Rusterholz",
"given": "Thomas"
},
{
"family": "Gutierrez",
"given": "Carolina"
},
{
"family": "Adamantidis",
"given": "Antoine"
}
],
"container-title-short": "Nat Commun",
"volume": "17",
"issue": "1",
"page": "9137",
"DOI": "10.1038/s41467-026-75792-1",
"PMID": "42649166",
"PMCID": "PMC13519010",
"ISSN": "2041-1723",
"publisher": "Nature Portfolio",
"URL": "https://doi.org/10.1038/s41467-026-75792-1",
"language": "en",
"issued": {
"date-parts": [
[
2026,
7,
28
]
]
}
}

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.1073/pnas.2316150121
Distinct lateral hypothalamic CaMKIIα neuronal populations regulate wakefulness and locomotor activity.
Journal: Proceedings of the National Academy of Sciences of the United States of America
In common: systems, 11 references
[2] doi:10.1038/s41593-023-01325-4
Early alterations in the MCH system link aberrant neuronal activity and sleep disturbances in a mouse model of Alzheimer's disease.
Journal: Nature neuroscience
In common: mouse, 4 references, author Antoine Adamantidis
[3] doi:10.1038/s41467-022-35299-x
GABAergic neurons in the rostromedial tegmental nucleus are essential for rapid eye movement sleep suppression.
Journal: Nature communications
In common: systems, mouse, 6 references
[4] doi:10.1093/braincomms/fcaf469 [code]
Variability and predictability in human sleep.
Journal: Brain communications
In common: 2 authors
[5] doi:10.1038/s41467-025-62069-2 [code]
Temporal coding carries more stable cortical visual representations than firing rate over time.
Journal: Nature communications
In common: Signal Processing Toolbox, systems, mouse, 6 references
[6] doi:10.1038/s41467-025-62265-0 [code]
A role for the thalamus in danger evoked awakening during sleep.
Journal: Nature communications
In common: systems, mouse, 2 references, author Antoine Adamantidis
[7] doi:10.1038/s41467-024-46707-9 [code]
A midbrain GABAergic circuit constrains wakefulness in a mouse model of stress.
Journal: Nature communications
In common: systems, mouse, 5 references
[8] doi:10.7554/elife.103738
Orexin population activity precisely reflects net body movement across behavioral and metabolic states.
Journal: eLife
In common: systems, mouse, 5 references
[9] doi:10.1016/j.isci.2026.115897 [code]
Experience and behavior modulate piriform cortex odor representation in freely moving mice.
Journal: iScience
In common: Signal Processing Toolbox, systems, mouse, 5 references
[10] doi:10.1038/s41467-024-45515-5 [code]
Transient targeting of hypothalamic orexin neurons alleviates seizures in a mouse model of epilepsy.
Journal: Nature communications
In common: Signal Processing Toolbox, systems, mouse, 4 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.1038/s41467-026-75792-1.svg)](https://openscicode.org/badge/doi/10.1038/s41467-026-75792-1)
<!-- oscr-badge:end -->
reStructuredText
.. oscr-badge:start

.. image:: https://openscicode.org/badge/doi/10.1038/s41467-026-75792-1.svg
   :target: https://openscicode.org/badge/doi/10.1038/s41467-026-75792-1
   :alt: OSCR

.. oscr-badge:end
HTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.1038/s41467-026-75792-1"><img src="https://openscicode.org/badge/doi/10.1038/s41467-026-75792-1.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.