Skip to main content

Merge nuclei segmentations from multiple models

Project description

MergeSegmentations

Repository overview

This repository contains the file and scripts that support the study titled "Efficient integration and validation of deep learning-based nuclei segmentations in H&E slides from multiple models"

  1. Merging segmentations
  2. Recreating Figures in manuscript
  3. Linear mixed models for assessing variance explained in bulk-RNA gene expression data
  4. Pathway analysis for genes explained by high variance

All the data and files required to run the scripts are located in the data directory.

The study overview is illustrated here:

Study overview

Merging segmentations using Annoy

Usage:
cellmerger -m <method1_predictions> -p <method2_predictions> -o <outdir>

The input to the scripts are prediction files from the monusac and pannuke models. This can be tweaked to take inputs from any similar models as long as the outputs follow a datastructure that is similar to the format described as follows:

The file is a pickle dump with underlying datastructure as a dictionary. Where each key corresponds to a unique nuclei id.

For example: { 'id1':{'box':[],'centroid':[],'contour':[], 'prob':[], 'type':[]},
'id2':{'box':[],'centroid':[],'contour':[], 'prob':[], 'type':[]}
}

The box describes the bounding box of the nuclei The centroid describes the centroid x,y coordinates of the nuclei The countour describes the boundary of the nuclei in coordinates The prob details the probability of the prediction of nuclei The type details the type of the nuclei, i.e epithelial etc.

The primary function of this code is the "merge_coordinates" function in the script that uses Annoy to merge the predictions.

The output is a ".dat" file which is a pickle file, which has all the combined/integrated/merged predictions in a datastructure described in the example above.

Script to recreate plots as demonstrated in manuscript

The Jupyter notebook titled paper_plots_final.ipynb has the analyses scripts that created the plots. Associated files to run this jupyter notebook have also been uploaded to the repository.

Script to build mixed linear models

The script titled pca_script.R that performs this analysis uses the variancePartition package in R to build the mixed models to assess the variance contributed by the individual models.

Pathway analysis script

The script titled pathway.R that performs this analysis uses the WebGestaltR package to perform the analysis.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cellmerge-0.1.0.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

cellmerge-0.1.0-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file cellmerge-0.1.0.tar.gz.

File metadata

  • Download URL: cellmerge-0.1.0.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.9

File hashes

Hashes for cellmerge-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9bce625f53b5af2e20cf5aadd48b5558cec18f1cb7e51fdf34f5bbcf27002c36
MD5 067b67a522d4eb52d203163dbf2d1c40
BLAKE2b-256 c494b31b401ab2e8a91ca7b14290d9b92afaf90e948cb62d3d5254ac000c76ae

See more details on using hashes here.

File details

Details for the file cellmerge-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: cellmerge-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.9

File hashes

Hashes for cellmerge-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d50e6d4fd2f23050b6235fd0ec52e31a5826be88ffb05bece63468a16b19a055
MD5 100c3569a0f2afe4bc49424eff93a189
BLAKE2b-256 45697997018cea98ba93c3e29998ee557f0e4bae56b4cf212ba6d4fbf3c0ed29

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page