lecilab-behavior-analysis
  • Getting started
  • Figures
  • API
  • Daily reports
/

Gallery#

Every plot of the package. Hover over a figure to see what it shows, and click it to see the code that draws it (the names in the code link to their documentation). The figures are drawn from the sample data of the repository (sample_data: four mice of one project, their first three months of training) by the current code each time this documentation is built.

Training history
Training historyEverything about how a mouse trained, in one figure.Click to see the code
Session summary
Session summaryOne day of a mouse: performance, choices, center port, timing.Click to see the code
Online plot (in the village)
Online plot (in the village)What happens in a session while the mouse does the task, updated after each trial.Click to see the code
Calendar of trials
Calendar of trialsTrials per day, as a calendar.Click to see the code
Trials and water per day
Trials and water per dayTrials of each session, by training stage, and water.Click to see the code
Time of day of training
Time of day of trainingWhen the mouse was in the box, as a 24-hour clock.Click to see the code
Performance through training
Performance through trainingPerformance (rolling window) through all trials.Click to see the code
Performance by trial type
Performance by trial typePerformance in trials where the correct side repeats or alternates, and by side.Click to see the code
Center port by day
Center port by dayCenter pokes per trial and center hold time, mean and 95% CI.Click to see the code
Reaction times by day
Reaction times by dayReaction time and time between trials, mean and 95% CI.Click to see the code
Settings and choices, session by session
Settings and choices, session by sessionThe proportion of left choices by correct side and difficulty in each session (a psychometric curve per session, as colours), with some settings of each session above it. One day is framed.Click to see the code
Performance through the session
Performance through the sessionRolling performance, a dashed line at each session.Click to see the code
Correct responses by side
Correct responses by sideCorrect and incorrect trials on each side.Click to see the code
Repeat or alternate
Repeat or alternatePerformance in trials where the correct side repeats the previous one, or alternates.Click to see the code
Center pokes and hold time
Center pokes and hold timeHistograms of the center pokes per trial and their duration.Click to see the code
When each trial started
When each trial startedTrial number against the time since the session started.Click to see the code
Reaction time and time between trials
Reaction time and time between trialsTrial by trial through the session, with their distributions on the sides.Click to see the code
Psychometric curve: visual
Psychometric curve: visualLeft choices against the brightness ratio of the ports (positive: left brighter), with a lapse logistic fit.Click to see the code
Psychometric curve: cloud of tones
Psychometric curve: cloud of tonesLeft choices against the evidence of the cloud of tones (6 bins), with a lapse logistic fit.Click to see the code
Choices by side and difficulty
Choices by side and difficultyLeft choices for each correct side and difficulty (when there is no stimulus value to plot against).Click to see the code
Bias evolution
Bias evolutionRepeat / alternate and left / right bias through training.Click to see the code
Bias by session or mouse
Bias by session or mouseThe bias triangle with a point per session of one day, or per mouse: as the win-stay / lose-switch plot.Click to see the code
Win-stay / lose-switch through training
Win-stay / lose-switch through trainingAfter a correct trial, does the mouse stay? After an error, does it switch? Through training, dark to yellow.Click to see the code
Win-stay / lose-switch by session, day or mouse
Win-stay / lose-switch by session, day or mouseA point per session of one day, per day of training, or per mouse: the same function, split another way.Click to see the code
Performance of every mouseinteractive
Performance of every mousePerformance through trials of every mouse of a project (interactive; long histories are grouped).Click to see the code
Trials and performance per day
Trials and performance per dayTrials and performance of each mouse, day by day.Click to see the code
Box occupancy and who follows whom
Box occupancy and who follows whomWhen the box was used, day by day and through the day, and which mouse used it after which.Click to see the code
Strategies of each mouse
Strategies of each mouseWin-stay / lose-switch and bias in the last 48 hours, a point per mouse.Click to see the code
Performance in each training stage
Performance in each training stagePerformance of the cohort through the trials of each stage: the mean, and each mouse.Click to see the code

The inputs of the examples#

Every example draws from some of these inputs. With your data:

import pandas as pd

from lecilab_behavior_analysis.io.loading import load_project_logs, load_project_trials

# the trials of several mice, prepared for analysis (and their performance through trials)
cohort = load_project_trials("COT_cannula_data", ["NUO001", "NUO002", "NUO003", "NUO009"])
# the trials of one mouse, and of one of its days
trials = cohort[cohort["subject"] == "NUO003"]
day = trials[trials["year_month_day"] == "2025-11-08"]
# the events and the sessions summaries of the project's setups (with the settings of each session)
events, summary, _ = load_project_logs("COT_cannula_data")

To draw them from the sample data of the repository, add root="sample_data" to both functions.

The tutorial goes through these step by step.

2022, Learning Circuits Lab

Made with Sphinx and Shibuya theme.