Temporal drift of sleep-wake representations in hypothalamic neuronal ensembles.
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] § 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] § 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
- function [dataArrayEnv, F0Weight] = f_directEnvNorm(filePath, clusterNum, numWorkers);
- %[dataArrayEnv, F0Weights] = f_directEnvNorm(filePath, clusterNum,numWorkers);
- %
- %This function is designed to align the raw calcium traces stored in the
- %text file with name 'filePath' to zero using an F0 estimated by fitting a number of Gaussian
- %distributions (clusterNum) and normalize them using the envelope
- %normalization. For more infos refer to Lukas.
- %
- %INPUTS (all optional):
- % filePath: The path and name to the file where the raw data is stored.
- % Make sure that each column represents a cell and its rows the different
- % time points.
- % clusterNum: The number of Guassisans the fluorescence intensities should
- % be clustered into to find F0 (default = 3).
- % numWorkers: Number of parallel workers for the estimation of the
- % Gaussians (default = 55).
- %
- %OUTPUTS:
- %dataArrayEnv: The normalized calcium time series.
- %F0Weights: The estimated baseline F0 and the Weight, that is, the
- % percentage of explained data by the distribution.
- %
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %%
- %---------Convenience-------
- addpath(genpath('Z:\Lab_resources\calcium_imaging_toolbox'));
- if ~exist('filePath')|| isempty(filePath) %only tifs specified so far, h5 could easily be implemented
- [FileName,PathName] = uigetfile({'*.txt'},'Select the text file for fluorescence normalization');
- filePath = [PathName FileName];
- end
- if ~exist('clusterNum')|| isempty(clusterNum)
- clusterNum = 3;
- end
- if ~exist('numWorkers')|| isempty(numWorkers)
- numWorkers = 5;
- end
- %%
- %---------Loading data and generating sessionStarts
- tracesRaw = importdata(filePath, '\t'); %load in the data from text file
- % tracesRaw = importdata(filePath, ','); %load in the data from text file
- if isa(tracesRaw, 'struct') %check whether the text file still contains the header information and if so...
- tracesRaw = tracesRaw.data; % ... retrieve the data
- tracesRaw = tracesRaw(:,2:end); %and delete the first column (frame numbering)
- end
- sessionStarts = [0 size(tracesRaw,1)];
- %% Find the F0 and re-zero the traces with the Gaussian fitting (probably optional)
- tracesZeroed = NaN(size(tracesRaw)); %pre-allocation
- F0Weight = NaN(2,length(sessionStarts)-1,size(tracesZeroed,2));
- % pObject = parpool('Castor',numWorkers); %define the pool of workers
- % parfor j=1:size(tracesRaw,2)
- for j=1:size(tracesRaw,2)
- subst = tracesRaw(:,j);
- substi = NaN(2,length(sessionStarts)-1);
- for k=1:length(sessionStarts)-1
- [W,M,V,L] = EM_GM(subst(sessionStarts(k)+1:sessionStarts(k+1)),clusterNum);
- [F0,idx] = min(M);
- substi(:,k) = [F0; W(idx)];
- % F0Weight(1:2,k,j) = [F0; W(idx)];
- % F0Weight(1,k,j) = F0;
- % F0Weight(2,k,j) = W(idx);
- subst(sessionStarts(k)+1:sessionStarts(k+1)) = subst(sessionStarts(k)+1:sessionStarts(k+1))-F0;
- end
- tracesZeroed(:,j) = subst;
- F0Weight(:,:,j) = substi;
- end
- % delete(pObject);
- %% Do envelope normalizations
- dataArrayEnv = NaN(size(tracesZeroed)); % pre-allocate space
- Diff = [];
- y = [];
- env = [];
- for i=1:size(tracesZeroed,2)
- Diff(:,i) = diff(tracesZeroed(:,i));
- y = hilbert(Diff(:,i));
- env(:,i) = abs(y);
- for j=1:length(sessionStarts)-1
- 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)));
- end
- clear y;
- %sNorm(:,i) = tracesRaw(:,i)/std(Diff(:,i)); %alternatively normalize to
- %the standard deviation of the distribution of Diff.
- end
- F0Weight = squeeze(F0Weight);
- end
f_directEnvNorm.m at commit 50030a7, no license · at the source
Overview
- Zentrum für Experimentelle Neurologie, Department of Neurology, Inselspital University Hospital Bern, University of Bern, Bern, Switzerland
- Department of Biomedical Research, University of Bern, Bern, Switzerland
- Present Address: Department of Neuroscience, Yale School of Medicine, Yale University, New Haven, CT USA
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/
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
Availability: 1 check, the latest on 27 September 2026: the link answers (HTTP 200)
- 27 September 2026: the link answers (HTTP 200)
Zenodo 20747987
Availability: 1 check, the latest on 27 September 2026: the link answers (HTTP 200)
- 27 September 2026: the link answers (HTTP 200)
4 files
- Yan Y. 2026 Temporal drift of sleep-wake representations in hypothalamic neuronal ensembles/
Code/ , MATLAB, 105 linesCount_stable_cells.m - Yan Y. 2026 Temporal drift of sleep-wake representations in hypothalamic neuronal ensembles/
Code/ , MATLAB, 89 linesCount_state_changs.m - Yan Y. 2026 Temporal drift of sleep-wake representations in hypothalamic neuronal ensembles/
Code/ , MATLAB, 95 linesf_directEnvNorm.m - README.md, Text, 10 lines
zenlabcode/calciumimaging
50030a73adad21a951c535b6df4ec13becb02622, 3 March 2026Availability: 1 check, the latest on 27 September 2026: the link answers
- 27 September 2026: the link answers
4 files
- Yan Y. 2026 Temporal drift of sleep-wake representations in hypothalamic neuronal ensembles/
Code/ , MATLAB, 105 linesCount_stable_cells.m - Yan Y. 2026 Temporal drift of sleep-wake representations in hypothalamic neuronal ensembles/
Code/ , MATLAB, 89 linesCount_state_changs.m - Yan Y. 2026 Temporal drift of sleep-wake representations in hypothalamic neuronal ensembles/
Code/ , MATLAB, 95 lines, 2 matchesf_directEnvNorm.m - README.md, Text, 10 lines
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://
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
- figshare:31441240, at figshare; found in DataCite
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/
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://
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/
url = {https://
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/
VL - 17
IS - 1
SP - 9137
SN - 2041-1723
PB - Nature Publishing Group
DO - 10.1038/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1038/
"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":
"volume": "17",
"issue": "1",
"page": "9137",
"DOI": "10.1038/
"PMID": "42649166",
"PMCID": "PMC13519010",
"ISSN": "2041-1723",
"publisher": "Nature Publishing Group",
"URL": "https://
"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 AmericaIn 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 neuroscienceIn 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 communicationsIn common: systems, mouse, 6 references
- [4] doi:10.1093/braincomms/fcaf469 [code]
- Variability and predictability in human sleep.Journal: Brain communicationsIn 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 communicationsIn 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 communicationsIn 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 communicationsIn 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: eLifeIn 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: iScienceIn 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 communicationsIn 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.
Claim this paper
Correct its record
Say what each link of this record is, remove the ones that are not the paper's, add the ones that are missing. The correction becomes a new version of the record, in its Versions section.
Validate its tracing map
You validate the map as this page shows it: 3 repositories of the authors' code, each at its verified commit and with its license, 6 scripts, and 2 matches between paragraphs and code (see the Code and Map sections). It then receives a DOI on Zenodo, with you (your ORCID iD) and OSCR as its creators; the code itself is not deposited.
The map's fingerprint: sha256:ebab0edf5b7d046c…
Add the badge to the code's README
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 -->
[](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:endHTML
<!-- 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.
