This repository stores codes and related files to generate the TransfNet-PDO model describled in "Doerfler, Chen, et al. Integrating Artificial Intelligence-Driven Digital Pathology and Genomics to Establish Patient-Derived Organoids as New Approach Methodologies for Drug Response in Head and Neck Cancer". 2025, Oral Oncology (in press).
1. Install hover_net package following instructions on https://github.com/vqdang/hover_net
2. Download hover_net source codes from https://github.com/vqdang/hover_net
3. Install QuPath-0.5.1-arm64 or other versions that can run the groovy scripts included in this repository
- Select tumor or normal regions on PDO whole slide images(eg: svs files)
- Manually draw and classify training tiles of 256 x 256 px within those regions
- Generate training tiles using genTilesFromAnn.groovy in qupath software
- Run default hover_net model to segment and predict cells on the training tiles
- Convert json files to geojson files for qupath software using json2gson function in util_train_prep
- In qupath software,import images and geojson files of training tiles and manually refine and annotate cell nuclei as tumor or normal
- Generate final training patches for hover_net model using gen_hvPatch function in util_train_prep.py
- Split training patches into training split and validation split
- Replace /hover_net/dataloader/train_loader.py with train_loader.py in modified_modules of this repository
- Replace /hover_net/models/hovernet/post_procss.py with train_loader.py in modified_modules of this repository
- Train new model following instructions on https://github.com/vqdang/hover_net
- Download pre-trained model checkpoint from https://huggingface.co/jic115/TransferNet-PDO/tree/main
- Replace /hover_net/infer/wsi.py with wsi.py in modified_modules of this repository if many cells are not got predicted
- Download the infer directory from this repository and supplement proper information to the slurm files
- Run prediction on slurm-enabled GPU cluster using hv_pred_tile.slurm for tiles or hv_pred_wsi.slurm for whole slide images (eg:svs files)
- Convert the output jsons files to geojson files and count the cell number of each predicted cell type inside a PDO using count_cell_inside_PDO fuction in util_eval_prep.py
- Predict PDO type via majoirty voting
