OSCR

Complex pectoral-fin-driven locomotion underlies refined visuomotor behavior in the cichlid <i>Astatotilapia burtoni</i>.

Code ↔ Paper

3 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 3 matches
  1. [1] § STAR★Methods › Method details › Kinematic tracking and analysis ↔ src/cichlid_omr/fin_tracking.py, lines 1–11 · score 0.76 · swim bladder, DeepLabCut, tail point, mouth, tip, mid
  2. [2] § STAR★Methods › Method details › Kinematic tracking and analysis ↔ notebooks/02_fin_tracking/00_DLC_analyses.ipynb, lines 75–121 · score 0.60 · swim bladder, tail point, tip, mid, tracked
  3. [3] § STAR★Methods › Method details › Optomotor task with varying bar widths ↔ src/cichlid_omr/random_bar_width.py, lines 40–86 · score 0.55 · bar widths, heading angle, rotated, cichlids, Zebrafish, edges

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 · 217 lines · 7.3 KB · MIT · 1 match

  1. """Helpers for the DeepLabCut fin-tracking analysis (notebooks/02_fin_tracking).
  2. Coordinate arrays are shaped `(n_frames, n_bodyparts, 2)` with the body-part order
  3. `mouth, swim_bladder, tail_point_mid, tail_point_tip, left_pect_base, left_pect_tip,
  4. right_pect_base, right_pect_tip` (swim bladder at index 5, tail mid at index 2).
  5. """
  6. import json
  7. import numpy as np
  8. import pandas as pd
  9. def extract_coords_from_results_file(filename):
  10. """Read a DeepLabCut `.h5` results file into `(bodyparts, coords, likelihoods)`."""
  11. df = pd.read_hdf(filename)
  12. index = df.index
  13. multi_index = df.loc[index[0]].index
  14. scorer_indices = multi_index.levels[0]
  15. bodypart_indices = multi_index.levels[1]
  16. n_frames = len(index)
  17. n_bodyparts = len(bodypart_indices)
  18. coords = np.ones((n_frames, n_bodyparts, 2)) * np.nan
  19. likelihoods = np.ones((n_frames, n_bodyparts)) * np.nan
  20. for i, _idx in enumerate(index):
  21. for j, bodypart in enumerate(bodypart_indices):
  22. coords[i, j, 0] = df.loc[i][scorer_indices[0]][bodypart]["x"]
  23. coords[i, j, 1] = df.loc[i][scorer_indices[0]][bodypart]["y"]
  24. likelihoods[i, j] = df.loc[i][scorer_indices[0]][bodypart]["likelihood"]
  25. return bodypart_indices, coords, likelihoods
  26. def extract_coords_from_centroid_file(filename):
  27. """Read an `X`/`Y` centroid `.csv` into an `(n_frames, 2)` array."""
  28. df = pd.read_csv(filename)
  29. index = df.index
  30. n_frames = len(index)
  31. coords = np.ones((n_frames, 2)) * np.nan
  32. for i, _idx in enumerate(index):
  33. coords[i, 0] = df.loc[i]["X"]
  34. coords[i, 1] = df.loc[i]["Y"]
  35. return coords
  36. def center_coords(coords):
  37. """Translate all body parts so the swim bladder (index 5) sits at the origin."""
  38. swim_bladder_coords = coords[:, 5][:, np.newaxis]
  39. coords_centered = coords - swim_bladder_coords
  40. return coords_centered
  41. def calculate_heading_angle(coords, discontinuity_threshold=None):
  42. """Heading angle (radians, unwrapped) from the tail-mid body part (index 2)."""
  43. heading_angle = np.arctan2(coords[:, 2, 1], coords[:, 2, 0])[:, np.newaxis]
  44. heading_angle = np.unwrap(heading_angle, discont=discontinuity_threshold, axis=0)
  45. return heading_angle
  46. def rotate_coords(coords, rotation_angle):
  47. """Rotate every frame's coordinates by `rotation_angle` (radians)."""
  48. normalized_coords = np.stack(
  49. [
  50. coords[:, :, 0] * np.cos(rotation_angle) - coords[:, :, 1] * np.sin(rotation_angle),
  51. coords[:, :, 1] * np.cos(rotation_angle) + coords[:, :, 0] * np.sin(rotation_angle),
  52. ],
  53. axis=2,
  54. )
  55. return normalized_coords
  56. class NumpyEncoder(json.JSONEncoder):
  57. """JSON encoder that serialises numpy scalars and arrays."""
  58. def default(self, obj):
  59. if isinstance(
  60. obj,
  61. (
  62. np.int_,
  63. np.intc,
  64. np.intp,
  65. np.int8,
  66. np.int16,
  67. np.int32,
  68. np.int64,
  69. np.uint8,
  70. np.uint16,
  71. np.uint32,
  72. np.uint64,
  73. ),
  74. ):
  75. return int(obj)
  76. elif isinstance(obj, (np.float16, np.float32, np.float64)):
  77. return float(obj)
  78. elif isinstance(obj, (np.ndarray,)):
  79. return obj.tolist()
  80. return json.JSONEncoder.default(self, obj)
  81. def detect_bouts(data, bout_threshold, window_size):
  82. """Return a boolean mask marking frames within a swim bout.
  83. A bout starts when the signal deviates by more than `bout_threshold` from a running
  84. extremum and ends after `window_size` frames without a further deviation.
  85. """
  86. min_value = np.inf
  87. max_value = -np.inf
  88. find_max = True
  89. bout_detected = np.zeros(len(data)).astype(bool)
  90. bout_counter = 0
  91. prev_value = None
  92. bout = False
  93. for index, value in enumerate(data):
  94. if value > max_value:
  95. max_value = value
  96. if value < min_value:
  97. min_value = value
  98. if bout:
  99. if not find_max and value > min_value + bout_threshold:
  100. max_value = value
  101. if not find_max:
  102. find_max = True
  103. elif find_max and value < max_value - bout_threshold:
  104. min_value = value
  105. if find_max:
  106. find_max = False
  107. if np.abs(value - prev_value) > bout_threshold:
  108. bout_counter = 0
  109. else:
  110. bout_counter += 1
  111. else:
  112. if value > min_value + bout_threshold or value < max_value - bout_threshold:
  113. bout = True
  114. bout_counter = 0
  115. if value < max_value - bout_threshold:
  116. find_max = False
  117. if bout_counter > window_size:
  118. min_value = np.inf
  119. max_value = -np.inf
  120. bout = False
  121. find_max = True
  122. bout_counter = 0
  123. prev_value = value
  124. bout_detected[index] = bout
  125. return bout_detected
  126. def detect_peaks2(data, delta, x=None):
  127. """Peak/trough detection (Billauer's algorithm); returns `(minima, maxima)` tables."""
  128. maxtab = []
  129. mintab = []
  130. if x is None:
  131. x = np.arange(len(data))
  132. data = np.asarray(data)
  133. mn, mx = np.inf, -np.inf
  134. mnpos, mxpos = np.nan, np.nan
  135. lookformax = True
  136. for i in np.arange(len(data)):
  137. this = data[i]
  138. if this > mx:
  139. mx = this
  140. mxpos = x[i]
  141. if this < mn:
  142. mn = this
  143. mnpos = x[i]
  144. if lookformax:
  145. if this < mx - delta:
  146. maxtab.append((mxpos, mx))
  147. mn = this
  148. mnpos = x[i]
  149. lookformax = False
  150. else:
  151. if this > mn + delta:
  152. mintab.append((mnpos, mn))
  153. mx = this
  154. mxpos = x[i]
  155. lookformax = True
  156. maxtab = np.array(maxtab)
  157. mintab = np.array(mintab)
  158. return mintab, maxtab
  159. def calculate_frequency_from_peaks(data, data_length, framerate, half_cycles=False):
  160. """Expand peak indices `data` into a per-frame frequency trace (Hz)."""
  161. new_data = np.zeros(data_length)
  162. for peak0, peak1 in zip(data[:-1], data[1:], strict=False):
  163. frequency = framerate / ((1 + int(half_cycles)) * (peak1 - peak0))
  164. new_data[peak0:peak1] = frequency
  165. new_data[-1] = frequency
  166. return new_data
  167. def calculate_continuous_inter_peak_interval(data, data_length):
  168. """Expand peak indices `data` into a per-frame inter-peak-interval trace."""
  169. new_data = np.zeros(data_length)
  170. for peak0, peak1 in zip(data[:-1], data[1:], strict=False):
  171. ipi = peak1 - peak0
  172. new_data[peak0:peak1] = ipi
  173. new_data[data[-1] :] = ipi
  174. return new_data
  175. def check_bout_starts_ends(bouts, bout_starts, bout_ends):
  176. """Pad `bout_starts`/`bout_ends` so they pair up when a bout runs past a signal edge."""
  177. if len(bout_starts) != len(bout_ends):
  178. if bout_starts[0] > bout_ends[0]:
  179. bout_starts = np.insert(bout_starts, 0, 0)
  180. bouts, bout_starts, bout_ends = check_bout_starts_ends(bouts, bout_starts, bout_ends)
  181. if bout_starts[-1] > bout_ends[-1]:
  182. bout_ends = np.append(bout_ends, len(bouts))
  183. bouts, bout_starts, bout_ends = check_bout_starts_ends(bouts, bout_starts, bout_ends)
  184. return bouts, bout_starts, bout_ends

fin_tracking.py at commit 3672765, under MIT · at the source

Overview

Authors: Nicholas C. Guilbeault1,2, Molly E. Westbrook3, Venkatesh S. Krishna1, Rida Ansari1,2, Alexander Keth3, Aristides B. Arrenberg4, Scott A. Juntti3, Tod R. Thiele1,2,5
ORCID iDs: Scott A. Juntti
  1. Department of Biological Sciences, University of Toronto Scarborough, Scarborough, ON, Canada
  2. Department of Cell and Systems Biology, University of Toronto, Toronto, ON, Canada
  3. Department of Biology, University of Maryland, College Park, MD, USA
  4. Werner Reichardt Centre for Integrative Neuroscience, University of Tübigen, Tübigen, Germany
  5. Natural Science Division, Pepperdine University, Malibu, CA, USA
Journal: iScience, volume 29, issue 9, article 117136
Dates: received 12 May 2026; accepted 24 July 2026; published online 18 August 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.1016/j.isci.2026.117136 · PMID 42662783 · PMCID PMC13520728 · OpenAlex W7203726305
Open access: gold, a free copy (OpenAlex)
Status: code verified
Categories: other (organism), zebrafish (organism), systems (subfield)
Methods: Statistics, Machine learning
Keywords: zebrafish, cichlid, optomotor, visual systems, evolution, neural circuits
Topic: Biomimetic flight and propulsion mechanisms (Aerospace Engineering, Engineering), according to OpenAlex
Funding: NSERC; Human Frontier Science Program (RGY0079/201); Canadian Foundation for Innovation and the Ontario Research Fund; NIH (R35GM142872)
Citations: not cited yet (Europe PMC); 69 references in the paper

Abstract

The optomotor response (OMR) is a conserved visuomotor reflex that stabilizes position during optic flow. The OMR has been extensively studied in zebrafish but examined in detail in only a small number of other fish species. Here, we characterize the OMR in larval cichlids (Astatotilapia burtoni). Using high-resolution behavioral assays, we reveal striking species differences in alignment accuracy, speed matching, and swimming kinematics. While zebrafish employ discrete tail-driven swims and stepwise turns, cichlids exhibit continuous swimming, dynamic pivot maneuvers, and backward locomotion powered by complex pectoral fin movements (labriform swimming). Local contrast analyses indicate inverted, species-specific visual feature tuning for the OMR. These results, together with a prior report of similar prey-capture kinematics between these species, highlight the modularity of evolved visuomotor specializations. Together, our results establish larval cichlid optomotor behavior as a tractable system for elucidating how evolutionary history and ecological demands shape neural circuits to produce diverse solutions to a highly conserved visuomotor behavior.

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 3 matches between paragraphs and lines of code.

Zenodo 21463359

License: MIT
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Size: 1 file
Software Heritage: not checked
Found in: “Data and code availability”
Not found: README, license file, CITATION.cff, environment file, tests, continuous integration, documentation
Tools: NumPy (22 files), pandas (16 files), Matplotlib (15 files), SciPy (9 files), Pingouin (4 files), scikit-learn (2 files), DeepLabCut (1 file), ggpubr (1 file), OpenCV (1 file), rstatix (1 file), tidyverse (1 file)
Availability: 1 check, the latest on 27 September 2026: the link answers (HTTP 200)
  • 27 September 2026: the link answers (HTTP 200)
33 files

ncguilbeault/cichlid_omr_analysis

License: MIT
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Commit: 36727650834d019e61e3d06f11f1bff93c1f2f68, 20 July 2026
Languages: Jupyter (18), Python (10), R (3)
Size: 44 files, 31 scripts
Software Heritage: not archived
Found in: the Zenodo archive record
Holds: README, license file, CITATION.cff, environment (pyproject.toml, uv.lock), 18 notebooks
Not found: tests, continuous integration, documentation
Tools: NumPy (22 files), pandas (16 files), Matplotlib (15 files), SciPy (9 files), Pingouin (4 files), scikit-learn (2 files), DeepLabCut (1 file), ggpubr (1 file), OpenCV (1 file), rstatix (1 file), tidyverse (1 file)
Availability: 1 check, the latest on 27 September 2026: the link answers
  • 27 September 2026: the link answers
33 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:

  • 2 repositories of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
  • 62 scripts, each with its path and the digest of its content;
  • 3 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

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

Data and code availability

• All data reported in this study 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.21463359. • Any additional information required to reanalyze the data reported in this study 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 2, 28 September 2026

  • Authors: added Scott A. Juntti (0000-0001-7634-1395); removed Scott A. Juntti

Version 1, 27 September 2026: the first record

Recorded: type, language, journal, volume, issue, pages, dates, 8 authors, 6 keywords, 4 funders, 67 references.

Cite

This paper

Guilbeault, N. C., Westbrook, M. E., Krishna, V. S., Ansari, R., Keth, A., Arrenberg, A. B., Juntti, S. A., & Thiele, T. R. (2026). Complex pectoral-fin-driven locomotion underlies refined visuomotor behavior in the cichlid &lt;i&gt;Astatotilapia burtoni&lt;/i&gt;. iScience, 29(9), 117136. https://doi.org/10.1016/j.isci.2026.117136

BibTeX

@article{guilbeault2026complex,
author = {Guilbeault, Nicholas C. and Westbrook, Molly E. and Krishna, Venkatesh S. and Ansari, Rida and Keth, Alexander and Arrenberg, Aristides B. and Juntti, Scott A. and Thiele, Tod R.},
title = {{Complex pectoral-fin-driven locomotion underlies refined visuomotor behavior in the cichlid \&lt;i\&gt;Astatotilapia burtoni\&lt;/i\&gt;}},
journal = {iScience},
year = {2026},
month = aug,
volume = {29},
number = {9},
pages = {117136},
publisher = {Elsevier},
issn = {2589-0042},
doi = {10.1016/j.isci.2026.117136},
url = {https://doi.org/10.1016/j.isci.2026.117136},
pmid = {42662783},
pmcid = {PMC13520728}
}

RIS

TY - JOUR
AU - Guilbeault, Nicholas C.
AU - Westbrook, Molly E.
AU - Krishna, Venkatesh S.
AU - Ansari, Rida
AU - Keth, Alexander
AU - Arrenberg, Aristides B.
AU - Juntti, Scott A.
AU - Thiele, Tod R.
TI - Complex pectoral-fin-driven locomotion underlies refined visuomotor behavior in the cichlid &lt;i&gt;Astatotilapia burtoni&lt;/i&gt;
T2 - iScience
J2 - iScience
PY - 2026
DA - 2026/08/18
VL - 29
IS - 9
SP - 117136
SN - 2589-0042
PB - Elsevier
DO - 10.1016/j.isci.2026.117136
UR - https://doi.org/10.1016/j.isci.2026.117136
LA - en
ER -

CSL-JSON

{
"id": "10.1016/j.isci.2026.117136",
"type": "article-journal",
"title": "Complex pectoral-fin-driven locomotion underlies refined visuomotor behavior in the cichlid &lt;i&gt;Astatotilapia burtoni&lt;/i&gt;",
"container-title": "iScience",
"author": [
{
"family": "Guilbeault",
"given": "Nicholas C."
},
{
"family": "Westbrook",
"given": "Molly E."
},
{
"family": "Krishna",
"given": "Venkatesh S."
},
{
"family": "Ansari",
"given": "Rida"
},
{
"family": "Keth",
"given": "Alexander"
},
{
"family": "Arrenberg",
"given": "Aristides B."
},
{
"family": "Juntti",
"given": "Scott A."
},
{
"family": "Thiele",
"given": "Tod R."
}
],
"container-title-short": "iScience",
"volume": "29",
"issue": "9",
"page": "117136",
"DOI": "10.1016/j.isci.2026.117136",
"PMID": "42662783",
"PMCID": "PMC13520728",
"ISSN": "2589-0042",
"publisher": "Elsevier",
"URL": "https://doi.org/10.1016/j.isci.2026.117136",
"language": "en",
"issued": {
"date-parts": [
[
2026,
8,
18
]
]
}
}

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.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, 7 references
[2] doi:10.1038/s41593-026-02232-0 [code]
Entorhinal cortex represents task-relevant remote locations independently of CA1.
Journal: Nature neuroscience
In common: DeepLabCut, Pingouin, OpenCV, 5 other tools, systems, 1 reference
[3] doi:10.1038/s41593-026-02228-w [code]
Circuit response to neuromodulation characterized with simultaneous deep brain stimulation and precision neuroimaging in humans.
Journal: Nature neuroscience
In common: Pingouin, rstatix, OpenCV, 7 other tools, systems
[4] doi:10.1038/s41467-026-69633-4 [code]
Visuomotor decision-making through multifeature convergence in the larval zebrafish hindbrain.
Journal: Nature communications
In common: scikit-learn, pandas, SciPy, 2 other tools, zebrafish, 4 references
[5] doi:10.1038/s41586-026-10629-x [code]
Whole-genome duplication shaped cell-type evolution in the vertebrate brain.
Journal: Nature
In common: Pingouin, rstatix, ggpubr, 6 other tools, other
[6] doi:10.1038/s41593-026-02262-8 [code]
Cheese3D enables sensitive detection and analysis of whole-face movement in mice.
Journal: Nature neuroscience
In common: DeepLabCut, OpenCV, scikit-learn, 4 other tools, systems, 1 reference
[7] doi:10.1038/s41467-026-72152-x [code]
Centralized brain networks controlling antennal grooming coordination.
Journal: Nature communications
In common: DeepLabCut, OpenCV, scikit-learn, 4 other tools, systems, 1 reference
[8] doi:10.1162/imag.a.1321 [code]
Phase similarity between similar objects indicates representational merging across retrieval training but not sleep.
Journal: Imaging neuroscience (Cambridge, Mass.)
In common: Pingouin, rstatix, ggpubr, 6 other tools
[9] doi:10.1016/j.nicl.2026.104012 [code]
Structural-functional multilayer brain network properties and outcome of combined repetitive transcranial magnetic stimulation and psychotherapy for obsessive-compulsive disorder.
Journal: NeuroImage. Clinical
In common: Pingouin, rstatix, ggpubr, 6 other tools
[10] doi:10.1002/imt2.70163 [code]
Spatial multi-omics unveils sphingolipid metabolic reprogramming within the retinal pathological niche.
Journal: iMeta
In common: rstatix, OpenCV, ggpubr, 6 other tools

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.