This repo contains an R package for analyzing (single cell) HCI imaging data. The package structure is inspired by Seurat.
Please see the wiki for a detailled walkthrough of the analsysis steps and capabilities of the package, some basic information is outlined below.
Very important note: We make no claims on the statistical validity of applying some of the approaches on any given dataset and this package is "use at your own risk". As the HCI feature space is so diverse and to maintain flexibility you can in principle run any data through the package but this also means you can easily end up violating statistical assumptions. If in doubt, reach out to your local friendly statistician for advice if any given method is valid.
Please see the wiki for detailled install instructions
For the basic install (does not cover optional dependencies) and given blas, lapack, nlopt and libxml2 are available to the system (see install instructions otherwise):
if (!requireNamespace("remotes", quietly = TRUE)) {
install.packages("remotes")
}
remotes::install_git("https://github.com/TrynkaLab/tglow-r.git")
Please see the wiki wiki for a detailled walkthrough of the analsysis steps and capabilities of the package.
A very minimal workflow on a qc'ed object might look like this:
data(tglow_example)
# Subset to the first 50 features on the raw assay
tglow@assays[["raw"]] <- tglow@assays$raw[,1:50]
# Select 2000 random cells
tglow <- tglow[sample(nrow(tglow), 2000),]
# Scale data
tglow <- scale_dataset(tglow, assay="raw")
# Run PCA
tglow <- calculate_pca(tglow, assay="raw")
# Cluster cells
tglow <- calculate_clustering(tglow, "PCA.raw")
# UMAP
tglow <- calculate_umap(tglow, reduction="PCA.raw")
# Plot
tglow_dimplot(tglow, "UMAP.PCA.raw", ident="clusters_res_0.1")
tglow_dimplot(tglow, "UMAP.PCA.raw", ident="drug")
tglow_dimplot(tglow, "UMAP.PCA.raw", ident="donor")
# Find markers with a linear mixed model
markers <- find_markers_lmm(tglow,
"clusters_res_0.1",
assay="raw",
slot="scale.data",
covariates=c("Metadata_plate", "Metadata_well"))
# Plot top 5 markers
plot_markers(markers, topn=5)
# Calculate drug effects with a linear mixed model
drug.effect <- calculate_lmm(tglow,
assay="raw",
slot="data",
covariates=c("drug", "Metadata_plate", "Metadata_well", "donor"),
formula= ~ drug + (1|Metadata_plate:Metadata_well) + (1|donor))
NOTE on naming scheme: Functions with the prefix
tglow_either retlate to one of the Tglow s4 objects or are specific to the Tglow image processing pipeline. The functions without a spcific prefix should be more generically applicable.
A full index of functions can be found in Function List
- Olivier Bakker
- Julie Matte
- Madeline Ohl