Giter Club home page Giter Club logo

hrmas_nc's Introduction

Glioma Classification from HRMAS NMR Spectrum

Machine Learning Assisted Intraoperative Assessment of Brain Tumor Margins Using HRMAS NMR Spectroscopy
Doruk Cakmakci, Emin Onur Karakaslar, Elisa Ruhland, Marie-Pierre Chenard, Francois Proust, Martial Piotto, Izzie Jacques Namer and A. Ercument Cicek
PLoS Computational Biology 2020, in press

Scripts

Create Dataset: This script is used to create the experiment setup presented in the paper. Samples are grouped according to their patient ids. Patients are randomly shuffled. Folds are generated by stratified and grouped k-fold cross validation approach. Finally, spectrum data is preprocessed as discussed in the paper.

SHAP Value Plotting: This script contains function used for generating SHAP Value Plots given in Figure 3 in the paper.

Benign vs. Malignant Glioma Classification Models

Random Forest, CNN , Fully-connected NN, SVM , PLSDA

Control vs. Glioma Classification Models

Random Forest, CNN, Fully-connected NN, SVM, PLSDA

Dependencies

  • PyTorch
  • scikit-learn
  • pandas
  • numpy
  • xlrd
  • PyNMR
  • shap

Getting Started

  • Download the dataset from here. Extract the compressed folder and move dataset folder to /data folder as a subdirectory.
  • Download and save Supplementary Table 1 to /data folder. Rename the file to supplement.xls
  • Install dependencies. If an Ubuntu machine with GPU is used, dependencies may be installed by creating a conda environment using ubuntu_environment.yml file and installing shap and xlrd dependencies using conda.
  • Clone PyNMR library to /lib
  • Generate dataset using create_dataset.py by uncommenting corresponding dataset option (Lines 222-225)
  • Execute any model script (For random forest, SHAP plots will be saved to the same directory)

Reproduce Results

In order to reproduce the results reported in the preprint the dataset and folds must be downloaded from here. After extracting the compressed folder, fold_data/ must be moved to /reproduce/ as a subdirectory. Below you may find the instructions for reproducing Figure 2 and Figure 3 from the preprint.

  • Instructions for Figure 2:
    • Panel A:
      • Execute cnn.py, nn.py, rf.py, plsda.py and svm.py scripts located under /reproduce/figure_2/control_tumor/seed_2453, /reproduce/figure_2/control_tumor/seed_1117 and /reproduce/figure_2/control_tumor/seed_423 (In total of 15 scripts should be executed).
      • Execute plot_boxplot.py located at /reproduce/figure_2/control_tumor/. The plot will be saved to the same directory.
    • Panel B:
      • Execute cnn.py, nn.py, rf.py, plsda.py and svm.py scripts located under /reproduce/figure_2/benign_aggressive/seed_228, /reproduce/figure_2/benign_aggressive/seed_1849 and /reproduce/figure_2/benign_aggressive/seed_2251 (In total of 15 scripts should be executed).
      • Execute plot_boxplot.py located at /reproduce/figure_2/benign_aggressive/. The plot will be saved to the same directory.
  • Instructions for Figure 3:
    • Panel A:
      • Execute rf.py script located at /reproduce/figure_3/control_tumor/seed_1648.
      • The plot will be saved to /reproduce/figure_3/control_tumor/seed_1648/plots.
    • Panel B:
      • Execute rf.py script located at /reproduce/figure_3/benign_aggressive/seed_1648.
      • The plot will be saved to /reproduce/figure_3/benign_aggressive/seed_1648/plots.

hrmas_nc's People

Contributors

dorukcakmakci avatar ciceklab avatar

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.