OSCR

The tectal melanocortin system modulates energy-dependent visual avoidance behavior in zebrafish.

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, not stored by OSCR: doi.org · Europe PMC

The paper is loaded when this pane is shown.

The authors' code

Python · 277 lines · 10 KB · CC-BY-4.0

  1. #Visual stimulation code used for the size discrimination assay
  2. #Used in the manuscript: Puvvada M., Hladnik T., Zhang Y., Svara F., Lemmens S.,Jorgensen L. V. G., Briggman K., Arrenberg A., Foerster D., Hammerschmidt M., "The tectal melanocortin system modulates energy-dependent visual avoidance behavior in zebrafish"
  3. #Method for developing the size discrimination assay was originally described in Barker and Baier, 2015.
  4. #Code written by Fabian Svara
  5. import math
  6. from datetime import datetime, date
  7. import random
  8. from collections import deque
  9. import json
  10. from psychopy import visual, core, monitors, event, platform_specific
  11. from psychopy.tools.monitorunittools import cm2deg, deg2cm, cm2pix, deg2pix
  12. def norm2pix(norm, win):
  13. x = norm[0] * win.size[0] / 2.0
  14. y = norm[1] * win.size[1] / 2.0
  15. return x, y
  16. def pix2norm(pix, win):
  17. x = 2 * pix[0] / win.size[0]
  18. y = 2 * pix[1] / win.size[1]
  19. return x, y
  20. def cm2norm(cm, monitor, win):
  21. px = (cm2pix(cm[0], monitor), cm2pix(cm[1], monitor))
  22. norm = pix2norm(px, win)
  23. return norm
  24. class MovingDot(object):
  25. def __init__(self, win, frame_time, monitor, initial_pos_cm, speed_deg_s, size_deg):
  26. self.initial_pos_cm = initial_pos_cm
  27. self.initial_pos_deg = tuple(cm2deg(xx, monitor) for xx in initial_pos_cm)
  28. self.speed_deg_s = speed_deg_s
  29. self.speed_deg_f = speed_deg_s * frame_time # deg / frame
  30. self.win = win
  31. self.monitor = monitor
  32. self.size_deg = size_deg
  33. self.shape = visual.Polygon(
  34. win, units='deg', edges=100, radius=size_deg/2, fillColor='black', lineColor='black', pos=self.initial_pos_deg)
  35. def update(self):
  36. self.shape.pos += (self.speed_deg_f, 0)
  37. def draw(self):
  38. self.shape.draw()
  39. def visible(self):
  40. pos_x_px = deg2pix(self.shape.pos[0], self.monitor)
  41. if -self.win.size[0] / 2 < pos_x_px < self.win.size[0] / 2:
  42. return True
  43. else:
  44. return False
  45. class DotTrack(object):
  46. def __init__(self, win, frame_time, monitor, heartbeat_f, aquarium_sz_cm, offset_cm, dot_sizes_deg, dot_speed_deg_s, dot_gap_cm):
  47. self.aquarium_sz_cm = aquarium_sz_cm
  48. self.frame_time = frame_time
  49. self.offset_cm = offset_cm
  50. self.win = win
  51. self.frame_count = 0
  52. self.log = []
  53. self.monitor = monitors.Monitor(monitor)
  54. self.dot_sizes_deg = dot_sizes_deg
  55. self.dot_speed_deg_s = dot_speed_deg_s
  56. self.dot_gap_cm = dot_gap_cm
  57. self.heartbeat_f = heartbeat_f
  58. self.reset()
  59. self.build_box()
  60. def reset(self):
  61. self.add_dots(self.dot_sizes_deg, self.dot_speed_deg_s, self.dot_gap_cm)
  62. self.frame_count = 0
  63. self.log = []
  64. def get_track_vertices(self, units='cm'):
  65. x = self.aquarium_sz_cm[0]
  66. y = self.aquarium_sz_cm[1]
  67. box_vert = [[-x/2, y/2], [x/2, y/2], [x/2, -y/2], [-x/2, -y/2], [-x/2, y/2]]
  68. pos = (0, self.offset_cm)
  69. if units == 'cm':
  70. return pos, box_vert
  71. elif units == 'norm':
  72. box_vert_norm = [cm2norm(xx, self.monitor, self.win) for xx in box_vert]
  73. pos_norm = cm2norm(pos, self.monitor, self.win)
  74. return pos_norm, box_vert_norm
  75. def build_box(self):
  76. pos, box_vert = self.get_track_vertices(units='cm')
  77. self.box = visual.ShapeStim(
  78. self.win, units='cm', vertices=box_vert, closeShape=False, lineWidth=1, pos=pos, lineColor='black')
  79. def draw(self, with_dots=True, inc_frame_count=True):
  80. pos, vert = self.get_track_vertices(units='norm')
  81. # size != 1.0 here so as to not occlude parts of the bounding box
  82. _ = visual.Aperture(self.win, size=1.003, shape=vert, pos=pos)
  83. self.box.draw()
  84. if with_dots:
  85. if self.frame_count % self.dot_gap_frames == 0:
  86. if self.dots:
  87. self.active_dots.appendleft(self.dots.pop())
  88. for cur_d in self.active_dots:
  89. cur_d.update()
  90. if cur_d.visible():
  91. cur_d.draw()
  92. if self.frame_count % self.heartbeat_f == 0:
  93. self.log.append([(self.frame_count, xx.size_deg, xx.shape.pos[0], xx.shape.pos[1]) for xx in self.active_dots])
  94. if inc_frame_count:
  95. self.frame_count += 1
  96. def add_dots(self, dot_sizes_deg, speed_deg_s, dot_gap_cm):
  97. """
  98. We construct the PsychoPy dots (Polygons) once in the beginning, and keep track of a subet of active dots
  99. in this class. This is because updating the positions of the Polygons is very expensive and causes dropped
  100. frames when there are many of them.
  101. The active dots are in a FIFO, when dot_gap_frames frames have elapses, a new dot becomes active and is added to
  102. the FIFO. Dots are removed implicitly due to the maximum length of the FIFO, which is calculated based on the
  103. maximal number of dots that will be visible simultaneously. Only dots in the FIFO have their positions
  104. updated and are drawn.
  105. """
  106. dot_gap_deg = cm2deg(dot_gap_cm, self.monitor)
  107. dot_gap_s = dot_gap_deg / speed_deg_s
  108. self.dot_gap_frames = int(round(dot_gap_s / self.frame_time))
  109. max_visible_cm = deg2cm(max(dot_sizes_deg), self.monitor) * 2 + self.aquarium_sz_cm[0]
  110. max_dot_gaps = max_visible_cm / dot_gap_cm
  111. max_visible_dots = int(math.ceil(max_dot_gaps + 1))
  112. print(f'At most {max_visible_dots} dots will be visible simultaneously.')
  113. init_gap_cm = deg2cm(max(dot_sizes_deg), self.monitor) / 2
  114. init_pos_cm = (-self.aquarium_sz_cm[0] / 2 - init_gap_cm, self.offset_cm)
  115. self.dots = []
  116. self.active_dots = deque([], maxlen=max_visible_dots) ## has appendleft() and pop()
  117. side = 1
  118. side_offset = 0.4
  119. for cur_size_deg in dot_sizes_deg:
  120. cur_pos_cm = (init_pos_cm[0], init_pos_cm[1] + side_offset * side)
  121. cur_dot = MovingDot(self.win, self.frame_time, self.monitor, cur_pos_cm, speed_deg_s, cur_size_deg)
  122. self.dots.append(cur_dot)
  123. side *= -1
  124. print(f'Dots in total: {len(self.dots)}')
  125. def write_log(out_fname, tracks, aquarium_sz_cm, aquarium_spacing_cm, top_track_offset_cm, dot_sizes_deg, dot_speed_deg_s,
  126. presentations, dot_gap_cm, heartbeat_s, random_seed):
  127. log_dict = {
  128. 'aquarium_size_cm': aquarium_sz_cm,
  129. 'aquarium_spacing_cm': aquarium_spacing_cm,
  130. 'top_track_offset_cm': top_track_offset_cm,
  131. 'dot_sizes_deg': dot_sizes_deg,
  132. 'dot_speed_deg_s': dot_speed_deg_s,
  133. 'presentations': presentations,
  134. 'dot_gap_cm': dot_gap_cm,
  135. 'heartbeat_s': heartbeat_s,
  136. 'random_seed': random_seed,
  137. }
  138. for idx, cur_t in enumerate(tracks, start=1):
  139. log_dict[f'track_{idx}'] = cur_t.log
  140. with open(out_fname, 'w') as fp:
  141. fp.write(json.dumps(log_dict, indent=4))
  142. def main():
  143. aquarium_sz_cm = (15.6, 2.6)
  144. aquarium_spacing_cm = 2.8
  145. top_track_offset_cm = 4
  146. dot_sizes_deg = [1, 2, 5, 10, 20, 30]
  147. dot_speed_deg_s = 42
  148. presentations = 9
  149. dot_gap_cm = 4
  150. heartbeat_s = 5
  151. show_label_frames = 3
  152. randomize = False
  153. random_seed = 1234
  154. monitor = 'LittleScreen'
  155. win = visual.Window(size=(1024, 768), fullscr=True, screen=1, color=(1, 1, 1), monitor=monitor, checkTiming=True, allowStencil=True)
  156. win.recordFrameIntervals = True
  157. frame_time_s = win.monitorFramePeriod
  158. heartbeat_f = int(round(heartbeat_s / frame_time_s))
  159. print(f'Heartbeat: {heartbeat_f}')
  160. print(f'Monitor has {1 / frame_time_s} Hz refresh rate')
  161. shuffle = random.Random(random_seed).shuffle
  162. dot_sizes = []
  163. for cur_dot_size_deg in dot_sizes_deg:
  164. dot_sizes.extend([cur_dot_size_deg] * presentations)
  165. shuffle(dot_sizes)
  166. tracks = [
  167. DotTrack(win, frame_time_s, monitor, heartbeat_f, aquarium_sz_cm, top_track_offset_cm - aquarium_spacing_cm * 0, dot_sizes, dot_speed_deg_s, dot_gap_cm),
  168. DotTrack(win, frame_time_s, monitor, heartbeat_f, aquarium_sz_cm, top_track_offset_cm - aquarium_spacing_cm * 1, dot_sizes, dot_speed_deg_s, dot_gap_cm),
  169. DotTrack(win, frame_time_s, monitor, heartbeat_f, aquarium_sz_cm, top_track_offset_cm - aquarium_spacing_cm * 2, dot_sizes, dot_speed_deg_s, dot_gap_cm),
  170. DotTrack(win, frame_time_s, monitor, heartbeat_f, aquarium_sz_cm, top_track_offset_cm - aquarium_spacing_cm * 3, dot_sizes, dot_speed_deg_s, dot_gap_cm),
  171. ]
  172. text_sz = 0.25
  173. platform_specific.rush()
  174. while True:
  175. for cur_t in tracks:
  176. cur_t.draw(with_dots=False, inc_frame_count=False)
  177. win.flip()
  178. quit = False
  179. while True:
  180. keys = event.waitKeys()
  181. if 's' in keys:
  182. break
  183. if 'q' in keys:
  184. quit = True
  185. break
  186. if quit:
  187. break
  188. label_frames = 0
  189. now = datetime.now()
  190. date_str = now.strftime('%Y-%m-%dT%H-%M-%S')
  191. label = visual.TextStim(
  192. win, text=date_str,
  193. pos=(aquarium_sz_cm[0] / 2, top_track_offset_cm + aquarium_sz_cm[1] / 2 + text_sz), units='cm',
  194. color=(-1, -1, -1), height=text_sz)
  195. while True:
  196. keys = event.getKeys()
  197. if 'q' in keys:
  198. break
  199. if tracks[0].frame_count % heartbeat_f == 0:
  200. label_frames = show_label_frames
  201. if label_frames:
  202. label.draw()
  203. label_frames -= 1
  204. for cur_track in tracks:
  205. cur_track.draw()
  206. win.flip() # Syncs to monitor frame
  207. write_log(f'experiment-{date_str}.json', tracks, aquarium_sz_cm, aquarium_spacing_cm, top_track_offset_cm,
  208. dot_sizes_deg, dot_speed_deg_s, presentations, dot_gap_cm, heartbeat_s, random_seed)
  209. for cur_t in tracks:
  210. cur_t.reset()
  211. print(f'Overall, {win.nDroppedFrames} frames were dropped.')
  212. win.close()
  213. core.quit()
  214. if __name__ == '__main__':
  215. main()

Visualstimulationcode_moving_dots.py, under CC-BY-4.0 · at the source

Overview

Authors: Madhuri Puvvada1, Tim Hladnik2, Yue Zhang2, Fabian Svara3, Silke Lemmens1, Louise von Gersdorff Jørgensen4, Kevin Briggman3, Aristides Arrenberg2, Dominique Förster1,5, Matthias Hammerschmidt1,6
ORCID iDs: Madhuri Puvvada
  1. Institute of Zoology, University of Cologne, Cologne, Germany
  2. Werner Reichardt Centre for Integrative Neuroscience, Tuebingen, Germany
  3. Max Planck Institute for Neurobiology of Behavior – Caesar, Bonn, Germany
  4. Department of Veterinary and Animal Sciences, Faculty of Health and Medical Sciences, University of Copenhagen, Frederiksberg, Denmark
  5. Department of Neurology, Faculty of Medicine and University Hospital Cologne, University of Cologne, Cologne, Germany
  6. Center for Molecular Medicine Cologne (CMMC), Cologne, Germany
Journal: iScience, volume 29, issue 6, article 116095
Dates: received 4 July 2025; accepted 7 May 2026; published online 22 May 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.1016/j.isci.2026.116095 · PMID 42231971 · PMCID PMC13223957 · OpenAlex W7162116065
Open access: gold, a free copy (OpenAlex)
Status: code verified
Categories: zebrafish (organism)
Methods: Spectral & time-frequency, Statistics, Evoked potentials, fMRI & imaging, Single-unit activity, calcium imaging
Keywords: biological sciences
Topic: Regulation of Appetite and Obesity (Endocrine and Autonomic Systems, Neuroscience), according to OpenAlex
Funding: German Research Foundation (INST 37/1254-1 FUGG, 233886668); Human Frontier Science Program (RGY0079); National Institute of General Medical Sciences (544966926, GM63904, INST 37/1254-1 FUGG, AR 1076/1-2, 430158665, AR 1076/1-1)
Citations: cited by 1 paper (Europe PMC); 46 references in the paper
Research resources: Goat anti-rabbit Alexa 555 RRID:AB_141784, Goat anti-chicken Alexa 488 RRID:AB_142924, Mouse Anti-SV2 RRID:AB_2315387, Chicken anti-GFP RRID:AB_2534023, Goat anti-mouse Alexa 647 RRID:AB_2535804, Rabbit anti-RFP RRID:AB_591279

Abstract

Energy homeostasis depends on both food intake and behavioral control of energy expenditure. The hypothalamic melanocortin system is classically associated with feeding regulation, but its broader behavioral roles remain less defined. Using larval zebrafish, we show that hypothalamic pro-opiomelanocortin (pomca)-expressing neurons project to the tectum and target neurons expressing the melanocortin receptor Mc4r. Rather than altering prey consumption, melanocortin signaling in this circuit modulates visually guided avoidance of small stimuli, an energy-demanding behavior. Sated larvae, with higher energy reserves, avoid small objects (prey or other, potentially harmful, protozoa) more readily, while hungry larvae do not. Importantly, disrupting Mc4r signaling in sated fish reduces this avoidance behavior, indicating that the melanocortin system gates energy expenditure decisions based on internal state. These findings uncover a previously undescribed function for hypothalamic melanocortin signaling in tuning sensorimotor responses to visual stimuli, not to regulate feeding per se but to modulate behavioral energy allocation.

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

Repository

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

Zenodo 20015261

License: CC-BY-4.0
State: the link answers, verified on 28 September 2026
Evidence: files inventoried
Languages: Python (1)
Size: 1 file, 1 script
Software Heritage: not checked
Found in: “Data and code availability”
Not found: README, license file, CITATION.cff, environment file, tests, continuous integration, documentation
Tools: PsychoPy (1 file)
Availability: 1 check, the latest on 28 September 2026: the link answers (HTTP 200)
  • 28 September 2026: the link answers (HTTP 200)
1 file

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

No dataset and no data link were found in the paper.

Data and code availability

All data reported in this paper will be shared by the lead contact upon request.

All original code has been deposited at Zenodo and is publicly available at https://doi.org/10.5281/zenodo.20015261 as of the date of publication.

Any additional information required to reanalyze the data reported in this paper is available from the lead contact upon request.

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

Recorded: type, language, journal, volume, issue, pages, dates, 10 authors, 1 keyword, 3 funders, 45 references, 6 RRIDs.

Cite

This paper

Puvvada, M., Hladnik, T., Zhang, Y., Svara, F., Lemmens, S., von Gersdorff Jørgensen, L., Briggman, K., Arrenberg, A., Förster, D., & Hammerschmidt, M. (2026). The tectal melanocortin system modulates energy-dependent visual avoidance behavior in zebrafish. iScience, 29(6), 116095. https://doi.org/10.1016/j.isci.2026.116095

BibTeX

@article{puvvada2026tectal,
author = {Puvvada, Madhuri and Hladnik, Tim and Zhang, Yue and Svara, Fabian and Lemmens, Silke and von Gersdorff Jørgensen, Louise and Briggman, Kevin and Arrenberg, Aristides and Förster, Dominique and Hammerschmidt, Matthias},
title = {{The tectal melanocortin system modulates energy-dependent visual avoidance behavior in zebrafish}},
journal = {iScience},
year = {2026},
month = may,
volume = {29},
number = {6},
pages = {116095},
publisher = {Elsevier},
issn = {2589-0042},
doi = {10.1016/j.isci.2026.116095},
url = {https://doi.org/10.1016/j.isci.2026.116095},
pmid = {42231971},
pmcid = {PMC13223957}
}

RIS

TY - JOUR
AU - Puvvada, Madhuri
AU - Hladnik, Tim
AU - Zhang, Yue
AU - Svara, Fabian
AU - Lemmens, Silke
AU - von Gersdorff Jørgensen, Louise
AU - Briggman, Kevin
AU - Arrenberg, Aristides
AU - Förster, Dominique
AU - Hammerschmidt, Matthias
TI - The tectal melanocortin system modulates energy-dependent visual avoidance behavior in zebrafish
T2 - iScience
J2 - iScience
PY - 2026
DA - 2026/05/22
VL - 29
IS - 6
SP - 116095
SN - 2589-0042
PB - Elsevier
DO - 10.1016/j.isci.2026.116095
UR - https://doi.org/10.1016/j.isci.2026.116095
LA - en
ER -

CSL-JSON

{
"id": "10.1016/j.isci.2026.116095",
"type": "article-journal",
"title": "The tectal melanocortin system modulates energy-dependent visual avoidance behavior in zebrafish",
"container-title": "iScience",
"author": [
{
"family": "Puvvada",
"given": "Madhuri"
},
{
"family": "Hladnik",
"given": "Tim"
},
{
"family": "Zhang",
"given": "Yue"
},
{
"family": "Svara",
"given": "Fabian"
},
{
"family": "Lemmens",
"given": "Silke"
},
{
"family": "von Gersdorff Jørgensen",
"given": "Louise"
},
{
"family": "Briggman",
"given": "Kevin"
},
{
"family": "Arrenberg",
"given": "Aristides"
},
{
"family": "Förster",
"given": "Dominique"
},
{
"family": "Hammerschmidt",
"given": "Matthias"
}
],
"container-title-short": "iScience",
"volume": "29",
"issue": "6",
"page": "116095",
"DOI": "10.1016/j.isci.2026.116095",
"PMID": "42231971",
"PMCID": "PMC13223957",
"ISSN": "2589-0042",
"publisher": "Elsevier",
"URL": "https://doi.org/10.1016/j.isci.2026.116095",
"language": "en",
"issued": {
"date-parts": [
[
2026,
5,
22
]
]
}
}

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.64898/2026.03.09.710483 [code]
Multimodal reference brain atlas of adult <i>Danionella cerebrum</i>
Journal: bioRxiv (preprint)
In common: 4 references
[2] doi:10.1371/journal.pgen.1012171
Canalization of neural dynamics by δ-protocadherins in the developing zebrafish optic tectum.
Journal: PLoS genetics
In common: zebrafish, 3 references
[3] doi:10.1038/s41467-026-71371-6
Molecular and functional dissection using CaMPARI-seq reveals the neuronal organization for dissociating optic flow-dependent behaviors.
Journal: Nature communications
In common: zebrafish, 2 references
[4] doi:10.1016/j.isci.2026.117136 [code]
Complex pectoral-fin-driven locomotion underlies refined visuomotor behavior in the cichlid &lt;i&gt;Astatotilapia burtoni&lt;/i&gt;.
Journal: iScience
In common: zebrafish, 2 references
[5] doi:10.1038/s41467-026-69633-4 [code]
Visuomotor decision-making through multifeature convergence in the larval zebrafish hindbrain.
Journal: Nature communications
In common: zebrafish, 2 references
[6] doi:10.1016/j.crmeth.2026.101421 [code]
EthoPy provides an accessible platform for reproducible behavioral neuroscience.
Journal: Cell reports methods
In common: PsychoPy, 1 reference
[7] doi:10.1162/imag.a.1330 [code]
Human risk taking and metabolic state: No credible evidence for desacyl-ghrelin modulation of neural or behavioural effects.
Journal: Imaging neuroscience (Cambridge, Mass.)
In common: 2 references
[8] doi:10.1038/s41467-026-76242-8 [code]
Whole-brain, all-optical interrogation of neuronal dynamics underlying gut and vascular interoception in zebrafish.
Journal: Nature communications
In common: zebrafish, 1 reference
[9] doi:10.1038/s41598-026-58107-8
Three-dimensional voltage imaging in live larval zebrafish brains using fully genetically encoded voltage indicator.
Journal: Scientific reports
In common: zebrafish, 1 reference
[10] doi:10.1038/s41467-026-71640-4
Neural temporal scaling accounts for robust hunting behavior across temperatures.
Journal: Nature communications
In common: zebrafish, 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.