Last updated: 2022-12-06

Checks: 6 1

Knit directory: synovialscrnaseq/

This reproducible R Markdown analysis was created with workflowr (version 1.6.2). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.


The R Markdown file has unstaged changes. To know which version of the R Markdown file created these results, you’ll want to first commit it to the Git repo. If you’re still working on the analysis, you can ignore this warning. When you’re finished, you can run wflow_publish to commit the R Markdown file and build the HTML.

Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.

The command set.seed(20210105) was run prior to running the code in the R Markdown file. Setting a seed ensures that any results that rely on randomness, e.g. subsampling or permutations, are reproducible.

Great job! Recording the operating system, R version, and package versions is critical for reproducibility.

Nice! There were no cached chunks for this analysis, so you can be confident that you successfully produced the results during this run.

Great job! Using relative paths to the files within your workflowr project makes it easier to run your code on other machines.

Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility.

The results in this page were generated with repository version 816d5c9. See the Past versions tab to see a history of the changes made to the R Markdown and HTML files.

Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use wflow_publish or wflow_git_commit). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:


Ignored files:
    Ignored:    '/
    Ignored:    .Rhistory
    Ignored:    .Rproj.user/
    Ignored:    .empty/
    Ignored:    analysis/.Rhistory
    Ignored:    analysis/iSEE_interactive_document.html
    Ignored:    code/test_files/
    Ignored:    data/Culemann/
    Ignored:    data/E-MTAB-8322/
    Ignored:    data/Synovial scRNA-seq samples - Sheet1.csv
    Ignored:    data/Zhang_top20_singlecell_cluster_markers_fromGithub.csv
    Ignored:    data/findMarkers_results.rds
    Ignored:    data/findMarkers_results_v2.rds
    Ignored:    data/info/
    Ignored:    data/syn_sce_tidy_filtered.rds
    Ignored:    data/syn_sce_tidy_hvg.rds
    Ignored:    data/syn_sce_tidy_hvg_cms.rds
    Ignored:    docs/
    Ignored:    output/Figures_Paper/
    Ignored:    output/Sample_summaries_RA_comparisons.rds
    Ignored:    output/Sample_summaries_direct_dissociation.rds
    Ignored:    output/Sample_summaries_exvivo_treatment.rds
    Ignored:    output/Suppl_Figure_4d.rds
    Ignored:    output/barcodes.txt
    Ignored:    output/count_matrix_unfiltered.mtx
    Ignored:    output/emptyDrops_result_v4.rds
    Ignored:    output/emptyDrops_result_v4_tmp.rds
    Ignored:    output/emptyDrops_result_v4tmptmp.rds
    Ignored:    output/entropies_fstat_v5_ec.rds
    Ignored:    output/entropies_fstat_v5_main.rds
    Ignored:    output/entropies_fstat_v5_mp.rds
    Ignored:    output/entropies_fstat_v5_sf.rds
    Ignored:    output/entropies_fstat_v5_tc.rds
    Ignored:    output/findMarkers_results_v5_ec.rds
    Ignored:    output/findMarkers_results_v5_main.rds
    Ignored:    output/findMarkers_results_v5_mp.rds
    Ignored:    output/findMarkers_results_v5_sf.rds
    Ignored:    output/findMarkers_results_v5_tc.rds
    Ignored:    output/findMarkers_results_v6.rds
    Ignored:    output/findMarkers_results_v6_ec.rds
    Ignored:    output/findMarkers_results_v6_main.rds
    Ignored:    output/findMarkers_results_v6_mp.rds
    Ignored:    output/findMarkers_results_v6_sf.rds
    Ignored:    output/findMarkers_results_v6_tc.rds
    Ignored:    output/findMarkers_results_v7_ec.rds
    Ignored:    output/findMarkers_results_v7_main.rds
    Ignored:    output/findMarkers_results_v7_mp.rds
    Ignored:    output/findMarkers_results_v7_sf.rds
    Ignored:    output/findMarkers_results_v7_tc.rds
    Ignored:    output/genes.txt
    Ignored:    output/goana_results_v6_ec.rds
    Ignored:    output/goana_results_v6_mp.rds
    Ignored:    output/preprocessing_number_of_cells.rds
    Ignored:    output/syn_v4_sce_emptyDrops_invivo.rds
    Ignored:    output/syn_v4_swappedDrops_24300_after.rds
    Ignored:    output/syn_v4_swappedDrops_24300_before.rds
    Ignored:    output/syn_v4_swappedDrops_24793_after.rds
    Ignored:    output/syn_v4_swappedDrops_24793_before.rds
    Ignored:    output/syn_v5_annot_df_manual.rds
    Ignored:    output/syn_v5_cluster_cellid_match_invivo.rds
    Ignored:    output/syn_v5_clustering_lookup_invivo.rds
    Ignored:    output/syn_v5_clustering_lookup_multiple_invivo.rds
    Ignored:    output/syn_v5_res_da_Accute_inflammation_invivo.rds
    Ignored:    output/syn_v5_res_da_Diagnosis_invivo.rds
    Ignored:    output/syn_v5_res_da_Diagnosis_main_invivo.rds
    Ignored:    output/syn_v5_res_da_Lymphoid_folicles_invivo.rds
    Ignored:    output/syn_v5_res_da_Pathotype_invivo.rds
    Ignored:    output/syn_v5_res_da_Therapy_invivo.rds
    Ignored:    output/syn_v5_res_da_Vascularisation_bin_invivo.rds
    Ignored:    output/syn_v5_res_ds_Accute_inflammation_invivo.rds
    Ignored:    output/syn_v5_res_ds_Diagnosis_invivo.rds
    Ignored:    output/syn_v5_res_ds_Diagnosis_main_invivo.rds
    Ignored:    output/syn_v5_res_ds_Lymphoid_folicles_invivo.rds
    Ignored:    output/syn_v5_res_ds_Pathotype_invivo.rds
    Ignored:    output/syn_v5_res_ds_Therapy_invivo.rds
    Ignored:    output/syn_v5_res_ds_Vascularisation_bin_invivo.rds
    Ignored:    output/syn_v5_sce.rds
    Ignored:    output/syn_v5_sce_ec_invivo.rds
    Ignored:    output/syn_v5_sce_filtered_invivo.rds
    Ignored:    output/syn_v5_sce_hvg_cms_doublet_annot_manual_invivo.rds
    Ignored:    output/syn_v5_sce_hvg_cms_doublet_cmstest_invivo.rds
    Ignored:    output/syn_v5_sce_hvg_cms_doublet_invivo.rds
    Ignored:    output/syn_v5_sce_hvg_cms_doublet_subcluster_invivo.rds
    Ignored:    output/syn_v5_sce_hvg_invivo.rds
    Ignored:    output/syn_v5_sce_mp_invivo.rds
    Ignored:    output/syn_v5_sce_sf_invivo.rds
    Ignored:    output/syn_v5_sce_tc_invivo.rds
    Ignored:    output/syn_v5_vst_out_invivo.rds
    Ignored:    output/syn_v6_cluster_cellid_match_invivo.rds
    Ignored:    output/syn_v6_clustering_lookup_invivo.rds
    Ignored:    output/syn_v6_clustering_lookup_multiple_invivo.rds
    Ignored:    output/syn_v6_sce.rds
    Ignored:    output/syn_v6_sce_Figure8.rds
    Ignored:    output/syn_v6_sce_Figure8_dic_ls.rds
    Ignored:    output/syn_v6_sce_ec_invivo.rds
    Ignored:    output/syn_v6_sce_filtered_invivo.rds
    Ignored:    output/syn_v6_sce_hdf5/
    Ignored:    output/syn_v6_sce_hvg_cms_doublet_invivo.rds
    Ignored:    output/syn_v6_sce_hvg_cms_doublet_subcluster_invivo.rds
    Ignored:    output/syn_v6_sce_hvg_invivo.rds
    Ignored:    output/syn_v6_sce_hvg_marker_genes.rds
    Ignored:    output/syn_v6_sce_mp_invivo.rds
    Ignored:    output/syn_v6_sce_sf_invivo.rds
    Ignored:    output/syn_v6_sce_tc_invivo.rds
    Ignored:    output/syn_v6_sfig1.rds
    Ignored:    output/syn_v6_vst_out_invivo.rds
    Ignored:    output/syn_v7_cluster_cellid_match_invivo.rds
    Ignored:    output/syn_v7_clustering_lookup_invivo.rds
    Ignored:    output/syn_v7_clustering_lookup_multiple_invivo.rds
    Ignored:    output/syn_v7_sce.rds
    Ignored:    output/syn_v7_sce_ec_invivo.rds
    Ignored:    output/syn_v7_sce_filtered_invivo.rds
    Ignored:    output/syn_v7_sce_hdf5/
    Ignored:    output/syn_v7_sce_hvg_cms_doublet_invivo.rds
    Ignored:    output/syn_v7_sce_hvg_cms_doublet_subcluster_invivo.rds
    Ignored:    output/syn_v7_sce_hvg_invivo.rds
    Ignored:    output/syn_v7_sce_mp_invivo.rds
    Ignored:    output/syn_v7_sce_sf_invivo.rds
    Ignored:    output/syn_v7_sce_tc_invivo.rds
    Ignored:    output/syn_v7_sfig1.rds
    Ignored:    output/syn_v7_vst_out_invivo.rds

Untracked files:
    Untracked:  analysis/scRNAseq_complete_01_preprocessing_comparison.Rmd
    Untracked:  analysis/scRNAseq_complete_04_Annotation_v7.Rmd
    Untracked:  analysis/test.Rmd
    Untracked:  code/rebuild_ezRun.R
    Untracked:  nonhosted_public/
    Untracked:  singRstudio.sh.bak

Unstaged changes:
    Modified:   analysis/scRNAseq_complete_01_preprocessing.Rmd
    Modified:   analysis/scRNAseq_complete_02_HVG_Dimred.Rmd
    Modified:   analysis/scRNAseq_complete_03-2_Subcelltypes_processing.Rmd
    Modified:   analysis/scRNAseq_complete_03-3_Subcelltypes_clustering.Rmd
    Modified:   analysis/scRNAseq_complete_03-4_Subcelltypes_clustering_walktrap.Rmd
    Modified:   analysis/scRNAseq_complete_03_Batch_Clustering_Doublets.Rmd
    Modified:   analysis/scRNAseq_complete_04-2_celltype_markers.Rmd
    Modified:   analysis/scRNAseq_complete_04-2_celltype_markers_subcelltypes.Rmd
    Modified:   analysis/scRNAseq_complete_Figures.Rmd
    Modified:   analysis/write_tsv.Rmd
    Modified:   code/create_hdf5.R

Staged changes:
    Modified:   analysis/scRNAseq_complete_00_ambient_RNA.Rmd

Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.


These are the previous versions of the repository in which changes were made to the R Markdown (analysis/scRNAseq_complete_03-3_Subcelltypes_clustering.Rmd) and HTML (public/scRNAseq_complete_03-3_Subcelltypes_clustering.html) files. If you’ve configured a remote Git repository (see ?wflow_git_remote), click on the hyperlinks in the table below to view the files as they were in that past version.

File Version Author Date Message
html 3443cc6 Reto Gerber 2022-04-25 Update
Rmd b5b139f Reto Gerber 2022-03-29 Update analysis
html b5b139f Reto Gerber 2022-03-29 Update analysis
Rmd 7d99571 Reto Gerber 2022-03-21 update analysis
html 7d99571 Reto Gerber 2022-03-21 update analysis
Rmd 9133ed1 Reto Gerber 2022-03-04 update to v6
html 9133ed1 Reto Gerber 2022-03-04 update to v6
html f2e34e1 Reto Gerber 2021-07-29 Update navbar
Rmd ee1face Reto Gerber 2021-07-29 Add missing scripts
html 222b0d1 Reto Gerber 2021-07-29 Update analysis to v5

Set up

suppressPackageStartupMessages({
  library(dplyr)
  library(ggplot2)
  library(purrr)
  library(stringr)
  library(SummarizedExperiment)
  library(SingleCellExperiment)
  library(scater)
  library(scran)
  library(igraph)
  library(scuttle)
  library(tidySingleCellExperiment)
  library(bluster)
  library(BiocParallel)
})
n_workers <- 10
RhpcBLASctl::blas_set_num_threads(n_workers)
bpparam <- MulticoreParam(workers = n_workers, RNGseed = 123)

here::here()
[1] "/home/retger/Synovial/synovialscrnaseq"
remove_low_quality_samples <- TRUE
analysis_version <- 7

set.seed(100)

clusters_lookup <- list()

Indiviual analysis

Repeat analysis for the four main cell types of interest.

Subclustering - SF

celltype_name_pre <- "sf"

load

tmpfilename <- paste0("syn_v",analysis_version,"_sce_",celltype_name_pre,dplyr::if_else(remove_low_quality_samples, "_invivo",""),".rds")
sce_sub <- readRDS(file = here::here("output",tmpfilename))

clustering

graph_clustering <- function(x, k) {
  bpstart(bpparam)
  g <- buildSNNGraph(sce_sub, use.dimred="corrected", k=k, BPPARAM = bpparam)
  bpstop(bpparam)
  igraph::cluster_louvain(g)$membership
}
ratios_ls <- list()
sub_clusters_lookup <- list()
knns <- c(5,10,20,30)
for(k in knns){
  set.seed(123)
  clusters <- graph_clustering(sce_sub, k)
  colData(sce_sub)[[paste0(celltype_name_pre,"_clusters_k",k)]] <- clusters
  sub_clusters_lookup[[paste0(celltype_name_pre,"_clusters_k",k)]] <- 
    data.frame(cell_id = colnames(sce_sub), 
               cluster = paste0(toupper(celltype_name_pre),"_", as.character(clusters)))
  
  # ratios_ls[[as.character(k)]] <- bootstrapStability(reducedDim(sce_sub, "corrected"), 
  #                              FUN=graph_clustering, k=k, 
  #                              clusters = clusters,
  #                              iterations = 20)
}
clusters_lookup[[celltype_name_pre]] <- sub_clusters_lookup
cat("### UMAP cluster {.tabset}\n\n")

UMAP cluster

for(k in knns){
  cat("#### k=",k,"\n\n")
  print(plotReducedDim(sce_sub,"UMAP_corrected", 
               colour_by=paste0(celltype_name_pre,"_clusters_k",k), 
               text_by=paste0(celltype_name_pre,"_clusters_k",k)))
  cat("\n\n")
}

k= 5

Version Author Date
9133ed1 Reto Gerber 2022-03-04
222b0d1 Reto Gerber 2021-07-29

k= 10

Version Author Date
9133ed1 Reto Gerber 2022-03-04
222b0d1 Reto Gerber 2021-07-29

k= 20

Version Author Date
9133ed1 Reto Gerber 2022-03-04
222b0d1 Reto Gerber 2021-07-29

k= 30

Version Author Date
9133ed1 Reto Gerber 2022-03-04
222b0d1 Reto Gerber 2021-07-29
cat("### {-}")

cluster purity

save

tmpfilename <- paste0("syn_v",analysis_version,"_sce_",celltype_name_pre,dplyr::if_else(remove_low_quality_samples, "_invivo",""),".rds")
saveRDS(sce_sub, file = here::here("output",tmpfilename))

Subclustering - EC

celltype_name_pre <- "ec"

load

tmpfilename <- paste0("syn_v",analysis_version,"_sce_",celltype_name_pre,dplyr::if_else(remove_low_quality_samples, "_invivo",""),".rds")
sce_sub <- readRDS(file = here::here("output",tmpfilename))

clustering

graph_clustering <- function(x, k) {
  bpstart(bpparam)
  g <- buildSNNGraph(sce_sub, use.dimred="corrected", k=k, BPPARAM = bpparam)
  bpstop(bpparam)
  igraph::cluster_louvain(g)$membership
}
ratios_ls <- list()
sub_clusters_lookup <- list()
knns <- c(5,10,20,30)
for(k in knns){
  set.seed(123)
  clusters <- graph_clustering(sce_sub, k)
  colData(sce_sub)[[paste0(celltype_name_pre,"_clusters_k",k)]] <- clusters
  sub_clusters_lookup[[paste0(celltype_name_pre,"_clusters_k",k)]] <- 
    data.frame(cell_id = colnames(sce_sub), 
               cluster = paste0(toupper(celltype_name_pre),"_", as.character(clusters)))
  
  # ratios_ls[[as.character(k)]] <- bootstrapStability(reducedDim(sce_sub, "corrected"), 
  #                              FUN=graph_clustering, k=k, 
  #                              clusters = clusters,
  #                              iterations = 20)
}
clusters_lookup[[celltype_name_pre]] <- sub_clusters_lookup
cat("### UMAP cluster {.tabset}\n\n")

UMAP cluster

for(k in knns){
  cat("#### k=",k,"\n\n")
  print(plotReducedDim(sce_sub,"UMAP_corrected", 
               colour_by=paste0(celltype_name_pre,"_clusters_k",k), 
               text_by=paste0(celltype_name_pre,"_clusters_k",k)))
  cat("\n\n")
}

k= 5

Version Author Date
9133ed1 Reto Gerber 2022-03-04
222b0d1 Reto Gerber 2021-07-29

k= 10

Version Author Date
9133ed1 Reto Gerber 2022-03-04
222b0d1 Reto Gerber 2021-07-29

k= 20

Version Author Date
9133ed1 Reto Gerber 2022-03-04
222b0d1 Reto Gerber 2021-07-29

k= 30

Version Author Date
9133ed1 Reto Gerber 2022-03-04
222b0d1 Reto Gerber 2021-07-29
cat("### {-}")

cluster purity

save

tmpfilename <- paste0("syn_v",analysis_version,"_sce_",celltype_name_pre,dplyr::if_else(remove_low_quality_samples, "_invivo",""),".rds")
saveRDS(sce_sub, file = here::here("output",tmpfilename))

Subclustering - Macrophages

celltype_name_pre <- "mp"

load

tmpfilename <- paste0("syn_v",analysis_version,"_sce_",celltype_name_pre,dplyr::if_else(remove_low_quality_samples, "_invivo",""),".rds")
sce_sub <- readRDS(file = here::here("output",tmpfilename))

clustering

graph_clustering <- function(x, k) {
  bpstart(bpparam)
  g <- buildSNNGraph(sce_sub, use.dimred="corrected", k=k, BPPARAM = bpparam)
  bpstop(bpparam)
  igraph::cluster_louvain(g)$membership
}
ratios_ls <- list()
sub_clusters_lookup <- list()
knns <- c(5,10,20,30)
for(k in knns){
  set.seed(123)
  clusters <- graph_clustering(sce_sub, k)
  colData(sce_sub)[[paste0(celltype_name_pre,"_clusters_k",k)]] <- clusters
  sub_clusters_lookup[[paste0(celltype_name_pre,"_clusters_k",k)]] <- 
    data.frame(cell_id = colnames(sce_sub), 
               cluster = paste0(toupper(celltype_name_pre),"_", as.character(clusters)))
  
  # ratios_ls[[as.character(k)]] <- bootstrapStability(reducedDim(sce_sub, "corrected"), 
  #                              FUN=graph_clustering, k=k, 
  #                              clusters = clusters,
  #                              iterations = 20)
}
clusters_lookup[[celltype_name_pre]] <- sub_clusters_lookup
cat("### UMAP cluster {.tabset}\n\n")

UMAP cluster

for(k in knns){
  cat("#### k=",k,"\n\n")
  print(plotReducedDim(sce_sub,"UMAP_corrected", 
               colour_by=paste0(celltype_name_pre,"_clusters_k",k), 
               text_by=paste0(celltype_name_pre,"_clusters_k",k)))
  cat("\n\n")
}

k= 5

Version Author Date
9133ed1 Reto Gerber 2022-03-04
222b0d1 Reto Gerber 2021-07-29

k= 10

Version Author Date
9133ed1 Reto Gerber 2022-03-04
222b0d1 Reto Gerber 2021-07-29

k= 20

Version Author Date
9133ed1 Reto Gerber 2022-03-04
222b0d1 Reto Gerber 2021-07-29

k= 30

Version Author Date
9133ed1 Reto Gerber 2022-03-04
222b0d1 Reto Gerber 2021-07-29
cat("### {-}")

cluster purity

save

tmpfilename <- paste0("syn_v",analysis_version,"_sce_",celltype_name_pre,dplyr::if_else(remove_low_quality_samples, "_invivo",""),".rds")
saveRDS(sce_sub, file = here::here("output",tmpfilename))

Subclustering - T-cells

celltype_name_pre <- "tc"

load

tmpfilename <- paste0("syn_v",analysis_version,"_sce_",celltype_name_pre,dplyr::if_else(remove_low_quality_samples, "_invivo",""),".rds")
sce_sub <- readRDS(file = here::here("output",tmpfilename))

clustering

graph_clustering <- function(x, k) {
  bpstart(bpparam)
  g <- buildSNNGraph(sce_sub, use.dimred="corrected", k=k, BPPARAM = bpparam)
  bpstop(bpparam)
  igraph::cluster_louvain(g)$membership
}
ratios_ls <- list()
sub_clusters_lookup <- list()
knns <- c(5,10,20,30)
for(k in knns){
  set.seed(123)
  clusters <- graph_clustering(sce_sub, k)
  colData(sce_sub)[[paste0(celltype_name_pre,"_clusters_k",k)]] <- clusters
  sub_clusters_lookup[[paste0(celltype_name_pre,"_clusters_k",k)]] <- 
    data.frame(cell_id = colnames(sce_sub), 
               cluster = paste0(toupper(celltype_name_pre),"_", as.character(clusters)))
  
  # ratios_ls[[as.character(k)]] <- bootstrapStability(reducedDim(sce_sub, "corrected"), 
  #                              FUN=graph_clustering, k=k, 
  #                              clusters = clusters,
  #                              iterations = 20)
}
clusters_lookup[[celltype_name_pre]] <- sub_clusters_lookup
cat("### UMAP cluster {.tabset}\n\n")

UMAP cluster

for(k in knns){
  cat("#### k=",k,"\n\n")
  print(plotReducedDim(sce_sub,"UMAP_corrected", 
               colour_by=paste0(celltype_name_pre,"_clusters_k",k), 
               text_by=paste0(celltype_name_pre,"_clusters_k",k)))
  cat("\n\n")
}

k= 5

Version Author Date
9133ed1 Reto Gerber 2022-03-04
222b0d1 Reto Gerber 2021-07-29

k= 10

Version Author Date
9133ed1 Reto Gerber 2022-03-04
222b0d1 Reto Gerber 2021-07-29

k= 20

Version Author Date
9133ed1 Reto Gerber 2022-03-04
222b0d1 Reto Gerber 2021-07-29

k= 30

Version Author Date
9133ed1 Reto Gerber 2022-03-04
222b0d1 Reto Gerber 2021-07-29
cat("### {-}")

cluster purity

save

tmpfilename <- paste0("syn_v",analysis_version,"_sce_",celltype_name_pre,dplyr::if_else(remove_low_quality_samples, "_invivo",""),".rds")
saveRDS(sce_sub, file = here::here("output",tmpfilename))

Combine clustering results

tmpfilename <- paste0("syn_v",analysis_version,"_clustering_lookup_multiple",dplyr::if_else(remove_low_quality_samples, "_invivo",""),".rds")
saveRDS(clusters_lookup, here::here("output",tmpfilename))

tmpfilename <- paste0("syn_v",analysis_version,"_sce_hvg_cms_doublet_subcluster",dplyr::if_else(remove_low_quality_samples, "_invivo",""),".rds")
syn_sce_tidy_hvg_cms <- readRDS(file = here::here("output",tmpfilename))


for(k in knns){
  colData(syn_sce_tidy_hvg_cms)[[paste0("combined_clusters_k",k)]] <- ""
  for(sub_name in names(clusters_lookup)){
    celllabelmatch <- match(clusters_lookup[[sub_name]][[paste0(sub_name,"_clusters_k",k)]]$cell_id,
                          colnames(syn_sce_tidy_hvg_cms))
    celllabelmatch <- celllabelmatch[!is.na(celllabelmatch)]
    colData(syn_sce_tidy_hvg_cms)[[paste0("combined_clusters_k",k)]][celllabelmatch] <-  clusters_lookup[[sub_name]][[paste0(sub_name,"_clusters_k",k)]]$cluster
  }
  colData(syn_sce_tidy_hvg_cms)[[paste0("combined_clusters_k",k)]][colData(syn_sce_tidy_hvg_cms)[[paste0("combined_clusters_k",k)]] == ""] <-
  colData(syn_sce_tidy_hvg_cms)[[paste0("combined_clusters_k",k)]][colData(syn_sce_tidy_hvg_cms)[[paste0("combined_clusters_k",k)]] == ""]
}
tmpfilename <- paste0("syn_v",analysis_version,"_sce_hvg_cms_doublet_subcluster",dplyr::if_else(remove_low_quality_samples, "_invivo",""),".rds")
saveRDS(syn_sce_tidy_hvg_cms, file = here::here("output",tmpfilename))

4th Part: Annotation


sessionInfo()
R version 4.0.3 (2020-10-10)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04 LTS

Matrix products: default
BLAS/LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.8.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=C             
 [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] parallel  stats4    stats     graphics  grDevices utils     datasets 
[8] methods   base     

other attached packages:
 [1] gdtools_0.2.3                  BiocParallel_1.24.1           
 [3] bluster_1.0.0                  tidySingleCellExperiment_1.0.0
 [5] scuttle_1.0.4                  igraph_1.2.6                  
 [7] scran_1.18.7                   scater_1.18.6                 
 [9] SingleCellExperiment_1.12.0    SummarizedExperiment_1.20.0   
[11] Biobase_2.50.0                 GenomicRanges_1.42.0          
[13] GenomeInfoDb_1.26.7            IRanges_2.24.1                
[15] S4Vectors_0.28.1               BiocGenerics_0.36.1           
[17] MatrixGenerics_1.2.1           matrixStats_0.58.0            
[19] stringr_1.4.0                  purrr_0.3.4                   
[21] ggplot2_3.3.3                  dplyr_1.0.4                   
[23] workflowr_1.6.2               

loaded via a namespace (and not attached):
 [1] bitops_1.0-6              fs_1.5.0                 
 [3] httr_1.4.2                rprojroot_2.0.2          
 [5] tools_4.0.3               R6_2.5.0                 
 [7] irlba_2.3.3               vipor_0.4.5              
 [9] lazyeval_0.2.2            DBI_1.1.1                
[11] colorspace_2.0-0          withr_2.4.1              
[13] tidyselect_1.1.0          gridExtra_2.3            
[15] compiler_4.0.3            git2r_0.28.0             
[17] cli_2.3.0                 BiocNeighbors_1.8.2      
[19] DelayedArray_0.16.3       plotly_4.9.3             
[21] labeling_0.4.2            scales_1.1.1             
[23] systemfonts_1.0.1         digest_0.6.27            
[25] svglite_1.2.3.2           rmarkdown_2.6            
[27] RhpcBLASctl_0.20-137      XVector_0.30.0           
[29] pkgconfig_2.0.3           htmltools_0.5.1.1        
[31] sparseMatrixStats_1.2.1   highr_0.8                
[33] limma_3.46.0              htmlwidgets_1.5.3        
[35] rlang_0.4.10              DelayedMatrixStats_1.12.3
[37] farver_2.0.3              generics_0.1.0           
[39] jsonlite_1.7.2            RCurl_1.98-1.2           
[41] magrittr_2.0.1            BiocSingular_1.6.0       
[43] GenomeInfoDbData_1.2.4    Matrix_1.3-2             
[45] Rcpp_1.0.6                ggbeeswarm_0.6.0         
[47] munsell_0.5.0             fansi_0.4.2              
[49] viridis_0.5.1             lifecycle_1.0.0          
[51] stringi_1.5.3             whisker_0.4              
[53] yaml_2.2.1                edgeR_3.32.1             
[55] zlibbioc_1.36.0           grid_4.0.3               
[57] promises_1.2.0.1          dqrng_0.2.1              
[59] crayon_1.4.1              lattice_0.20-41          
[61] cowplot_1.1.1             beachmat_2.6.4           
[63] locfit_1.5-9.4            knitr_1.31               
[65] pillar_1.4.7              glue_1.4.2               
[67] evaluate_0.14             data.table_1.13.6        
[69] vctrs_0.3.6               httpuv_1.5.5             
[71] tidyr_1.1.2               gtable_0.3.0             
[73] assertthat_0.2.1          xfun_0.21                
[75] rsvd_1.0.3                later_1.1.0.1            
[77] viridisLite_0.3.0         tibble_3.0.6             
[79] beeswarm_0.2.3            statmod_1.4.35           
[81] ellipsis_0.3.1            here_1.0.1