Package: panoptes-he
Panoptes for cancer H&E image prediction and visualization (PyPI version)panoptes is a InceptionResnet-based multi-resolution CNN architecture for cancer H&E histopathological image features
prediction. It is initially created to predict visualize features of endometrial carcinoma (UCEC), hoping to automate
and assist gynecologic pathologists making quicker and accurate decisions and diagnosis without sequencing analyses.
Details can be found in the paper:https://doi.org/10.1016/j.xcrm.2021.100400It can also be applied to other cancer types.Features includedCurrently, it includes training/validating/testing of following features of endometrial cancer:18 mutations (ARID1A, ATM, BRCA2, CTCF, CTNNB1, FAT1, FBXW7, FGFR2, JAK1, KRAS, MTOR,
PIK3CA, PIK3R1, PPP2R1A, PTEN, RPL22, TP53, ZFHX3)4 molecular subtypes (CNV.H, CNV.L, MSI, POLE). if you want to predict only 1 subtype (eg. CNV.H),
then type "CNV.H".Histological subtypes (Endometrioid, Serous)Modestrain: training a new model from scratch.validate: load a trained model and validate it on a set of prepared samples.test: load a trained model and apply to a intact H&E slide.VariantsPC are architectures with the branch integrating BMI and age; P are original PanoptesPanoptes1 (InceptionResnetV1-based; P1/PC1)Panoptes2 (InceptionResnetV2-based; P2/PC2)Panoptes3 (InceptionResnetV1-based; P3/PC3)Panoptes2 (InceptionResnetV2-based; P4/PC4)UsageInstall the package version through pippip install panoptes-heRequirements are listed inrequirements.txtfrom panoptes.execute import panoptes, get_default_dataGet default label_file and split_file:label_file, split_file = get_default_data()Parameterspanoptes(mode, outdir, feature, architecture, log_dir, image_dir, tile_dir=None, modeltoload=None, imagefile=None, batchsize=24, epoch=100000, resolution=None, BMI=np.nan, age=np.nan, label_file=None, split_file=None, cancer='UCEC')mode(required): select a mode to use (train, validate, test)outdir(required): name of the output directoryfeature(required): select a feature to predict (histology, subtype, POLE, MSI, CNV.L, CNV.H, ARID1A, ATM, BRCA2,
CTCF, CTNNB1, FAT1, FBXW7, FGFR2, JAK1, KRAS, MTOR, PIK3CA, PIK3R1, PPP2R1A, PTEN, RPL22, TP53, ZFHX3)architecture(required): select a architecture to use (P1, P2, P3, P4, PC1, PC2, PC3, PC4)log_dir(required): directory for log file, which will also contain the outdir.image_dir(required): directory contains the svs/scn scanned H&E slidestile_dir(required for train and validate): directory contains tiles of svs/scn scanned H&E slidesmodeltoload(required for validate and test): full path to trained model to load (without .meta)imagefile(required for test): the svs/scn scanned H&E slide to be tested in image_dirbatchsize(optional, default=24): batch sizeepoch(optional, default=100): max epoch; early stop is enabled.resolution(optional): resolution of scanned H&E slides. If known, enter 20 or 40. Otherwise, leave blank.BMI(optional): patient BMI for test with PC models.age(optional): patient age for test with PC models.label_file(required for train and validate): label dictionary. Example can be usedsample_lable.csv.split_file(optional): For train and validate mode, random split is default for data separation.cancer(currently optional): Currently only UCEC is supported.
If you prefer a customized split, please provide a split file (example can be usedsample_sep_file.csv)Main repository and commandline, bash, GUI version can be found in:https://github.com/rhong3/Panoptes