OSCR

A homecage operant paradigm reveals behavioral dynamics of social motivation in mice.

Code ↔ Paper

10 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 10 matches · 1 of them tie a paragraph to a whole file without given lines: a weak match, whose lines are not tinted
  1. [1] § Results › Identification of social seeking vs. exploration trials ↔ Code/ChenFigureS2.ipynb, lines 35 to 163 · score 0.66 · post hoc, Bonferroni correction, empty cage, S2A, pairwise, ANOVA · Report a mismatch
  2. [2] § Results › The homecage social operant test ↔ Code/ChenFigure1.ipynb, lines 49 to 182 · score 0.66 · active pokes, empty cage, door opened, Cohen, social stimulus, sex · Report a mismatch
  3. [3] § Results › Identification of social seeking vs. exploration trials ↔ Code/ChenFigure1.ipynb, lines 49 to 182 · score 0.65 · pairwise post hoc, Bonferroni correction, empty cage, social stimulus, bars, day · Report a mismatch
  4. [4] § Results › Identification of social seeking vs. exploration trials ↔ Code/ChenFigureS2.ipynb, lines 35 to 163 · score 0.64 · post hoc, Bonferroni correction, empty cage, social stimulus, pairwise, bars · Report a mismatch
  5. [5] § STAR★Methods › Method details › Homecage social operant assay ↔ SocialDoorInstructions/Arduino_code/Code_variants/SocialDoor_Touch_080525/a_Header.h, the whole file · a weak match · score 0.62 · SD cards, touching, door opening, track, social door, active · Report a mismatch
  6. [6] § STAR★Methods › Method details › Quantification of daily rhythms of feeding ↔ SocialDoorInstructions/Arduino_code/For FED3 user/src/FED3.cpp, lines 1163 to 1245 · score 0.60 · pellet retrieval, SD card, logged, dispensed, FED3, social · Report a mismatch
  7. [7] § STAR★Methods › Method details › Homecage social operant assay ↔ SocialDoorInstructions/Arduino_code/For FED3 user/src/FED3.cpp, lines 140 to 266 · score 0.59 · pellet dispenser, pulse, retrieved, ports, ms, triggered · Report a mismatch
  8. [8] § Results › Identification of social seeking vs. exploration trials ↔ SocialDoorInstructions/doordata_process.ipynb, lines 1374 to 1459 · score 0.52 · proximity traces, Nonreciprocal interactions, door opening, window, Classification, Seeking · Report a mismatch
  9. [9] § Results › Identification of social seeking vs. exploration trials ↔ SocialDoorInstructions/doordata_process.ipynb, lines 1327 to 1412 · score 0.52 · proximity traces, Nonreciprocal interactions, door opening, window, Classification, Seeking · Report a mismatch
  10. [10] § Results › The homecage social operant test ↔ Code/ChenFigureS5.ipynb, lines 33 to 174 · score 0.50 · empty cage, Cohen, social stimulus, ANOVA, extinction, sex · 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

Jupyter notebook · 166 lines · 6 KB · CC-BY-4.0 · 2 matches

  1. # %% [markdown]
  2. # <a href="https://colab.research.google.com/github/yiruchen4/Chen2025/blob/main/Code/ChenFigureS4.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
  3. # %%
  4. # @title Importe libraries and functions
  5. !pip install pingouin > /dev/null 2>&1
  6. import numpy as np
  7. import pandas as pd
  8. import seaborn as sns
  9. from scipy.interpolate import interp1d
  10. import matplotlib.pyplot as plt
  11. from matplotlib.ticker import MaxNLocator
  12. import pingouin as pg
  13. import os
  14. import warnings
  15. from scipy.stats import ttest_rel
  16. warnings.filterwarnings("ignore")
  17. def add_sig_line(ax, x1, x2, y, p_val, h=1):
  18. if p_val < 0.0001:
  19. stars = '****'
  20. elif p_val < 0.001:
  21. stars = '***'
  22. elif p_val < 0.01:
  23. stars = '**'
  24. elif p_val < 0.05:
  25. stars = '*'
  26. else:
  27. return
  28. ax.plot([x1, x2], [y + h, y + h], lw=1.2, c='darkgray')
  29. ax.text((x1 + x2) / 2, y + h + 1.5, stars, ha='center', va='center', fontsize=11, fontweight='bold')
  30. # %%
  31. # @title Figure S2A-B
  32. # Load and preprocess data
  33. df_a = pd.read_csv(r"https://raw.githubusercontent.com/yiruchen4/Chen2026/main/Data/data_FigureS2a.csv")
  34. df_b = pd.read_csv(r"https://raw.githubusercontent.com/yiruchen4/Chen2026/main/Data/data_FigureS2b.csv")
  35. # Color palettes and orders
  36. custom_palette = {"Seeking": "slateblue", "Exploring": "hotpink"}
  37. interaction_order = ["Seeking", "Exploring"]
  38. mode_order = ["empty", "social"]
  39. # Create combined figure with 2:1 ratio
  40. fig = plt.figure(figsize=(10, 3.5), dpi=600)
  41. gs = fig.add_gridspec(1, 2, width_ratios=[3, 1.5])
  42. # === LEFT PLOT: Time-course ===
  43. ax1 = fig.add_subplot(gs[0, 0])
  44. xtick_positions = range(-60, 61, 24)
  45. xtick_labels = [1, 2, 3, 4, 5, 6]
  46. ax1.axvspan(-72, 0, color='orange', alpha=0.15)
  47. ax1.axvspan(0, 72, color='deepskyblue', alpha=0.15)
  48. sns.lineplot(data=df_a, x="hoursfloor", y="event", hue="behavior",
  49. errorbar='se', palette=custom_palette,
  50. hue_order=interaction_order, ax=ax1)
  51. for start in range(-66, 73, 24):
  52. ax1.axvspan(start, start + 12, color="grey", alpha=0.3)
  53. ax1.set_xticks(xtick_positions)
  54. ax1.set_xticklabels(xtick_labels, fontsize=13)
  55. ax1.set_yticks(ax1.get_yticks())
  56. ax1.tick_params(axis="y", which="both", left=True, right=False, labelsize=13)
  57. ax1.yaxis.set_major_locator(MaxNLocator(nbins=4, integer=True))
  58. ax1.set_xlabel("Day", fontsize=13)
  59. ax1.set_ylabel("Number of events", fontsize=13)
  60. ax1.text(0.275, 1.025, "Empty cage", fontsize=13, color='orange', transform=ax1.transAxes, ha='center')
  61. ax1.text(0.735, 1.025, "Social stimulus", fontsize=13, color='deepskyblue', transform=ax1.transAxes, ha='center')
  62. legend1 = ax1.legend(title=f'N = {len(df_a["device_number"].unique())}', title_fontsize=13, loc="upper left", frameon=False, fontsize=13)
  63. legend1.get_title().set_alpha(0.5)
  64. sns.despine(ax=ax1)
  65. # === RIGHT PLOT: Bar and Strip ===
  66. ax2 = fig.add_subplot(gs[0, 1])
  67. sns.barplot(data=df_b, x="behavior", y="event", hue="mode",
  68. errorbar="se", capsize=0.15,
  69. order=interaction_order, hue_order=mode_order,
  70. palette={"empty": "#FFE5B4", "social": "#BFEFFF"},
  71. ax=ax2)
  72. sns.stripplot(data=df_b, x="behavior", y="event", hue="mode",
  73. dodge=True, jitter=False, palette=['black']*4,
  74. alpha=0.25, size=8, zorder=2,
  75. order=interaction_order, hue_order=mode_order,
  76. legend=False, ax=ax2)
  77. # Connect dots
  78. x_positions = {"Seeking": 0, "Exploring": 1}
  79. for interaction in df_b["behavior"].unique():
  80. subset = df_b[df_b["behavior"] == interaction]
  81. empty = subset[subset["mode"] == "empty"].reset_index(drop=True)
  82. social = subset[subset["mode"] == "social"].reset_index(drop=True)
  83. for i in range(len(empty)):
  84. ax2.plot(
  85. [x_positions[interaction] - 0.2, x_positions[interaction] + 0.2],
  86. [empty.loc[i, "event"], social.loc[i, "event"]],
  87. color="gray", alpha=0.5, linewidth=1.2, zorder=4
  88. )
  89. for interaction in df_b["behavior"].unique():
  90. subset = df_b[df_b["behavior"] == interaction]
  91. empty_data = subset[subset["mode"] == "empty"]["event"].reset_index(drop=True)
  92. social_data = subset[subset["mode"] == "social"]["event"].reset_index(drop=True)
  93. _, p_value = ttest_rel(empty_data, social_data)
  94. y_max = subset["event"].max()
  95. x_center = x_positions[interaction]
  96. print(f'{interaction} paired t-test p-value:')
  97. print(f'{p_value:.8f}')
  98. add_sig_line(ax2, x_center - 0.2, x_center + 0.2, y_max, p_value, h=4)
  99. # We'll keep only relevant columns
  100. df_anova = df_b[["device_number", "mode", "behavior", "event"]].copy()
  101. # Run repeated measures ANOVA with two within-subject factors: mode and behavior
  102. aov = pg.rm_anova(dv="event", within=["mode", "behavior"], subject="device_number", data=df_anova, detailed=True)
  103. print('ANOVA result:')
  104. print(aov)
  105. # Make sure you're using the right data
  106. df_posthoc = df_b[["device_number", "mode", "behavior", "event"]].copy()
  107. # Create a new column combining mode and behavior
  108. df_posthoc["condition"] = df_posthoc["mode"] + "_" + df_posthoc["behavior"]
  109. # Run post-hoc pairwise comparisons with correction
  110. pairwise = pg.pairwise_tests(
  111. data=df_posthoc,
  112. dv="event",
  113. within="condition",
  114. subject="device_number",
  115. padjust="bonf", # Bonferroni correction
  116. # effsize="cohen"
  117. )
  118. # Display results
  119. print("Post-hoc pairwise comparison with correction:")
  120. with pd.option_context('display.float_format', '{:.9f}'.format):
  121. print(pairwise[["A", "B", "T", "p-corr"]])
  122. # Final formatting
  123. ax2.set_ylabel("Average events per day", fontsize=14)
  124. ax2.set_xlabel("")
  125. ax2.set_xticklabels([label.capitalize() for label in interaction_order], fontsize=14)
  126. ax2.set_yticks(ax2.get_yticks())
  127. ax2.tick_params(axis="y", which="both", left=True, right=False, labelsize=13)
  128. ax2.yaxis.set_major_locator(MaxNLocator(5))
  129. sns.despine(ax=ax2)
  130. handles, labels = ax2.get_legend_handles_labels()
  131. ax2.legend('',frameon=False)
  132. ax2.legend(title_fontsize=13, handles=handles[:2], labels=["Empty", "Social"],
  133. fontsize=13, frameon=False, loc="upper right")
  134. plt.tight_layout()
  135. plt.show()
  136. # %%

ChenFigureS2.ipynb, under CC-BY-4.0 · at the source

Overview

Authors: Yiru Chen1, Susan E. Maloney1,2, Alexxai V. Kravitz1
  1. Department of Psychiatry, School of Medicine, Washington University in St. Louis, St. Louis, MO 63110, USA
  2. Intellectual and Developmental Disabilities Research Center, Washington University in St. Louis, St. Louis, MO 63108, USA
Institutions: Washington University in St. Louis (United States)
Journal: Cell reports methods, volume 6, issue 4, article 101374
Dates: received 29 August 2025; accepted 2 March 2026; published online 30 March 2026; in print April 2026
Type: Brief report · Language: English
License: CC BY-NC
Identifiers: DOI 10.1016/j.crmeth.2026.101374 · PMID 41916298 · PMCID PMC13107048 · OpenAlex W7143439151
Open access: gold, a free copy (OpenAlex)
Status: code verified (how the code is found and verified)
Categories: mouse (organism), methods / tools (subfield)
Methods: Statistics
Keywords: social, operant, mice, dopamine, behavior, social behavior, motivation, feeding
MeSH: Behavior, Animal*, Conditioning, Operant*, Motivation*, Social Behavior*, Animals, Circadian Rhythm, Dopamine, Male, Mice, Mice, Inbred C57BL (* major topic)
Topic: Neurotransmitter Receptor Influence on Behavior (Cellular and Molecular Neuroscience, Neuroscience), according to OpenAlex
Funding: national institutes of health (1RM1MH138313-01, R01DK136810, P50HD103525); Intellectual and Developmental Disabilities Research Center; Taylor Family Institute for Innovative Psychiatric Research; Washington University School of Medicine
Citations: cited by 1 paper (Europe PMC); 30 references in the paper
Research resources: Mouse, C57BL/6J, Wild-type RRID:IMSR_JAX:000664, Python 3.13 RRID:SCR_008394, Affinity Designer 2 RRID:SCR_016952, Arduino IDE RRID:SCR_024884, Visual Studio Code RRID:SCR_026031

Abstract

We present an open-source, homecage-based social operant paradigm that enables continuous, multi-day measurement of social motivation in mice without experimenter intervention. In this task, a nose-poke response triggers an automated door that provides controlled access to a social partner in an adjacent cage. Using this system, we demonstrate that operant responding is specifically driven by access to a social partner and reveals robust daily rhythms of social motivation across the circadian cycle. We further show that social seeking in this task is sensitive to pharmacological manipulation of dopamine signaling. By combining operant rigor with continuous homecage monitoring, this method increases ecological validity, temporal resolution, and scalability, providing a flexible platform for studying social motivation and its neural regulation in both basic and disease-relevant contexts.

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

Repositories

Its files are read in the Code ↔ Paper reader above, with 10 matches between paragraphs and lines of code.

Zenodo 18748340

License: CC-BY-4.0
State: the link answers, verified on 30 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 (10 files), pandas (10 files), Matplotlib (9 files), seaborn (9 files), SciPy (8 files), Pingouin (5 files), statsmodels (3 files), scikit-learn (1 file)
Availability: 1 check, the latest on 30 September 2026: the link answers (HTTP 200)
  • 30 September 2026: the link answers (HTTP 200)
17 files

Zenodo 18748341

License: CC-BY-4.0
State: the link answers, verified on 30 September 2026
Evidence: files inventoried
Size: 1 file
Software Heritage: not checked
Found in: the text, “Quantification and statistical analysis”
Not found: README, license file, CITATION.cff, environment file, tests, continuous integration, documentation
Tools: NumPy (10 files), pandas (10 files), Matplotlib (9 files), seaborn (9 files), SciPy (8 files), Pingouin (5 files), statsmodels (3 files), scikit-learn (1 file)
Availability: 1 check, the latest on 30 September 2026: the link answers (HTTP 200)
  • 30 September 2026: the link answers (HTTP 200)
16 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;
  • 31 scripts, each with its path and the digest of its content;
  • 10 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

Data and code availability

• Processed data have been deposited at Zenodo: https://doi.org/10.5281/zenodo.18748340 and are publicly available as of the date of publication. • All original code has been deposited at Zenodo: https://doi.org/10.5281/zenodo.18748340 and is publicly available 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-NC), from the paper cited above.

Materials availability

This study did not generate new unique reagents.

The design of the social door, a list of required materials, a detailed construction protocol, and annotated scripts for data processing and analysis have been deposited at Zenodo: https://doi.org/10.5281/zenodo.18748340.

Reproduced under the paper's license (CC BY-NC), 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, 30 September 2026: the first record

Recorded: type, language, journal, volume, issue, pages, dates, 3 authors, 8 keywords, 10 MeSH terms, 4 funders, 29 references, 5 RRIDs.

Cite

This paper

Chen, Y., Maloney, S. E., & Kravitz, A. V. (2026). A homecage operant paradigm reveals behavioral dynamics of social motivation in mice. Cell reports methods, 6(4), 101374. https://doi.org/10.1016/j.crmeth.2026.101374

BibTeX

@article{chen2026homecage,
author = {Chen, Yiru and Maloney, Susan E. and Kravitz, Alexxai V.},
title = {{A homecage operant paradigm reveals behavioral dynamics of social motivation in mice}},
journal = {Cell reports methods},
year = {2026},
month = mar,
volume = {6},
number = {4},
pages = {101374},
publisher = {Elsevier},
issn = {2667-2375},
doi = {10.1016/j.crmeth.2026.101374},
url = {https://doi.org/10.1016/j.crmeth.2026.101374},
pmid = {41916298},
pmcid = {PMC13107048}
}

RIS

TY - JOUR
AU - Chen, Yiru
AU - Maloney, Susan E.
AU - Kravitz, Alexxai V.
TI - A homecage operant paradigm reveals behavioral dynamics of social motivation in mice
T2 - Cell reports methods
J2 - Cell Rep Methods
PY - 2026
DA - 2026/03/30
VL - 6
IS - 4
SP - 101374
SN - 2667-2375
PB - Elsevier
DO - 10.1016/j.crmeth.2026.101374
UR - https://doi.org/10.1016/j.crmeth.2026.101374
LA - en
ER -

CSL-JSON

{
"id": "10.1016/j.crmeth.2026.101374",
"type": "article-journal",
"title": "A homecage operant paradigm reveals behavioral dynamics of social motivation in mice",
"container-title": "Cell reports methods",
"author": [
{
"family": "Chen",
"given": "Yiru"
},
{
"family": "Maloney",
"given": "Susan E."
},
{
"family": "Kravitz",
"given": "Alexxai V."
}
],
"container-title-short": "Cell Rep Methods",
"volume": "6",
"issue": "4",
"page": "101374",
"DOI": "10.1016/j.crmeth.2026.101374",
"PMID": "41916298",
"PMCID": "PMC13107048",
"ISSN": "2667-2375",
"publisher": "Elsevier",
"URL": "https://doi.org/10.1016/j.crmeth.2026.101374",
"language": "en",
"issued": {
"date-parts": [
[
2026,
3,
30
]
]
}
}

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-024-52294-6 [code]
Sex differences in neural representations of social and nonsocial reward in the medial prefrontal cortex.
Journal: Nature communications
In common: mouse, 6 references
[2] doi:10.1016/j.crmeth.2026.101421 [code]
EthoPy provides an accessible platform for reproducible behavioral neuroscience.
Journal: Cell reports methods
In common: seaborn, scikit-learn, pandas, 3 other tools, methods / tools, mouse, 2 references
[3] doi:10.1002/advs.202518450 [code]
A Brain-Wide Atlas of Astrocytic Oxytocin Receptors Reveals a Glial Basis for Nucleus Accumbens Modulation of Affiliative Behavior.
Journal: Advanced science (Weinheim, Baden-Wurttemberg, Germany)
In common: Pingouin, statsmodels, seaborn, 4 other tools, mouse, 1 reference
[4] doi:10.1016/j.crmeth.2023.100504
A comprehensive assay of social motivation reveals sex-specific roles of autism-associated genes and oxytocin.
Journal: Cell reports methods
In common: mouse, 5 references
[5] doi:10.7554/elife.91765 [code]
Post-ejaculatory inhibition of female sexual drive via heterogeneous neuronal ensembles in the medial preoptic area.
Journal: eLife
In common: statsmodels, seaborn, scikit-learn, 4 other tools, mouse, 1 reference
[6] doi:10.7554/elife.77411 [code]
The role of anterior insular cortex inputs to dorsolateral striatum in binge alcohol drinking.
Journal: eLife
In common: statsmodels, seaborn, scikit-learn, 4 other tools, mouse, 1 reference
[7] doi:10.1016/j.ynstr.2022.100501 [code]
Prebiotic supplementation modulates selective effects of stress on behavior and brain metabolome in aged mice.
Journal: Neurobiology of stress
In common: statsmodels, seaborn, scikit-learn, 4 other tools, mouse, 1 reference
[8] doi:10.1016/j.isci.2026.114694 [code]
Dissociating neural circuits of social and prosocial reward in rat helping behavior.
Journal: iScience
In common: statsmodels, seaborn, scikit-learn, 4 other tools, 1 reference
[9] doi:10.1038/s41467-024-52769-6 [code]
Diminished circadian and ultradian rhythms of human brain activity in pathological tissue in vivo.
Journal: Nature communications
In common: statsmodels, seaborn, scikit-learn, 4 other tools, 1 reference
[10] doi:10.1371/journal.pbio.3002343
Optogenetic and chemogenetic approaches reveal differences in neuronal circuits that mediate initiation and maintenance of social interaction.
Journal: PLoS biology
In common: 5 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.

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.1016/j.crmeth.2026.101374.svg)](https://openscicode.org/badge/doi/10.1016/j.crmeth.2026.101374)
<!-- oscr-badge:end -->
reStructuredText
.. oscr-badge:start

.. image:: https://openscicode.org/badge/doi/10.1016/j.crmeth.2026.101374.svg
   :target: https://openscicode.org/badge/doi/10.1016/j.crmeth.2026.101374
   :alt: OSCR

.. oscr-badge:end
HTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.1016/j.crmeth.2026.101374"><img src="https://openscicode.org/badge/doi/10.1016/j.crmeth.2026.101374.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.