GithubHelp home page GithubHelp logo

immunohe's Introduction

immunoHE

Code to reproduce the work in "Prediction of TMB and an immune gene expression signature from melanoma diagnostic H&E images"

The code required to reproduce figures 3-5 in the manuscript is in the figures directory.

Instructions for reproducing all of the work in the manuscript from end to end:

Image Processing

Collated TCGA data

Collated TMB and immune signature data for TCGA-SKCM samples is found in data.tsv.

Download RNASeq data (optional)

First, install the GDC data transfer tool:
https://gdc.cancer.gov/access-data/gdc-data-transfer-tool

Then download the RNASeq data for TCGA-SKCM files as follows:

./gdc-client download -m gdc_manifest.2018-10-04.txt

Download and tile diagnostic H&E slides

  1. Navigate to images/
  2. Run the following to create a shell script for image pre-processing:
./make_tiling_jobs.py -s 512 -m gdc_manifest.2018-11-03.txt

This creates a script tile_jobs.sh that will coordinate downloading TCGA-SKCM diagnostic H&E slides, tiling, removal of the original slides, and selecting min(number of patches, 1000) patches from each slide.

  1. Run this as follows:
./tile_jobs.sh

Normalize the slide patches

  1. Navigate to images/
  2. Run the following to create a shell script for image patch normalization:
./make_norm_jobs.py

This creates a script norm_jobs.sh that will normalize all of the patches using NORM.jpeg as a reference.

This also creates a tsv, image.paths.normed.tsv, that you will need for patch-label assignment.

  1. Run this as follows:
./norm_jobs.sh

Feature Extraction

  1. Assign TMB and immune signature patch labels by creating two tsv files images.paths.labels.immune.binary.tsv and images.paths.labels.tmb.binary.tsv.
./add_label.py
  1. Use inception v3 to extract features from each patch.
./feature_extractor.py --samples images.paths.labels.tmb.binary.tsv --output features/tmb.inceptionv3.features
./feature_extractor.py --samples images.paths.labels.immune.binary.tsv --output features/immune.inceptionv3.features

This process takes ~8hours using a GPU and generates two 3Gb npy files.

  1. Feature pooling

Pool the features that you just extracted as follows:

./pooler.sh

This will create max, average, and p-normed feature vectors for each slide and write them to the features/ directory. The pooled feature vectors used in this work are located in the features/ directory.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.