Organoids scRNAseq Analysis

Author

Ahmed M. Elhossiny

This section describes the processing and analysis of the organoid/fibroblast scRNAseq dataset, which includes tumor organoid monocultures, fibroblast (CAF and normal fibroblast) monocultures, and their pairwise cocultures. We use this dataset to examine WNT ligand, receptor, and downstream target expression across conditions, complementing the in vivo WNT signaling analysis described in CellChat Analysis.

1 Setup and Environment Configuration

Code
suppressPackageStartupMessages({
  library(Seurat)
  library(SeuratWrappers)
  library(SeuratExtend)
  library(tidyverse)
  library(scCustomize)
  library(CellChat)
  library(reticulate)
  library(qs)
  library(clustree)
})

use_condaenv("/path/to/conda/envs/single_cell/", required = TRUE)
sc <- import("scanpy")
anndata <- import("anndata")
scipy <- import('scipy')

outputDir <- 'outputs'
dir.create(outputDir, showWarnings = F, recursive = T)

2 Data Loading and Object Preparation

We read the organoids_samples_manifest.xlsx from the data directory, containing metadata for each sample. The columns used from this manifest are:

Column Description Example
sample_id unique sample identifier sample_1
patient_id patient/donor identifier patient_1
run_id sequencing run/batch identifier run_1
category culture condition (monoculture or coculture, by pairing) Tumor_Coculture
condition cell population captured (Epithelial or Fibroblasts) Epithelial
disease_state tumor- or normal-derived Tumor

We load CellBender-processed HDF5 count data for each sample, as described in scRNAseq Ambient RNA Correction, and append the manifest metadata to each Seurat object before merging into a single object.

Code
samples_info <- readxl::read_xlsx("../data/organoids_samples_manifest.xlsx")
samples <- unique(samples_info$sample_id)

obj <- lapply(samples, function(x) {
  sample_info <- samples_info %>% filter(sample_id == x)
  seurat <- Read_CellBender_h5_Mat(paste0("outputs/cellbender/", x, "/", x, "_filtered.h5")) %>%
    CreateSeuratObject()
  seurat$sample_id <- x
  seurat$patient_id <- sample_info$patient_id
  seurat$run_id <- sample_info$run_id
  seurat$celltype_disease <- sample_info$category
  seurat$celltype <- sample_info$condition
  seurat$diseaseState <- sample_info$disease_state
  seurat <- RenameCells(seurat, add.cell.id = x)
  return(seurat)
})
obj <- reduce(obj, merge)
obj <- JoinLayers(obj, assay = 'RNA')

3 Quality Control and Doublet Detection

We calculate the percentage of mitochondrial genes (percent.mt), then run Scrublet (Wolock et al. 2019) on each sample separately to flag potential doublets, in the same way as described in scRNAseq Data Processing and Integration.

Code
obj[["percent.mt"]] <- PercentageFeatureSet(obj, pattern = "^MT-")

scrublet_res <- lapply(unique(obj$sample_id), function(x) {
  message(x)
  sample <- subset(obj, subset = sample_id == x)
  adata <- anndata$AnnData(
    X = scipy$sparse$csr_matrix(
      Matrix::t(LayerData(sample, assay = 'RNA', layer = "counts"))
    )
  )
  sc$pp$scrublet(adata)
  scrublet_res <- py_to_r(adata$obs) %>%
    select(doublet_score, predicted_doublet)
  rownames(scrublet_res) <- colnames(sample)
  scrublet_res$predicted_doublet <- unlist(scrublet_res$predicted_doublet)
  return(scrublet_res)
}) %>% bind_rows()
obj <- AddMetaData(obj, scrublet_res)

4 Data Integration

We apply standard QC filters (percent.mt < 15, nFeature_RNA > 200), then integrate samples using scVI (Lopez et al. 2018), as described in scRNAseq Data Processing and Integration.

Code
obj[["RNA"]] <- split(obj[["RNA"]], f = obj$sample_id)
obj <- subset(obj, subset = percent.mt < 15 & nFeature_RNA > 200)
obj <- FindVariableFeatures(obj)
obj <- NormalizeData(obj)
obj <- ScaleData(obj)
obj <- RunPCA(obj)

obj <- IntegrateLayers(
  object = obj,
  method = scVIIntegration,
  conda_env = "/path/to/conda/envs/single_cell/",
  new.reduction = "integrated.scvi",
  verbose = TRUE
)
obj <- RunUMAP(obj, reduction = 'integrated.scvi', dims = 1:30)
obj <- JoinLayers(obj, assay = 'RNA')
qs::qsave(obj, "outputs/integrated_obj.qs")

5 Clustering and Annotation

As with the other scRNAseq datasets, we scan a range of clustering resolutions with clustree (Zappia and Oshlack 2018) before selecting a final resolution. At a coarse resolution (0.01), clusters separate cleanly into the two expected broad populations, which we annotate directly as Epithelial (organoid) and Fibroblast.

Code
obj <- FindNeighbors(obj, reduction = 'integrated.scvi', dims = 1:30)
res <- seq(from = 0.05, to = 1, by = 0.05)
for (x in res) {
  obj <- FindClusters(obj, resolution = x, cluster.name = paste0("res.", x))
}
clustree(obj, prefix = 'res.', layout = "sugiyama")

obj <- FindClusters(obj, resolution = 0.01)
new_ann <- c('0' = 'Fibroblasts', '1' = 'Epithelial')
obj <- RenameIdents(obj, new_ann)
obj$celltype <- Idents(obj)

We then combine the culture condition (celltype_disease, renamed here to culture) with the cell population (celltype) to define a group label for each cell, and remove the small number of cross-contaminating cells (e.g. epithelial cells captured in a fibroblast-labeled well, or vice versa).

Code
obj@meta.data <- obj@meta.data %>%
  select(sample_id, patient_id, run_id, celltype_disease, celltype)
colnames(obj@meta.data)[4] <- 'culture'

obj$group <- paste0(obj$culture, "_", obj$celltype)
obj <- obj[, !(obj$group %in% c("Tumor_Fibro_Epithelial",
                                "Normal_Fibro_Epithelial",
                                "Normal_Epithelial_Fibroblasts",
                                "Tumor_Epithelial_Fibroblasts"))]

obj <- RunUMAP(obj, reduction = 'integrated.scvi', dims = 1:30)
qs::qsave(obj, "outputs/integrated_obj_tumor_normal_fibro.qs")

Finally, group values are relabeled into descriptive condition names for plotting. The conditions used in the final WNT signaling figure are tumor organoid monoculture and coculture (with normal fibroblasts or with CAFs), CAF monoculture and coculture (with tumor organoids), and normal fibroblast monoculture and coculture (with tumor organoids); the normal organoid conditions are excluded from this figure.

Code
obj$group <- gsub("Tumor_Epithelial_Epithelial", "TumorOrganoids(Monoculture)", obj$group)
obj$group <- gsub("Tumor_Fibro_Fibroblasts", "CAFs(Monoculture)", obj$group)
obj$group <- gsub("Normal_Fibro_Fibroblasts", "NormalFibroblasts(Monoculture)", obj$group)
obj$group <- gsub("Normal_Epithelial_Epithelial", "NormalEpiOrganoids(Monoculture)", obj$group)

obj$group <- gsub("Tumor_Epi_Normal_Fibro_Coculture_Epithelial", "TumorOrganoids(Coculture_w_NormalFibroblasts)", obj$group)
obj$group <- gsub("Tumor_Epi_Normal_Fibro_Coculture_Fibroblasts", "NormalFibroblasts(Coculture_w_TumorOrganoids)", obj$group)

obj$group <- gsub("Normal_Coculture_Fibroblasts", "NormalFibroblasts(Coculture_w_NormalEpiOrganoids)", obj$group)
obj$group <- gsub("Normal_Coculture_Epithelial", "NormalEpiOrganoids(Coculture_w_NormalFibroblasts)", obj$group)

obj$group <- gsub("Tumor_Coculture_Epithelial", "TumorOrganoids(Coculture_w_CAFs)", obj$group)
obj$group <- gsub("Tumor_Coculture_Fibroblasts", "CAFs(Coculture_w_TumorOrganoids)", obj$group)

6 WNT Signaling Dot Plot

We restrict the object to the conditions used in the figure (tumor organoids, CAFs, and normal fibroblasts, excluding the normal organoid conditions), then plot WNT ligand, receptor, and downstream target expression, along with classical and basal PDAC marker expression in the tumor organoid conditions, using CellChat’s (Jin et al. 2021) ligand-receptor database to define the WNT gene sets.

Code
tumor_fibro_org_subset <- subset(obj, subset = group %in% c(
  "TumorOrganoids(Monoculture)", "TumorOrganoids(Coculture_w_NormalFibroblasts)", "TumorOrganoids(Coculture_w_CAFs)",
  "CAFs(Monoculture)", "CAFs(Coculture_w_TumorOrganoids)",
  "NormalFibroblasts(Monoculture)", "NormalFibroblasts(Coculture_w_TumorOrganoids)"
))

tumor_fibro_org_subset$group <- factor(tumor_fibro_org_subset$group, levels = c(
  "TumorOrganoids(Monoculture)", "TumorOrganoids(Coculture_w_NormalFibroblasts)", "TumorOrganoids(Coculture_w_CAFs)",
  "NormalFibroblasts(Monoculture)", "NormalFibroblasts(Coculture_w_TumorOrganoids)",
  "CAFs(Monoculture)", "CAFs(Coculture_w_TumorOrganoids)"
))

wnt_ligands <- CellChatDB.human$interaction %>% filter(pathway_name %in% c("ncWNT", "WNT")) %>% pull(ligand) %>% unique()
wnt_receptors <- CellChatDB.human$interaction %>% filter(pathway_name %in% c("ncWNT", "WNT")) %>%
  pull(receptor) %>% strsplit("_") %>% unlist() %>% unique()
wnt_downstream <- c("PORCN", "TCF3", "TCF4", "TCF7", "LEF1", "AXIN1", "AXIN2")

organoid_dotplot_wout_NormalOrg <- DotPlot2(tumor_fibro_org_subset,
                                            features = list("WNT Ligands" = c("WNT2", "WNT5A", "WNT7A", "WNT7B", "WNT10A"),
                                                            "WNT Downstream Targets" = c("LEF1"),
                                                            "Classical PDAC Markers" = c("MUC5AC", "TFF1", "GATA6"),
                                                            "Basal PDAC Markers" = c("KRT17", "S100A2", "KRT6A")),
                                            group.by = 'group', flip = T,
                                            color_scheme = 'RdYlBu-rev')
organoid_dotplot_wout_NormalOrg

References

Jin, Suoqin, Christian F Guerrero-Juarez, Lihua Zhang, et al. 2021. “Inference and Analysis of Cell-Cell Communication Using CellChat.” Nature Communications 12 (1): 1088.
Lopez, Romain, Jeffrey Regier, Michael B Cole, Michael I Jordan, and Nir Yosef. 2018. “Deep Generative Modeling for Single-Cell Transcriptomics.” Nature Methods 15 (12): 1053–58.
Wolock, Samuel L., Romain Lopez, and Allon M. Klein. 2019. “Scrublet: Computational Identification of Cell Doublets in Single-Cell Transcriptomic Data.” Cell Systems 8 (4): 281–291.e9. https://doi.org/https://doi.org/10.1016/j.cels.2018.11.005.
Zappia, Luke, and Alicia Oshlack. 2018. “Clustering Trees: A Visualization for Evaluating Clusterings at Multiple Resolutions.” Gigascience 7 (7): giy083.