# **MODIFY THIS CHUNK**
project_id  <- "HDMA-public" # determines the name of the cache folder
doc_id      <- "02-global_analysis/03" # determines name of the subfolder of `figures` where pngs/pdfs are saved
out         <- here::here("output/", doc_id); dir.create(out, recursive = TRUE)
figout      <- here::here("figures/", doc_id, "/")
cache       <- paste0("~/scratch/cache/", project_id, "/", doc_id, "/")
script_path <- here::here("code/utils")

1 Overview

In this analysis we correlate sample clusters using either markerpeaks or chromvar of markerpeaks.

2 Set up

# libraries
library(here)
library(ArchR)
library(dplyr)
library(tidyr)
library(ggplot2)
library(purrr)
library(glue)
library(readr)
library(tibble)
library(cowplot)
library(Seurat)
library(BSgenome.Hsapiens.UCSC.hg38)
library(dendextend)
library(ComplexHeatmap)
library(chromVAR)
library(motifmatchr)
library(circlize)

# shared project scripts/functions
source(file.path(script_path, "plotting_config.R"))
source(file.path(script_path, "hdma_palettes.R"))
#source(file.path(script_path, "sj_scRNAseq_helpers.R"))

ggplot2::theme_set(theme_minimal())

# selin functions
# adapting from scrattch.hicat
# https://github.com/AllenInstitute/scrattch.hicat/blob/7ccfbc24e3a51326740d08b5b306b18afeb890d9/R/dendro.R#L49
pvclust_show_signif_gradient <- function(dend, pvclust_obj, signif_type = c("bp", "au"),
                                         signif_col_fun = NULL, ...) {

  signif_type <- match.arg(signif_type)
  pvalue_per_node <- pvclust_obj$edges[[signif_type]]
  ord <- rank(get_branches_heights(dend, sort = FALSE))
  pvalue_per_node <- pvalue_per_node[ord]
  signif_col <- signif_col_fun(100)
  pvalue_by_all_nodes <- rep(NA, dendextend::nnodes(dend))
  ss_leaf <- which_leaf(dend)
  pvalue_by_all_nodes[!ss_leaf] <- pvalue_per_node
  pvalue_by_all_nodes <- na_locf(pvalue_by_all_nodes)
  the_cols <- signif_col[round(pvalue_by_all_nodes * 100)]
  signif_lwd = seq(0.5,2,length.out=100)
  the_lwds = signif_lwd[round(pvalue_by_all_nodes * 100)]
  dend = dend %>%
    assign_values_to_branches_edgePar(the_cols, "col") %>%
    assign_values_to_branches_edgePar(the_lwds, "lwd") %>%
    assign_values_to_branches_edgePar(pvalue_by_all_nodes, "conf")
}

build_dend <- function(mat, n_boot = 100, distance = "cor", hclust = "complete") {

  pvclust_res <- pvclust::pvclust(mat,
                                  nboot = n_boot,
                                  method.dist = distance,
                                  method.hclust = hclust)

  dend <- as.dendrogram(pvclust_res$hclust)
  
  dend <- dend %>% pvclust_show_signif_gradient(
    pvclust_res,
    signif_type = "bp",
    signif_col_fun = colorRampPalette(c("gray90", "gray50", "black")))

  message("done next step")
  return(list(dend = dend, pvclust_res = pvclust_res))

}

3 Get tissue metadata

tissue_meta <- read_tsv(here::here("code/02-global_analysis/01-organs_keep.tsv"))
## Rows: 12 Columns: 3
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: "\t"
## chr (3): organcode, organ, iteration
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.

4 Get all annotations

# add organ colors
col.data.frame <- data.frame(Color=cmap_organ) %>% dplyr::mutate(organ=names(cmap_organ))

organ.code.list <- tissue_meta$organcode
all.annots <- lapply(1:length(organ.code.list), function(i){
  # read cluster id annotation
  annot <- read.csv(sprintf(here::here("output/01-preprocessing/02/shared/meta/%s_meta_cluster.txt"), organ.code.list[i]), sep="\t") %>% as.data.frame
  rownames(annot) <- annot$cb
  annot$L0_clusterID <- paste0(organ.code.list[i],"_",annot$L1_clusterID)
  annot$L3_clusterID <- paste0(organ.code.list[i],"_",annot$L3_clusterName)
  return(annot)
})
all.annots <- dplyr::bind_rows(all.annots)
rownames(all.annots) <- all.annots$L0_clusterID

all.annots <- all.annots %>%
  mutate(Cluster = paste0(organ_code, "_",L1_clusterID)) %>%
  mutate(Cluster_labelled = paste0(organ_code, "_", L1_clusterID, "_", L3_clusterName)) %>%
  left_join(col.data.frame) %>%
  tibble::column_to_rownames(var = "Cluster")
## Joining with `by = join_by(organ)`
all.annots
##                  organ organ_code L1_clusterID L0_clusterName L1_clusterName
## AG_0           Adrenal         AG            0            epi         AG_epi
## AG_1           Adrenal         AG            1            epi         AG_epi
## AG_2           Adrenal         AG            2            epi         AG_epi
## AG_3           Adrenal         AG            3            epi         AG_epi
## AG_4           Adrenal         AG            4            epi         AG_epi
## AG_5           Adrenal         AG            5            end         AG_end
## AG_6           Adrenal         AG            6            imm         AG_imm
## AG_7           Adrenal         AG            7            str         AG_str
## AG_8           Adrenal         AG            8            epi         AG_epi
## AG_9           Adrenal         AG            9            epi         AG_epi
## BR_0             Brain         BR            0            epi         BR_epi
## BR_1             Brain         BR            1            epi         BR_epi
## BR_10            Brain         BR           10            epi         BR_epi
## BR_11            Brain         BR           11            str         BR_str
## BR_12            Brain         BR           12            epi         BR_epi
## BR_13            Brain         BR           13            end         BR_end
## BR_14            Brain         BR           14            epi         BR_epi
## BR_15            Brain         BR           15            epi         BR_epi
## BR_16            Brain         BR           16            end         BR_end
## BR_17            Brain         BR           17            imm         BR_imm
## BR_2             Brain         BR            2            epi         BR_epi
## BR_3             Brain         BR            3            epi         BR_epi
## BR_4             Brain         BR            4            epi         BR_epi
## BR_5             Brain         BR            5            epi         BR_epi
## BR_6             Brain         BR            6            epi         BR_epi
## BR_7             Brain         BR            7            epi         BR_epi
## BR_8             Brain         BR            8            str         BR_str
## BR_9             Brain         BR            9            epi         BR_epi
## EY_0               Eye         EY            0            epi         EY_epi
## EY_1               Eye         EY            1            str         EY_str
## EY_10              Eye         EY           10            epi         EY_epi
## EY_11              Eye         EY           11            epi         EY_epi
## EY_12              Eye         EY           12            str         EY_str
## EY_13              Eye         EY           13            epi         EY_epi
## EY_14              Eye         EY           14            str         EY_str
## EY_15              Eye         EY           15            epi         EY_epi
## EY_16              Eye         EY           16            epi         EY_epi
## EY_17              Eye         EY           17            str         EY_str
## EY_18              Eye         EY           18            imm         EY_imm
## EY_19              Eye         EY           19            epi         EY_epi
## EY_2               Eye         EY            2            epi         EY_epi
## EY_20              Eye         EY           20            epi         EY_epi
## EY_21              Eye         EY           21            epi         EY_epi
## EY_3               Eye         EY            3            epi         EY_epi
## EY_4               Eye         EY            4            str         EY_str
## EY_5               Eye         EY            5            str         EY_str
## EY_6               Eye         EY            6            epi         EY_epi
## EY_7               Eye         EY            7            epi         EY_epi
## EY_8               Eye         EY            8            epi         EY_epi
## EY_9               Eye         EY            9            end         EY_end
## HT_0             Heart         HT            0            str         HT_str
## HT_1             Heart         HT            1            str         HT_str
## HT_10            Heart         HT           10            str         HT_str
## HT_11            Heart         HT           11            end         HT_end
## HT_12            Heart         HT           12            str         HT_str
## HT_13            Heart         HT           13            epi         HT_epi
## HT_14            Heart         HT           14            imm         HT_imm
## HT_15            Heart         HT           15            epi         HT_epi
## HT_2             Heart         HT            2            str         HT_str
## HT_3             Heart         HT            3            str         HT_str
## HT_4             Heart         HT            4            end         HT_end
## HT_5             Heart         HT            5            str         HT_str
## HT_6             Heart         HT            6            str         HT_str
## HT_7             Heart         HT            7            str         HT_str
## HT_8             Heart         HT            8            str         HT_str
## HT_9             Heart         HT            9            str         HT_str
## LI_0             Liver         LI            0            imm         LI_imm
## LI_1             Liver         LI            1            epi         LI_epi
## LI_10            Liver         LI           10            end         LI_end
## LI_11            Liver         LI           11            imm         LI_imm
## LI_12            Liver         LI           12            imm         LI_imm
## LI_13            Liver         LI           13            epi         LI_epi
## LI_2             Liver         LI            2            imm         LI_imm
## LI_3             Liver         LI            3            epi         LI_epi
## LI_4             Liver         LI            4            epi         LI_epi
## LI_5             Liver         LI            5            imm         LI_imm
## LI_6             Liver         LI            6            epi         LI_epi
## LI_7             Liver         LI            7            imm         LI_imm
## LI_8             Liver         LI            8            imm         LI_imm
## LI_9             Liver         LI            9            str         LI_str
## LU_0              Lung         LU            0            epi         LU_epi
## LU_1              Lung         LU            1            str         LU_str
## LU_10             Lung         LU           10            epi         LU_epi
## LU_11             Lung         LU           11            end         LU_end
## LU_12             Lung         LU           12            imm         LU_imm
## LU_13             Lung         LU           13            str         LU_str
## LU_14             Lung         LU           14            epi         LU_epi
## LU_15             Lung         LU           15            epi         LU_epi
## LU_16             Lung         LU           16            epi         LU_epi
## LU_17             Lung         LU           17            imm         LU_imm
## LU_2              Lung         LU            2            end         LU_end
## LU_3              Lung         LU            3            epi         LU_epi
## LU_4              Lung         LU            4            str         LU_str
## LU_5              Lung         LU            5            epi         LU_epi
## LU_6              Lung         LU            6            str         LU_str
## LU_7              Lung         LU            7            str         LU_str
## LU_8              Lung         LU            8            epi         LU_epi
## LU_9              Lung         LU            9            epi         LU_epi
## MU_0            Muscle         MU            0            str         MU_str
## MU_1            Muscle         MU            1            str         MU_str
## MU_10           Muscle         MU           10            str         MU_str
## MU_11           Muscle         MU           11            end         MU_end
## MU_12           Muscle         MU           12            str         MU_str
## MU_13           Muscle         MU           13            epi         MU_epi
## MU_14           Muscle         MU           14            str         MU_str
## MU_15           Muscle         MU           15            imm         MU_imm
## MU_16           Muscle         MU           16            str         MU_str
## MU_17           Muscle         MU           17            str         MU_str
## MU_18           Muscle         MU           18            str         MU_str
## MU_19           Muscle         MU           19            str         MU_str
## MU_2            Muscle         MU            2            str         MU_str
## MU_20           Muscle         MU           20            epi         MU_epi
## MU_21           Muscle         MU           21            str         MU_str
## MU_3            Muscle         MU            3            str         MU_str
## MU_4            Muscle         MU            4            str         MU_str
## MU_5            Muscle         MU            5            end         MU_end
## MU_6            Muscle         MU            6            end         MU_end
## MU_7            Muscle         MU            7            str         MU_str
## MU_8            Muscle         MU            8            str         MU_str
## MU_9            Muscle         MU            9            str         MU_str
## SK_0              Skin         SK            0            str         SK_str
## SK_1              Skin         SK            1            str         SK_str
## SK_10             Skin         SK           10            epi         SK_epi
## SK_11             Skin         SK           11            str         SK_str
## SK_12             Skin         SK           12            epi         SK_epi
## SK_13             Skin         SK           13            end         SK_end
## SK_14             Skin         SK           14            epi         SK_epi
## SK_15             Skin         SK           15            imm         SK_imm
## SK_16             Skin         SK           16            str         SK_str
## SK_17             Skin         SK           17            epi         SK_epi
## SK_18             Skin         SK           18            epi         SK_epi
## SK_2              Skin         SK            2            epi         SK_epi
## SK_3              Skin         SK            3            str         SK_str
## SK_4              Skin         SK            4            end         SK_end
## SK_5              Skin         SK            5            str         SK_str
## SK_6              Skin         SK            6            str         SK_str
## SK_7              Skin         SK            7            epi         SK_epi
## SK_8              Skin         SK            8            str         SK_str
## SK_9              Skin         SK            9            str         SK_str
## SP_0            Spleen         SP            0            str         SP_str
## SP_1            Spleen         SP            1            str         SP_str
## SP_10           Spleen         SP           10            imm         SP_imm
## SP_11           Spleen         SP           11            str         SP_str
## SP_2            Spleen         SP            2            end         SP_end
## SP_3            Spleen         SP            3            imm         SP_imm
## SP_4            Spleen         SP            4            str         SP_str
## SP_5            Spleen         SP            5            imm         SP_imm
## SP_6            Spleen         SP            6            end         SP_end
## SP_7            Spleen         SP            7            str         SP_str
## SP_8            Spleen         SP            8            imm         SP_imm
## SP_9            Spleen         SP            9            imm         SP_imm
## ST_0  StomachEsophagus         ST            0            epi         ST_epi
## ST_1  StomachEsophagus         ST            1            str         ST_str
## ST_10 StomachEsophagus         ST           10            end         ST_end
## ST_11 StomachEsophagus         ST           11            str         ST_str
## ST_12 StomachEsophagus         ST           12            str         ST_str
## ST_13 StomachEsophagus         ST           13            epi         ST_epi
## ST_14 StomachEsophagus         ST           14            str         ST_str
## ST_15 StomachEsophagus         ST           15            epi         ST_epi
## ST_16 StomachEsophagus         ST           16            epi         ST_epi
## ST_17 StomachEsophagus         ST           17            str         ST_str
## ST_18 StomachEsophagus         ST           18            str         ST_str
## ST_19 StomachEsophagus         ST           19            imm         ST_imm
## ST_2  StomachEsophagus         ST            2            str         ST_str
## ST_20 StomachEsophagus         ST           20            end         ST_end
## ST_21 StomachEsophagus         ST           21            str         ST_str
## ST_3  StomachEsophagus         ST            3            epi         ST_epi
## ST_4  StomachEsophagus         ST            4            epi         ST_epi
## ST_5  StomachEsophagus         ST            5            str         ST_str
## ST_6  StomachEsophagus         ST            6            str         ST_str
## ST_7  StomachEsophagus         ST            7            str         ST_str
## ST_8  StomachEsophagus         ST            8            str         ST_str
## ST_9  StomachEsophagus         ST            9            epi         ST_epi
## TM_0            Thymus         TM            0            imm         TM_imm
## TM_1            Thymus         TM            1            imm         TM_imm
## TM_10           Thymus         TM           10            str         TM_str
## TM_11           Thymus         TM           11            imm         TM_imm
## TM_12           Thymus         TM           12            imm         TM_imm
## TM_13           Thymus         TM           13            str         TM_str
## TM_14           Thymus         TM           14            epi         TM_epi
## TM_15           Thymus         TM           15            imm         TM_imm
## TM_16           Thymus         TM           16            epi         TM_epi
## TM_17           Thymus         TM           17            str         TM_str
## TM_2            Thymus         TM            2            imm         TM_imm
## TM_3            Thymus         TM            3            epi         TM_epi
## TM_4            Thymus         TM            4            epi         TM_epi
## TM_5            Thymus         TM            5            str         TM_str
## TM_6            Thymus         TM            6            epi         TM_epi
## TM_7            Thymus         TM            7            end         TM_end
## TM_8            Thymus         TM            8            epi         TM_epi
## TM_9            Thymus         TM            9            epi         TM_epi
## TR_0           Thyroid         TR            0            epi         TR_epi
## TR_1           Thyroid         TR            1            epi         TR_epi
## TR_10          Thyroid         TR           10            end         TR_end
## TR_11          Thyroid         TR           11            epi         TR_epi
## TR_2           Thyroid         TR            2            epi         TR_epi
## TR_3           Thyroid         TR            3            str         TR_str
## TR_4           Thyroid         TR            4            str         TR_str
## TR_5           Thyroid         TR            5            str         TR_str
## TR_6           Thyroid         TR            6            epi         TR_epi
## TR_7           Thyroid         TR            7            str         TR_str
## TR_8           Thyroid         TR            8            epi         TR_epi
## TR_9           Thyroid         TR            9            str         TR_str
##       L2_clusterID                  L2_clusterName
## AG_0       AG_epi1                  adrenal cortex
## AG_1       AG_epi2                  adrenal cortex
## AG_2       AG_epi3                  adrenal cortex
## AG_3       AG_epi4                  adrenal cortex
## AG_4       AG_epi5         sympathoadrenal lineage
## AG_5        AG_end                     endothelial
## AG_6        AG_imm                     macrophages
## AG_7        AG_str                         stromal
## AG_8       AG_epi6         sympathoadrenal lineage
## AG_9       AG_epi7         schwann cell precursors
## BR_0       BR_epi1              excitatory neurons
## BR_1       BR_epi2              dorsal radial glia
## BR_10     BR_epi10  CGE-derived inhibitory neurons
## BR_11      BR_str2             smooth muscle cells
## BR_12     BR_epi11              excitatory neurons
## BR_13      BR_end1                     endothelial
## BR_14     BR_epi12              excitatory neurons
## BR_15     BR_epi13 oligodendrocyte precursor cells
## BR_16      BR_end2                     endothelial
## BR_17       BR_imm                     macrophages
## BR_2       BR_epi3              excitatory neurons
## BR_3       BR_epi4  MGE-derived inhibitory neurons
## BR_4       BR_epi5              excitatory neurons
## BR_5       BR_epi6              excitatory neurons
## BR_6       BR_epi7              excitatory neurons
## BR_7       BR_epi8              excitatory neurons
## BR_8       BR_str1             smooth muscle cells
## BR_9       BR_epi9  MGE-derived inhibitory neurons
## EY_0       EY_epi1         retinal progenitor cell
## EY_1       EY_str1                      fibroblast
## EY_10      EY_epi7                             RPE
## EY_11      EY_epi8                      horizontal
## EY_12      EY_str4                   smooth muscle
## EY_13      EY_epi9                       astrocyte
## EY_14      EY_str5             myogenic progenitor
## EY_15     EY_epi10   ciliated pigmented epithelium
## EY_16     EY_epi11                         schwann
## EY_17      EY_str6                      melanocyte
## EY_18       EY_imm                      macrophage
## EY_19     EY_epi12                          cornea
## EY_2       EY_epi2                             rod
## EY_20     EY_epi13                        amacrine
## EY_21     EY_epi14                          cornea
## EY_3       EY_epi3                        amacrine
## EY_4       EY_str2             trabecular meshwork
## EY_5       EY_str3              extraocular muscle
## EY_6       EY_epi4                retinal ganglion
## EY_7       EY_epi5                         bipolar
## EY_8       EY_epi6                            cone
## EY_9        EY_end            vascular endothelium
## HT_0       HT_str1                             vCM
## HT_1       HT_str2                             vCM
## HT_10     HT_str10                      fibroblast
## HT_11      HT_end2                     endocardial
## HT_12     HT_str11                      fibroblast
## HT_13      HT_epi1                        neuronal
## HT_14       HT_imm                      macrophage
## HT_15      HT_epi2                      epicardial
## HT_2       HT_str3                             aCM
## HT_3       HT_str4                      fibroblast
## HT_4       HT_end1                     endocardial
## HT_5       HT_str5                             aCM
## HT_6       HT_str6                      fibroblast
## HT_7       HT_str7                             vCM
## HT_8       HT_str8                     cycling vCM
## HT_9       HT_str9                        pericyte
## LI_0       LI_imm1            cycling erythroblast
## LI_1       LI_epi1                      hepatocyte
## LI_10       LI_end                     endothelial
## LI_11      LI_imm6               B cell progenitor
## LI_12      LI_imm7                   megakaryocyte
## LI_13      LI_epi5                   cholangiocyte
## LI_2       LI_imm2                    erythroblast
## LI_3       LI_epi2                      hepatocyte
## LI_4       LI_epi3                      hepatocyte
## LI_5       LI_imm3              early erythroblast
## LI_6       LI_epi4                      hepatocyte
## LI_7       LI_imm4                         Kupffer
## LI_8       LI_imm5                    erythroblast
## LI_9        LI_str                        stellate
## LU_0       LU_epi1    airway epithelial progenitor
## LU_1       LU_str1               airway fibroblast
## LU_10      LU_epi6    airway epithelial progenitor
## LU_11      LU_end2                      lymphatics
## LU_12      LU_imm1                      macrophage
## LU_13      LU_str5            airway smooth muscle
## LU_14      LU_epi7        pulmonary neuroendocrine
## LU_15      LU_epi8                        ciliated
## LU_16      LU_epi9                     mesothelial
## LU_17      LU_imm2                   megakaryocyte
## LU_2       LU_end1            vascular endothelial
## LU_3       LU_epi2                        ciliated
## LU_4       LU_str2            airway smooth muscle
## LU_5       LU_epi3    airway epithelial progenitor
## LU_6       LU_str3                       pericytes
## LU_7       LU_str4               airway fibroblast
## LU_8       LU_epi4    airway epithelial progenitor
## LU_9       LU_epi5    airway epithelial progenitor
## MU_0       MU_str1         myocytes (fast/Type II)
## MU_1       MU_str2                   smooth muscle
## MU_10      MU_str9          myocytes (slow/Type I)
## MU_11      MU_end3                     endothelial
## MU_12     MU_str10            myogenic progenitors
## MU_13      MU_epi1                   keratinocytes
## MU_14     MU_str11                       pericytes
## MU_15       MU_imm                     macrophages
## MU_16     MU_str12          myocytes (slow/Type I)
## MU_17     MU_str13                       myoblasts
## MU_18     MU_str14                        myocytes
## MU_19     MU_str15                       pericytes
## MU_2       MU_str3         myocytes (fast/Type II)
## MU_20      MU_epi2                   keratinocytes
## MU_21     MU_str16            myogenic progenitors
## MU_3       MU_str4            myogenic progenitors
## MU_4       MU_str5                     fibroblasts
## MU_5       MU_end1                     endothelial
## MU_6       MU_end2                     endothelial
## MU_7       MU_str6             myoblasts (cycling)
## MU_8       MU_str7                   smooth muscle
## MU_9       MU_str8                 tenogenic cells
## SK_0       SK_str1                      fibroblast
## SK_1       SK_str2                      fibroblast
## SK_10      SK_epi3                      melanocyte
## SK_11      SK_str8                 skeletal muscle
## SK_12      SK_epi4           interfollicular cells
## SK_13      SK_end2           lymphatic endothelium
## SK_14      SK_epi5           melanocyte progenitor
## SK_15       SK_imm                      macrophage
## SK_16      SK_str9                      fibroblast
## SK_17      SK_epi6                    keratinocyte
## SK_18      SK_epi7            epidermal progenitor
## SK_2       SK_epi1                    keratinocyte
## SK_3       SK_str3                      fibroblast
## SK_4       SK_end1            vascular endothelium
## SK_5       SK_str4                      fibroblast
## SK_6       SK_str5                        pericyte
## SK_7       SK_epi2                         schwann
## SK_8       SK_str6                 skeletal muscle
## SK_9       SK_str7                      fibroblast
## SP_0       SP_str1                      Fibroblast
## SP_1       SP_str2                      Fibroblast
## SP_10      SP_imm5                    Erythroblast
## SP_11      SP_str5                        Pericyte
## SP_2       SP_end1          Endothelial progenitor
## SP_3       SP_imm1                         B cells
## SP_4       SP_str3                      Fibroblast
## SP_5       SP_imm2                      Macrophage
## SP_6       SP_end2          Endothelial progenitor
## SP_7       SP_str4                      Fibroblast
## SP_8       SP_imm3                   Megakaryocyte
## SP_9       SP_imm4                      NK T cells
## ST_0       ST_epi1            chief and neck cells
## ST_1       ST_str1                   smooth muscle
## ST_10      ST_end1                     endothelial
## ST_11      ST_str7                 cycling stromal
## ST_12      ST_str8                       pericytes
## ST_13      ST_epi5   epithelial basal/keratinocyte
## ST_14      ST_str9     interstitial cells of Cajal
## ST_15      ST_epi6             ciliated epithelium
## ST_16      ST_epi7                 endocrine cells
## ST_17     ST_str10                   smooth muscle
## ST_18     ST_str11             MYH3+ smooth muscle
## ST_19       ST_imm                      macrophage
## ST_2       ST_str2                   smooth muscle
## ST_20      ST_end2                      lymphatics
## ST_21     ST_str12                     mesothelial
## ST_3       ST_epi2                  parietal cells
## ST_4       ST_epi3        keratinocytes/tuft cells
## ST_5       ST_str3                     fibroblasts
## ST_6       ST_str4                     fibroblasts
## ST_7       ST_str5                   smooth muscle
## ST_8       ST_str6                    enteric glia
## ST_9       ST_epi4                 enteric neurons
## TM_0       TM_imm1            CD8+ CD4+ thymocytes
## TM_1       TM_imm2            CD8+ CD4+ thymocytes
## TM_10      TM_str2          vascular smooth muscle
## TM_11      TM_imm4                 dendritic cells
## TM_12      TM_imm5                     macrophages
## TM_13      TM_str3                     fibroblasts
## TM_14      TM_epi6    medullary TEC (myoid Type I)
## TM_15      TM_imm6                         B cells
## TM_16      TM_epi7   medullary TEC (neuromuscular)
## TM_17      TM_str4                     fibroblasts
## TM_2       TM_imm3            CD8+ CD4+ thymocytes
## TM_3       TM_epi1  medullary TEC (myoid Type IIa)
## TM_4       TM_epi2  medullary TEC (myoid Type IIa)
## TM_5       TM_str1                     fibroblasts
## TM_6       TM_epi3                    cortical TEC
## TM_7        TM_end               endothelial cells
## TM_8       TM_epi4           medullary TEC (myoid)
## TM_9       TM_epi5           medullary TEC (myoid)
## TR_0       TR_epi1              thyroid follicular
## TR_1       TR_epi2              thyroid follicular
## TR_10       TR_end                     endothelial
## TR_11      TR_epi6                     parathyroid
## TR_2       TR_epi3              thyroid follicular
## TR_3       TR_str1                         stromal
## TR_4       TR_str2                      fibroblast
## TR_5       TR_str3                 skeletal muscle
## TR_6       TR_epi4              thyroid follicular
## TR_7       TR_str4              thyroid follicular
## TR_8       TR_epi5              thyroid follicular
## TR_9       TR_str5                   smooth muscle
##                         L3_clusterName ncell median_numi median_ngene
## AG_0                  adrenal cortex 1   823      9498.0       3280.0
## AG_1                  adrenal cortex 2   576      6827.5       3114.0
## AG_2                  adrenal cortex 3   511     10567.0       3661.0
## AG_3                  adrenal cortex 4   483      6340.0       2487.0
## AG_4         sympathoadrenal lineage 1   155      5262.0       2564.0
## AG_5                       endothelial   115      4117.0       2188.0
## AG_6                       macrophages    89      4511.0       2478.0
## AG_7                           stromal    77      5502.0       2741.0
## AG_8         sympathoadrenal lineage 2    29      5121.0       2596.0
## AG_9           schwann cell precursors    25      4319.0       2382.0
## BR_0              excitatory neurons 1  9750      3355.5       1803.0
## BR_1                dorsal radial glia  9436      5506.0       2694.5
## BR_10   CGE-derived inhibitory neurons  3502      3304.0       1801.0
## BR_11            smooth muscle cells 2  3373      2095.0       1464.0
## BR_12             excitatory neurons 7  3372      7511.0       3102.5
## BR_13                    endothelial 1  3234      2067.0       1491.5
## BR_14             excitatory neurons 8  2996      4389.0       2140.5
## BR_15  oligodendrocyte precursor cells  1070      5853.5       2692.0
## BR_16                    endothelial 2   648     12580.0       4536.0
## BR_17                      macrophages   335      4456.0       2425.0
## BR_2              excitatory neurons 2  6705      6587.0       2809.0
## BR_3  MGE-derived inhibitory neurons 1  4939     10606.0       3750.0
## BR_4              excitatory neurons 3  4766      2563.0       1526.0
## BR_5              excitatory neurons 4  4721      7868.0       3003.0
## BR_6              excitatory neurons 5  4463     12916.0       4204.0
## BR_7              excitatory neurons 6  4405      4842.0       2302.0
## BR_8             smooth muscle cells 1  4070      4973.0       2856.5
## BR_9  MGE-derived inhibitory neurons 2  3812      4171.0       2099.0
## EY_0           retinal progenitor cell 10546      1747.0       1304.0
## EY_1                        fibroblast  6420      1773.5       1328.0
## EY_10                              RPE  2441      2226.0       1593.0
## EY_11                       horizontal  2303      2353.0       1583.0
## EY_12                    smooth muscle  2141      1748.0       1295.0
## EY_13                        astrocyte  1932      1884.5       1390.5
## EY_14              myogenic progenitor  1923      2012.0       1484.0
## EY_15    ciliated pigmented epithelium  1081      2053.0       1490.0
## EY_16                          schwann  1017      2043.0       1464.0
## EY_17                       melanocyte   686      2210.0       1563.0
## EY_18                       macrophage   640      2468.5       1754.0
## EY_19                         cornea 1   519      1948.0       1441.0
## EY_2                               rod  6100      1139.5        917.0
## EY_20                       amacrine 2   329      3041.0       1853.0
## EY_21                         cornea 2    67      4192.0       2493.0
## EY_3                        amacrine 1  5672      1599.0       1161.0
## EY_4               trabecular meshwork  4704      1844.0       1357.5
## EY_5                extraocular muscle  4008      3553.5       2147.0
## EY_6                  retinal ganglion  3616      5408.5       2844.5
## EY_7                           bipolar  2907      1305.0       1000.0
## EY_8                              cone  2592      2059.5       1438.0
## EY_9              vascular endothelium  2451      2297.0       1665.0
## HT_0                             vCM 1 33620      2865.0       1588.0
## HT_1                             vCM 2 14883      2702.0       1530.0
## HT_10                     fibroblast 3  2550      5004.5       2657.0
## HT_11                    endocardial 2  2438      4112.0       2359.5
## HT_12                     fibroblast 4  1728      2145.5       1423.5
## HT_13                         neuronal  1036      2440.0       1616.0
## HT_14                       macrophage   869      2386.0       1586.0
## HT_15                       epicardial   528      5563.0       2913.5
## HT_2                             aCM 1 13925      4281.0       2404.0
## HT_3                      fibroblast 1 10121      2293.0       1507.0
## HT_4                     endocardial 1  8253      4041.0       2346.0
## HT_5                             aCM 2  8102      7503.0       3492.0
## HT_6                      fibroblast 2  7147      1699.0       1256.0
## HT_7                             vCM 3  5716      1781.5       1166.0
## HT_8                       cycling vCM  5654      3687.0       2014.5
## HT_9                          pericyte  3684      2350.0       1526.0
## LI_0              cycling erythroblast 16461      1480.0       1132.0
## LI_1                      hepatocyte 1 14247      2051.0       1477.0
## LI_10                      endothelial  1674      1773.5       1348.0
## LI_11                B cell progenitor  1154      1469.0       1144.5
## LI_12                    megakaryocyte  1042      1960.0       1406.0
## LI_13                    cholangiocyte  1004      1986.0       1462.5
## LI_2                    erythroblast 1  8716      1250.0        931.5
## LI_3                      hepatocyte 2  8171      1655.0       1250.0
## LI_4                      hepatocyte 3  3807      3849.0       2315.0
## LI_5                early erythroblast  3762      1846.5       1415.5
## LI_6                      hepatocyte 4  3701      2070.0       1521.0
## LI_7                           Kupffer  3467      1800.0       1358.0
## LI_8                    erythroblast 2  2362      1492.0       1168.5
## LI_9                          stellate  2239      1769.0       1368.0
## LU_0    airway epithelial progenitor 1 28899      1839.0       1385.0
## LU_1               airway fibroblast 1 22426      1674.0       1256.5
## LU_10   airway epithelial progenitor 5  6086      3427.0       2111.0
## LU_11                       lymphatics  3748      3297.0       2198.0
## LU_12                       macrophage  3747      2134.0       1566.0
## LU_13           airway smooth muscle 2  3507      3113.0       1915.0
## LU_14         pulmonary neuroendocrine  3041      3994.0       2447.0
## LU_15                       ciliated 2  1709      3981.0       2500.0
## LU_16                      mesothelial   395      3727.0       2393.0
## LU_17                    megakaryocyte   284      2742.5       1840.0
## LU_2              vascular endothelial 21309      2530.0       1768.0
## LU_3                        ciliated 1 13959      3880.0       2488.0
## LU_4            airway smooth muscle 1 12194      1667.0       1260.5
## LU_5    airway epithelial progenitor 2 10353      1737.0       1335.0
## LU_6                         pericytes  9897      2429.0       1696.0
## LU_7               airway fibroblast 2  8418      1566.0       1134.0
## LU_8    airway epithelial progenitor 3  8389      2206.0       1529.0
## LU_9    airway epithelial progenitor 4  6559      2413.0       1685.0
## MU_0         myocytes (fast/Type II) 1 12909      2491.0       1576.0
## MU_1                   smooth muscle 1  8838      1226.0        944.0
## MU_10         myocytes (slow/Type I) 1  4136      1845.0       1400.0
## MU_11                    endothelial 3  3590      1149.0        955.0
## MU_12           myogenic progenitors 2  3372      1454.0       1148.5
## MU_13                  keratinocytes 1  2660      3016.0       1987.5
## MU_14                      pericytes 1  1887      1961.0       1403.0
## MU_15                      macrophages  1755      2404.0       1678.0
## MU_16         myocytes (slow/Type I) 2  1263      4471.0       2589.0
## MU_17                        myoblasts  1008      3007.5       1901.5
## MU_18                         myocytes  1006      3318.0       2012.0
## MU_19                      pericytes 2   928      1594.5       1183.0
## MU_2         myocytes (fast/Type II) 2  7879      1991.0       1461.0
## MU_20                  keratinocytes 2   921      3651.0       2256.0
## MU_21           myogenic progenitors 3   546      3320.5       2087.5
## MU_3            myogenic progenitors 1  7496      2613.5       1720.0
## MU_4                       fibroblasts  6093      1575.0       1149.0
## MU_5                     endothelial 1  5955      3137.0       2041.0
## MU_6                     endothelial 2  5944      3318.5       2170.0
## MU_7               myoblasts (cycling)  5393      1883.0       1368.0
## MU_8                   smooth muscle 2  4571      1382.0       1062.0
## MU_9                   tenogenic cells  4392      2146.0       1510.0
## SK_0                      fibroblast 1  9770      1045.0        839.0
## SK_1                      fibroblast 2  6716       997.0        802.0
## SK_10                       melanocyte  1878      2086.0       1538.5
## SK_11                skeletal muscle 2  1799      1556.0       1165.0
## SK_12            interfollicular cells  1731      1624.0       1268.0
## SK_13            lymphatic endothelium  1171      2216.0       1620.0
## SK_14            melanocyte progenitor   764      1337.0       1014.5
## SK_15                       macrophage   632      1968.5       1478.0
## SK_16                     fibroblast 6   323      2437.0       1680.0
## SK_17                   keratinocyte 2   243      2745.0       1923.0
## SK_18             epidermal progenitor   226      3222.0       2219.0
## SK_2                    keratinocyte 1  6480      1614.5       1251.5
## SK_3                      fibroblast 3  5251      2099.0       1546.0
## SK_4              vascular endothelium  4889      2314.0       1684.0
## SK_5                      fibroblast 4  4846      2110.0       1549.0
## SK_6                          pericyte  3366      1694.5       1294.0
## SK_7                           schwann  3111      2319.0       1685.0
## SK_8                 skeletal muscle 1  2354      3035.0       2104.5
## SK_9                      fibroblast 5  2251      1157.0        923.0
## SP_0                      Fibroblast 1  6992      1306.0       1052.0
## SP_1                      Fibroblast 2  4525      1280.0       1052.0
## SP_10                     Erythroblast  1310      1247.5       1026.5
## SP_11                         Pericyte   605      1599.0       1237.0
## SP_2          Endothelial progenitor 1  3925      1261.0       1024.0
## SP_3                           B cells  3866      1148.0        955.0
## SP_4                      Fibroblast 3  2645      1870.0       1426.0
## SP_5                        Macrophage  2635      1228.0       1010.0
## SP_6          Endothelial progenitor 2  2012      1364.5       1106.0
## SP_7                      Fibroblast 4  1787      1538.0       1183.0
## SP_8                     Megakaryocyte  1462      1270.0       1008.5
## SP_9                        NK T cells  1413      1031.0        869.0
## ST_0              chief and neck cells 11861      1884.0       1402.0
## ST_1                   smooth muscle 1  7577      1717.0       1205.0
## ST_10                      endothelial  3381      2925.0       1952.0
## ST_11                  cycling stromal  3130      2137.0       1507.5
## ST_12                        pericytes  2550      2157.5       1496.5
## ST_13    epithelial basal/keratinocyte  2197      2630.0       1760.0
## ST_14      interstitial cells of Cajal  1893      1928.0       1347.0
## ST_15              ciliated epithelium  1430      5941.5       2942.5
## ST_16                  endocrine cells  1289      2003.0       1438.0
## ST_17                  smooth muscle 4  1070      2215.0       1428.5
## ST_18              MYH3+ smooth muscle  1003      1649.0       1225.0
## ST_19                       macrophage   595      1753.0       1299.0
## ST_2                   smooth muscle 2  6860      2179.0       1561.5
## ST_20                       lymphatics   383      4337.0       2589.0
## ST_21                      mesothelial   243      3002.0       2020.0
## ST_3                    parietal cells  6473      2339.0       1604.0
## ST_4          keratinocytes/tuft cells  5869      3064.0       1883.0
## ST_5                     fibroblasts 1  5672      1577.0       1173.0
## ST_6                     fibroblasts 2  5555      1804.0       1287.0
## ST_7                   smooth muscle 3  5518      2597.5       1553.5
## ST_8                      enteric glia  4858      2408.5       1629.0
## ST_9                   enteric neurons  4256      2897.5       1811.0
## TM_0            CD8+ CD4+ thymocytes 1  9138      1641.0       1209.0
## TM_1            CD8+ CD4+ thymocytes 2  6268      2216.5       1567.5
## TM_10           vascular smooth muscle   812      2944.0       1952.0
## TM_11                  dendritic cells   787      2983.0       2012.0
## TM_12                      macrophages   554      2802.0       1952.0
## TM_13                    fibroblasts 2   380      2547.5       1779.0
## TM_14     medullary TEC (myoid Type I)   358      3772.0       2199.0
## TM_15                          B cells   290      2530.0       1743.0
## TM_16    medullary TEC (neuromuscular)    98      3763.0       2211.5
## TM_17                    fibroblasts 3    93      4355.0       2727.0
## TM_2            CD8+ CD4+ thymocytes 3  5635      3161.0       2069.0
## TM_3  medullary TEC (myoid Type IIa) 1  5033      2833.0       1753.0
## TM_4  medullary TEC (myoid Type IIa) 2  3228      5237.0       3106.0
## TM_5                     fibroblasts 1  2959      2706.0       1832.0
## TM_6                      cortical TEC  2783      3354.0       2183.0
## TM_7                 endothelial cells  1332      3690.0       2352.5
## TM_8           medullary TEC (myoid) 1  1086      2212.0       1594.0
## TM_9           medullary TEC (myoid) 2   868      4783.5       2854.5
## TR_0              thyroid follicular 1  2956       877.0        690.5
## TR_1              thyroid follicular 2  1833      1729.0       1253.0
## TR_10                      endothelial   104      1424.0       1098.0
## TR_11                      parathyroid    38      1086.5        851.5
## TR_2              thyroid follicular 3  1280      1576.5       1132.0
## TR_3                           stromal   842      1211.0        945.0
## TR_4                        fibroblast   781      1442.0       1092.0
## TR_5                   skeletal muscle   643      1633.0       1137.0
## TR_6              thyroid follicular 4   299      3412.0       2199.0
## TR_7              thyroid follicular 5   205      5072.0       2997.0
## TR_8              thyroid follicular 6   200      3141.0       1972.0
## TR_9                     smooth muscle   118      1315.5       1012.5
##       median_pctmt median_nfrags median_tss median_frip
## AG_0   0.008694896        6784.0     9.8320   0.2906086
## AG_1   0.000000000        4341.5    10.3445   0.2400227
## AG_2   0.008910274        5692.0     9.6830   0.2679032
## AG_3   0.000000000        5519.0     9.8760   0.3020710
## AG_4   0.000000000        4425.0    10.1390   0.2104465
## AG_5   0.006551792        4192.0    10.1250   0.2417165
## AG_6   0.000000000        4198.0     9.2670   0.2150213
## AG_7   0.012624669        4658.0     9.6150   0.2005007
## AG_8   0.008352126        3915.0     8.7370   0.2073171
## AG_9   0.000000000        4698.0    10.0740   0.2070255
## BR_0   0.000000000        1866.0    11.8610   0.3870669
## BR_1   0.013566987        3350.0     9.7770   0.3424843
## BR_10  0.017761216        1721.0    10.3635   0.3210436
## BR_11  0.000000000        2463.0     9.0570   0.3364532
## BR_12  0.016878451        4449.0     6.6585   0.2419875
## BR_13  0.000000000        2956.5    11.9775   0.4422478
## BR_14  0.019928261        1770.5     8.3715   0.2613537
## BR_15  0.018828005        3057.0     8.0480   0.2774552
## BR_16  0.026992980        7422.0     7.7325   0.2867702
## BR_17  0.012419660        2876.0     8.7530   0.2997575
## BR_2   0.017807853        3471.0     7.9430   0.2751980
## BR_3   0.023658000        4681.0     8.3430   0.2800320
## BR_4   0.000000000        1651.0     8.5700   0.2553894
## BR_5   0.021318552        3541.0     8.9220   0.3049986
## BR_6   0.010365111        6408.0     7.8950   0.3039353
## BR_7   0.017404421        4021.0     8.0160   0.2696100
## BR_8   0.006265568        6185.5     9.6930   0.3446895
## BR_9   0.018750308        2208.0     9.0720   0.2879843
## EY_0   0.000000000        5474.5     8.5635   0.3559524
## EY_1   0.000000000        3965.0     7.3525   0.2440456
## EY_10  0.000000000        6760.0     7.3900   0.2914894
## EY_11  0.000000000        5421.0     8.9110   0.3297352
## EY_12  0.000000000        3926.0     8.2430   0.2751092
## EY_13  0.000000000        5165.5     8.5235   0.3331338
## EY_14  0.000000000        3226.0     7.6910   0.2893633
## EY_15  0.000000000        6337.0     8.1430   0.2944911
## EY_16  0.000000000        4000.0     7.7680   0.2543410
## EY_17  0.000000000        5778.5     7.0585   0.2545192
## EY_18  0.000000000        5739.5     7.3670   0.2633844
## EY_19  0.000000000        5142.0     8.3490   0.3057549
## EY_2   0.000000000        4668.5     9.5120   0.3241456
## EY_20  0.000000000        6701.0     8.1680   0.2851702
## EY_21  0.000000000        7417.0     8.3510   0.2563750
## EY_3   0.000000000        4972.5     8.9510   0.3095179
## EY_4   0.000000000        4115.0     7.2200   0.2540445
## EY_5   0.000000000        5811.0     8.0715   0.2820939
## EY_6   0.000000000        9299.0     6.8285   0.2790853
## EY_7   0.000000000        5283.0     9.2810   0.3275157
## EY_8   0.000000000        4681.0     8.6270   0.3193018
## EY_9   0.000000000        5664.0     6.9130   0.2389978
## HT_0   0.000000000        4297.0    13.0730   0.5849987
## HT_1   0.000000000        4711.0    14.5430   0.6116706
## HT_10  0.029456571        9394.0    10.7620   0.4604975
## HT_11  0.026073392        7079.5    11.0075   0.4731459
## HT_12  0.000000000        9705.0     7.2080   0.2459824
## HT_13  0.007520954        9193.5     8.0300   0.2719164
## HT_14  0.035555556        4379.0    11.2630   0.4472385
## HT_15  0.032058994       11645.5     9.3880   0.3545280
## HT_2   0.044483986        5549.0    10.2720   0.4554882
## HT_3   0.000000000        4224.0    11.2210   0.4792648
## HT_4   0.026326181        8340.0    12.7750   0.5446288
## HT_5   0.049415836        7897.0    11.4300   0.5061523
## HT_6   0.000000000        9416.0     6.4470   0.2140711
## HT_7   0.000000000        5337.5    12.9645   0.5901435
## HT_8   0.000000000        6596.5    12.6755   0.5622221
## HT_9   0.000000000        4504.0    11.8595   0.5127287
## LI_0   0.000000000        6066.0    14.2760   0.5300218
## LI_1   0.000000000        7801.0    12.2550   0.5354654
## LI_10  0.021967808        7757.0    11.8550   0.4986895
## LI_11  0.033882012        6372.0    12.2955   0.4746923
## LI_12  0.000000000        9223.5    10.1870   0.4494615
## LI_13  0.000000000        7509.5    11.8260   0.5161030
## LI_2   0.000000000        4234.5    16.4680   0.5759017
## LI_3   0.000000000        8819.0    12.8870   0.5419121
## LI_4   0.015588465        6913.0    11.2550   0.5166667
## LI_5   0.000000000        9036.5     9.3785   0.4327077
## LI_6   0.017373176        9119.0    13.3640   0.5323080
## LI_7   0.000000000        7607.0    11.0190   0.4858573
## LI_8   0.033444850        5765.5    13.6765   0.5003090
## LI_9   0.045977011        7426.0    12.4530   0.4615881
## LU_0   0.000000000        7820.0    11.1980   0.4708435
## LU_1   0.000000000        5717.0     9.6560   0.4111272
## LU_10  0.000000000        4225.0     9.5650   0.4305648
## LU_11  0.000000000        9018.0    10.4675   0.4077182
## LU_12  0.000000000        6820.0    10.0760   0.4071856
## LU_13  0.000000000        3664.0     8.6170   0.3560707
## LU_14  0.000000000        8665.0    10.1120   0.4037476
## LU_15  0.000000000       10085.0    10.7760   0.4472972
## LU_16  0.000000000        9957.0    10.1170   0.3761694
## LU_17  0.000000000        8176.0    10.2535   0.4212004
## LU_2   0.000000000        7937.0    10.8950   0.4397472
## LU_3   0.000000000       10875.0    10.7160   0.4447208
## LU_4   0.000000000        5780.5    10.8435   0.4538845
## LU_5   0.000000000        6975.0    10.4590   0.4261281
## LU_6   0.000000000        7272.0    10.1860   0.4290918
## LU_7   0.000000000        2819.0    10.6270   0.4685009
## LU_8   0.000000000        3804.0    12.2710   0.5301370
## LU_9   0.000000000        6574.0    10.7530   0.4515553
## MU_0   0.000000000        4924.0     9.2820   0.3641249
## MU_1   0.000000000        3615.5     8.4270   0.2421676
## MU_10  0.000000000        1644.0     7.6600   0.2488060
## MU_11  0.000000000        1671.5     8.8250   0.2584469
## MU_12  0.000000000        1581.0     6.6480   0.1691530
## MU_13  0.000000000        7178.5     7.1465   0.2303479
## MU_14  0.000000000        4554.0     8.5580   0.3142937
## MU_15  0.000000000        5947.0     8.5440   0.2917408
## MU_16  0.017576752        6073.0     8.4300   0.3162202
## MU_17  0.000000000        4162.0     6.2295   0.1954142
## MU_18  0.000000000        6221.0     8.8710   0.3319132
## MU_19  0.000000000        4097.0     8.2765   0.2476429
## MU_2   0.000000000        1667.0     8.2940   0.2873815
## MU_20  0.000000000        4834.0     6.6890   0.2181361
## MU_21  0.000000000        7041.0     6.9000   0.2197898
## MU_3   0.000000000        5669.0     7.6355   0.2170886
## MU_4   0.000000000        3530.0     9.1570   0.3380994
## MU_5   0.000000000        6804.0     8.6260   0.3092818
## MU_6   0.000000000        8562.0     8.9390   0.2570856
## MU_7   0.000000000        4248.0     9.3690   0.3424157
## MU_8   0.000000000        3719.0    10.5890   0.2993061
## MU_9   0.000000000        5618.0     8.3485   0.3076372
## SK_0   0.000000000        5309.0    11.2075   0.3673519
## SK_1   0.000000000        5082.0     9.0645   0.2814145
## SK_10  0.000000000       11650.5     9.7015   0.3197439
## SK_11  0.000000000        7535.0     8.1570   0.2758354
## SK_12  0.000000000       11598.0     8.1770   0.2690161
## SK_13  0.000000000       11785.0     9.0030   0.2726693
## SK_14  0.000000000        6240.0     9.1795   0.3365651
## SK_15  0.000000000       11487.0     8.0150   0.2447416
## SK_16  0.000000000       12720.0     8.8010   0.2663116
## SK_17  0.000000000       15798.0     8.5560   0.3043914
## SK_18  0.000000000       20768.5     8.0565   0.2561533
## SK_2   0.000000000       10549.5     8.1130   0.2869286
## SK_3   0.000000000       11838.0     9.2720   0.2968277
## SK_4   0.000000000       12033.0     9.7170   0.2975901
## SK_5   0.000000000       11837.5     8.7125   0.2684831
## SK_6   0.000000000        9537.5     9.0510   0.2878892
## SK_7   0.000000000       13144.0    10.2560   0.3130526
## SK_8   0.000000000       15036.5     6.7370   0.2249189
## SK_9   0.000000000        5735.0    12.1460   0.3830239
## SP_0   0.000000000       10301.5     9.1640   0.3842029
## SP_1   0.000000000        9449.0     8.0220   0.2990939
## SP_10  0.000000000       11752.0    10.3905   0.3671281
## SP_11  0.000000000       11802.0     8.7450   0.3540848
## SP_2   0.000000000        9814.0     9.6270   0.4070856
## SP_3   0.000000000        9672.0     8.7675   0.3449239
## SP_4   0.000000000       12785.0     8.1290   0.3132419
## SP_5   0.000000000       11904.0     7.7250   0.3233659
## SP_6   0.000000000       11179.0     8.3495   0.3201988
## SP_7   0.000000000       11094.0     8.5640   0.3604484
## SP_8   0.000000000        8970.0     9.4900   0.3690736
## SP_9   0.000000000        7903.0     9.2720   0.3540741
## ST_0   0.000000000        6182.0     6.6410   0.3739692
## ST_1   0.000000000        3480.0     9.4640   0.4137931
## ST_10  0.000000000        8246.0     6.7800   0.2916590
## ST_11  0.000000000        5848.0     7.7360   0.3343433
## ST_12  0.000000000        5742.0     6.6140   0.2982265
## ST_13  0.000000000        5906.0     7.6730   0.3458430
## ST_14  0.000000000        4286.0     7.2950   0.3242678
## ST_15  0.000000000        8573.0     6.7095   0.3558540
## ST_16  0.000000000        5616.0     7.5370   0.3401291
## ST_17  0.000000000        3380.0     7.5435   0.3645593
## ST_18  0.000000000        9000.0     7.5520   0.3222845
## ST_19  0.000000000        4929.0     6.8560   0.2915455
## ST_2   0.000000000        8330.5     7.0580   0.3101341
## ST_20  0.008760019       12228.0     6.3050   0.2757800
## ST_21  0.000000000        9200.0     6.4170   0.2511874
## ST_3   0.000000000        6494.0     6.8990   0.3467225
## ST_4   0.000000000        5267.0     7.8290   0.4141766
## ST_5   0.000000000        4232.5     6.9900   0.3065838
## ST_6   0.000000000        4140.0     6.8950   0.3107011
## ST_7   0.000000000        3830.0     8.5245   0.3725678
## ST_8   0.000000000        6390.5     7.9080   0.3282216
## ST_9   0.000000000        7484.5     7.7910   0.3051967
## TM_0   0.000000000        7320.5    10.3715   0.4011234
## TM_1   0.000000000        8730.5     9.9710   0.3883311
## TM_10  0.016287522        9510.0     8.2820   0.2570674
## TM_11  0.000000000       18951.0     9.0350   0.3684325
## TM_12  0.000000000       11846.0     9.1155   0.3482074
## TM_13  0.000000000       11344.0     9.3675   0.3222823
## TM_14  0.017678080        9345.0     9.6745   0.3108051
## TM_15  0.000000000       10797.5     8.9465   0.3503555
## TM_16  0.015671902       10618.5    10.2670   0.3287925
## TM_17  0.000000000       14998.0     8.0290   0.2405268
## TM_2   0.000000000       15301.0     9.7400   0.3649286
## TM_3   0.000000000        7791.0    10.3690   0.3334088
## TM_4   0.052861108        6042.0     8.5540   0.2751473
## TM_5   0.000000000        8797.0     7.8470   0.2495930
## TM_6   0.000000000       15137.0     9.2760   0.3598779
## TM_7   0.020995179       10580.0     8.5815   0.2643730
## TM_8   0.000000000        7036.5     9.9080   0.2941622
## TM_9   0.023935129       15510.0     6.9870   0.2000755
## TR_0   0.094652175        2672.5     8.2640   0.2180735
## TR_1   0.075642965        5348.0     8.3060   0.2246005
## TR_10  0.000000000        4631.5     9.4335   0.2279165
## TR_11  0.000000000        5151.0     9.5625   0.2916235
## TR_2   0.000000000        4630.5     9.6495   0.3123944
## TR_3   0.000000000        3763.0     9.0520   0.2203774
## TR_4   0.000000000        5173.0     8.1310   0.2126551
## TR_5   0.000000000        4934.0     9.3890   0.2602256
## TR_6   0.086580087        9162.0     8.3230   0.2308157
## TR_7   0.088222320       14047.0     8.5760   0.2340779
## TR_8   0.000000000        6855.0     9.3005   0.3006673
## TR_9   0.000000000        4462.5     9.0155   0.2268618
##                                                                                                                                                        note
## AG_0                                                                             NR5A1+ CYP11A1/CYP11B1+; mostly PCW21; groups with 2 and 3 in cluster tree
## AG_1                                                                                                              AGTR1+ likely zona glomerulosa; all PCW17
## AG_2                                                                                                    NR5A1+ AKR1B1+ SULT2A1+ CYP11A1/CYP11B1+; all PCW18
## AG_3                                                                                                                                    NR5A1+; mosly PCW21
## AG_4                                                             PHOX2A/B+ ISL1+ GATA3+; likely mix of chromaffin cells and sympathoblasts from all samples
## AG_5                                                                                                                           PECAM1+ TEK+; mix of samples
## AG_6                                                                                                              PTPRC+ MRC+ CD163+ IKZF1+; mix of samples
## AG_7                                                                            COL3A1+ TRPC6+; possibly mix of fibroblasts & pericytes; mix of all samples
## AG_8                                                             PHOX2A/B+ ISL1+ GATA3+; likely mix of chromaffin cells and sympathoblasts from all samples
## AG_9                                                                                                                                  CDH19 MPZ ERBB3 PLP1+
## BR_0                                                                                                                    TBR1/EMX1+ CUX2+ excitatory neurons
## BR_1                                                                                         VIM+ TOP2A+ (cycling) MOXD1+; EMX1/2+ indicating likely dorsal
## BR_10                                                                               DLX+ GAD1 GAD2 inhibitory neuron; ADARB2/CALB2 indicative of CGE origin
## BR_11                                                                                                                          ACTA2/PRDM6, clusters with 8
## BR_12                                                                                            CNTN4 KCNQ5 excitatory neurons;entirely T63_b4_Brain_PCW20
## BR_13                                                                                                                  entirely T382_b4_Brain_PCW15; MECOM+
## BR_14                                                                                                                              CUX2+ excitatory neurons
## BR_15                                                                                      NOVA1 SOX6 LHFPL3 OPCML+ although lacking canonical PDGFRA OLIG2
## BR_16                                                                                                                                         VWF/MECOM/TEK
## BR_17                                                                                    PTPRC LY86 MRC1 CD163L1+; subset with high estimated contamination
## BR_2                                                                                                          NEUROD2 BCL11B TBR1 POU6F2 excitatory neurons
## BR_3  GABRG3 (GABA receptor) SGCZ marker; GAD1 GAD2 inhibitory neurons; mostly T64_b4_Brain_PCW18; LHX6+ indicating medial ganglionic eminence (MGE) origin
## BR_4                                                                                                                     NEUROD2 excitatory neurons; UNC5D+
## BR_5                                                                                                mostly T64_b4_Brain_PCW18; RFX3 RORB excitatory neurons
## BR_6                                                                                 mostly T47_b4_Brain_PCW17; high SATB2 NEUROD2 FEZF2 excitatory neurons
## BR_7                                                                                                                               CNTN4 excitatory neurons
## BR_8                                                                                                                          ACTA2/PRDM6, clusters with 11
## BR_9                                                                                    DLX+ GAD1 GAD2 inhibitory neuron; LHX6/SOX6+ indicating MGE-derived
## EY_0                                                                                                                                                  CRB1+
## EY_1                                                                                                                          high COL1A2 COL1A1 fibroblast
## EY_10                                                                                                              TRPM3 TRPM1 PLD5 OPCML BEST1 markers RPE
## EY_11                                                                                                                            ONECUT1 ONECUT2 horizontal
## EY_12                                                                                                                              MYH11 smooth muscle cell
## EY_13                                                                                                                    high PAX2 GFAP; DCLK1 ERBB4 marker
## EY_14                                                                                                                                    CLCN5 BMPR1B NCOA1
## EY_15                                                                                                                              SLC4A4 SLC38A11 ATP6V1C2
## EY_16                                                                                                                                           NRXN1 NCAM2
## EY_17                                                                                                                                              PAX3 TYR
## EY_18                                                                                                                                           PTPRC CD163
## EY_19                                                                                                                                 PIP5K1B COL4A3 COL4A4
## EY_2                                                                                                                                       rod ANO2+ NR2E3+
## EY_20                                                                                                                      GAD1 GAD2 GABA_amacrine/amacrine
## EY_21                                                                                                                                 PIP5K1B COL4A3 COL4A4
## EY_3                                                                                                                       GAD1 GAD2 GABA_amacrine/amacrine
## EY_4                                                                                                                                     BICC1 LAMA4 PIEZO2
## EY_5                                                                                                                  high TRPC6; TTN MYH3 skeletal muscle 
## EY_6                                                                                                                                    RBPMS, GAP43, EPHA6
## EY_7                                                                                                                GRIK1 CA10 NRXN3 oncone/offcone bipolar
## EY_8                                                                                                                                          THRB, PRDM1 +
## EY_9                                                                                                                                                 PECAM1
## HT_0                                                                                                                   high ACTN2 ANKRD1 MYOCD no NPPA MYH6
## HT_1                                                                                    high ACTN2 ANKRD1 MYOCD no NPPA MYH6; entirely T014_b11_Heart_PCW18
## HT_10                                                                                                                              DCN COL1A2 COL1A1 marker
## HT_11                                                                                                                       PECAM1 marker; high CDH5 NOTCH1
## HT_12                                                                  entirely cluster 0 of T379_b11_Heart_PCW15; MYH3 NEB MYBPC1; same cluster level as 6
## HT_13                                                                NRXN1 XKR4 LRRTM4 marker; half is cluster 6 of T379_b11_Heart_PCW15; neuronal receptor
## HT_14                                                                                                                                    PTPRC marker CD163
## HT_15                                                                                                                                     EFEMP1 WT1 marker
## HT_2                                                                                                   NPPA MYH6 MYL7 marker; entirely T032_b11_Heart_PCW12
## HT_3                                                                                                                               DCN COL1A2 COL1A1 marker
## HT_4                                                                                                                        PECAM1 CDH5 marker; high NOTCH1
## HT_5                                                      MYL2 ANKRD1 MYL7 TNNI3 ACTN2 CNN1 marker; mostly T104_b11_Heart_PCW17; high MYL7 MYH6 NPPA atrial
## HT_6                                                                                               COL1A2 COL1A1 MYH3 marker; entirely T379_b11_Heart_PCW15
## HT_7                                                                                                  ANKRD1 ACTN2 MYL2 marker; mostly T104_b11_Heart_PCW17
## HT_8                                                                                                                                   cell cycle dependent
## HT_9                                                                                                                              PDGFRB RGS5 NOTCH3 marker
## LI_0                                                                                                                              cycling; ANK1 TFRC SLC4A1
## LI_1                                                                                                                                      high AFP ALB APOB
## LI_10                                                                                                                            LDB2 STAB2 KDR endothelial
## LI_11                                                               EBF1 PAX5 marker; B lineage cells https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3323878/
## LI_12                                                                                                      high PECAM1 and TRPC6; ITGA2B (CD41) DNM3 marker
## LI_13                                                                                                             PKHD1 ANXA4 cholangiocyte (secretes bile)
## LI_2                                                                                                                          ANK1 SLC4A1 ALAS2 TFRC marker
## LI_3                                                                                                                                      high AFP ALB APOB
## LI_4                                                                                                              entirely T375_b15_Liver_PCW15; AFP marker
## LI_5                                                                                                                   cell cycle dependent; high ANK1 TFRC
## LI_6                                                                                                                                      high AFP ALB APOB
## LI_7                                                                                                        LGMN Kupffer cells (liver resident macrophages)
## LI_8                                                                                                                                                  TFRC 
## LI_9                                                stellate cells (lipocytes that become myofibroblast-like when liver is injured); high COL3A1 DCN COL6A3
## LU_0                                                                                                                                     SFTPB SFTPC marker
## LU_1                                                                                                                                MEOX2 marker; high WNT2
## LU_10                                                                                            cycling; entirely T164_b12_Lung_PCW10; high ETV5 some SOX9
## LU_11                                                                                                                         PROX1 RELN marker; lymphatics
## LU_12                                                                                                                                           PTPRC CD163
## LU_13                                                                                  cycling; entirely T164_b12_Lung_PCW10; EYA4 HHIP MYH11 MYOCD markers
## LU_14                                                                                        GRP NRG1 NRXN1 GRIK2 markers; high GHRL (although not markers)
## LU_15                                                                                                                           DNAH11 DNAH5 dynein markers
## LU_16                                                                                                                                                   C3 
## LU_17                                                                                                                            ITGA2B (CD41) DNM3 markers
## LU_2                                                                                                                                                 PECAM1
## LU_3                                                                                                                            DNAH11 DNAH5 dynein markers
## LU_4                                                                                                                    HHIP EYA4 MYH11 DACH2 HPSE2 markers
## LU_5                                                                                                                                           SFTPB marker
## LU_6                                                                                                                              PDGFRB TRPC6 LRRTM4 SLIT3
## LU_7                                                                                                                                MEOX2 marker; high WNT2
## LU_8                                                                                                                                           SFTPB marker
## LU_9                                                                                                                          cycling; high ETV5 some SFPTB
## MU_0                                                                                                   high TTN/MYLPF; high MYOG; low PAX3 (PMID: 32396864)
## MU_1                                                                                                          low UMI; MYLK high; mostly PCW17; G2/M phases
## MU_10    MYBPC1/MYH7B/TNNT1 (PMID: PMC9569562); MYOD1-low but MYOG/ACTC1 high (PMID: 37003036); TNNT1 contractile gene; MUSK+ (neuromuscular synaptic gene)
## MU_11                                                                                                                        PECAM1;VWF;ESAM+; mostly PCW17
## MU_12                                                                                                                                                 PAX3+
## MU_13                                                                                                                                            KRT10/SCEL
## MU_14                                                                                                                                            RGS5/KCNJ8
## MU_15                                                                                            expression of macrophage markers inlcuding PTPRC/MRC/F13A1
## MU_16                                                                         MYH7+; MYOD1-low but MYOG/ACTC1 high (PMID: 37003036); TNNT1 contractile gene
## MU_17                                                                                                                                                 PAX7+
## MU_18                                                                                                                               clusters with 0/2/10/16
## MU_19                                                                                                                                low UMI; ITGA1+ TRPC6+
## MU_2                                             high PAX7; high TTN/MYLPF; Myosin heavy chain embryonic (MYH3)+; high MYOG/PAX7 low PAX3  (PMID: 32396864)
## MU_20                                                                                                                                        KRT4/17+, SCEL
## MU_21                                                                                                                                                 PAX3+
## MU_3                                                                                                                                                  PAX3+
## MU_4                                                                                                                                                  FBN1+
## MU_5                                                                                              MECOM/VWF+; also expressing VEGF recepors (KDR/FLT4/NRP2)
## MU_6                                                                                                                         PECAM1;VWF;ESAM+; mostly PCW17
## MU_7                                                                                 PAX7+ and G2/M cell cycle states; somewhat higher markers TOP2A/CENPE+
## MU_8                                                                                                                                           MECOM/SFTPB+
## MU_9                                                                                                                                              TNMD/MKX+
## SK_0                                                                                                                                             RHOJ, CUBN
## SK_1                                                                                                                              LRRTM4+, COL6A6+, ABCA10+
## SK_10                                                                                       TYRP1+, TRPM1+, DCT+, all components of pigment producing genes
## SK_11                                                                                                                                 NEB, MYH3, DMD, ACTN2
## SK_12                                                                                                                                 EDA+, TSPEAR+, FRAS1+
## SK_13                                                                                                                                        PROX1+, STAB2+
## SK_14                                                                                            EDNRB+ ITGA8+ temporary until additional marker validation
## SK_15                                                                                                                                   PTPRC+, MRC1+, LGMN
## SK_16                                                                                                                                    PDZRN4, BMP5, PRLR
## SK_17                                                                                   KRT4, KRT13, KRT23+, MYO5B+ (either granular or basal keratinocyte)
## SK_18                                                                                                                                         DNMT1+, BMP7+
## SK_2                                                                                                                             KRT10+, TP63+, MME+, DSC3+
## SK_3                                                                                                                                             RHOJ, CUBN
## SK_4                                                                                                                             PECAM1, VWF, FLT1(VEGFR1)+
## SK_5                                                                                                                              LRRTM4+, COL6A6+, ABCA10+
## SK_6                                                                                                                                TRPC6+, ACTA2+, PDGFRB+
## SK_7                                                                                                                                         NRXN1+, CDH19+
## SK_8                                                                                                                                  NEB, MYH3, DMD, ACTN2
## SK_9                                                                                                                        KIF26B+, SPON1+, DAAM2+, KCNN2+
## SP_0                                                                                                                                                 ATXN1+
## SP_1                                                                                                                                                 ATXN1+
## SP_10                                                                                                               SPTA1 and ANK1+ erythroblastoid markers
## SP_11                                                                                                                                         ACTA2+, TRPC6
## SP_2                                                                                                                               CD34+ and PECAM positive
## SP_3                                                                                                                                     MS4A1, CD19, IGHM+
## SP_4                                                                                                                                                 ATXN1+
## SP_5                                                                                                                                                 CD163+
## SP_6                                                                                                                               CD34+ and PECAM positive
## SP_7                                                                                                                                                 ATXN1+
## SP_8                                                                                                                                          RIPOR3+ DNM3+
## SP_9                                                                                                                                                CD247+ 
## ST_0                                                                                                                                                  MUC6+
## ST_1                                                                                                                                          ACTA2+ MYH11+
## ST_10                                                                                                                                          PECAM1+ VWF+
## ST_11                                                                                                                          cell cycle dependent; MKI67+
## ST_12                                                                                                                                  TRPC6+ PDGFRB+ RGS5+
## ST_13                                                                                                    mostly esophagus sample; KRT5+ KRT15+ high SCPEP1 
## ST_14                                                                                                                                            ANO1+ KIT+
## ST_15                                                                                                   mostly esophagus sample; high umi; DNAH12+ CFAP299+
## ST_16                                                                                                                                    GHRL+ high SST HDC
## ST_17                                                                                                mostly esophagus sample; MYH11+ COL12A1+ ACTA2+ MYH11+
## ST_18                                                                                                                                     TTN+ MYH3+ TNNT3+
## ST_19                                                                                                                                      high PTPRC CD163
## ST_2                                                                                                                  COL1A1+ ACTA2+ COL3A1+ COL1A2+ MYH11+
## ST_20                                                                                                                       high umi; high STAB2 RELN PROX1
## ST_21                                                                                                                            high umi; mesothelial WT1+
## ST_3                                                                                                                                          ATP4A+ ATP4B+
## ST_4                                                                                                     mostly esophagus sample; KRT13+ KRT4+ KRT7+ IRAG2+
## ST_5                                                                                                                                  high DCN COL1A2 FBLN1
## ST_6                                                                                                                                  high DCN COL1A2 FBLN1
## ST_7                                                                                                                 mostly esophagus sample; ACTA2+ MYH11+
## ST_8                                                                                                                        same cluster level as 19 immune
## ST_9                                                                                                                               DSCAM+ CHAT+ NOS1+ NRG1+
## TM_0                                                                                                                    PTPRC+; clusters with 1/3; low CD8+
## TM_1                                                                                                  TOX/TOX2 markers; PTPRC+; clusters with 0/3; low CD8+
## TM_10                                                                                                                                    ACTA2/RGS5/PDGFRB+
## TM_11                                                                                                         FLT3+; high expresison of Park et al DC genes
## TM_12                                                                                              CD163L1+; high expression of Park et al macrophage genes
## TM_13                                                                                                                                    COL1A2/COl3A1/DCN+
## TM_14                                                                                                                                MYH7+; clusters with 2
## TM_15                                                                                                     PAX5+; high expression of Park et al B cell genes
## TM_16                                                                                                          expression of BCHE (neurotransmitter enzyme)
## TM_17                                                                                                                                           FN1+/FLRT2+
## TM_2                                                                                     PTPRC+; cycling (G2/M and S-assigned); clusters with 0/1; low CD8+
## TM_3                                                                             MYOG/MYPN/MYOT/MYH2+ (similar to TEC(myo) in Park et al); clusters with 14
## TM_4                                                                                                                                                  MYH2+
## TM_5                                                                                                                                     COL1A2/COl3A1/DCN+
## TM_6                                      CDH1+; ADARB2+; SLIT-ROBO signaling; very minor AIRE+ pre-decontX; high expression of Park et al cTEC/mcTEC genes
## TM_7                                                                                                                                         PECAM1+/MECOM+
## TM_8                                                                                                           PAX7+; high expression of TEC(myo) signature
## TM_9                                                                                                           PAX7+; high expression of TEC(myo) signature
## TR_0                                                                                                                                         TPO, TG, TSHR+
## TR_1                                                                                                                                         TPO, TG, TSHR+
## TR_10                                                                                                                                               PECAM1+
## TR_11                                                                                                                         CASR, SPOCK3, DNAH11 positive
## TR_2                                                                                                                                         TPO, TG, TSHR+
## TR_3                                                                                                  unclear markers but still has NKAIN3, P3H2 expression
## TR_4                                                                                                            COL1A1, COL1A2 positive but not contractile
## TR_5                                                                                                                                    MYO18B, MYOM1, SOX6
## TR_6                                                                                                                                         TPO, TG, TSHR+
## TR_7                                                                                                                                         TPO, TG, TSHR+
## TR_8                                                                                                                                         TPO, TG, TSHR+
## TR_9                                                                                                                                          ACTA2, TAGLN+
##       L0_clusterID                        L3_clusterID
## AG_0          AG_0                 AG_adrenal cortex 1
## AG_1          AG_1                 AG_adrenal cortex 2
## AG_2          AG_2                 AG_adrenal cortex 3
## AG_3          AG_3                 AG_adrenal cortex 4
## AG_4          AG_4        AG_sympathoadrenal lineage 1
## AG_5          AG_5                      AG_endothelial
## AG_6          AG_6                      AG_macrophages
## AG_7          AG_7                          AG_stromal
## AG_8          AG_8        AG_sympathoadrenal lineage 2
## AG_9          AG_9          AG_schwann cell precursors
## BR_0          BR_0             BR_excitatory neurons 1
## BR_1          BR_1               BR_dorsal radial glia
## BR_10        BR_10   BR_CGE-derived inhibitory neurons
## BR_11        BR_11            BR_smooth muscle cells 2
## BR_12        BR_12             BR_excitatory neurons 7
## BR_13        BR_13                    BR_endothelial 1
## BR_14        BR_14             BR_excitatory neurons 8
## BR_15        BR_15  BR_oligodendrocyte precursor cells
## BR_16        BR_16                    BR_endothelial 2
## BR_17        BR_17                      BR_macrophages
## BR_2          BR_2             BR_excitatory neurons 2
## BR_3          BR_3 BR_MGE-derived inhibitory neurons 1
## BR_4          BR_4             BR_excitatory neurons 3
## BR_5          BR_5             BR_excitatory neurons 4
## BR_6          BR_6             BR_excitatory neurons 5
## BR_7          BR_7             BR_excitatory neurons 6
## BR_8          BR_8            BR_smooth muscle cells 1
## BR_9          BR_9 BR_MGE-derived inhibitory neurons 2
## EY_0          EY_0          EY_retinal progenitor cell
## EY_1          EY_1                       EY_fibroblast
## EY_10        EY_10                              EY_RPE
## EY_11        EY_11                       EY_horizontal
## EY_12        EY_12                    EY_smooth muscle
## EY_13        EY_13                        EY_astrocyte
## EY_14        EY_14              EY_myogenic progenitor
## EY_15        EY_15    EY_ciliated pigmented epithelium
## EY_16        EY_16                          EY_schwann
## EY_17        EY_17                       EY_melanocyte
## EY_18        EY_18                       EY_macrophage
## EY_19        EY_19                         EY_cornea 1
## EY_2          EY_2                              EY_rod
## EY_20        EY_20                       EY_amacrine 2
## EY_21        EY_21                         EY_cornea 2
## EY_3          EY_3                       EY_amacrine 1
## EY_4          EY_4              EY_trabecular meshwork
## EY_5          EY_5               EY_extraocular muscle
## EY_6          EY_6                 EY_retinal ganglion
## EY_7          EY_7                          EY_bipolar
## EY_8          EY_8                             EY_cone
## EY_9          EY_9             EY_vascular endothelium
## HT_0          HT_0                            HT_vCM 1
## HT_1          HT_1                            HT_vCM 2
## HT_10        HT_10                     HT_fibroblast 3
## HT_11        HT_11                    HT_endocardial 2
## HT_12        HT_12                     HT_fibroblast 4
## HT_13        HT_13                         HT_neuronal
## HT_14        HT_14                       HT_macrophage
## HT_15        HT_15                       HT_epicardial
## HT_2          HT_2                            HT_aCM 1
## HT_3          HT_3                     HT_fibroblast 1
## HT_4          HT_4                    HT_endocardial 1
## HT_5          HT_5                            HT_aCM 2
## HT_6          HT_6                     HT_fibroblast 2
## HT_7          HT_7                            HT_vCM 3
## HT_8          HT_8                      HT_cycling vCM
## HT_9          HT_9                         HT_pericyte
## LI_0          LI_0             LI_cycling erythroblast
## LI_1          LI_1                     LI_hepatocyte 1
## LI_10        LI_10                      LI_endothelial
## LI_11        LI_11                LI_B cell progenitor
## LI_12        LI_12                    LI_megakaryocyte
## LI_13        LI_13                    LI_cholangiocyte
## LI_2          LI_2                   LI_erythroblast 1
## LI_3          LI_3                     LI_hepatocyte 2
## LI_4          LI_4                     LI_hepatocyte 3
## LI_5          LI_5               LI_early erythroblast
## LI_6          LI_6                     LI_hepatocyte 4
## LI_7          LI_7                          LI_Kupffer
## LI_8          LI_8                   LI_erythroblast 2
## LI_9          LI_9                         LI_stellate
## LU_0          LU_0   LU_airway epithelial progenitor 1
## LU_1          LU_1              LU_airway fibroblast 1
## LU_10        LU_10   LU_airway epithelial progenitor 5
## LU_11        LU_11                       LU_lymphatics
## LU_12        LU_12                       LU_macrophage
## LU_13        LU_13           LU_airway smooth muscle 2
## LU_14        LU_14         LU_pulmonary neuroendocrine
## LU_15        LU_15                       LU_ciliated 2
## LU_16        LU_16                      LU_mesothelial
## LU_17        LU_17                    LU_megakaryocyte
## LU_2          LU_2             LU_vascular endothelial
## LU_3          LU_3                       LU_ciliated 1
## LU_4          LU_4           LU_airway smooth muscle 1
## LU_5          LU_5   LU_airway epithelial progenitor 2
## LU_6          LU_6                        LU_pericytes
## LU_7          LU_7              LU_airway fibroblast 2
## LU_8          LU_8   LU_airway epithelial progenitor 3
## LU_9          LU_9   LU_airway epithelial progenitor 4
## MU_0          MU_0        MU_myocytes (fast/Type II) 1
## MU_1          MU_1                  MU_smooth muscle 1
## MU_10        MU_10         MU_myocytes (slow/Type I) 1
## MU_11        MU_11                    MU_endothelial 3
## MU_12        MU_12           MU_myogenic progenitors 2
## MU_13        MU_13                  MU_keratinocytes 1
## MU_14        MU_14                      MU_pericytes 1
## MU_15        MU_15                      MU_macrophages
## MU_16        MU_16         MU_myocytes (slow/Type I) 2
## MU_17        MU_17                        MU_myoblasts
## MU_18        MU_18                         MU_myocytes
## MU_19        MU_19                      MU_pericytes 2
## MU_2          MU_2        MU_myocytes (fast/Type II) 2
## MU_20        MU_20                  MU_keratinocytes 2
## MU_21        MU_21           MU_myogenic progenitors 3
## MU_3          MU_3           MU_myogenic progenitors 1
## MU_4          MU_4                      MU_fibroblasts
## MU_5          MU_5                    MU_endothelial 1
## MU_6          MU_6                    MU_endothelial 2
## MU_7          MU_7              MU_myoblasts (cycling)
## MU_8          MU_8                  MU_smooth muscle 2
## MU_9          MU_9                  MU_tenogenic cells
## SK_0          SK_0                     SK_fibroblast 1
## SK_1          SK_1                     SK_fibroblast 2
## SK_10        SK_10                       SK_melanocyte
## SK_11        SK_11                SK_skeletal muscle 2
## SK_12        SK_12            SK_interfollicular cells
## SK_13        SK_13            SK_lymphatic endothelium
## SK_14        SK_14            SK_melanocyte progenitor
## SK_15        SK_15                       SK_macrophage
## SK_16        SK_16                     SK_fibroblast 6
## SK_17        SK_17                   SK_keratinocyte 2
## SK_18        SK_18             SK_epidermal progenitor
## SK_2          SK_2                   SK_keratinocyte 1
## SK_3          SK_3                     SK_fibroblast 3
## SK_4          SK_4             SK_vascular endothelium
## SK_5          SK_5                     SK_fibroblast 4
## SK_6          SK_6                         SK_pericyte
## SK_7          SK_7                          SK_schwann
## SK_8          SK_8                SK_skeletal muscle 1
## SK_9          SK_9                     SK_fibroblast 5
## SP_0          SP_0                     SP_Fibroblast 1
## SP_1          SP_1                     SP_Fibroblast 2
## SP_10        SP_10                     SP_Erythroblast
## SP_11        SP_11                         SP_Pericyte
## SP_2          SP_2         SP_Endothelial progenitor 1
## SP_3          SP_3                          SP_B cells
## SP_4          SP_4                     SP_Fibroblast 3
## SP_5          SP_5                       SP_Macrophage
## SP_6          SP_6         SP_Endothelial progenitor 2
## SP_7          SP_7                     SP_Fibroblast 4
## SP_8          SP_8                    SP_Megakaryocyte
## SP_9          SP_9                       SP_NK T cells
## ST_0          ST_0             ST_chief and neck cells
## ST_1          ST_1                  ST_smooth muscle 1
## ST_10        ST_10                      ST_endothelial
## ST_11        ST_11                  ST_cycling stromal
## ST_12        ST_12                        ST_pericytes
## ST_13        ST_13    ST_epithelial basal/keratinocyte
## ST_14        ST_14      ST_interstitial cells of Cajal
## ST_15        ST_15              ST_ciliated epithelium
## ST_16        ST_16                  ST_endocrine cells
## ST_17        ST_17                  ST_smooth muscle 4
## ST_18        ST_18              ST_MYH3+ smooth muscle
## ST_19        ST_19                       ST_macrophage
## ST_2          ST_2                  ST_smooth muscle 2
## ST_20        ST_20                       ST_lymphatics
## ST_21        ST_21                      ST_mesothelial
## ST_3          ST_3                   ST_parietal cells
## ST_4          ST_4         ST_keratinocytes/tuft cells
## ST_5          ST_5                    ST_fibroblasts 1
## ST_6          ST_6                    ST_fibroblasts 2
## ST_7          ST_7                  ST_smooth muscle 3
## ST_8          ST_8                     ST_enteric glia
## ST_9          ST_9                  ST_enteric neurons
## TM_0          TM_0           TM_CD8+ CD4+ thymocytes 1
## TM_1          TM_1           TM_CD8+ CD4+ thymocytes 2
## TM_10        TM_10           TM_vascular smooth muscle
## TM_11        TM_11                  TM_dendritic cells
## TM_12        TM_12                      TM_macrophages
## TM_13        TM_13                    TM_fibroblasts 2
## TM_14        TM_14     TM_medullary TEC (myoid Type I)
## TM_15        TM_15                          TM_B cells
## TM_16        TM_16    TM_medullary TEC (neuromuscular)
## TM_17        TM_17                    TM_fibroblasts 3
## TM_2          TM_2           TM_CD8+ CD4+ thymocytes 3
## TM_3          TM_3 TM_medullary TEC (myoid Type IIa) 1
## TM_4          TM_4 TM_medullary TEC (myoid Type IIa) 2
## TM_5          TM_5                    TM_fibroblasts 1
## TM_6          TM_6                     TM_cortical TEC
## TM_7          TM_7                TM_endothelial cells
## TM_8          TM_8          TM_medullary TEC (myoid) 1
## TM_9          TM_9          TM_medullary TEC (myoid) 2
## TR_0          TR_0             TR_thyroid follicular 1
## TR_1          TR_1             TR_thyroid follicular 2
## TR_10        TR_10                      TR_endothelial
## TR_11        TR_11                      TR_parathyroid
## TR_2          TR_2             TR_thyroid follicular 3
## TR_3          TR_3                          TR_stromal
## TR_4          TR_4                       TR_fibroblast
## TR_5          TR_5                  TR_skeletal muscle
## TR_6          TR_6             TR_thyroid follicular 4
## TR_7          TR_7             TR_thyroid follicular 5
## TR_8          TR_8             TR_thyroid follicular 6
## TR_9          TR_9                    TR_smooth muscle
##                            Cluster_labelled   Color
## AG_0                  AG_0_adrenal cortex 1 #876941
## AG_1                  AG_1_adrenal cortex 2 #876941
## AG_2                  AG_2_adrenal cortex 3 #876941
## AG_3                  AG_3_adrenal cortex 4 #876941
## AG_4         AG_4_sympathoadrenal lineage 1 #876941
## AG_5                       AG_5_endothelial #876941
## AG_6                       AG_6_macrophages #876941
## AG_7                           AG_7_stromal #876941
## AG_8         AG_8_sympathoadrenal lineage 2 #876941
## AG_9           AG_9_schwann cell precursors #876941
## BR_0              BR_0_excitatory neurons 1 #0C727C
## BR_1                BR_1_dorsal radial glia #0C727C
## BR_10  BR_10_CGE-derived inhibitory neurons #0C727C
## BR_11           BR_11_smooth muscle cells 2 #0C727C
## BR_12            BR_12_excitatory neurons 7 #0C727C
## BR_13                   BR_13_endothelial 1 #0C727C
## BR_14            BR_14_excitatory neurons 8 #0C727C
## BR_15 BR_15_oligodendrocyte precursor cells #0C727C
## BR_16                   BR_16_endothelial 2 #0C727C
## BR_17                     BR_17_macrophages #0C727C
## BR_2              BR_2_excitatory neurons 2 #0C727C
## BR_3  BR_3_MGE-derived inhibitory neurons 1 #0C727C
## BR_4              BR_4_excitatory neurons 3 #0C727C
## BR_5              BR_5_excitatory neurons 4 #0C727C
## BR_6              BR_6_excitatory neurons 5 #0C727C
## BR_7              BR_7_excitatory neurons 6 #0C727C
## BR_8             BR_8_smooth muscle cells 1 #0C727C
## BR_9  BR_9_MGE-derived inhibitory neurons 2 #0C727C
## EY_0           EY_0_retinal progenitor cell #ff9f0f
## EY_1                        EY_1_fibroblast #ff9f0f
## EY_10                             EY_10_RPE #ff9f0f
## EY_11                      EY_11_horizontal #ff9f0f
## EY_12                   EY_12_smooth muscle #ff9f0f
## EY_13                       EY_13_astrocyte #ff9f0f
## EY_14             EY_14_myogenic progenitor #ff9f0f
## EY_15   EY_15_ciliated pigmented epithelium #ff9f0f
## EY_16                         EY_16_schwann #ff9f0f
## EY_17                      EY_17_melanocyte #ff9f0f
## EY_18                      EY_18_macrophage #ff9f0f
## EY_19                        EY_19_cornea 1 #ff9f0f
## EY_2                               EY_2_rod #ff9f0f
## EY_20                      EY_20_amacrine 2 #ff9f0f
## EY_21                        EY_21_cornea 2 #ff9f0f
## EY_3                        EY_3_amacrine 1 #ff9f0f
## EY_4               EY_4_trabecular meshwork #ff9f0f
## EY_5                EY_5_extraocular muscle #ff9f0f
## EY_6                  EY_6_retinal ganglion #ff9f0f
## EY_7                           EY_7_bipolar #ff9f0f
## EY_8                              EY_8_cone #ff9f0f
## EY_9              EY_9_vascular endothelium #ff9f0f
## HT_0                             HT_0_vCM 1 #D51F26
## HT_1                             HT_1_vCM 2 #D51F26
## HT_10                    HT_10_fibroblast 3 #D51F26
## HT_11                   HT_11_endocardial 2 #D51F26
## HT_12                    HT_12_fibroblast 4 #D51F26
## HT_13                        HT_13_neuronal #D51F26
## HT_14                      HT_14_macrophage #D51F26
## HT_15                      HT_15_epicardial #D51F26
## HT_2                             HT_2_aCM 1 #D51F26
## HT_3                      HT_3_fibroblast 1 #D51F26
## HT_4                     HT_4_endocardial 1 #D51F26
## HT_5                             HT_5_aCM 2 #D51F26
## HT_6                      HT_6_fibroblast 2 #D51F26
## HT_7                             HT_7_vCM 3 #D51F26
## HT_8                       HT_8_cycling vCM #D51F26
## HT_9                          HT_9_pericyte #D51F26
## LI_0              LI_0_cycling erythroblast #3b46a3
## LI_1                      LI_1_hepatocyte 1 #3b46a3
## LI_10                     LI_10_endothelial #3b46a3
## LI_11               LI_11_B cell progenitor #3b46a3
## LI_12                   LI_12_megakaryocyte #3b46a3
## LI_13                   LI_13_cholangiocyte #3b46a3
## LI_2                    LI_2_erythroblast 1 #3b46a3
## LI_3                      LI_3_hepatocyte 2 #3b46a3
## LI_4                      LI_4_hepatocyte 3 #3b46a3
## LI_5                LI_5_early erythroblast #3b46a3
## LI_6                      LI_6_hepatocyte 4 #3b46a3
## LI_7                           LI_7_Kupffer #3b46a3
## LI_8                    LI_8_erythroblast 2 #3b46a3
## LI_9                          LI_9_stellate #3b46a3
## LU_0    LU_0_airway epithelial progenitor 1 #f0643e
## LU_1               LU_1_airway fibroblast 1 #f0643e
## LU_10  LU_10_airway epithelial progenitor 5 #f0643e
## LU_11                      LU_11_lymphatics #f0643e
## LU_12                      LU_12_macrophage #f0643e
## LU_13          LU_13_airway smooth muscle 2 #f0643e
## LU_14        LU_14_pulmonary neuroendocrine #f0643e
## LU_15                      LU_15_ciliated 2 #f0643e
## LU_16                     LU_16_mesothelial #f0643e
## LU_17                   LU_17_megakaryocyte #f0643e
## LU_2              LU_2_vascular endothelial #f0643e
## LU_3                        LU_3_ciliated 1 #f0643e
## LU_4            LU_4_airway smooth muscle 1 #f0643e
## LU_5    LU_5_airway epithelial progenitor 2 #f0643e
## LU_6                         LU_6_pericytes #f0643e
## LU_7               LU_7_airway fibroblast 2 #f0643e
## LU_8    LU_8_airway epithelial progenitor 3 #f0643e
## LU_9    LU_9_airway epithelial progenitor 4 #f0643e
## MU_0         MU_0_myocytes (fast/Type II) 1 #89C75F
## MU_1                   MU_1_smooth muscle 1 #89C75F
## MU_10        MU_10_myocytes (slow/Type I) 1 #89C75F
## MU_11                   MU_11_endothelial 3 #89C75F
## MU_12          MU_12_myogenic progenitors 2 #89C75F
## MU_13                 MU_13_keratinocytes 1 #89C75F
## MU_14                     MU_14_pericytes 1 #89C75F
## MU_15                     MU_15_macrophages #89C75F
## MU_16        MU_16_myocytes (slow/Type I) 2 #89C75F
## MU_17                       MU_17_myoblasts #89C75F
## MU_18                        MU_18_myocytes #89C75F
## MU_19                     MU_19_pericytes 2 #89C75F
## MU_2         MU_2_myocytes (fast/Type II) 2 #89C75F
## MU_20                 MU_20_keratinocytes 2 #89C75F
## MU_21          MU_21_myogenic progenitors 3 #89C75F
## MU_3            MU_3_myogenic progenitors 1 #89C75F
## MU_4                       MU_4_fibroblasts #89C75F
## MU_5                     MU_5_endothelial 1 #89C75F
## MU_6                     MU_6_endothelial 2 #89C75F
## MU_7               MU_7_myoblasts (cycling) #89C75F
## MU_8                   MU_8_smooth muscle 2 #89C75F
## MU_9                   MU_9_tenogenic cells #89C75F
## SK_0                      SK_0_fibroblast 1 #ad0773
## SK_1                      SK_1_fibroblast 2 #ad0773
## SK_10                      SK_10_melanocyte #ad0773
## SK_11               SK_11_skeletal muscle 2 #ad0773
## SK_12           SK_12_interfollicular cells #ad0773
## SK_13           SK_13_lymphatic endothelium #ad0773
## SK_14           SK_14_melanocyte progenitor #ad0773
## SK_15                      SK_15_macrophage #ad0773
## SK_16                    SK_16_fibroblast 6 #ad0773
## SK_17                  SK_17_keratinocyte 2 #ad0773
## SK_18            SK_18_epidermal progenitor #ad0773
## SK_2                    SK_2_keratinocyte 1 #ad0773
## SK_3                      SK_3_fibroblast 3 #ad0773
## SK_4              SK_4_vascular endothelium #ad0773
## SK_5                      SK_5_fibroblast 4 #ad0773
## SK_6                          SK_6_pericyte #ad0773
## SK_7                           SK_7_schwann #ad0773
## SK_8                 SK_8_skeletal muscle 1 #ad0773
## SK_9                      SK_9_fibroblast 5 #ad0773
## SP_0                      SP_0_Fibroblast 1 #3BBCA8
## SP_1                      SP_1_Fibroblast 2 #3BBCA8
## SP_10                    SP_10_Erythroblast #3BBCA8
## SP_11                        SP_11_Pericyte #3BBCA8
## SP_2          SP_2_Endothelial progenitor 1 #3BBCA8
## SP_3                           SP_3_B cells #3BBCA8
## SP_4                      SP_4_Fibroblast 3 #3BBCA8
## SP_5                        SP_5_Macrophage #3BBCA8
## SP_6          SP_6_Endothelial progenitor 2 #3BBCA8
## SP_7                      SP_7_Fibroblast 4 #3BBCA8
## SP_8                     SP_8_Megakaryocyte #3BBCA8
## SP_9                        SP_9_NK T cells #3BBCA8
## ST_0              ST_0_chief and neck cells #208A42
## ST_1                   ST_1_smooth muscle 1 #208A42
## ST_10                     ST_10_endothelial #208A42
## ST_11                 ST_11_cycling stromal #208A42
## ST_12                       ST_12_pericytes #208A42
## ST_13   ST_13_epithelial basal/keratinocyte #208A42
## ST_14     ST_14_interstitial cells of Cajal #208A42
## ST_15             ST_15_ciliated epithelium #208A42
## ST_16                 ST_16_endocrine cells #208A42
## ST_17                 ST_17_smooth muscle 4 #208A42
## ST_18             ST_18_MYH3+ smooth muscle #208A42
## ST_19                      ST_19_macrophage #208A42
## ST_2                   ST_2_smooth muscle 2 #208A42
## ST_20                      ST_20_lymphatics #208A42
## ST_21                     ST_21_mesothelial #208A42
## ST_3                    ST_3_parietal cells #208A42
## ST_4          ST_4_keratinocytes/tuft cells #208A42
## ST_5                     ST_5_fibroblasts 1 #208A42
## ST_6                     ST_6_fibroblasts 2 #208A42
## ST_7                   ST_7_smooth muscle 3 #208A42
## ST_8                      ST_8_enteric glia #208A42
## ST_9                   ST_9_enteric neurons #208A42
## TM_0            TM_0_CD8+ CD4+ thymocytes 1 #6E4B9E
## TM_1            TM_1_CD8+ CD4+ thymocytes 2 #6E4B9E
## TM_10          TM_10_vascular smooth muscle #6E4B9E
## TM_11                 TM_11_dendritic cells #6E4B9E
## TM_12                     TM_12_macrophages #6E4B9E
## TM_13                   TM_13_fibroblasts 2 #6E4B9E
## TM_14    TM_14_medullary TEC (myoid Type I) #6E4B9E
## TM_15                         TM_15_B cells #6E4B9E
## TM_16   TM_16_medullary TEC (neuromuscular) #6E4B9E
## TM_17                   TM_17_fibroblasts 3 #6E4B9E
## TM_2            TM_2_CD8+ CD4+ thymocytes 3 #6E4B9E
## TM_3  TM_3_medullary TEC (myoid Type IIa) 1 #6E4B9E
## TM_4  TM_4_medullary TEC (myoid Type IIa) 2 #6E4B9E
## TM_5                     TM_5_fibroblasts 1 #6E4B9E
## TM_6                      TM_6_cortical TEC #6E4B9E
## TM_7                 TM_7_endothelial cells #6E4B9E
## TM_8           TM_8_medullary TEC (myoid) 1 #6E4B9E
## TM_9           TM_9_medullary TEC (myoid) 2 #6E4B9E
## TR_0              TR_0_thyroid follicular 1 #8A9FD1
## TR_1              TR_1_thyroid follicular 2 #8A9FD1
## TR_10                     TR_10_endothelial #8A9FD1
## TR_11                     TR_11_parathyroid #8A9FD1
## TR_2              TR_2_thyroid follicular 3 #8A9FD1
## TR_3                           TR_3_stromal #8A9FD1
## TR_4                        TR_4_fibroblast #8A9FD1
## TR_5                   TR_5_skeletal muscle #8A9FD1
## TR_6              TR_6_thyroid follicular 4 #8A9FD1
## TR_7              TR_7_thyroid follicular 5 #8A9FD1
## TR_8              TR_8_thyroid follicular 6 #8A9FD1
## TR_9                     TR_9_smooth muscle #8A9FD1

5 Load RNA dendrogram order

# use RNA dendrogram order
rna_dend_order <- read.csv(here::here("output/02-global_analysis/02/cluster_metadata_dend_order.tsv"), sep="\t")

6 Load marker peaks

marker_peaks_all <- readRDS(here::here("output/01-preprocessing/03/markerPeaks_Clusters.rds"))

7 Lenient marker peak cutoff

Cutoff FDR <= 0.1 and Log2FC >=0.5

marker_peaks <- getMarkers(marker_peaks_all, cutOff = "FDR <= 0.1 & Log2FC >= 0.5")
marker_peaks

7.1 Clean up the marker peaks and remove duplicates

# unique(GRanges) only dedups based on genomic ranges not considering other columns
tmp <- marker_peaks %>% unlist %>% as.data.frame %>% rownames_to_column(var="organ") %>% GRanges %>% unique
tmp <- tmp %>% as.data.frame
marker_peaks_unique <- tmp[,c("seqnames", "start", "end")]
marker_peaks_unique

7.2 Get pseudobulked Peak Matrix

pb_peak <- readRDS(here::here("output/01-preprocessing/03/allorgan_peakmatrix_pseudobulked.rds"))

# filter for marker peaks only
rowData(pb_peak)$rowid <- rownames(rowData(pb_peak))
marker_df <- merge(rowData(pb_peak), marker_peaks_unique)
pb_peak_marker <- pb_peak[marker_df$rowid,]
saveRDS(pb_peak_marker, file.path(out, "pseudobulked_marker_peak_matrix.rds"))
pb_peak_marker

7.2.1 Run correlation on marker peak matrix

pb_peak_marker <- readRDS(file.path(out, "pseudobulked_marker_peak_matrix.rds"))
mat <- pb_peak_marker@assays@data$PeakMatrix
cluster_pb <- cor(mat)
dend_res_pb <- build_dend(cluster_pb, n_boot = 100)
saveRDS(dend_res_pb, file.path(out, "dend_res_markerpeak_pseudobulked.rds"))
dend_res_pb <- readRDS(file.path(out, "dend_res_markerpeak_pseudobulked.rds"))
dend_labeled_pb <- dend_res_pb$dend

7.2.2 Plot correlation based on pseudobulk

clust_order <- rev(order.dendrogram(dend_labeled_pb))

dff1 <- cluster_pb[clust_order, clust_order]
ht1 <- Heatmap(dff1, name="Pseudobulked marker peaks \ncount correlations",
               cluster_columns = F,
               cluster_rows = F,
               row_labels = all.annots[colnames(cluster_pb)[clust_order], "Cluster_labelled"],
               row_names_gp = gpar(fontsize = 8, col=all.annots[colnames(cluster_pb)[clust_order], "Color"]),
               column_labels = all.annots[colnames(cluster_pb)[clust_order], "Cluster_labelled"],
               column_names_gp = gpar(fontsize = 8, col=all.annots[colnames(cluster_pb)[clust_order], "Color"]),
               col = cmap_chromvar
)

all.annots.rnadend <- merge(all.annots, rna_dend_order[,c("Cluster", "Order")], by.x="L0_clusterID", by.y="Cluster", all.x=T)
rownames(all.annots.rnadend) <- all.annots.rnadend$L0_clusterID
all.annots.rnadend <- all.annots.rnadend[colnames(cluster_pb),] %>% mutate(origOrder=1:dim(all.annots.rnadend)[1]) %>% arrange(by=Order)
rownames(all.annots.rnadend) <- all.annots.rnadend$L0_clusterID

# plot by RNA dendrogram order 
clust_order <- rev(all.annots.rnadend$origOrder)
dff2 <- cluster_pb[clust_order, clust_order]

ht2 <- Heatmap(dff2, name="Pseudobulked marker peaks \ncount correlations",
               cluster_columns = F,
               cluster_rows = F,
               row_labels = all.annots.rnadend[colnames(cluster_pb)[clust_order], "Cluster_labelled"],
               row_names_gp = gpar(fontsize = 8, col=all.annots.rnadend[colnames(cluster_pb)[clust_order], "Color"]),
               column_labels = all.annots.rnadend[colnames(cluster_pb)[clust_order], "Cluster_labelled"],
               column_names_gp = gpar(fontsize = 8, col=all.annots.rnadend[colnames(cluster_pb)[clust_order], "Color"]),
               col = cmap_chromvar
)

# draw
draw(ht1)

draw(ht2)

7.3 ChromVAR on pseudobulked Peak Matrix

chromvar_pb <- pb_peak_marker

# convert into a RangedSummarizedExperiment
allseqinfo <- BSgenome.Hsapiens.UCSC.hg38@seqinfo
seqlevels(allseqinfo) <- c(paste0("chr",1:22),"chrX")
marker_peaks <- GRanges(seqnames = rowData(chromvar_pb)$seqnames,IRanges(rowData(chromvar_pb)$start, rowData(chromvar_pb)$end), seqinfo = allseqinfo)
rowRanges(chromvar_pb) <- marker_peaks
assayNames(chromvar_pb) <- "counts"

# add gc bias, filter, motif matching
chromvar_pb <- addGCBias(chromvar_pb, genome = BSgenome.Hsapiens.UCSC.hg38)
#chromvar_pb <- filterPeaks(chromvar_pb)
#chromvar_pb.filt <- filterPeaks(chromvar_pb, min_fragments_per_peak = 1000)
saveRDS(chromvar_pb, file.path(out, "marker_peaks_pseudobulk_bias.rds"))

motifs <- readRDS(here::here("data/external/Kartha2022_cisbp/cisBP_human_pfms_2021.rds")) # this is from Kartha et al 2022 Cell Genomics

motif_ix <- matchMotifs(motifs, chromvar_pb,
                        genome = BSgenome.Hsapiens.UCSC.hg38)
saveRDS(motif_ix, file.path(out,"marker_peaks_pseudobulk_matched_motif_cisbp2021JB.rds"))

# computing deviations
all.dev <- computeDeviations(object = chromvar_pb,
                         annotations = motif_ix)
saveRDS(all.dev, file.path(out, "marker_peaks_pseudobulk_chromvar.rds"))

7.3.1 Run correlation on chromvar deviation z score matrix

all.dev <- readRDS(file.path(out, "marker_peaks_pseudobulk_chromvar.rds"))
mat <- all.dev@assays@data$z
cluster_chromvar <- cor(mat)
cluster_chromvar_feat <- cor(t(mat))
# cluster columns (cell clusters)
dend_res_chromvar <- build_dend(cluster_chromvar, n_boot = 100)
saveRDS(dend_res_chromvar, file.path(out, "dend_res_markerpeak_chromvar.rds"))

# cluster rows (features)
dend_res_chromvar_feat <- build_dend(cluster_chromvar_feat, n_boot = 100)
saveRDS(dend_res_chromvar_feat, file.path(out, "dend_res_markerpeak_chromvar_feat.rds"))
dend_res_chromvar <- readRDS(file.path(out, "dend_res_markerpeak_chromvar.rds"))
dend_labeled_chromvar <- dend_res_chromvar$dend

dend_res_chromvar_feat <- readRDS(file.path(out, "dend_res_markerpeak_chromvar_feat.rds"))
dend_labeled_chromvar_feat <- dend_res_chromvar_feat$dend

7.3.2 Plot TF vs cluster heatmap

clust_order <- rev(order.dendrogram(dend_labeled_chromvar))
feat_order <- rev(order.dendrogram(dend_labeled_chromvar_feat))
df <- mat[feat_order, clust_order]

# Calculate breaks based on quantiles to handle outliers
break_points <- quantile(df, probs = seq(0.01, 0.99, length.out = length(cmap_chromvar)))
color_mapping <- colorRamp2(break_points, cmap_chromvar)

ht1 <- Heatmap(df, name="ChromVAR deviations z-score",
               cluster_columns = F,
               cluster_rows = F,
               row_names_gp = gpar(fontsize = 4),
               column_labels = all.annots[colnames(df), "Cluster_labelled"],
               column_names_gp = gpar(fontsize = 8, col=all.annots[colnames(df), "Color"]),
               col = color_mapping
)
draw(ht1)

# instead of the dendrograms we built, try ComplexHeatmap built in hierarchical clustering
ht2 <- Heatmap(mat, name="ChromVAR deviations z-score",
               cluster_columns = T,
               cluster_rows = T,
               row_names_gp = gpar(fontsize = 4),
               column_labels = all.annots[colnames(mat), "Cluster_labelled"],
               column_names_gp = gpar(fontsize = 8, col=all.annots[colnames(mat), "Color"]),
               col = color_mapping
               )

draw(ht2)

all.annots.rnadend <- merge(all.annots, rna_dend_order[,c("Cluster", "Order")], by.x="L0_clusterID", by.y="Cluster", all.x=T)
rownames(all.annots.rnadend) <- all.annots.rnadend$L0_clusterID
all.annots.rnadend <- all.annots.rnadend[colnames(mat),] %>% mutate(origOrder=1:dim(all.annots.rnadend)[1]) %>% arrange(by=Order)
rownames(all.annots.rnadend) <- all.annots.rnadend$L0_clusterID

# plot by RNA dendrogram order 
clust_order <- rev(all.annots.rnadend$origOrder)
feat_order <- rev(order.dendrogram(dend_labeled_chromvar_feat))
df <- mat[feat_order, clust_order]

ht3 <- Heatmap(df, name="ChromVAR deviations z-score",
               cluster_columns = F,
               cluster_rows = F,
               row_names_gp = gpar(fontsize = 4),
               column_labels = all.annots.rnadend[colnames(df), "Cluster_labelled"],
               column_names_gp = gpar(fontsize = 8, col=all.annots.rnadend[colnames(df), "Color"]),
               col = color_mapping
               )

draw(ht3)

7.3.3 Plot correlation based on chromvar

clust_order <- rev(order.dendrogram(dend_labeled_chromvar))

dff1 <- cluster_chromvar[clust_order, clust_order]
ht1 <- Heatmap(dff1, name="ChromVAR deviations \nz score correlations",
               cluster_columns = F,
               cluster_rows = F,
               row_labels = all.annots[colnames(cluster_chromvar)[clust_order], "Cluster_labelled"],
               row_names_gp = gpar(fontsize = 8, col=all.annots[colnames(cluster_chromvar)[clust_order], "Color"]),
               column_labels = all.annots[colnames(cluster_chromvar)[clust_order], "Cluster_labelled"],
               column_names_gp = gpar(fontsize = 8, col=all.annots[colnames(cluster_chromvar)[clust_order], "Color"]),
               col = cmap_chromvar
)

all.annots.rnadend <- merge(all.annots, rna_dend_order[,c("Cluster", "Order")], by.x="L0_clusterID", by.y="Cluster", all.x=T)
rownames(all.annots.rnadend) <- all.annots.rnadend$L0_clusterID
all.annots.rnadend <- all.annots.rnadend[colnames(cluster_chromvar),] %>% mutate(origOrder=1:dim(all.annots.rnadend)[1]) %>% arrange(by=Order)
rownames(all.annots.rnadend) <- all.annots.rnadend$L0_clusterID


# plot by RNA dendrogram order 
clust_order <- rev(all.annots.rnadend$origOrder)
dff2 <- cluster_chromvar[clust_order, clust_order]

ht2 <- Heatmap(dff2, name="ChromVAR deviations \nz score correlations",
               cluster_columns = F,
               cluster_rows = F,
               row_labels = all.annots.rnadend[colnames(cluster_chromvar)[clust_order], "Cluster_labelled"],
               #row_title = paste0("ChromVAR Deviations (",length(tf.set), " TFs)"),
               #row_title_side = "left",
               row_names_gp = gpar(fontsize = 8, col=all.annots.rnadend[colnames(cluster_chromvar)[clust_order], "Color"]),
               column_labels = all.annots.rnadend[colnames(cluster_chromvar)[clust_order], "Cluster_labelled"],
               column_names_gp = gpar(fontsize = 8, col=all.annots.rnadend[colnames(cluster_chromvar)[clust_order], "Color"]),
               col = cmap_chromvar
)

# draw
draw(ht1)

draw(ht2)

### Run correlation, filter for top half variable tf only

#all.dev <- readRDS(file.path(out, "marker_peaks_pseudobulk_chromvar.rds"))
mat <- all.dev@assays@data$z

# identify tf subset with most variability
maxz <- rowMaxs(mat)
cutoff <- maxz %>% quantile(0.5)
mat.filtered <- mat[which(maxz>cutoff),]
tf.set <- rownames(mat.filtered)

cluster_chromvar <- cor(mat.filtered)
cluster_chromvar_feat <- cor(t(mat.filtered))
# cluster columns (cell clusters)
dend_res_chromvar <- build_dend(cluster_chromvar, n_boot = 100)
saveRDS(dend_res_chromvar, file.path(out, "dend_res_markerpeak_chromvar_tophalfchromvarz.rds"))

# cluster rows (features)
dend_res_chromvar_feat <- build_dend(cluster_chromvar_feat, n_boot = 100)
saveRDS(dend_res_chromvar_feat, file.path(out, "dend_res_markerpeak_chromvar_feat_tophalfchromvarz.rds"))
dend_res_chromvar <- readRDS(file.path(out, "dend_res_markerpeak_chromvar_tophalfchromvarz.rds"))
dend_labeled_chromvar <- dend_res_chromvar$dend

dend_res_chromvar_feat <- readRDS(file.path(out, "dend_res_markerpeak_chromvar_feat_tophalfchromvarz.rds"))
dend_labeled_chromvar_feat <- dend_res_chromvar_feat$dend

7.3.4 Plot correlation, filter for top half variable tf only

clust_order <- rev(order.dendrogram(dend_labeled_chromvar))

dff1 <- cluster_chromvar[clust_order, clust_order]
ht1 <- Heatmap(dff1, name="ChromVAR deviations \nz score correlations",
               cluster_columns = F,
               cluster_rows = F,
               row_labels = all.annots[colnames(cluster_chromvar)[clust_order], "Cluster_labelled"],
               row_names_gp = gpar(fontsize = 8, col=all.annots[colnames(cluster_chromvar)[clust_order], "Color"]),
               row_title = paste0("ChromVAR Deviations (",length(tf.set), " TFs)"),
               row_title_side = "left",
               column_labels = all.annots.rnadend[colnames(cluster_chromvar)[clust_order], "Cluster_labelled"],
               column_names_gp = gpar(fontsize = 8, col=all.annots[colnames(cluster_chromvar)[clust_order], "Color"]),
               col = cmap_chromvar
)

all.annots.rnadend <- merge(all.annots, rna_dend_order[,c("Cluster", "Order")], by.x="L0_clusterID", by.y="Cluster", all.x=T)
rownames(all.annots.rnadend) <- all.annots.rnadend$L0_clusterID
all.annots.rnadend <- all.annots.rnadend[colnames(cluster_chromvar),] %>% mutate(origOrder=1:dim(all.annots.rnadend)[1]) %>% arrange(by=Order)
rownames(all.annots.rnadend) <- all.annots.rnadend$L0_clusterID


# plot by RNA dendrogram order 
clust_order <- rev(all.annots.rnadend$origOrder)
dff2 <- cluster_chromvar[clust_order, clust_order]

ht2 <- Heatmap(dff2, name="ChromVAR deviations \nz score correlations",
               cluster_columns = F,
               cluster_rows = F,
               row_labels = all.annots.rnadend[colnames(cluster_chromvar)[clust_order], "Cluster_labelled"],
               row_title = paste0("ChromVAR Deviations (",length(tf.set), " TFs)"),
               row_title_side = "left",
               row_names_gp = gpar(fontsize = 8, col=all.annots.rnadend[colnames(cluster_chromvar)[clust_order], "Color"]),
               column_labels = all.annots.rnadend[colnames(cluster_chromvar)[clust_order], "Cluster_labelled"],
               column_names_gp = gpar(fontsize = 8, col=all.annots.rnadend[colnames(cluster_chromvar)[clust_order], "Color"]),
               col = cmap_chromvar
)

# draw
draw(ht1)

draw(ht2)

7.3.5 Plot TF vs cluster heatmap, top half variable tf only

clust_order <- rev(order.dendrogram(dend_labeled_chromvar))
feat_order <- rev(order.dendrogram(dend_labeled_chromvar_feat))
df <- mat.filtered[feat_order, clust_order]

# Calculate breaks based on quantiles to handle outliers
break_points <- quantile(df, probs = seq(0.01, 0.99, length.out = length(cmap_chromvar)))
color_mapping <- colorRamp2(break_points, cmap_chromvar)

ht1 <- Heatmap(df, name="ChromVAR deviations z-score",
               cluster_columns = F,
               cluster_rows = F,
               row_names_gp = gpar(fontsize = 6),
               column_labels = all.annots[colnames(cluster_chromvar)[clust_order], "Cluster_labelled"],
               column_names_gp = gpar(fontsize = 8, col=all.annots[colnames(cluster_chromvar)[clust_order], "Color"]),
               col = color_mapping
)
draw(ht1)

# instead of the dendrograms we built, try ComplexHeatmap built in hierarchical clustering
ht2 <- Heatmap(mat.filtered, name="ChromVAR deviations z-score",
               cluster_columns = T,
               cluster_rows = T,
               row_names_gp = gpar(fontsize = 6),
               column_labels = all.annots[colnames(mat), "Cluster_labelled"],
               column_names_gp = gpar(fontsize = 8, col=all.annots[colnames(mat), "Color"]),
               col = color_mapping
               )

draw(ht2)

all.annots.rnadend <- merge(all.annots, rna_dend_order[,c("Cluster", "Order")], by.x="L0_clusterID", by.y="Cluster", all.x=T)
rownames(all.annots.rnadend) <- all.annots.rnadend$L0_clusterID
all.annots.rnadend <- all.annots.rnadend[colnames(mat.filtered),] %>% mutate(origOrder=1:dim(all.annots.rnadend)[1]) %>% arrange(by=Order)
rownames(all.annots.rnadend) <- all.annots.rnadend$L0_clusterID

# plot by RNA dendrogram order 
clust_order <- rev(all.annots.rnadend$origOrder)
feat_order <- rev(order.dendrogram(dend_labeled_chromvar_feat))
df <- mat.filtered[feat_order, clust_order]

ht3 <- Heatmap(df, name="ChromVAR deviations z-score",
               cluster_columns = F,
               cluster_rows = F,
               row_names_gp = gpar(fontsize = 7),
               column_labels = all.annots.rnadend[colnames(df), "Cluster_labelled"],
               column_names_gp = gpar(fontsize = 8, col=all.annots.rnadend[colnames(df), "Color"]),
               col = color_mapping
               )

draw(ht3)

7.3.6 Plot TF vs cluster heatmap, manually selected TFs only

source(here::here("output/01-preprocessing/02/shared/markergenes/markergenes_dendro.R"))

mat <- all.dev@assays@data$z

mat.filtered <- mat[TFSets[TFSets %in% rownames(mat)],]
tf.set <- rownames(mat.filtered)

all.annots.rnadend <- merge(all.annots, rna_dend_order[,c("Cluster", "Order")], by.x="L0_clusterID", by.y="Cluster", all.x=T)
rownames(all.annots.rnadend) <- all.annots.rnadend$L0_clusterID
all.annots.rnadend <- all.annots.rnadend[colnames(mat.filtered),] %>% mutate(origOrder=1:dim(all.annots.rnadend)[1]) %>% arrange(by=Order)
rownames(all.annots.rnadend) <- all.annots.rnadend$L0_clusterID

# plot by RNA dendrogram order 
clust_order <- all.annots.rnadend$origOrder
df <- mat.filtered[, clust_order]

# Calculate breaks based on quantiles to handle outliers
# break_points <- quantile(df, probs = seq(0.1, 0.9, length.out = length(cmap_chromvar)))
break_points <- quantile(df, probs=c(0.05, 0.06, 0.1, 0.15, 0.5, 0.85, 0.9, 0.94, 0.95))
color_mapping <- colorRamp2(break_points, cmap_chromvar)


ht3 <- Heatmap(df, name="ChromVAR deviations z-score",
               cluster_columns = F,
               cluster_rows = F,
               row_names_gp = gpar(fontsize = 7),
               column_labels = all.annots.rnadend[colnames(df), "Cluster_labelled"],
               column_names_gp = gpar(fontsize = 8, col=all.annots.rnadend[colnames(df), "Color"]),
               col = color_mapping
               )

draw(ht3)

# Calculate breaks based on quantiles to handle outliers
cmap_whitered <- c("white", "red")
break_points <- quantile(df, probs = seq(0.1, 0.9, length.out = length(cmap_whitered)))
color_mapping <- colorRamp2(break_points, colors = cmap_whitered)


ht4 <- Heatmap(df, name="ChromVAR deviations z-score",
               cluster_columns = F,
               cluster_rows = F,
               row_names_gp = gpar(fontsize = 7),
               column_labels = all.annots.rnadend[colnames(df), "Cluster_labelled"],
               column_names_gp = gpar(fontsize = 8, col=all.annots.rnadend[colnames(df), "Color"]),
               col = color_mapping
               )

draw(ht4)

8 Session info

.libPaths()
## [1] "/oak/stanford/groups/wjg/bliu/software/R_lib"     
## [2] "/share/software/user/open/R/4.1.2/lib64/R/library"
sessionInfo()
## R version 4.1.2 (2021-11-01)
## Platform: x86_64-pc-linux-gnu (64-bit)
## Running under: CentOS Linux 7 (Core)
## 
## Matrix products: default
## BLAS/LAPACK: /share/software/user/open/openblas/0.3.10/lib/libopenblas_haswellp-r0.3.10.so
## 
## locale:
##  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
##  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
##  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
##  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
##  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
## [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       
## 
## attached base packages:
## [1] stats4    grid      stats     graphics  grDevices utils     datasets 
## [8] methods   base     
## 
## other attached packages:
##  [1] ggrastr_1.0.1                     GenomicFeatures_1.46.5           
##  [3] AnnotationDbi_1.56.2              circlize_0.4.15                  
##  [5] motifmatchr_1.16.0                chromVAR_1.16.0                  
##  [7] ComplexHeatmap_2.10.0             dendextend_1.17.1                
##  [9] BSgenome.Hsapiens.UCSC.hg38_1.4.4 BSgenome_1.62.0                  
## [11] rtracklayer_1.54.0                Biostrings_2.62.0                
## [13] XVector_0.34.0                    SeuratObject_4.1.3               
## [15] Seurat_4.3.0                      cowplot_1.1.1                    
## [17] tibble_3.2.1                      readr_2.1.4                      
## [19] glue_1.6.2                        purrr_1.0.2                      
## [21] tidyr_1.3.1                       dplyr_1.1.4                      
## [23] rhdf5_2.38.1                      SummarizedExperiment_1.24.0      
## [25] Biobase_2.54.0                    MatrixGenerics_1.6.0             
## [27] Rcpp_1.0.10                       Matrix_1.5-4                     
## [29] GenomicRanges_1.46.1              GenomeInfoDb_1.30.1              
## [31] IRanges_2.28.0                    S4Vectors_0.32.4                 
## [33] BiocGenerics_0.40.0               matrixStats_0.63.0               
## [35] data.table_1.14.8                 stringr_1.5.0                    
## [37] plyr_1.8.8                        magrittr_2.0.3                   
## [39] ggplot2_3.5.0                     gtable_0.3.3                     
## [41] gtools_3.9.4                      gridExtra_2.3                    
## [43] ArchR_1.0.2                       here_1.0.1                       
## 
## loaded via a namespace (and not attached):
##   [1] utf8_1.2.3                  R.utils_2.12.2             
##   [3] spatstat.explore_3.1-0      reticulate_1.28            
##   [5] tidyselect_1.2.0            poweRlaw_0.70.6            
##   [7] RSQLite_2.3.1               htmlwidgets_1.6.2          
##   [9] BiocParallel_1.28.3         Rtsne_0.16                 
##  [11] munsell_0.5.0               codetools_0.2-18           
##  [13] ica_1.0-3                   DT_0.27                    
##  [15] future_1.33.2               miniUI_0.1.1.1             
##  [17] withr_3.0.0                 spatstat.random_3.1-4      
##  [19] colorspace_2.1-0            progressr_0.13.0           
##  [21] filelock_1.0.2              highr_0.10                 
##  [23] knitr_1.42                  ROCR_1.0-11                
##  [25] tensor_1.5                  listenv_0.9.0              
##  [27] GenomeInfoDbData_1.2.7      polyclip_1.10-4            
##  [29] bit64_4.0.5                 rprojroot_2.0.3            
##  [31] parallelly_1.35.0           vctrs_0.6.5                
##  [33] generics_0.1.3              xfun_0.39                  
##  [35] BiocFileCache_2.2.1         R6_2.5.1                   
##  [37] doParallel_1.0.17           ggbeeswarm_0.7.2           
##  [39] clue_0.3-64                 bitops_1.0-7               
##  [41] rhdf5filters_1.6.0          spatstat.utils_3.0-2       
##  [43] cachem_1.0.8                DelayedArray_0.20.0        
##  [45] vroom_1.6.3                 promises_1.2.0.1           
##  [47] BiocIO_1.4.0                scales_1.3.0               
##  [49] beeswarm_0.4.0              globals_0.16.2             
##  [51] goftest_1.2-3               seqLogo_1.60.0             
##  [53] rlang_1.1.3                 GlobalOptions_0.1.2        
##  [55] splines_4.1.2               lazyeval_0.2.2             
##  [57] spatstat.geom_3.1-0         yaml_2.3.7                 
##  [59] reshape2_1.4.4              abind_1.4-5                
##  [61] httpuv_1.6.10               tools_4.1.2                
##  [63] ellipsis_0.3.2              jquerylib_0.1.4            
##  [65] RColorBrewer_1.1-3          ggridges_0.5.4             
##  [67] progress_1.2.2              zlibbioc_1.40.0            
##  [69] RCurl_1.98-1.12             prettyunits_1.1.1          
##  [71] deldir_1.0-6                pbapply_1.7-0              
##  [73] GetoptLong_1.0.5            viridis_0.6.3              
##  [75] zoo_1.8-12                  ggrepel_0.9.5              
##  [77] cluster_2.1.2               magick_2.7.3               
##  [79] scattermore_1.0             lmtest_0.9-40              
##  [81] RANN_2.6.1                  fitdistrplus_1.1-11        
##  [83] hms_1.1.3                   patchwork_1.2.0            
##  [85] mime_0.12                   evaluate_0.21              
##  [87] xtable_1.8-4                XML_3.99-0.14              
##  [89] shape_1.4.6                 biomaRt_2.50.3             
##  [91] compiler_4.1.2              KernSmooth_2.23-20         
##  [93] crayon_1.5.2                R.oo_1.25.0                
##  [95] htmltools_0.5.5             later_1.3.1                
##  [97] tzdb_0.4.0                  TFBSTools_1.32.0           
##  [99] DBI_1.1.3                   dbplyr_2.3.2               
## [101] rappdirs_0.3.3              MASS_7.3-54                
## [103] cli_3.6.2                   R.methodsS3_1.8.2          
## [105] parallel_4.1.2              igraph_1.4.2               
## [107] pkgconfig_2.0.3             TFMPvalue_0.0.9            
## [109] GenomicAlignments_1.30.0    sp_1.6-0                   
## [111] plotly_4.10.1               spatstat.sparse_3.0-1      
## [113] xml2_1.3.4                  foreach_1.5.2              
## [115] annotate_1.72.0             vipor_0.4.5                
## [117] DirichletMultinomial_1.36.0 bslib_0.4.2                
## [119] digest_0.6.31               pracma_2.4.2               
## [121] sctransform_0.3.5           RcppAnnoy_0.0.20           
## [123] CNEr_1.30.0                 spatstat.data_3.0-1        
## [125] rmarkdown_2.21              leiden_0.4.2               
## [127] uwot_0.1.14                 curl_5.0.0                 
## [129] restfulr_0.0.15             shiny_1.7.4                
## [131] Rsamtools_2.10.0            rjson_0.2.21               
## [133] lifecycle_1.0.3             nlme_3.1-153               
## [135] jsonlite_1.8.4              Rhdf5lib_1.16.0            
## [137] viridisLite_0.4.2           fansi_1.0.4                
## [139] pillar_1.9.0                lattice_0.20-45            
## [141] GO.db_3.14.0                KEGGREST_1.34.0            
## [143] fastmap_1.1.1               httr_1.4.6                 
## [145] survival_3.2-13             png_0.1-8                  
## [147] iterators_1.0.14            bit_4.0.5                  
## [149] stringi_1.7.12              sass_0.4.6                 
## [151] blob_1.2.4                  memoise_2.0.1              
## [153] caTools_1.18.2              irlba_2.3.5.1              
## [155] future.apply_1.10.0