patchpy is our codebase to train and run models that perform predictive classification tasks on patches from image-based screening data in python.
Currently assumes that these data have been processed with CellProfiler, to map objects to images.
Depends on imscreenpy (https://github.com/HabelNadik/imscreenpy), which provides functionality to process cellprofiler outputs.
You can install patchpy from the git repo, or download it and install from a local folder:
# install from git
python -m pip install git+https://github.com/HabelNadik/patchpy
# install from your local copy
cd /path/to/local/patchpy
python -m pip install .
You will also need to install imscreenpy (https://github.com/HabelNadik/imscreenpy), which you can install from github or a local folder as well:
# install from git
python -m pip install git+https://github.com/HabelNadik/imscreenpy
# install from your local copy
cd /path/to/local/imscreenpy
python -m pip install .
We used patchpy to do training and inference with adversarial autoencoders on patches from image-based screening data. Some example scripts can be found in the examples folder. Notably, patchpy requires two things in most cases, an ismcreenpy-style sample annotation excel file - this file lists key information about the raw data and also provides paths - and a file that we usually call models.json that stores the paths to model weights and and information about the model architecture.
We have two submitted manuscripts that make extensive use of patchpy and demonstrate its functionality reasonably well in our opinions and the code will be available soon, so stay tuned!
patchpy Contains all logic that is used by other scripts and contains submodules to process data, load models and train models
patchpy/training
Contains functions to train models, training functions accept training specific parameters: models, number of images, etc. and data specific paramaeters such as plates.
Training scripts are not directly concerned with the processing of dataframes or images.
patchpy/processing
Contains functions to generate training and prediction data and is therefore concerned with images and dataframes.
All access to processing should be done via a single point of contact: prepare_data.py
patchpy/models
Defines models. All points of contact with other modules should be implemented within this folder.
Concrete implementations of models of should be in submodules of models, such as autoencoders.
This is the first public version of patchpy.