Mouse Colony Breeding Planner
Last reviewed
BeginnerWhat you'll learn
~45 min- Ask an AI tool, in plan mode, for a small program that reads a colony's breeding pairs and litter records and a study request, and makes a forecast of what the pairs can be expected to produce for the study, and by when
- Read its plan for the rules that matter: only pairs still breeding, each cross's own expected genotypes, only litters born when the study's age range allows, litters not yet weaned left out of the average
- Check the forecast's dates and numbers against values worked out for the practice records
- See why an expected number of mice is an average with a wide range, and who decides what to breed from it
The story, and what you will end up with
It is Monday 16 November 2026. You help run the mouse colony at your facility, and a lab the facility breeds for has sent a study request: for a study starting on 1 March 2027 they need 12 mice homozygous for a changed gene and 12 unchanged littermates as controls, half male and half female, all aged 8 to 12 weeks on the day it starts. On Thursday the colony manager meets the lab and the facility manager to plan the breeding. Before then, the colony manager has asked you what the line’s breeding pairs can be expected to produce for the study, and by when.
You could work it out on paper from the cage cards. A small program that does it from the colony’s records gives the same answer every time, and shows its working.
By the end of this lesson you will have a forecast on your own computer: a page in your browser, made by a small program from the colony’s records and the study request, that shows which pairs’ litters can fall in the study’s age range, how many mice of each genotype those litters can be expected to wean, the range around each number, and what the forecast assumes. It runs on your computer and sends nothing anywhere. It decides nothing: how many animals to breed, and every change to that, is decided by the people responsible under the approved animal protocol, such as the investigator and the facility manager, and the forecast is something you bring them. You build it by asking your AI tool in plain English, and you check it against numbers this lesson gives you.
🔍Words used in this lessonclick to expand
- Line PL1: the made-up mouse line in this lesson. It carries one changed gene. Each mouse has two copies: m is the changed copy and + the unchanged one.
- Genotype: which two copies a mouse carries. +/+ has two unchanged copies, m/+ one of each (often called het, for heterozygous), m/m two changed copies (homozygous).
- Breeding pair: a male and a female housed together to breed. A pair is written male first, so BP-03, an m/+ male with a +/+ female, is an m/+ by +/+ pair.
- Expected share of each genotype: for one gene that is not on a sex chromosome, where every genotype survives equally, each parent passes on one of its two copies at random. So an m/+ by m/+ pair is expected to give 1 m/m to 2 m/+ to 1 +/+ (a quarter, a half and a quarter); m/+ by +/+ gives half m/+ and half +/+ and no m/m; m/m by m/+ gives half m/m and half m/+ and no +/+. These shares are averages over many pups, not what any one litter will hold.
- Littermate controls: unchanged (+/+) mice from the same litters as the m/m mice, so that both groups share parents and early life. Only an m/+ by m/+ pair has both in one litter.
- Weaning: taking pups from their mother into cages of their own. In the practice records, pups that die before weaning are counted in the number born but not the number weaned; check how your colony’s records count them.
- Planning figure: a number a colony plans with, such as how many days after pairing a first litter is expected. The ones in this lesson are made up for the practice colony. Yours come from your own colony’s records and your facility’s procedures.
Before you start
First, if your AI tool is still open, leave it: type /exit and press Enter (if you use Antigravity, press Ctrl+D with nothing typed instead), and wait until you see the $ or % prompt. The next line goes there, in the terminal, not in the AI tool. It makes a folder for this lesson beside your practice folder and goes into it:
mkdir -p ~/bio-workbench/09-colony-planner && cd ~/bio-workbench/09-colony-plannerStart your AI tool with the start line you kept from the setup lesson, the one with approval prompts off. Then ask it to set the folder up:
Set this folder up so we can undo any change you make, download https://learn.intellimetrics.net/starters/biotech/09/colony-records.zip and unpack it into a data folder, and save a checkpoint.Look for it saying three things: the folder is set up with Git (the program that saves snapshots, from setup), four files are in the data folder (breeding-pairs.csv, litters.csv, planning-figures.csv and study-request.csv), and a first snapshot, your checkpoint, is saved. Later you can ask whether the files have changed since then. If it does not mention one of them, ask: “Did you save a checkpoint with the files in it?” It may also keep the zip file in the data folder, which is fine; if it says it kept one somewhere outside this folder, ask it to delete that copy. If the download does not work, download colony-records.zip in your browser, check where it went (the browser’s list of downloads shows the folder), and tell your AI tool, for example: “colony-records.zip is in my Downloads folder. Unpack that one file into a data folder here, and save a checkpoint.” In Windows PowerShell or a desktop app, “my Downloads folder” works as is; only say “my Windows Downloads folder” if you use Ubuntu (WSL) on Windows, which keeps its own Downloads folder apart from Windows.
The box below says what is in the practice files; later steps refer to them.
ℹWhat is in colony-records.zipclick to expand
Four files, each of which opens in a spreadsheet program: the colony’s records for line PL1 as of Monday 16 November 2026.
breeding-pairs.csv: six pairs, each with its cage, the male’s and female’s IDs and genotypes, the date they were paired and a status.
| Pair | Cross (male by female) | Paired | Status |
|---|---|---|---|
| BP-01 | m/+ by m/+ | 14 September 2026 | breeding |
| BP-02 | m/+ by m/+ | 14 September 2026 | breeding |
| BP-03 | m/+ by +/+ | 28 September 2026 | breeding |
| BP-04 | m/m by m/+ | 26 October 2026 | breeding, no litter yet |
| BP-05 | m/+ by m/+ | 9 November 2026 | breeding, no litter yet |
| BP-06 | m/+ by m/+ | 15 May 2026 | retired on 2 November 2026 |
litters.csv: every PL1 litter since June, eleven in all (L-01 to L-11), with the pair, the date born, the number born, the number weaned, and how many of each genotype were weaned. Six of the litters are BP-06’s, from before it retired. L-04 weaned 2 of the 8 born. L-10 (BP-01, born 4 November) and L-11 (BP-02, born 5 November) are not weaned yet, so their weaned and genotype cells are blank.
planning-figures.csv: the practice colony’s planning figures: a first litter 24 days after pairing, 26 days between litters, weaning at 21 days old, and each pup’s genotype known by weaning.
study-request.csv: study S-27-03 on line PL1, starting 1 March 2027: 12 m/m and 12 +/+ littermate controls, half male and half female in each group, aged 56 to 84 days (8 to 12 weeks) on the start date.
Everything in these files is made up for this course: the colony, the line, its mice, the study, the planning figures and every number. Each lesson in this track has its own practice files, with their own people and dates.
Switch to plan mode
Your AI tool is already open. Switch to plan mode now: Shift+Tab until it says plan, or /plan (the keys for each tool). In plan mode it usually reads your files, asks its questions and shows you a plan before it builds anything; the order can vary.
The conversation
Each message below is an example. Say it your own way.
Say what you want
Say what you do, which files to use, and what you want to know:
I help run a mouse colony. From the records and study request in data, show what to expect from our breeding pairs for the study, by when, and how many pups in all. Ask me what you need first.Your AI tool usually reads all four files and comes back with questions. It may already work out the birth window, 7 December 2026 to 4 January 2027, and point out that BP-03 cannot give m/m pups and BP-04 cannot give +/+ pups.
Answer its questions
Answer each in a sentence. These are questions the tools often ask, with one way to answer each. Yours may ask them in a different order or show a list of choices:
| If it asks | You might say |
|---|---|
| Must the +/+ controls come from the same litters as the m/m mice? | Yes, only +/+ from the same litters as m/m count as controls. |
| Your planning figures, or the gaps your pairs have shown? Is 7 December a hard cut-off? | Use the planning figures, and count only litters born 7 December to 4 January. |
| Is your colony’s litter history the right basis? Leave out the litter that weaned 2? | Use every weaned PL1 litter, L-04 included, not those still unweaned. Use each cross’s expected genotype shares. |
| The records have no sex. Assume half and half? | Assume about as many males as females, and split each number by sex. |
| Forecast the five pairs as they are, or with changes? | The five active pairs as they are; no changes planned. |
| “How many pups in all”: born in the window, from now, or only usable ones? | All pups expected born to the five pairs from 16 November to 4 January, all genotypes. |
| Averages, or how likely you are to fill the groups? | Both: averages, and a range for each from the spread of our weaned litters and each litter’s chance. |
| Answer here, or save it as a file? | A page I can open in my browser, made by a program I can run again on new records. |
If it asks several questions at once, answer the ones about what counts, which records to use and what the study needs from the study’s request and your colony’s own records, a sentence each, and accept its suggestions only about how the page looks. If you cannot tell which kind a question is, treat it as a rule. If it asks something not listed here, answer it the same way, in a sentence.
These answers follow the practice study’s request and this practice colony’s planning figures. For a real study, what counts as a littermate control, how sex is balanced and whether the age range or start date can move come from the lab, and the planning figures from your own records.
Read the plan
Next it usually shows you a plan: what it will build and how it will check it. Some tools build straight after your answers, before you approve anything. If yours does, read what it says it built for the six things below, and ask in a sentence for any that is missing.
Read the plan for six things:
- Only pairs still breeding are forecast. BP-06 is retired, so it has no litters to come, but its litters stay in the record of how many pups a litter weans.
- Each pair’s expected genotypes come from its own cross, and +/+ controls are counted only from litters that can also hold m/m pups: BP-01, BP-02 and BP-05.
- Each pair’s next litters are dated from its last litter, or from its pairing date if it has none, with the planning figures, and only litters born from 7 December 2026 to 4 January 2027 count for the study.
- Expected pups come from the colony’s weaned litters, with L-10 and L-11, not weaned yet, left out rather than counted as none weaned.
- Every expected number has a range, and the plan says how the range is worked out, what it covers (such as the middle 90% of outcomes) and what it assumes: litters on time, pups lost before weaning lost evenly across genotypes, about as many males as females. This practice colony’s own way of working it out, which the figures on this page use: each study litter’s weaned size is taken, with equal chance, from the nine weaned litters in the colony’s records, and each pup’s genotype and sex fall by chance at the textbook shares (the cross’s expected shares from the words box, and half male). Under that way of working it out, the real number falls inside the middle 90% at least nine times in ten. Another way of working it out gives another range.
- Your records are read and left as they are, and what it makes is a program you can run again on new records.
A first plan often leaves one of these out, most often the range in item 5. Say so in a sentence, in your own words, for example:
For each expected number, give a range from the spread of our weaned litters and the chance in each litter, and say how likely we are to reach 12.When the plan has all six, approve it: if your AI tool offers a choice to go ahead, pick it; otherwise say “Yes, go ahead and build it.” In Codex, press Shift+Tab first to leave plan mode. In Copilot, saying it brings up a choice to go ahead; pick that. When it has finished, ask it: “Did you install anything, and where?” Nothing, or something inside this lesson’s folder, is fine for these lessons. It may say it used something already on your computer; that is fine too. If it names anywhere else on your computer, such as a copy of the zip file or a few scratch files of its own, ask it what they are for, and to remove them if you do not want them there.
Look at what it built
Ask it to run what it built:
Run it and show me the forecast.It may show the main figures in the terminal and say where the page is saved. To see the page itself, ask: “Open the forecast in my browser.” If it gives you a file location or an address without opening it, copy that into your browser’s address bar and press Enter. If it starts the page at a local address, one ending in a number, and says the address is already in use, say: “Something else is using that address. Don’t stop it. Use a different address for my page.” If your AI tool does not take a message after opening the page, wait a minute. If it still does not, close the terminal window, open a new one, type this lesson’s folder line again, start your tool, and say: “Start the page again so it keeps running while we talk.” The page and your saved work are files in the folder, so nothing is lost. When you have finished with the page, ask: “Stop the forecast page if it is still running.”
Your forecast will be worded and laid out in its own way. Check it for these:
- The birth window is 7 December 2026 to 4 January 2027: those are the birth dates that make a mouse 56 to 84 days old on 1 March 2027.
- Five litters fall in it, one from each pair still breeding: BP-03 and BP-04 about 15 December, BP-01 about 26 December, BP-02 about 27 December and BP-05 about 29 December. BP-03 and BP-04 also have litters due about 19 November, and BP-01, BP-02 and BP-05 about 30 November, 1 December and 3 December; all of those are too old on 1 March. BP-05’s 3 December litter would be 88 days old. BP-06 has no litters to come.
- A litter weans 5.89 pups on average: 53 weaned across the nine weaned litters. If it shows 4.82, it has counted L-10 and L-11 as weaning none. Six of those nine litters are BP-06’s, from before it retired, so the average rests mostly on a pair that is no longer breeding; why it was retired is a question for whoever retired it.
- About 7.36 m/m are expected from the five litters (2.94 from BP-04, 1.47 from each of BP-01, BP-02 and BP-05, none from BP-03), with a range of about 3 to 12 if the range is the middle 90% of outcomes worked out the practice colony’s way (item 5 of the plan), or about 4 to 11 if it is the middle 80%. If its range is worked out another way, check that the page says how. If it shows 8.83, it has counted BP-05’s 3 December litter; if 10.31, it has forecast litters for retired BP-06. The largest share comes from BP-04, which has had no litter yet and whose male is m/m; whether m/m males of this line breed is not in these files.
- Split by sex, that is about 3.68 m/m males and 3.68 females, against 6 of each.
- +/+ littermate controls come only from BP-01, BP-02 and BP-05: about 4.42 expected, range about 1 to 8 (middle 90%, worked out the same way). A forecast may count a +/+ pup only when its own litter turns out to hold an m/m too; then it shows about 3.39, range about 0 to 7. Either is a fair reading of the answer about littermates; check that the page says which it used. If it counts BP-03’s +/+ pups as controls, tell it they have no m/m littermates.
- It says how likely the request is to be met. Under the practice colony’s way of working it out, the chance of 12 or more m/m is about 5%, about 1 in 20, and the chance of 12 littermate controls is under 1 in 1,000. The request needs 6 m/m of each sex, so under the same way of working it out the chance of meeting even the m/m part is lower than 5%: about 1.8%.
- The last study litter, BP-05’s, is weaned and genotyped about 19 January 2027, 21 days after it is born.
- About 73 pups of all genotypes are expected to be born to the five pairs from 16 November to 4 January, in ten litters, half of them outside the birth window. It may say 72.7 (the average born across all eleven litters, 7.27) or 71.1 (across the nine weaned litters only, 7.11); the page should say which.
- When you ask “Have my record files changed since the checkpoint?”, it compares them with the checkpoint and says no.
If something on the list is not true, tell your AI tool in a sentence what you see and what you expected, for example: “BP-03’s +/+ pups are counted as controls. They have no m/m littermates, so leave them out of the controls.”
If your page names a source for a figure or a rule, open the source and check it says that. A page can cite a source that does not.
Notice what the average leaves out
The forecast says each of BP-01’s, BP-02’s and BP-05’s study litters is expected to give 1.47 m/m. Ask about one litter of that kind:
One litter from an m/+ by m/+ pair that weans 6 pups is expected to have 1.5 m/m. What is the chance it has none?Before you read on: one and a half m/m are expected. How often do you think a litter like that has none at all?
About 17.8%, nearly one such litter in five. Each pup has a three in four chance of not being m/m, and all six miss together 0.75 × 0.75 × 0.75 × 0.75 × 0.75 × 0.75 of the time, 729 times in 4,096. A litter like that most often has one or two m/m, and has none more often than it has three. The 7.36 in your forecast is an average of many such chances, and the five real litters will give one number, which could be well below it. That is why the forecast gives a range, and why the range is wide.
An expected number of mice is an average over many litters, and one litter can fall far short of it; plan with the range, and leave how many animals to breed, and every change to it, to the people responsible under the approved protocol.
The forecast shows the study is unlikely to be met by these pairs. Whether to set up more pairs, move the start date, change the age range or the controls, or something else, is for the investigator, the facility manager and whoever else your protocol names, at Thursday’s meeting. Your AI tool can draft what you bring:
Write a short summary of this forecast for Thursday's planning meeting with the lab and the facility manager.Look for a summary that gives the expected numbers with their ranges, says how likely the request is to be met, names what it assumes, and recommends no number of pairs. If it says the pairs “will not” meet the request, ask it to say how likely instead: a forecast cannot say what will happen. If it dates the summary, the meeting is Thursday 19 November 2026. Read it, change it as you see fit, and agree it with your colony manager before it goes to anyone.
One real run
Here is part of what one AI tool said after the experiment above, with Claude Code on 11 November 2026. Yours will word it differently; check your forecast against the list above, not against this.
| m/m pups | 0 | 1 | 2 | 3 | 4+ ||---|---|---|---|---|---|| Chance | 17.8% | 35.6% | 29.7% | 13.2% | 3.8% |
So the "expected 1.5" is just an average over many litters. A singlelitter most often has 1 or 2 m/m, and has none fairly often.The line, the pairs and the litters it talks about are made up for this course.
How real colonies differ
The practice records are small and tidy, and their planning figures are made up.
- How long a pair takes to give a first litter, how far apart its litters come, how many pups it has and how many it weans vary from one facility to another. The Jackson Laboratory’s colony-planning page puts it this way: “Breeding performance is environment dependent;” and “detailed baseline breeding statistics should be generated under your facility conditions.” (Colony planning, read 11 November 2026.) So plan with your own colony’s records for this line wherever you have them, and never with this lesson’s figures.
- The expected shares hold only under the conditions in the words box at the top. For a gene on the X chromosome, a change carried on another part of the genome, or a genotype that dies more often before weaning, they do not. Whoever knows the line says which applies.
- The forecast assumes every pair delivers on time and every litter weans an ordinary number. Check your colony’s records for how often your pairs have never delivered or stopped for a time. A pair with no litter yet, like BP-04 and BP-05, has not shown it can breed.
- Check what your own colony’s records carry beyond these, such as breeders’ birth dates and ages, generation, litters found dead, the sex of each weaned pup, genotyping results that failed and were run again, and genotypes spelled several ways (“m/+”, “het”, “m/wt”). Ask your AI tool to show any value it does not recognise rather than drop it.
- Before a meeting like Thursday’s, ask your colony manager which of these questions, none of them answered in these files, they want answered: whether the lab can take mice in batches or move the start date, whether m/m mice can breed, how old the breeding females are and why a pair was retired, how many animals the protocol still allows for this line and when it ends, and whether a holiday closure falls in the birth window.
- Most pups bred for this study would not be used by it: of the about 29 pups the five study litters are expected to wean, about 15 are m/+, and the earlier litters’ pups are too old. The forecast’s total stops on 4 January; check with your colony manager what happens to pairs left together after the study’s window closes. How your protocol counts animals (pups born, weaned, breeders), how many it still allows and when it ends are for the people responsible for it to say, not for the forecast.
- Genotyping takes a sample and time, and some results fail and are run again. When the sample is taken and how long a result takes are set by your facility’s procedures, not by this lesson’s planning figure. If results come later than the planning figure says, the mice reach the study later than the forecast shows.
Keep going
Small changes do not need plan mode. Say each in a sentence, then look at the page again:
- “If a new m/+ by m/+ pair were set up, by what date would it need to be paired for its first litter to fall in the birth window?” By this practice colony’s planning figure of 24 days, 11 December 2026. That is a date for the people who decide, not a reason to set a pair up.
- “Beside each cross’s expected shares, show the share of m/m among genotyped pups from m/+ by m/+ litters in our records.” On the practice records it is 10 of 47, 21.3%, against a quarter expected. With so few pups that is well within chance (if the true share were a quarter, 10 or fewer of 47 would happen about 35% of the time), so it shows neither that m/m pups die before weaning nor that they do not.
- “Save a checkpoint.” Your AI tool saves a snapshot you can return to.
When you want a forecast from your own colony’s records, use the finished program. It runs on your real files by itself, with your AI tool closed, so your AI tool never sees them. Nothing confidential or unpublished, and nothing about people or about animals under a protocol, goes to your AI tool or into this course folder. Your colony database’s export will not be shaped like the practice files: its columns will have other names, it will spell genotypes its own way, and it may carry protocol numbers and staff names. Do these steps in order; the first five happen now, while your AI tool is open and this folder still holds only the practice files:
-
Go through the data check, the questions in setup about what the data is, who decides how it is used, and which AI tool would see it. Colony records concern animals under an approved protocol, and the line and the study may be unpublished. Go on only if your facility allows this use.
-
Decide on a folder of its own for your real files, outside this course folder, for example
~/colony-records. Nothing has to be in it yet. If the folder is not there, ask your AI tool to make it: “Make an empty folder called colony-records in my home folder.” -
Ask your AI tool for blank files to fill in, for example: “In ~/colony-records, make me blank copies of the four record files that my spreadsheet program can open, with one made-up row in each, and show the forecast working on them.” Look for it running the forecast on the made-up rows. If your export’s columns have other names, tell your AI tool those names, never real rows, with two rows you make up in the same shape, and ask it to read files like that.
-
Give the program your own colony’s planning figures and rules in place of the practice colony’s: the planning figures your colony plans with, what counts as a littermate control and how sex is counted. Say each in a sentence, then ask: “Show the forecast working on a made-up example under my rules.” Check that the example follows each rule you gave.
-
Ask your AI tool for the exact line, for example: “Write me the exact line to make the forecast myself from files in ~/colony-records, with full paths.” Use your own folder’s name. If it offers to copy your real files into this folder instead, say no. Copy the line it gives you into a note. It will look something like this one, though yours may differ:
Terminal window python3 /home/dana/bio-workbench/09-colony-planner/scripts/forecast.py /home/dana/colony-records /home/dana/colony-forecast.htmlRead it left to right.
python3runs a Python program. Next comes the program that makes the forecast, in this lesson’s folder; then the folder it reads the four record files from; last, the page it writes./home/danais the home folder of someone whose user name is dana; your own user name goes wheredanais, and on a Mac the folders begin/Users/instead of/home/. The line runs the program where it is, so leave this lesson’s folder in place. Ask too how the files must be named and how dates must be written, because a spreadsheet program may rewrite2026-11-16as16/11/2026when it saves, and may read a cell that starts with+, such as+/+, as a formula. If you are unsure about any part, ask your AI tool now, while it is still open. -
Leave your AI tool the way you did at the start of this lesson.
-
Export your pairs and litters from your colony records, fill in your own planning figures from your records and the study’s request, and save the four files into your folder, named as your note says. Paste the line from your note at the
$or%prompt and press Enter, then open the page it writes in your browser. To come back to the lesson folder later, type this lesson’s folder line again, the line near the top of this page that begins withmkdir.
Try another case
Before the quiz, write two or three sentences for yourself. On 26 December BP-01’s litter is born, and there are four pups, not seven. The investigator emails to ask whether the study is still on. What would you check first, and what would you tell them?
A good answer records the litter, runs the forecast again and checks it: the updated forecast should include the litter that has been born, with its known count of four kept apart from its genotypes, which are still unknown until the pups are genotyped. If it does not, ask your AI tool for that in a sentence. It gives the investigator the new expected numbers with their range, not a promise. And it leaves whether to change the breeding, the dates or the groups to the people responsible under the protocol, with the new forecast in front of them.
Key takeaways
- A short ask is enough. What you do, which records, what you want to know; your AI tool’s questions bring out the study’s rules.
- What counts comes from the study and your records: littermate controls, the age window, which litters are weaned. Not from your AI tool’s suggestions.
- Check a new forecast against numbers you know before you trust it on records you do not.
- An expected number is an average. One litter can give none of a genotype, so plan with the range, and leave how many animals to breed to the people responsible under the approved protocol.
- Practice data stays practice data: real colony records go to the finished program, with your AI tool closed, after the data check.
A forecast says an m/+ by m/+ litter that weans 8 pups is expected to have 2 m/m. What does that 2 mean?
A study needs m/m mice and +/+ littermate controls. Which of these pairs' litters can give +/+ littermate controls?
Your forecast shows the pairs are unlikely to give the study what it asks for by its start date. What do you do?
What’s next
The next lesson is about a mouse cryopreservation service’s records: what each line has in the freezer, and what its test thaws show.