Skip to content

stat545ubc-2022/assignment-b3-karanvirsingh99

Repository files navigation

SPIAT Shiny App

Note: For assignment B4, I further developed the shiny app I made for assignment b3.

The SPIAT package is an R package with tools to analyze multiplex immunofluorescence data (mcIF). One of the tools embedded in this package is neighborhood detection, which allows users to identify cell neighborhoods in mcIF neighborhoods. The two main parameters to the SPIAT::identify_neighborhoods functions are the minimum size of the neighborhood, and the maximum distance to consider two cells as being part of the same neighborhood.

This shiny app provides an interactive visualization of how changing these two parameters affects neighborhood detection, using 4 sample mcIF images.

Furthermore, this app allows for uploading of mcIF data to detect neighborhoods and cluster similar neighborhoods based on their cell-type composition.

Data should be uploaded as a .csv file. Every row should be a cell. It should contain columns Image, Class, Centroid_x, Centroid_y. Two sample files are included to test the capabilities of the app: one with 4 images (ihc_sample.csv.gz) and one with 500 images (BT_cell_level_n_500.gz.csv). Please note runtime for 500 images is about 10 minutes.

A dendrogram is produced showing the clustering of the neighborhoods based on Bray-Curtis distances calculated on the proportions of cells of different types in each neighborhoods. Bar plots showing how the composition of clusters changes with different cluster numbers are also produced.

A table showing the average proportion by cell-type in each cluster is also produced.

Per-neighborhood data can be downloaded as a .csv file.

The sample images and sample data was generated by Karanvir Singh.

Prerequisites

This app requires tidyverse, ggsci and SPIAT to be installed. You can run the following code block in your R session to install the required packages.

install_packages("tidyverse")

if (!requireNamespace("BiocManager", quietly = TRUE)) {
      install.packages("BiocManager")}
# The following initialises usage of Bioc devel
BiocManager::install(version="devel")
BiocManager::install("SPIAT")

install_packages("ggsci")

Please note that you might run into issues if you try to install SPIAT on a Mac with an M1 or M2 CPU. I recommend installing the Intel-based version of R from here

How to run

To run this shiny app, run the following command in R:

shiny::runGitHub("assignment-b3-karanvirsingh99", "stat545ubc-2022")

About

assignment-b3-karanvirsingh99 created by GitHub Classroom

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages