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.

The 2 matches · all tie a paragraph to a whole file, not to 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
  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

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

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
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 Publishing Group},
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 Publishing Group
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 Publishing Group",
"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.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
[2] doi:10.1371/journal.pcbi.1014297 [code]
Statistics of cortical representational drift can enable robust readout.
Journal: PLoS computational biology
In common: systems, 6 references
[3] doi:10.1038/s44323-026-00105-0
Tilia Tomentosa promotes sleep, preserving sleep structure.
Journal: Npj biological timing and sleep
In common: mouse, 3 references
[4] doi:10.1016/j.isci.2026.116477
Slow intrinsic oscillations in the ventrolateral preoptic nucleus.
Journal: iScience
In common: 3 references
[5] doi:10.1523/eneuro.0344-25.2026 [code]
Long-Term Variability in Visual Processing versus Perceptual Stability.
Journal: eNeuro
In common: 3 references
[6] doi:10.1016/j.ohx.2026.e00797 [code]
Development of an automated REM sleep deprivation device for mice in neuroscience research.
Journal: HardwareX
In common: mouse, 2 references
[7] doi:10.1016/j.nbscr.2026.100149 [code]
Molecular correlates of sleep deprivation in the mouse brain identified by meta-analysis of microarray data.
Journal: Neurobiology of sleep and circadian rhythms
In common: mouse, 2 references
[8] doi:10.7554/elife.106992
Cortical layer 6b mediates state-dependent changes in brain activity and effects of orexin on waking and sleep.
Journal: eLife
In common: mouse, 2 references
[9] doi:10.1016/j.celrep.2026.117646 [code]
Medial entorhinal-hippocampal desynchronization parallels the emergence of memory impairment in a mouse model of Alzheimer's disease pathology.
Journal: Cell reports
In common: Signal Processing Toolbox, systems, mouse, 1 reference
[10] doi:10.1038/s41593-026-02231-1 [code]
The prefrontal cortex controls memory organization in the hippocampus.
Journal: Nature neuroscience
In common: Signal Processing Toolbox, systems, mouse, 1 reference

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.