A web application for optimising experimental group allocations while maintaining box/cage integrity. Uses Integer Linear Programming (ILP) to create balanced groups based on numeric values (e.g., weights) while ensuring animals from the same box stay together.
The app is hosted on Streamlit Cloud and can be accessed at:
https://group-optimiser-wcc2dtwleonkb38i3vyxfu.streamlit.app/
- Upload CSV files with experimental data
- Optimise group allocations based on:
- Numeric values (e.g., weights) to balance between groups
- Box/cage identifiers to maintain group integrity
- Optional grouping variable (e.g., strain, age) for stratified allocation
- Interactive visualisations:
- Initial distribution plots
- Optimised group distribution plots
- Combined distribution plots when using grouping variables
- Statistical summaries by group and subgroup
- Customisable group labels
- Download optimised allocations as CSV
Your CSV file should contain:
-
Required Columns:
- A numeric column (e.g., weights, measurements) to balance between groups
- A box/cage identifier column (e.g., box numbers, cage IDs) for subjects that must stay together
-
Optional Column:
- A grouping variable (e.g., strain, age) if you need stratified allocation
Example CSV format:
ID,Box,Weight,Strain
1,Box1,250,WT
2,Box1,245,WT
3,Box2,260,WT
4,Box2,255,WT
5,Box3,240,KO
6,Box3,235,KO
If you prefer to run the app locally:
- Clone this repository:
git clone https://github.com/MZelko82/group-optimiser.git
cd group-optimizer
- Install required packages:
pip install -r requirements.txt
- Run the app:
streamlit run streamlit_app.py
- Upload your CSV file
- Select the columns for optimisation:
- Value column to optimise (must be numeric)
- Box/cage identifier column
- Optional grouping variable column
- Configure groups:
- Set number of groups (2-10)
- Customise group labels if desired
- Click "Optimise Groups" to run
- Review the results:
- Initial distribution plot
- Group summary statistics
- Optimised distribution plots
- Download the results as CSV
This application processes all data in-memory and does not store any information permanently. Data is cleared when you close the browser or refresh the page. When using the hosted version, data is transmitted securely via HTTPS.