This repository contains the code used in the batch BO component of the AI-cyborg cardiac organoid maturation project conducted by Prof Na Li and Prof. Jia Liu's labs at Harvard University.
This project is licensed under the Apache License 2.0 - see the LICENSE
file for details.
The code requires installation of Anaconda and Git. All required packages are listed in the environment.yaml file. The software has been tested on the following OSes: Mac Sequoia 15.1.1, Windows 11 Home and Linux 22.04. There are no nonstandard hardware required.
Follow these steps to set up and run the project on your local machine. The typical time required for installation is about 5 to 10 minutes if Git and Conda have been installed, and 10 to 15 minutes if Conda and Git have not been installed.
Make sure you have the following tools installed (skip if you have installed these):
-
Conda
- Download and install Anaonda from:
-
Git
- Download and install Git from git-scm.com.
If on Mac/Linux, perform the following steps in the terminal. If on Windows, open up the Anaconda Powershell Prompt (can find this by searching in the Windows search bar), and then perform the following steps in the Anaconda Powershell prompt.
Clone this repository to your local machine using Git:
git clone https://github.com/CoNG-harvard/bio_batch_BO.git
cd bio_batch_BO
conda env create -f environment.yml
conda activate bio_batch_BO
For a demonstration of how to run the code, run the command
jupyter notebook
and then open up the notebook demo.ipynb.
The demo notebook loads in simulated data, which comprises 3 arrays: xp, yp, and pseudotime_current_devices. xp comprises the pseudotime and action in the existing dataset, yp comprises the change in pseudotime measured at the corresponding pseudotimes and actions, while pseudotime_current_devices contains the pseudotime of the existing current batch of devices for which we wish to sample actions. The expected output is a new set of actions to sample. The expected runtime on the demo is about 1 minute.
To run the software on your own data, first preprocess the data and create a new python .npz file with the xp, yp and pseudotime_current_devices for your problem. Then, run the demo notebook to generate a new batch of actions.
Acknowledgement: this code is adapted and modified from Gaussian Max-Value Entropy Search for Multi-Agent Bayesian Optimization by Haitong Ma, which in turn is modified from Distributed Bayesian Optimization for Multi-Agent Systems created by Filip Klaesson.