Sign inSign up

mandrea1/projectils_demo

By mandrea1

•Updated over 5 years ago

Projecting scRNA-seq data into a reference T cell atlas

Image
1

454

mandrea1/projectils_demo repository overview

⁠Docker image to run ProjecTILs

Log into Docker and download the image:

docker pull mandrea1/projectils_demo:1.0.0

This image contains an installation of RStudio, to run the ProjecTILs demo interactively (1). Alternatively, you can run the pipeline from command line (2).

⁠1) Run interactively in RStudio

Run the container using:

docker run --rm -p 8787:8787 -e PASSWORD=pass mandrea1/projectils_demo:1.0.0

and open a browser at the address localhost:8787

If prompted with username and password, use

  • username: rstudio
  • password: pass

Then, within the RStudio session running in the browser, open the ProjecTILs.demo.Rmd file. Run chunks separately and explore the package functionalities.

NOTE: Allocate at least 12GB of RAM to Docker, and increase as needed for larger query sets.

⁠2) Run from command line

To run the code within the docker container from command line, provide a one-liner code with the -e flag. Some examples:

  • Project sample data on TIL atlas
commands="library(ProjecTILs); \
ref <- load.reference.map('/home/rstudio/ref_TILAtlas_mouse_v1.rds'); \
querydata <- ProjecTILs::query_example_seurat; \
query.projected <- make.projection(querydata, ref=ref, skip.normalize = T); \
p <- plot.projection(ref, query.projected); \
ggsave('projected.example.umap.png', plot=p, width = 7, height = 6); \
saveRDS(query.projected, file='query.projected.rds')"
docker run -v `pwd`:`pwd` -w `pwd` mandrea1/projectils_demo:1.0.0 R -e "$commands"
  • Read 10x expression matrix and make projection - Note that fname should point to a folder containing the expression matrix in MEX format⁠. In this case an example is already mounted in the image at /home/rstudio/sample_data/
commands="library(ProjecTILs); \
ref <- load.reference.map('/home/rstudio/ref_TILAtlas_mouse_v1.rds'); \
fname <- '/home/rstudio/sample_data/'; \
querydata <- read.sc.query(fname, type='10x', min.cells=3, min.features=50); \
query.projected <- make.projection(querydata, ref=ref); \
p <- plot.projection(ref, query.projected); \
ggsave('projected.example10x.umap.png', plot=p, width = 7, height = 6); \
query.projected <- cellstate.predict(ref=ref, query=query.projected); \
p <- plot.statepred.composition(ref, query.projected); \
ggsave('projected.example10x.statepred.png', plot=p, width = 6, height = 4); \
saveRDS(query.projected, file='query10x.projected.rds')"
docker run -v `pwd`:`pwd` -w `pwd` mandrea1/projectils_demo:1.0.0 R -e "$commands"
  • Download LCMV atlas, download expression matrix from GEO, and project into the LCMV atlas
commands="library(ProjecTILs); \
library(GEOquery); \
refUrl <- 'https://ndownloader.figshare.com/files/23166794'; \
refFileName <- 'ref_LCMV_Atlas_mouse_v1.rds'; \
download.file(refUrl, refFileName); \
ref <- load.reference.map(refFileName); \
getGEOSuppFiles('GSE137007'); \
fname <- 'GSE137007/GSE137007_Run36_KK_UMI_Filterby_Gene500_UMI5000.txt.gz'; \
querydata <- read.sc.query(fname, type = 'raw'); \
query.projected <- make.projection(querydata, ref=ref); \
p <- plot.projection(ref, query.projected) + coord_flip() + scale_x_reverse() + scale_y_reverse(); \
ggsave('projected.lcmv.umap.png', plot=p, width = 7, height = 6); \
saveRDS(query.projected, file='query.projected.lcmv.rds')"
docker run -v `pwd`:`pwd` -w `pwd` mandrea1/projectils_demo:1.0.0 R -e "$commands"

NOTE: Allocate at least 12GB of RAM to Docker, and increase as needed for larger query sets.

⁠More information

Publication: Projecting single-cell transcriptomics data onto a reference T cell atlas to interpret immune responses. Massimo Andreatta, Jesus Corria Osorio, Soren Muller, Rafael Cubas, George Coukos, Santiago J Carmona (2020) bioRxiv preprint⁠

See also the ProjecTILs GitHub repository⁠

Tag summary

Content type

Image

Digest

Size

1.5 GB

Last updated

over 5 years ago

docker pull mandrea1/projectils_demo:1.1.0