OSCR

Midbrain somatostatin-expressing cells control pain-suppression during defensive states.

Code ↔ Paper

The paper beside its authors' code: matches between them have not been computed for this paper yet.

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 · 137 lines · 5.2 KB · MIT

  1. % getThermoVIDFzIntervals:
  2. % Detect freezing periods from thermographic videos (TESTO 885).
  3. % Code used in "Brainstem somatostatin-expressing cells promote analgesia during negative emotional states". Winke, et al. 2022.
  4. % [v0.1, Daniel Jercog 2022, see: github.com/djercog/TestoFreez]
  5. %
  6. % function [fzIntervals,tm,areaChange,areaMouse]=getThermoVIDFzIntervals(videoFullpath,ffmpegBinPath)
  7. % function [fzIntervals,tm,areaChange,areaMouse]=getThermoVIDFzIntervals(videoFullpath,ffmpegBinPath,immobilityThreshold,minFzDur,minNonFzMerge)
  8. %
  9. % Input:
  10. % videoFullpath: full path to thermographic video (e.g, videoFullpath='E:\Videos\WT_FCA_IR\24-CSP.wmv';)
  11. % ffmpegBinPath: Path to ffmpeg/bin instalation folder (e.g., ffmpegBinPath='E:\ffmpeg\bin';)
  12. % immobilityThreshold: Threshold for immobility detection (default immobilityThreshold=0.003;)
  13. % minFzDur: Minimum immobility period duration to be considered freezing (default minFzDur=0.5;)
  14. % minNonFzMerge: Minimum non-freezing period to be merged between consecutive freezing periods (default minNonFzMerge=0.1;)
  15. %
  16. % Output:
  17. % fzIntervals: Freezing intervals detected.
  18. % tm: Time
  19. % areaChange: % pixels changed between consecutive video image frames within the ROI defined.
  20. % areaMouse: mouse area detected in pixels.
  21. %
  22. % Requires:
  23. % - videoframets (https://www.mathworks.com/matlabcentral/fileexchange/61235-video-frame-time-stamps)
  24. % - ffmpeg (https://ffmpeg.org/download.html)
  25. function [fzIntervals,tm,areaChange,areaMouse]=getThermoVIDFzIntervals(videoFullpath,ffmpegBinPath,immobilityThreshold,minFzDur,minNonFzMerge)
  26. if nargin < 3
  27. immobilityThreshold = 0.003;
  28. minFzDur=0.5;
  29. minNonFzMerge=0.1;
  30. else
  31. if (nargin~=5)
  32. error('Wrong number of input arguments.')
  33. end
  34. end
  35. %check if ffmpeg exists (for vidoframerets0
  36. if exist(ffmpegBinPath)==0
  37. error('ffmpeg directory not found.')
  38. end
  39. tm=videoframets(ffmpegBinPath,videoFullpath); %get video frame timestamps based on ffmpeg
  40. %set HP roi
  41. vidObj = VideoReader(videoFullpath);
  42. vidFramesAux = read(vidObj,4500);
  43. fAux=figure('color','w');
  44. ax=subplot(1,1,1);hold on;
  45. title('Define HP area:','fontsize',12);
  46. roiHP=roipoly(vidFramesAux);
  47. roiHP=double(roiHP);
  48. roiHP(roiHP==0)=nan;
  49. close(fAux);
  50. %Load entire video
  51. display('Loading video....')
  52. vidFramesAux = read(vidObj);
  53. %Calculate %area change within ROI between binarized downsampled video consecutive frames
  54. display('Processing video....');
  55. clear areaChange areaMouse;
  56. for j=2:length(vidFramesAux)
  57. %obtain 2 consecutive video frames
  58. auxF1=roiHP.*double(vidFramesAux(:,:,3,j-1)); %process blue channel only
  59. auxF2=roiHP.*double(vidFramesAux(:,:,3,j)); %process blue channel only
  60. thresh=min(auxF1(:))+ graythresh(auxF1)*(max(auxF1(:))-min(auxF1(:))); %Otsu's thresholding
  61. auxF1(auxF1<=thresh)=0;auxF1(auxF1>thresh)=1;
  62. thresh=min(auxF2(:))+ graythresh(auxF2)*(max(auxF2(:))-min(auxF2(:))); %Otsu's thresholding
  63. auxF2(auxF2<=thresh)=0;auxF2(auxF2>thresh)=1;
  64. %invert scale: 1 on mouse;
  65. indTo1=find(auxF1==0);indTo0=find(auxF1==1);auxF1(indTo1)=1;auxF1(indTo0)=0;
  66. indTo1=find(auxF2==0);indTo0=find(auxF2==1);auxF2(indTo1)=1;auxF2(indTo0)=0;
  67. areaMouse(j-1)=(length(find(auxF1==1))+length(find(auxF2==1)))/2; %avg between the 2 frames
  68. areaChange(j-1)=length(find(auxF2-auxF1==1 | auxF2-auxF1==-1))/length(find(roiHP==1)); % %change relative to ROI
  69. end
  70. %detecting freezing
  71. tm=tm(2:end);
  72. fzAux=zeros(length(areaChange),1);
  73. fzAux(find(areaChange<immobilityThreshold))=1;
  74. endFzPer=find(diff(fzAux)==-1);
  75. begFzPer=find(diff(fzAux)==1)+1;
  76. if ~isempty(begFzPer) && ~isempty(endFzPer)
  77. if endFzPer(1)<begFzPer(1)
  78. begFzPer=[1;begFzPer];
  79. end
  80. if begFzPer(end)>endFzPer(end)
  81. endFzPer=[endFzPer;length(fzAux)];
  82. end
  83. fzOns=tm(begFzPer);
  84. fzOffs=tm(endFzPer);
  85. else
  86. fzOns=[];
  87. fzOffs=[];
  88. end
  89. %remove short nFZ periods if neighboring periods are fz periods
  90. indAux=find(fzOns(2:end)-fzOffs(1:end-1)<=minNonFzMerge);
  91. toRemove=[];
  92. for s=1:length(indAux)
  93. %if (fzOffs(indAux(s)-1)-fzOns(indAux(s)-1)>minFzDur && fzOffs(1+indAux(s))-fzOns(1+indAux(s))>minFzDur)
  94. if (fzOffs(1+indAux(s))-fzOns(1+indAux(s))>minNonFzMerge)
  95. toRemove=[toRemove,indAux(s)];
  96. end
  97. end
  98. fzOffs(toRemove)=[];
  99. fzOns(toRemove+1)=[];
  100. %remove shor fz
  101. indAux=find(fzOffs-fzOns<=minFzDur);
  102. fzOns(indAux)=[];
  103. fzOffs(indAux)=[];
  104. fzIntervals=[fzOns,fzOffs];
  105. verifyDet = input('Verify detection? Y/N [N]:','s');
  106. if strcmp(verifyDet,'Y')
  107. % Verify detection
  108. f = figure('color','w');
  109. ax(1)=subplot(5,1,5);hold on;
  110. plot(tm,areaChange,'k');
  111. axis tight;ylim([-0.005,0.02]);
  112. plot(fzIntervals,[0.01,0.01],'r','linewidth',2);
  113. ylabel('% Area Change');xlabel('Time (s)');
  114. set(gca,'tickdir','out');
  115. ax(2)=subplot(5,1,1:4,'fontsize',5);hold on;
  116. title('Verify detection...','fontsize',14);
  117. axis ij;
  118. set(gca,'xtick',[],'ytick',[],'xcolor','w','ycolor','w');
  119. for i=1:size(vidFramesAux,4)-1
  120. if ishandle(f)
  121. im=imagesc(vidFramesAux(:,:,:,i));
  122. p=plot(ax(1),[tm(i),tm(i)],[-0.005,0.02],'m','linewidth',1);
  123. pause(0.02);
  124. delete(im);
  125. delete(p);
  126. end
  127. end
  128. close(f);
  129. end

getThermoVIDFzIntervals.m at commit d68940d, under MIT · at the source

Overview

Authors: Nanci Winke1,2, Frank Aby3, Daniel Jercog1,2, Coline Riffault1,2, Rabia Bouali-Benazzouz3, Juliette Viellard1,2,3, Delphine Girard1,2, Zoe Grivet3, Marc Landry3, Laia Castell4, Emmanuel Valjent4,5, Stephane Valerio1,2, Pascal Fossat3, Cyril Herry1,2
  1. Univ. Bordeaux, Neurocentre Magendie, Bordeaux, France
  2. INSERM, Neurocentre Magendie, Bordeaux, France
  3. Univ. Bordeaux, CNRS, Institute for Neurodegenerative Diseases, Bordeaux, France
  4. Université de Montpellier, Institut de génomique fonctionnelle (IGF), CNRS, Montpellier, France
  5. INM, Univ. Montpellier, Inserm, Montpellier, France
Journal: eLife, volume 14, article RP106826
Dates: published online 10 November 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.7554/elife.106826 · PMID 43004867 · PMCID PMC13750795 · OpenAlex W4411577360
Open access: gold, a free copy (OpenAlex)
Status: code verified (how the code is found and verified)
Categories: mouse (organism), pain (population), systems (subfield)
Methods: Preprocessing, Evoked potentials, Statistics
Keywords: Mouse
MeSH: Fear*, Mesencephalon*, Neurons*, Pain*, Periaqueductal Gray*, Somatostatin*, Analgesia, Animals, Behavior, Animal, Male, Mice, Optogenetics (* major topic)
Topic: Pain Mechanisms and Treatments (Physiology (medical), Medicine), according to OpenAlex
Funding: Fondation pour la Recherche Médicale (FRM-PhD); Agence Nationale de la Recherche (ANR-10-EQPX-08-optopath, 10.67599/anr-19-ce16-0016, 10.67599/anr-23-ce37-0015); French Society for the Study and Treatment of Pain (SFETD)
Citations: not cited yet (Europe PMC); 43 references in the paper

Abstract

In threatening situations, animals exhibit a broad range of behavioral and autonomic responses. As such, a crucial adaptive response is the inhibition of pain, which facilitates relevant defensive behaviors that promote survival. Whereas the structures and mechanisms involved in fear and pain behaviors are well documented, little is known about the precise neuronal mechanisms mediating the emotional regulation of endogenous pain-suppression. Here, we used a combination of behavioral, anatomical, optogenetic, and electrophysiological approaches to investigate, in male mice, the role of somatostatin-expressing cells in the ventrolateral periaqueductal gray matter (SST+ vlPAG cells) in the control of analgesia induced during defensive states. Our data indicate that optogenetic inhibition of SST+ vlPAG cells promotes analgesia irrespective of animal defensive state. In contrast, optogenetic activation of long-range SST+ vlPAG cells that project to the rostral ventromedial medulla (RVM) abolishes the analgesia mediated by fear behavior. Together, these results identify a novel circuit mechanism composed of long-range SST+ vlPAG cells projecting to the RVM that regulate analgesia elicited during defensive states.

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

Repository

Its files are read in the Code ↔ Paper reader above.

djercog/TestoFreez

License: MIT
State: the link answers, verified on 12 November 2026
Evidence: files inventoried
Commit: d68940d92134eb61d42ea267541ada195c9f1cb2, 5 October 2026
Languages: MATLAB (1)
Size: 3 files, 1 script
Software Heritage: not archived
Found in: the text, “Cued fear-conditioned analgesia”
Holds: README, license file
Not found: CITATION.cff, environment file, tests, continuous integration, documentation
Tools: Image Processing Toolbox (1 file)
Availability: 1 check, the latest on 12 November 2026: the link answers
  • 12 November 2026: the link answers
3 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:

  • 1 repository of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
  • 1 script, each with its path and the digest of its content;
  • no match between paragraphs and code yet;
  • 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

All data generated or analysed during this study, including the source data underlying every figure, have been deposited in the Dryad Digital Repository under DOI https://doi.org/10.5061/dryad.63xsj3vj3. Custom code used for the automated detection of freezing behaviour from thermographic recordings (TestoFreez) is available at https://github.com/djercog/TestoFreez (copy archived at Jercog, 2026) and released under the MIT licence.

The following dataset was generated:

Cyril H, Nanci W, Frank A, Daniel J, Coline R. 2026. Midbrain somatostatin-expressing cells control pain-suppression during defensive states. Dryad Digital Repository.

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, 12 November 2026: the first record

Recorded: type, language, journal, volume, pages, dates, 14 authors, 1 keyword, 12 MeSH terms, 3 funders, 40 references.

Cite

This paper

Winke, N., Aby, F., Jercog, D., Riffault, C., Bouali-Benazzouz, R., Viellard, J., Girard, D., Grivet, Z., Landry, M., Castell, L., Valjent, E., Valerio, S., Fossat, P., & Herry, C. (2026). Midbrain somatostatin-expressing cells control pain-suppression during defensive states. eLife, 14, RP106826. https://doi.org/10.7554/elife.106826

BibTeX

@article{winke2026midbrain,
author = {Winke, Nanci and Aby, Frank and Jercog, Daniel and Riffault, Coline and Bouali-Benazzouz, Rabia and Viellard, Juliette and Girard, Delphine and Grivet, Zoe and Landry, Marc and Castell, Laia and Valjent, Emmanuel and Valerio, Stephane and Fossat, Pascal and Herry, Cyril},
title = {{Midbrain somatostatin-expressing cells control pain-suppression during defensive states}},
journal = {eLife},
year = {2026},
month = nov,
volume = {14},
pages = {RP106826},
publisher = {eLife Sciences Publications, Ltd},
issn = {2050-084X},
doi = {10.7554/elife.106826},
url = {https://doi.org/10.7554/elife.106826},
pmid = {43004867},
pmcid = {PMC13750795}
}

RIS

TY - JOUR
AU - Winke, Nanci
AU - Aby, Frank
AU - Jercog, Daniel
AU - Riffault, Coline
AU - Bouali-Benazzouz, Rabia
AU - Viellard, Juliette
AU - Girard, Delphine
AU - Grivet, Zoe
AU - Landry, Marc
AU - Castell, Laia
AU - Valjent, Emmanuel
AU - Valerio, Stephane
AU - Fossat, Pascal
AU - Herry, Cyril
TI - Midbrain somatostatin-expressing cells control pain-suppression during defensive states
T2 - eLife
J2 - eLife
PY - 2026
DA - 2026/11/10
VL - 14
SP - RP106826
SN - 2050-084X
PB - eLife Sciences Publications, Ltd
DO - 10.7554/elife.106826
UR - https://doi.org/10.7554/elife.106826
LA - en
ER -

CSL-JSON

{
"id": "10.7554/elife.106826",
"type": "article-journal",
"title": "Midbrain somatostatin-expressing cells control pain-suppression during defensive states",
"container-title": "eLife",
"author": [
{
"family": "Winke",
"given": "Nanci"
},
{
"family": "Aby",
"given": "Frank"
},
{
"family": "Jercog",
"given": "Daniel"
},
{
"family": "Riffault",
"given": "Coline"
},
{
"family": "Bouali-Benazzouz",
"given": "Rabia"
},
{
"family": "Viellard",
"given": "Juliette"
},
{
"family": "Girard",
"given": "Delphine"
},
{
"family": "Grivet",
"given": "Zoe"
},
{
"family": "Landry",
"given": "Marc"
},
{
"family": "Castell",
"given": "Laia"
},
{
"family": "Valjent",
"given": "Emmanuel"
},
{
"family": "Valerio",
"given": "Stephane"
},
{
"family": "Fossat",
"given": "Pascal"
},
{
"family": "Herry",
"given": "Cyril"
}
],
"container-title-short": "eLife",
"volume": "14",
"page": "RP106826",
"DOI": "10.7554/elife.106826",
"PMID": "43004867",
"PMCID": "PMC13750795",
"ISSN": "2050-084X",
"publisher": "eLife Sciences Publications, Ltd",
"URL": "https://doi.org/10.7554/elife.106826",
"language": "en",
"issued": {
"date-parts": [
[
2026,
11,
10
]
]
}
}

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.2023.108110
Microglial P2X4 receptors are essential for spinal neurons hyperexcitability and tactile allodynia in male and female neuropathic mice.
Journal: iScience
In common: pain, mouse, 1 reference, author Pascal Fossat
[2] doi:10.1038/s41586-026-10296-y [code]
Deconstruction of a spino-brain-spinal cord circuit that drives chronic pain.
Journal: Nature
In common: Image Processing Toolbox, pain, systems, mouse, 3 references
[3] doi:10.1186/s12916-024-03634-2
YTHDF1 in periaqueductal gray inhibitory neurons contributes to morphine withdrawal responses in mice.
Journal: BMC medicine
In common: mouse, 4 references
[4] doi:10.1038/s41467-023-35826-4
Topographic representation of current and future threats in the mouse nociceptive amygdala.
Journal: Nature communications
In common: pain, mouse, 4 references
[5] doi:10.7554/elife.96724
A septo-hypothalamic-medullary circuit directs stress-induced analgesia.
Journal: eLife
In common: pain, systems, mouse, 3 references
[6] doi:10.1038/s41586-024-07440-x [code]
Distinct µ-opioid ensembles trigger positive and negative fentanyl reinforcement.
Journal: Nature
In common: pain, mouse, author Emmanuel Valjent
[7] doi:10.1038/s41467-025-61180-8
Nicotine engages a VTA-NAc feedback loop to inhibit amygdala-projecting dopamine neurons and induce anxiety-like behaviors.
Journal: Nature communications
In common: systems, mouse, author Emmanuel Valjent
[8] doi:10.1002/adhm.202402132 [code]
Dye-Based Fluorescent Organic Nanoparticles, New Promising Tools for Optogenetics.
Journal: Advanced healthcare materials
In common: systems, mouse, author Cyril Herry
[9] doi:10.7554/elife.78689
Targeted anatomical and functional identification of antinociceptive and pronociceptive serotonergic neurons that project to the spinal dorsal horn.
Journal: eLife
In common: pain, mouse, 3 references
[10] doi:10.1038/s41467-023-42969-x
CA3 hippocampal synaptic plasticity supports ripple physiology during memory consolidation.
Journal: Nature communications
In common: mouse, author Cyril Herry

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.7554/elife.106826.svg)](https://openscicode.org/badge/doi/10.7554/elife.106826)
<!-- oscr-badge:end -->
reStructuredText
.. oscr-badge:start

.. image:: https://openscicode.org/badge/doi/10.7554/elife.106826.svg
   :target: https://openscicode.org/badge/doi/10.7554/elife.106826
   :alt: OSCR

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