The tectal melanocortin system modulates energy-dependent visual avoidance behavior in zebrafish.
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
Python · 277 lines · 10 KB · CC-BY-4.0
- #Visual stimulation code used for the size discrimination assay
- #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"
- #Method for developing the size discrimination assay was originally described in Barker and Baier, 2015.
- #Code written by Fabian Svara
- import math
- from datetime import datetime, date
- import random
- from collections import deque
- import json
- from psychopy import visual, core, monitors, event, platform_specific
- from psychopy.tools.monitorunittools import cm2deg, deg2cm, cm2pix, deg2pix
- def norm2pix(norm, win):
- x = norm[0] * win.size[0] / 2.0
- y = norm[1] * win.size[1] / 2.0
- return x, y
- def pix2norm(pix, win):
- x = 2 * pix[0] / win.size[0]
- y = 2 * pix[1] / win.size[1]
- return x, y
- def cm2norm(cm, monitor, win):
- px = (cm2pix(cm[0], monitor), cm2pix(cm[1], monitor))
- norm = pix2norm(px, win)
- return norm
- class MovingDot(object):
- def __init__(self, win, frame_time, monitor, initial_pos_cm, speed_deg_s, size_deg):
- self.initial_pos_cm = initial_pos_cm
- self.initial_pos_deg = tuple(cm2deg(xx, monitor) for xx in initial_pos_cm)
- self.speed_deg_s = speed_deg_s
- self.speed_deg_f = speed_deg_s * frame_time # deg / frame
- self.win = win
- self.monitor = monitor
- self.size_deg = size_deg
- self.shape = visual.Polygon(
- win, units='deg', edges=100, radius=size_deg/2, fillColor='black', lineColor='black', pos=self.initial_pos_deg)
- def update(self):
- self.shape.pos += (self.speed_deg_f, 0)
- def draw(self):
- self.shape.draw()
- def visible(self):
- pos_x_px = deg2pix(self.shape.pos[0], self.monitor)
- if -self.win.size[0] / 2 < pos_x_px < self.win.size[0] / 2:
- return True
- else:
- return False
- class DotTrack(object):
- def __init__(self, win, frame_time, monitor, heartbeat_f, aquarium_sz_cm, offset_cm, dot_sizes_deg, dot_speed_deg_s, dot_gap_cm):
- self.aquarium_sz_cm = aquarium_sz_cm
- self.frame_time = frame_time
- self.offset_cm = offset_cm
- self.win = win
- self.frame_count = 0
- self.log = []
- self.monitor = monitors.Monitor(monitor)
- self.dot_sizes_deg = dot_sizes_deg
- self.dot_speed_deg_s = dot_speed_deg_s
- self.dot_gap_cm = dot_gap_cm
- self.heartbeat_f = heartbeat_f
- self.reset()
- self.build_box()
- def reset(self):
- self.add_dots(self.dot_sizes_deg, self.dot_speed_deg_s, self.dot_gap_cm)
- self.frame_count = 0
- self.log = []
- def get_track_vertices(self, units='cm'):
- x = self.aquarium_sz_cm[0]
- y = self.aquarium_sz_cm[1]
- box_vert = [[-x/2, y/2], [x/2, y/2], [x/2, -y/2], [-x/2, -y/2], [-x/2, y/2]]
- pos = (0, self.offset_cm)
- if units == 'cm':
- return pos, box_vert
- elif units == 'norm':
- box_vert_norm = [cm2norm(xx, self.monitor, self.win) for xx in box_vert]
- pos_norm = cm2norm(pos, self.monitor, self.win)
- return pos_norm, box_vert_norm
- def build_box(self):
- pos, box_vert = self.get_track_vertices(units='cm')
- self.box = visual.ShapeStim(
- self.win, units='cm', vertices=box_vert, closeShape=False, lineWidth=1, pos=pos, lineColor='black')
- def draw(self, with_dots=True, inc_frame_count=True):
- pos, vert = self.get_track_vertices(units='norm')
- # size != 1.0 here so as to not occlude parts of the bounding box
- _ = visual.Aperture(self.win, size=1.003, shape=vert, pos=pos)
- self.box.draw()
- if with_dots:
- if self.frame_count % self.dot_gap_frames == 0:
- if self.dots:
- self.active_dots.appendleft(self.dots.pop())
- for cur_d in self.active_dots:
- cur_d.update()
- if cur_d.visible():
- cur_d.draw()
- if self.frame_count % self.heartbeat_f == 0:
- self.log.append([(self.frame_count, xx.size_deg, xx.shape.pos[0], xx.shape.pos[1]) for xx in self.active_dots])
- if inc_frame_count:
- self.frame_count += 1
- def add_dots(self, dot_sizes_deg, speed_deg_s, dot_gap_cm):
- """
- We construct the PsychoPy dots (Polygons) once in the beginning, and keep track of a subet of active dots
- in this class. This is because updating the positions of the Polygons is very expensive and causes dropped
- frames when there are many of them.
- The active dots are in a FIFO, when dot_gap_frames frames have elapses, a new dot becomes active and is added to
- the FIFO. Dots are removed implicitly due to the maximum length of the FIFO, which is calculated based on the
- maximal number of dots that will be visible simultaneously. Only dots in the FIFO have their positions
- updated and are drawn.
- """
- dot_gap_deg = cm2deg(dot_gap_cm, self.monitor)
- dot_gap_s = dot_gap_deg / speed_deg_s
- self.dot_gap_frames = int(round(dot_gap_s / self.frame_time))
- max_visible_cm = deg2cm(max(dot_sizes_deg), self.monitor) * 2 + self.aquarium_sz_cm[0]
- max_dot_gaps = max_visible_cm / dot_gap_cm
- max_visible_dots = int(math.ceil(max_dot_gaps + 1))
- print(f'At most {max_visible_dots} dots will be visible simultaneously.')
- init_gap_cm = deg2cm(max(dot_sizes_deg), self.monitor) / 2
- init_pos_cm = (-self.aquarium_sz_cm[0] / 2 - init_gap_cm, self.offset_cm)
- self.dots = []
- self.active_dots = deque([], maxlen=max_visible_dots) ## has appendleft() and pop()
- side = 1
- side_offset = 0.4
- for cur_size_deg in dot_sizes_deg:
- cur_pos_cm = (init_pos_cm[0], init_pos_cm[1] + side_offset * side)
- cur_dot = MovingDot(self.win, self.frame_time, self.monitor, cur_pos_cm, speed_deg_s, cur_size_deg)
- self.dots.append(cur_dot)
- side *= -1
- print(f'Dots in total: {len(self.dots)}')
- def write_log(out_fname, tracks, aquarium_sz_cm, aquarium_spacing_cm, top_track_offset_cm, dot_sizes_deg, dot_speed_deg_s,
- presentations, dot_gap_cm, heartbeat_s, random_seed):
- log_dict = {
- 'aquarium_size_cm': aquarium_sz_cm,
- 'aquarium_spacing_cm': aquarium_spacing_cm,
- 'top_track_offset_cm': top_track_offset_cm,
- 'dot_sizes_deg': dot_sizes_deg,
- 'dot_speed_deg_s': dot_speed_deg_s,
- 'presentations': presentations,
- 'dot_gap_cm': dot_gap_cm,
- 'heartbeat_s': heartbeat_s,
- 'random_seed': random_seed,
- }
- for idx, cur_t in enumerate(tracks, start=1):
- log_dict[f'track_{idx}'] = cur_t.log
- with open(out_fname, 'w') as fp:
- fp.write(json.dumps(log_dict, indent=4))
- def main():
- aquarium_sz_cm = (15.6, 2.6)
- aquarium_spacing_cm = 2.8
- top_track_offset_cm = 4
- dot_sizes_deg = [1, 2, 5, 10, 20, 30]
- dot_speed_deg_s = 42
- presentations = 9
- dot_gap_cm = 4
- heartbeat_s = 5
- show_label_frames = 3
- randomize = False
- random_seed = 1234
- monitor = 'LittleScreen'
- win = visual.Window(size=(1024, 768), fullscr=True, screen=1, color=(1, 1, 1), monitor=monitor, checkTiming=True, allowStencil=True)
- win.recordFrameIntervals = True
- frame_time_s = win.monitorFramePeriod
- heartbeat_f = int(round(heartbeat_s / frame_time_s))
- print(f'Heartbeat: {heartbeat_f}')
- print(f'Monitor has {1 / frame_time_s} Hz refresh rate')
- shuffle = random.Random(random_seed).shuffle
- dot_sizes = []
- for cur_dot_size_deg in dot_sizes_deg:
- dot_sizes.extend([cur_dot_size_deg] * presentations)
- shuffle(dot_sizes)
- tracks = [
- 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),
- 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),
- 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),
- 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),
- ]
- text_sz = 0.25
- platform_specific.rush()
- while True:
- for cur_t in tracks:
- cur_t.draw(with_dots=False, inc_frame_count=False)
- win.flip()
- quit = False
- while True:
- keys = event.waitKeys()
- if 's' in keys:
- break
- if 'q' in keys:
- quit = True
- break
- if quit:
- break
- label_frames = 0
- now = datetime.now()
- date_str = now.strftime('%Y-%m-%dT%H-%M-%S')
- label = visual.TextStim(
- win, text=date_str,
- pos=(aquarium_sz_cm[0] / 2, top_track_offset_cm + aquarium_sz_cm[1] / 2 + text_sz), units='cm',
- color=(-1, -1, -1), height=text_sz)
- while True:
- keys = event.getKeys()
- if 'q' in keys:
- break
- if tracks[0].frame_count % heartbeat_f == 0:
- label_frames = show_label_frames
- if label_frames:
- label.draw()
- label_frames -= 1
- for cur_track in tracks:
- cur_track.draw()
- win.flip() # Syncs to monitor frame
- write_log(f'experiment-{date_str}.json', tracks, aquarium_sz_cm, aquarium_spacing_cm, top_track_offset_cm,
- dot_sizes_deg, dot_speed_deg_s, presentations, dot_gap_cm, heartbeat_s, random_seed)
- for cur_t in tracks:
- cur_t.reset()
- print(f'Overall, {win.nDroppedFrames} frames were dropped.')
- win.close()
- core.quit()
- if __name__ == '__main__':
- main()
Visualstimulationcode_moving_dots.py, under CC-BY-4.0 · at the source
Overview
- Institute of Zoology, University of Cologne, Cologne, Germany
- Werner Reichardt Centre for Integrative Neuroscience, Tuebingen, Germany
- Max Planck Institute for Neurobiology of Behavior – Caesar, Bonn, Germany
- Department of Veterinary and Animal Sciences, Faculty of Health and Medical Sciences, University of Copenhagen, Frederiksberg, Denmark
- Department of Neurology, Faculty of Medicine and University Hospital Cologne, University of Cologne, Cologne, Germany
- Center for Molecular Medicine Cologne (CMMC), Cologne, Germany
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
Availability: 1 check, the latest on 28 September 2026: the link answers (HTTP 200)
- 28 September 2026: the link answers (HTTP 200)
1 file
- Visualstimulationcode_mo
ving_dots.py , Python, 277 lines
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://
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://
BibTeX
@article{puvvada2026tect
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/
url = {https://
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/
VL - 29
IS - 6
SP - 116095
SN - 2589-0042
PB - Elsevier
DO - 10.1016/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1016/
"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":
"volume": "29",
"issue": "6",
"page": "116095",
"DOI": "10.1016/
"PMID": "42231971",
"PMCID": "PMC13223957",
"ISSN": "2589-0042",
"publisher": "Elsevier",
"URL": "https://
"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.1073/pnas.2416215122 [code]
- The visuomotor transformations underlying target-directed behavior.Journal: Proceedings of the National Academy of Sciences of the United States of AmericaIn common: zebrafish, 6 references
- [2] doi:10.1186/s12915-021-01222-x
- Input from torus longitudinalis drives binocularity and spatial summation in zebrafish optic tectum.Journal: BMC biologyIn common: zebrafish, 5 references
- [3] doi:10.1016/j.cub.2025.07.007
- Quantifying the link between retinal performance and the optomotor response.Journal: Current biology : CBIn common: zebrafish, 5 references
- [4] doi:10.3389/fnmol.2022.818007
- Single-Cell RNA Sequencing Characterizes the Molecular Heterogeneity of the Larval Zebrafish Optic Tectum.Journal: Frontiers in molecular neuroscienceIn common: zebrafish, 5 references
- [5] doi:10.1038/s41592-022-01621-0 [code]
- Automated synapse-level reconstruction of neural circuits in the larval zebrafish brain.Journal: Nature methodsIn common: zebrafish, 4 references
- [6] doi:10.1038/s41467-023-40749-1 [code]
- Retina-derived signals control pace of neurogenesis in visual brain areas but not circuit assembly.Journal: Nature communicationsIn common: zebrafish, 4 references
- [7] doi:10.7554/elife.78381 [code]
- Recurrent network interactions explain tectal response variability and experience-dependent behavior.Journal: eLifeIn common: zebrafish, 4 references
- [8] doi:10.1126/sciadv.ade9909 [code]
- A single-cell resolution gene expression atlas of the larval zebrafish brain.Journal: Science advancesIn common: zebrafish, 4 references
- [9] doi:10.1038/s41380-023-02391-7 [code]
- High-resolution tracking of unconfined zebrafish behavior reveals stimulatory and anxiolytic effects of psilocybin.Journal: Molecular psychiatryIn common: zebrafish, 4 references
- [10] doi:10.1038/s41586-025-09651-2 [code]
- Integration of hunger and hormonal state gates infant-directed aggression.Journal: NatureIn common: 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: 1 repository of the authors' code, each at its verified commit and with its license, 1 script, and 0 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:e899bc09259ce023…
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.1016/j.isci.2026.116095)
<!-- oscr-badge:end -->reStructuredText
.. oscr-badge:start
.. image:: https://openscicode.org/badge/doi/10.1016/j.isci.2026.116095.svg
:target: https://openscicode.org/badge/doi/10.1016/j.isci.2026.116095
:alt: OSCR
.. oscr-badge:endHTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.1016/j.isci.2026.116095"><img src="https://openscicode.org/badge/doi/10.1016/j.isci.2026.116095.svg" alt="OSCR"></a>
<!-- oscr-badge:end -->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)
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
