Skip to main content

Create cell graphs from pathology slide data and train a graph neural network to predict patient outcomes for SPT.

Project description

cg-gnn

cg-gnn (short for "Cell Graph - Graph Neural Networks'') is a library to create cell graphs from pathology slide data and train a graph neural network model using them to predict patient outcomes. This library is designed to be used with and as part of the SPT framework, although independent functionality is also possible provided you can provide formatted, cell level slide data.

This library is a heavily modified version of histocartography and two of its applications, hact-net and patho-quant-explainer.

Installation

Using pip

In addition to installing via pip,

pip install cg-gnn

you must also install using the instructions on their websites,

  • pytorch
  • DGL
  • CUDA (optional but highly recommended if your machine supports it)

From source

  1. Clone this repository
  2. Create a conda environment using
conda env create -f environment.yml
  1. Run this module from the command line using main.py. Alternatively, scripts in the main directory running from a to d4 allow you to step through each individual section of the cg-gnn pipeline, saving files along the way.

Credits

As mentioned above, this repository is a heavily modified version of the histocartography project and two of its applications: hact-net and patho-quant-explainer. Specifically,

  • Cell graph formatting, saving, and loading using DGL is patterned on how they were implemented in hact-net
  • The neural network training and inference module is modified from the hact-net implementation for cell graphs
  • Importance score and separability calculations are sourced from patho-quant-explainer
  • The dependence on histocartography is indirect, through the functionality used by the above features

Due to dependency issues that arose when using the version of histocartography published on PyPI, we've chosen to copy and make slight updates to only the modules of histocartography used by the features supported in this library.

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

cg_gnn-0.1.4.tar.gz (55.5 kB view hashes)

Uploaded Source

Built Distribution

cg_gnn-0.1.4-py3-none-any.whl (66.6 kB view hashes)

Uploaded Python 3

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