Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Add a working environment #2

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
9 changes: 9 additions & 0 deletions Dockerfile.cytofcompensation
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Use the official image as a parent image.
FROM continuumio/miniconda3:4.8.2

# Set the working directory.
WORKDIR ~

# Run the command inside your image filesystem.
RUN conda install -c conda-forge mamba
RUN mamba install -y -c bioconda -c conda-forge bioconductor-catalyst=1.6 r::r-stringr r-ggpmisc r-data.table r-dtplyr r-ggplot2 bioconductor-flowcore r-tiff r::rstudio r-plotly r-matrixstats r-reshape2 r-raster r-viridis bioconductor-ebimage r-scales r-fields plotly unzip libgfortran r-devtools
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
RStudio: [![Binder](http://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/BodenmillerGroup/cyTOFcompensation/environment?urlpath=rstudio&filepath=README.md)
# cyTOF compensation

This repository contains scripts used to reproduce a majority of figures from the paper "Compensation of signal spillover in suspension and imaging mass cytometry" by Stéphane Chevrier\*, Helena L. Crowell\*, Vito R.T. Zanotelli\*, Stefanie Engler, Mark D. Robinson, and Bernd Bodenmiller which is published in 'Cell Systems' as "Compensation of Signal Spillover in Suspension and Imaging Mass Cytometry" (http://www.cell.com/cell-systems/abstract/S2405-4712(18)30063-2)
Expand All @@ -8,6 +9,28 @@ The raw data is available from Mendeley data under the DOI code 10.17632/v58yj49
The CATALYST package developed specifically to allow a user friendly usage of the developped spillover estimation and compensation approach can be found for download at: http://bioconductor.org/packages/CATALYST
A link to the light version of the web app, installation instructions, example datasets, and vignettes for CATALYST are available from the project page: https://catalyst-project.github.io/.


## Scripts in this repository only works for CATALYST 1.6

Due to changes in CATALYST, this repository only works with older versions (tested: CATALYST 1.6).
To generate a compatible enviornment, we suggest you to use conda:
https://docs.conda.io/projects/conda/en/latest/user-guide/install

To install the environment use:
```
conda env create -f environment.yml -n cytofcompensation
conda activate cytofcompensation
```
on a desktop you should be able to start Rstudio via

```
rstudio
```

This was tested on Ubuntu 18.04.
Alternatively we provide a dockerfile to generate a container with the environment.


The repository is organized in the following scripts:

0) retrieve_data.R:\
Expand Down
27 changes: 27 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
channels:
- conda-forge
- bioconda
dependencies:
- bioconductor-catalyst=1.6
- r::r-stringr
- r-ggpmisc
- r-data.table
- r-dtplyr
- r-ggplot2
- bioconductor-flowcore
- r-tiff
- r::rstudio
- r-plotly
- r-matrixstats
- r-reshape2
- r-raster
- r-viridis
- bioconductor-ebimage
- r-scales
- r-fields
- plotly
- r-irkernel
- libiconv
- icu<=60
- libgfortran
- r-devtools
10 changes: 5 additions & 5 deletions scripts/retrieve_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
# 'https://data.mendeley.com/datasets/v58yj49pfr/draft/files/3ef240f2-96ab-4dd7-aba4-68150c286990/Figure_4.zip?dl=1',
# 'https://data.mendeley.com/datasets/v58yj49pfr/draft/files/8ac64093-0273-4ae3-a53e-fdb3348ee7ac/Figure_S5.zip?dl=1')

urls_data = c('https://data.mendeley.com/datasets/v58yj49pfr/1/files/4cd060d1-9714-4040-ad24-9aa48b47d520/Figure_1.zip?dl=1',
'https://data.mendeley.com/datasets/v58yj49pfr/1/files/eeefe10c-49f8-4dc6-84b5-0fd82c7d9449/Figure_2-3.zip?dl=1',
'https://data.mendeley.com/datasets/v58yj49pfr/1/files/75c2eea3-0bca-4c7d-a06a-c0a75ebebcd2/Figure_4.zip?dl=1',
'https://data.mendeley.com/datasets/v58yj49pfr/1/files/859158e7-2786-481e-b070-99aab43aba36/Figure_S3.zip?dl=1',
'https://data.mendeley.com/datasets/v58yj49pfr/1/files/0e52746f-545c-4607-91c2-cd8635d4d269/Figure_S5.zip?dl=1')
urls_data = c('https://data.mendeley.com/public-files/datasets/v58yj49pfr/files/cd2b59f9-b34a-46c3-af33-fe3c43ed7d80/file_downloaded?dl=1',
'https://data.mendeley.com/public-files/datasets/v58yj49pfr/files/758f4f06-730e-4046-9b65-4ce74c56f581/file_downloaded?dl=1',
'https://data.mendeley.com/public-files/datasets/v58yj49pfr/files/fad34c02-8a26-4291-814a-dc3bd4d980a2/file_downloaded?dl=1',
'https://data.mendeley.com/public-files/datasets/v58yj49pfr/files/2eb186ee-7410-4f2e-b42e-1d2d8b8b4931/file_downloaded?dl=1',
'https://data.mendeley.com/public-files/datasets/v58yj49pfr/files/b39223d2-2825-4e79-9875-86fa0e1c55d2/file_downloaded?dl=1')

# set working directory to current script location
scriptdir <- dirname(parent.frame(2)$ofile)
Expand Down
4 changes: 2 additions & 2 deletions scripts/spillover_imc_helpers.R
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,9 @@ comp_datimg <- function(datimg, sm, method='nnls',...){

img_comp = img_mat %>%
flowCore::flowFrame() %>%
CATALYST::compCytof(sm,method=method, ...) %>%
CATALYST::compCytof(as.matrix(sm),method=method, ...) %>%
flowCore::exprs() %>%
as.data.table()
setnames(img_comp, orig_names)
return(img_comp)
}
}