Last updated: 2020-07-20
Checks: 6 1
Knit directory: cytomapper_publication/
This reproducible R Markdown analysis was created with workflowr (version 1.6.2). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.
The R Markdown is untracked by Git. To know which version of the R Markdown file created these results, you’ll want to first commit it to the Git repo. If you’re still working on the analysis, you can ignore this warning. When you’re finished, you can run wflow_publish
to commit the R Markdown file and build the HTML.
Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.
The command set.seed(20200602)
was run prior to running the code in the R Markdown file. Setting a seed ensures that any results that rely on randomness, e.g. subsampling or permutations, are reproducible.
Great job! Recording the operating system, R version, and package versions is critical for reproducibility.
Nice! There were no cached chunks for this analysis, so you can be confident that you successfully produced the results during this run.
Great job! Using relative paths to the files within your workflowr project makes it easier to run your code on other machines.
Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility.
The results in this page were generated with repository version db08b96. See the Past versions tab to see a history of the changes made to the R Markdown and HTML files.
Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use wflow_publish
or wflow_git_commit
). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:
Ignored files:
Ignored: .DS_Store
Ignored: .Rhistory
Ignored: .Rproj.user/
Ignored: analysis/.DS_Store
Ignored: data/PancreasData/.DS_Store
Ignored: data/PancreasData/pancreas_images.rds
Ignored: data/PancreasData/pancreas_masks.rds
Ignored: data/PancreasData/pancreas_sce.rds
Untracked files:
Untracked: analysis/04-cytomapperShiny.Rmd
Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.
There are no past versions. Publish this analysis with wflow_publish()
to start tracking its development.
This script offers an example on how to run the cytomapperShiny
function to gate and visualize cells on images. For more information, please refer to ?cytomapperShiny
and the Help
section within the Shiny app.
Here, we will read in the previously generated data objects and directly pass them into the cytomapperShiny
function.
library(cytomapper)
sce <- readRDS("data/PancreasData/pancreas_sce.rds")
masks <- readRDS("data/PancreasData/pancreas_masks.rds")
images <- readRDS("data/PancreasData/pancreas_images.rds")
When not supplying a segmentation mask or multi-channel image object, the cytomapperShiny
function can be used to perform classic hierarchical gating similar to FlowJo on cell-specific expression values:
if (interactive()) {
cytomapperShiny(object = sce, img_id = "ImageName", cell_id = "CellNumber")
}
Next, we will only supply the SingleCellExperiment
object and the CytoImageList
segmentation mask object to the Shiny function. In this setting, segmentation masks are coloured (i) based on selected marker expression and (ii) based on the gated cells.
if (interactive()) {
cytomapperShiny(object = sce, mask = masks,
cell_id = "CellNumber", img_id = "ImageName")
}
In the third setting, we will gate cells based on their mean expression counts but outline the selected cells on composite images. For this, we will need to supply the SingleCellExperiment
object, a CytoImageList
object containing segmentation masks and a CytoImageList
object containing multi-channel images.
if (interactive()) {
cytomapperShiny(object = sce, mask = masks, image = images,
cell_id = "CellNumber", img_id = "ImageName")
}
sessionInfo()
R version 4.0.2 (2020-06-22)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Catalina 10.15.6
Matrix products: default
BLAS: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRblas.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] parallel stats4 stats graphics grDevices utils datasets
[8] methods base
other attached packages:
[1] cytomapper_1.1.2 SingleCellExperiment_1.11.6
[3] SummarizedExperiment_1.19.6 DelayedArray_0.15.7
[5] matrixStats_0.56.0 Matrix_1.2-18
[7] Biobase_2.49.0 GenomicRanges_1.41.5
[9] GenomeInfoDb_1.25.8 IRanges_2.23.10
[11] S4Vectors_0.27.12 BiocGenerics_0.35.4
[13] EBImage_4.31.0 workflowr_1.6.2
loaded via a namespace (and not attached):
[1] viridis_0.5.1 viridisLite_0.3.0 svgPanZoom_0.3.4
[4] shiny_1.5.0 sp_1.4-2 GenomeInfoDbData_1.2.3
[7] vipor_0.4.5 tiff_0.1-5 yaml_2.2.1
[10] gdtools_0.2.2 pillar_1.4.6 backports_1.1.8
[13] lattice_0.20-41 glue_1.4.1 digest_0.6.25
[16] RColorBrewer_1.1-2 promises_1.1.1 XVector_0.29.3
[19] colorspace_1.4-1 htmltools_0.5.0 httpuv_1.5.4
[22] pkgconfig_2.0.3 raster_3.3-7 zlibbioc_1.35.0
[25] purrr_0.3.4 xtable_1.8-4 fftwtools_0.9-8
[28] scales_1.1.1 svglite_1.2.3.2 jpeg_0.1-8.1
[31] later_1.1.0.1 git2r_0.27.1 tibble_3.0.3
[34] generics_0.0.2 ggplot2_3.3.2 ellipsis_0.3.1
[37] magrittr_1.5 crayon_1.3.4 mime_0.9
[40] evaluate_0.14 fs_1.4.2 beeswarm_0.2.3
[43] shinydashboard_0.7.1 tools_4.0.2 lifecycle_0.2.0
[46] stringr_1.4.0 munsell_0.5.0 locfit_1.5-9.4
[49] compiler_4.0.2 systemfonts_0.2.3 rlang_0.4.7
[52] grid_4.0.2 RCurl_1.98-1.2 rstudioapi_0.11
[55] htmlwidgets_1.5.1 bitops_1.0-6 rmarkdown_2.3
[58] gtable_0.3.0 codetools_0.2-16 abind_1.4-5
[61] R6_2.4.1 gridExtra_2.3 knitr_1.29
[64] dplyr_1.0.0 fastmap_1.0.1 rprojroot_1.3-2
[67] stringi_1.4.6 ggbeeswarm_0.6.0 Rcpp_1.0.5
[70] vctrs_0.3.2 png_0.1-7 tidyselect_1.1.0
[73] xfun_0.15