# Data challenge — Mohebi lab

Thanks for your interest in the lab.

Rather than judge you on a CV, we would rather see how you think about data.
So here is some of ours: real recordings from a real experiment, with the real
problems still in them.

This is not a test with a right answer. We know what we found when we analysed
it, but the interesting part of your submission is your reasoning, not your
numbers.

---

## What this is

Simultaneous dopamine and noradrenaline recordings from mouse cortex, taken
while the animal performed a delayed-response task. You will:

1. Load the data and work out what is actually in it.
2. Build averaged response traces.
3. Quantify them and test a hypothesis.
4. Analyse the behaviour.
5. *(Optional)* Try to predict single-trial outcomes.
6. *(Optional)* Ask a question of your own.

Steps 1 to 4 are required and take most people **4 to 6 hours**. Steps 5 and 6
are open-ended — do them if they interest you.

---

## Getting started

```bash
conda env create -f environment.yml
conda activate mohebi-challenge
jupyter lab notebooks/
```

If you prefer pip: you need `numpy`, `pandas`, `scipy`, `matplotlib`,
`scikit-learn`, `pyarrow`, and `jupyterlab`. Any recent versions are fine.

Then **open `notebooks/00_orientation.ipynb` and read it before writing code.**
It explains the task, the recording method, and the data layout. Skipping it
is the most common way to waste an afternoon here.

---

## The notebooks

| Notebook | | What it covers |
|---|---|---|
| `00_orientation` | read | The experiment, the method, the data format |
| `01_load_and_inspect` | required | Load the data; find what is odd about it |
| `02_peth` | required | Normalise, smooth, average across trials |
| `03_quantify` | required | AUC measures, aggregation, a statistical test |
| `04_behavior` | required | Percent correct, d′, does delay hurt performance |
| `05_stretch_regression` | optional | Single-trial outcome prediction |
| `06_stretch_open` | optional | A question of your own |

Each required notebook asks you to write a few short functions. After each
one, a call to `checks.py` tells you whether it behaves the way ours does, and
gives you a hint if not.

**The checks are a safety net, not a grade.** They verify arithmetic. They
cannot tell you whether your interpretation is sound, which is the part we
actually read.

---

## What to send back

1. **Your completed notebooks**, with outputs saved and the written answers
   filled in. The questions marked **Question N** are not optional decoration —
   they are most of what we read.
2. **`SUBMISSION.md`** — one page. A template is in this folder.
3. **Your figures**, saved in `figures/`.

Zip it and email it back to us.

---

## Ground rules

**Use AI assistants if you want.** We do. But you must be able to explain and
defend every line, because we will go through your code with you. Where a tool
saved you real time, say so in your write-up — that is useful information about
how you work, not something to hide.

**Ask when you are stuck.** If you have been blocked for more than an hour,
email us with what you tried. Knowing when to ask for help is part of what we
are assessing, and struggling in silence for three days is the wrong answer.

**Partial work is welcome.** A thoughtful submission that gets through
notebook 03 and knows exactly why it stopped is stronger than a rushed one
that touches everything. Tell us what you did not get to.

**Do not fake certainty.** The single most valuable thing in your write-up is
the section on what you do not trust. Every result in this dataset has a
caveat. We want to see which ones you find.

---

## A note on the data

This is unpublished data from an ongoing project. Please keep it to yourself:
don't post it, share it, or upload it anywhere public. When you are done with
the challenge, delete your copy.

You are looking at four sessions from one animal. There is a second animal we
have held back, and we will run your code on it. That is not a trap — it is
what happens in the lab every time a new mouse comes off the rig. Code that
does not hardcode assumptions about this particular animal will be fine.

---

## Questions

Email us. Asking a good question about the data is a positive signal, not a
negative one.
