Last updated: 2024-02-12

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 58eeb06. 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/barcodes_filtered.txt
    Ignored:    output/column_metadata_filtered.txt
    Ignored:    output/combined_v7_SingleR_markers.rds
    Ignored:    output/combined_v7_SingleR_predictions.rds
    Ignored:    output/combined_v7_SingleR_predictions_lclc.rds
    Ignored:    output/combined_v7_SingleR_predictions_reclc.rds
    Ignored:    output/combined_v7_SingleR_predictions_recrec.rds
    Ignored:    output/combined_v7_SingleR_trained.rds
    Ignored:    output/combined_v7_sce.rds
    Ignored:    output/combined_v7_sce_filtered.rds
    Ignored:    output/combined_v7_sce_hvg.rds
    Ignored:    output/combined_v7_sce_hvg_cms.rds
    Ignored:    output/combined_v7_sce_hvg_cms_annotated.rds
    Ignored:    output/combined_v7_sce_tmp_hvg_cms.rds
    Ignored:    output/combined_v7_upsetplot_genelists.rds
    Ignored:    output/count_matrix_filtered.mtx
    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/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/genes_filtered.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_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_Figure8.rds
    Ignored:    output/syn_v7_sce_Figure8_dic_ls.rds
    Ignored:    output/syn_v7_sce_ec_invivo.rds
    Ignored:    output/syn_v7_sce_ec_invivo_trajectory.rds
    Ignored:    output/syn_v7_sce_ec_invivo_trajectory2.rds
    Ignored:    output/syn_v7_sce_ec_invivo_trajectory2_ATres.rds
    Ignored:    output/syn_v7_sce_ec_invivo_trajectory_icMat.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_cms_doublet_subcluster_invivo_cleaned.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/clean_and_save_sce.R
    Untracked:  analysis/description_integration_wei_stephenson
    Untracked:  analysis/scRNAseq_complete_01_preprocessing_comparison.Rmd
    Untracked:  analysis/scRNAseq_complete_05_ec_trajectory_analysis.Rmd
    Untracked:  analysis/scRNAseq_complete_05_ec_trajectory_analysis_2.Rmd
    Untracked:  analysis/scRNAseq_complete_05_ec_trajectory_analysis_3.Rmd
    Untracked:  code/plot_utilities.Rmd
    Untracked:  code/rebuild_ezRun.R
    Untracked:  code/tmp1.R
    Untracked:  code/tmp1.Rmd
    Untracked:  nonhosted_public/
    Untracked:  singRstudio.sh.bak

Unstaged changes:
    Modified:   analysis/scRNAseq_combined_06_Figures.Rmd
    Modified:   analysis/scRNAseq_complete_04-2_celltype_markers.Rmd
    Modified:   analysis/scRNAseq_complete_04-2_celltype_markers_subcelltypes.Rmd
    Modified:   analysis/scRNAseq_complete_04_Annotation_v7.Rmd
    Modified:   analysis/scRNAseq_complete_Figures.Rmd
    Modified:   analysis/write_tsv.Rmd
    Modified:   code/create_hdf5.R

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_04-2_celltype_markers.Rmd) and HTML (public/scRNAseq_complete_04-2_celltype_markers.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
Rmd 58eeb06 Reto Gerber 2023-05-30 add new version
html 58eeb06 Reto Gerber 2023-05-30 add new version
Rmd 4575ba6 Reto Gerber 2022-12-21 Update analyis
Rmd e786402 Reto Gerber 2022-05-28 update figures to final version of paper
html e786402 Reto Gerber 2022-05-28 update figures to final version of paper
Rmd 0f8368f Reto Gerber 2022-05-20 update figures
html 0f8368f Reto Gerber 2022-05-20 update figures
Rmd 5a6aa2a Reto Gerber 2022-04-25 rerun with small resolution
html 5a6aa2a Reto Gerber 2022-04-25 rerun with small resolution
Rmd 3443cc6 Reto Gerber 2022-04-25 Update
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 27d00c3 Reto Gerber 2021-10-20 Add untracked files, update

Set up

suppressPackageStartupMessages({
  library(ggplot2)
  library(SingleCellExperiment)
  library(scater)
  library(scran)
  library(scuttle)
  library(magrittr)
})
n_workers <- 10
RhpcBLASctl::blas_set_num_threads(n_workers)
source(here::here("code","utilities_plots.R"))
analysis_version <- 7

here::here()
[1] "/home/retger/Synovial/synovialscrnaseq"
set.seed(100)
sce_main <- readRDS(file =here::here("output",paste0("syn_v",analysis_version,"_sce_hvg_cms_doublet_subcluster_invivo.rds")))

if(is.null(sce_main$main_celltype)){
  sce_main$main_celltype <- sce_main$main_celltype_cellid
}
Loading required package: tidySingleCellExperiment

Attaching package: 'tidySingleCellExperiment'
The following object is masked from 'package:magrittr':

    extract
The following object is masked from 'package:IRanges':

    slice
The following object is masked from 'package:S4Vectors':

    rename
The following object is masked from 'package:matrixStats':

    count
The following object is masked from 'package:stats':

    filter

Supplementary Figure 10

format(object.size(sce_main),units="Mb")
[1] "6883.6 Mb"
colLabels(sce_main) <- colData(sce_main)$main_celltype
sce_main_red <- sce_main
sce_main_red <- sce_main_red[rowData(sce_main_red)$is_hvg,]
colData(sce_main_red) <- NULL
colLabels(sce_main_red) <- colData(sce_main)$main_celltype
rowData(sce_main_red) <- NULL
counts(sce_main_red) <- NULL
assay(sce_main_red,"reconstructed") <- NULL
metadata(sce_main_red) <- list()
reducedDims(sce_main_red) <- list()
as(sce_main_red, "SingleCellExperiment")
class: SingleCellExperiment 
dim: 3291 102758 
metadata(0):
assays(1): logcounts
rownames(3291): PERM1 HES4 ... RPS4Y1 MT-TR
rowData names(0):
colnames(102758): Syn_Bio_079.AAACCCAAGAGGCTGT
  Syn_Bio_079.AAACCCACACATCCCT ... Syn_Bio_050.TTTGTTGGTCTGTAAC-1
  Syn_Bio_050.TTTGTTGTCGCCCAGA-1
colData names(1): label
reducedDimNames(0):
altExpNames(0):
format(object.size(sce_main_red),units="Mb")
[1] "534.8 Mb"
markers <- findMarkers(sce_main_red, test.type = "wilcox", pval.type = "all", direction="up",
                       lfc=0.5, block=sce_main$Sample) 

saveRDS(markers,here::here("output",paste0("findMarkers_results_v",analysis_version,"_main.rds")))
markers <- readRDS(here::here("output",paste0("findMarkers_results_v",analysis_version,"_main.rds")))
topmarkers <- purrr::map(seq_along(markers), function(i){
  markers[[i]] %>% 
  as.data.frame() %>% 
  dplyr::arrange(FDR) %>% 
  dplyr::select(FDR) %>% 
  head(n=10)
})
names(topmarkers) <- names(markers)
topmarkers
$`B cells`
                   FDR
MS4A1     3.303241e-30
BANK1     2.858290e-24
TNFRSF13C 2.787433e-14
CD37      1.256120e-07
RALGPS2   3.068297e-03
CD79A     1.000000e+00
LTB       1.000000e+00
POU2F2    1.000000e+00
CD83      1.000000e+00
BIRC3     1.000000e+00

$`Dendritic cells`
                  FDR
HLA-DPB1 1.370881e-56
HLA-DPA1 1.370881e-56
HLA-DRA  1.639417e-56
HLA-DRB1 2.363214e-56
HLA-DQA1 4.509545e-56
HLA-DQB1 7.764549e-53
CST3     4.665384e-38
LGALS2   2.951278e-34
CPVL     1.100839e-31
CD74     5.035648e-24

$`Endothelial cells`
                 FDR
HSPG2   1.160748e-71
GNG11   1.160748e-71
ENG     6.552932e-71
TM4SF1  3.109673e-70
IFI27   2.034223e-67
AQP1    6.191734e-66
NPDC1   1.438575e-63
CLEC14A 5.437018e-63
RAMP2   1.421321e-61
COL15A1 8.094352e-61

$Fibroblasts
                FDR
LUM    1.734588e-72
DCN    2.079124e-69
FN1    2.079124e-69
C1S    2.837773e-65
CCDC80 4.030590e-65
MMP2   1.383558e-64
COL1A2 1.394713e-64
COL3A1 2.623164e-63
LRP1   1.468709e-58
HTRA1  1.468709e-58

$Macrophages
                FDR
CTSB   5.422159e-47
CD68   2.465772e-35
CTSL   1.084050e-26
CTSZ   5.945712e-23
MAFB   6.219787e-23
CD14   6.503482e-17
CYBB   1.955266e-12
PSAP   6.179828e-09
MS4A7  7.091365e-07
KCTD12 2.761744e-02

$`Mast cells`
                FDR
CPA3   7.654907e-33
TPSB2  8.078864e-32
TPSAB1 8.078864e-32
MS4A2  1.763697e-27
HPGDS  1.019243e-23
HPGD   3.151552e-22
CTSG   8.504468e-22
ANXA1  4.688402e-16
LTC4S  2.945854e-14
HDC    1.743379e-13

$Neutrophils
               FDR
S100A9 0.001104826
NAMPT  0.001104826
IFITM2 0.001104826
S100A8 0.001104826
FTH1   0.001104826
ITM2B  0.001104826
SRGN   0.001104826
SAT1   0.001446963
G0S2   0.001694698
SOD2   0.002518363

$`Pericytes/Mural cells`
                  FDR
CALD1    1.593488e-39
MYL9     5.735033e-37
TAGLN    1.950801e-35
IGFBP7   1.219012e-33
C11orf96 1.392688e-28
NOTCH3   2.579085e-28
TPM1     2.579085e-28
COL18A1  5.341102e-27
ADIRF    7.552298e-27
NR2F2    4.858776e-26

$Plasmablasts
                  FDR
IGHG1    5.278828e-07
PRDM1    5.278828e-07
IGHG3    5.278828e-07
MZB1     5.278828e-07
POU2AF1  1.941103e-06
PRDX4    6.310224e-06
CCND2    1.439282e-03
ZBP1     2.725350e-03
TENT5C   1.054154e-02
HIST1H1C 1.878322e-02

$`Plasmacytoid DCs`
                FDR
GZMB   3.111760e-23
PLD4   2.665760e-20
CLIC3  2.665760e-20
PLAC8  5.130436e-18
SOX4   2.604757e-14
SEMA7A 3.479245e-14
IRF8   1.356418e-12
LILRA4 4.308873e-12
SCT    6.845314e-12
GPR183 1.354720e-11

$`T cells/NK cells`
                 FDR
IL32    3.981844e-61
CD3D    1.655958e-41
CD3E    1.897720e-33
TRBC2   1.000297e-20
BCL11B  4.064669e-18
ZFP36L2 5.341862e-16
DUSP2   1.412035e-15
CD3G    3.667718e-11
HCST    3.590314e-10
SPOCK2  1.498644e-07
markergenes_ls <- purrr::map(topmarkers,~rownames(.x))
markergenes_ls <- markergenes_ls[celltype_order()]
names(markergenes_ls) <- names(markergenes_ls) %>% stringr::str_replace_all("/","\n")
markergenes_n <- purrr::map(markergenes_ls, ~length(.x))
markergenes <- unlist(markergenes_ls)
fdr_topmarkers <- unlist(topmarkers[celltype_order()])
names(fdr_topmarkers) <- markergenes
clusters <- sce_main$main_celltype %>% stringr::str_replace_all("/","\n")
clucol <- get_colors("main_celltype") 
clucol <- clucol[celltype_order()]
names(clucol) <- names(clucol) %>% stringr::str_replace_all("/","\n")

samples <- sce_main$Sample
samcol <- sample_cols(unique(samples))
names(samcol) <- unique(samples)

diagnosis <- sce_main$Diagnosis_main
diagcol <- get_colors("diagnosis") 
diagcol <- diagcol[names(diagcol) %in% unique(sce_main$Diagnosis_main)]


clusters_samples <- paste0(clusters,"-",diagnosis,"-", samples)

mataggr <- summarizeAssayByGroup(logcounts(sce_main),clusters_samples, subset.row=markergenes)

# order 
tmpcoldat <- colData(sce_main) %>% 
  as.data.frame() %>% 
  dplyr::left_join(data.frame(main_celltype=celltype_order(),
           main_celltype_order=seq_along(celltype_order())),
           by="main_celltype") %>% 
  dplyr::arrange(main_celltype_order, Diagnosis_main, Sample) 
  
order_samples <- tmpcoldat %>% 
  dplyr::select(main_celltype, Diagnosis_main, Sample) %>% 
  unique() %>% 
  dplyr::mutate(tmpname=paste0(stringr::str_replace_all(main_celltype,"/","\n"),"-",Diagnosis_main,"-", Sample)) %>% 
  dplyr::pull()

mataggr <- mataggr[,order_samples]

colnamessplit <- stringr::str_split(colnames(mataggr),"-")
clustersaggr <- purrr::map_chr(colnamessplit,~.x[1]) 
diagcolsaggr <- purrr::map_chr(colnamessplit,~.x[2])
samplesaggr <- purrr::map_chr(colnamessplit,~.x[3])
tmpass <-  t(apply(assay(mataggr,"mean"),1,scale))
colnames(tmpass) <- colnames(assay(mataggr,"mean"))
assay(mataggr,"mean_scale") <- tmpass


  
# order_samples <- colnames(mataggr)#[order(colnames(mataggr))]
library(ComplexHeatmap)
Loading required package: grid
========================================
ComplexHeatmap version 2.6.2
Bioconductor page: http://bioconductor.org/packages/ComplexHeatmap/
Github page: https://github.com/jokergoo/ComplexHeatmap
Documentation: http://jokergoo.github.io/ComplexHeatmap-reference

If you use it in published research, please cite:
Gu, Z. Complex heatmaps reveal patterns and correlations in multidimensional 
  genomic data. Bioinformatics 2016.

This message can be suppressed by:
  suppressPackageStartupMessages(library(ComplexHeatmap))
========================================
ha <- ComplexHeatmap::HeatmapAnnotation(
    `Cell type` = factor(clustersaggr,levels = unique(clustersaggr)),
    # Diagnosis=diagcolsaggr,
    Sample = samplesaggr,
    col=list(`Cell type`=clucol,Sample=samcol,Diagnosis=diagcol),
    annotation_legend_param=list(labels_gp = gpar(fontsize=16),
                                 title_gp = gpar(fontsize=20,fontface="bold")))

ht_opt$TITLE_PADDING = unit(c(4, 20), "points")
# ht_opt(RESET = TRUE)
ht <- ComplexHeatmap::Heatmap(
  assay(mataggr,"mean_scale"), 
  heatmap_legend_param = list(title = "Scaled expression",fontsize=20,gap=unit(20, "mm"),
                              labels_gp = gpar(fontsize=16),
                              title_gp = gpar(fontsize=20,fontface="bold")),
  cluster_rows = FALSE, 
  cluster_columns=FALSE,
  column_order=order_samples,
  show_column_names=FALSE,
  column_split=factor(clustersaggr,levels = unique(clustersaggr)),
  column_title = NULL,
  column_gap = unit(0.2, "mm"),
  right_annotation = ComplexHeatmap::rowAnnotation(`log10(FDR)`=ComplexHeatmap::anno_points(log10(fdr_topmarkers)),width=unit(20, "mm")),
  row_split=factor(unlist(purrr::map(seq_along(markergenes_n),~rep(names(markergenes_n)[.x],markergenes_n[[.x]]))),levels = unique(clustersaggr)),
  row_title = NULL
    )
hm <- ha %v% ht

figname <- "Suppl_Figure_10"
width <- 26 
height <- 18
res = 300
maxwidth <- 8.5
maxheight <- 11
downscale <- max(c(3,height/maxheight, width/maxwidth))
# ideally multiply by 'downscale' but imagemagick throws error for too large images
initres <- res*1.2
magick_geometry <- paste0(width/downscale*res,"x",height/downscale*res)

tiff(here::here("..","synovialscrnaseq","output","Figures_Paper",paste0(figname,".tiff")),width=width,height=height,res = initres, units = "in", compression="zip")
draw(hm,
   column_title=paste0("Figure S",stringr::str_extract(figname,"[[:digit:]]+$")),
   column_title_gp=grid::gpar(fontsize=10*downscale,fontfamily="Arial"))
Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
family 'Arial' not found in PostScript font database

Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
family 'Arial' not found in PostScript font database

Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
family 'Arial' not found in PostScript font database

Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
family 'Arial' not found in PostScript font database

Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
family 'Arial' not found in PostScript font database

Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
family 'Arial' not found in PostScript font database
dev.off()
pdf 
  2 
system(paste0("convert -geometry ",magick_geometry," ", here::here("..","synovialscrnaseq","output","Figures_Paper",paste0(figname,".tiff")), " ",here::here("..","synovialscrnaseq","output","Figures_Paper",paste0(figname,".tiff"))))

jpeg(here::here("..","synovialscrnaseq","output","Figures_Paper",paste0(figname,".jpeg")),width=width,height=height,res = initres, units = "in")
draw(hm,
   column_title=paste0("Figure S",stringr::str_extract(figname,"[[:digit:]]+$")),
   column_title_gp=grid::gpar(fontsize=10*downscale,fontfamily="Arial"))
Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
family 'Arial' not found in PostScript font database

Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
family 'Arial' not found in PostScript font database

Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
family 'Arial' not found in PostScript font database

Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
family 'Arial' not found in PostScript font database

Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
family 'Arial' not found in PostScript font database

Warning in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : font
family 'Arial' not found in PostScript font database
dev.off()
pdf 
  2 
system(paste0("convert -geometry ",magick_geometry," ", here::here("..","synovialscrnaseq","output","Figures_Paper",paste0(figname,".jpeg")), " ",here::here("..","synovialscrnaseq","output","Figures_Paper",paste0(figname,".jpeg"))))

pdf(here::here("..","synovialscrnaseq","output","Figures_Paper",paste0(figname,".pdf")),width=width,height=height)
draw(hm,
   column_title=paste0("Figure S",stringr::str_extract(figname,"[[:digit:]]+$")),
   column_title_gp=grid::gpar(fontsize=10*downscale))
dev.off()
pdf 
  2 

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] grid      parallel  stats4    stats     graphics  grDevices utils    
 [8] datasets  methods   base     

other attached packages:
 [1] ComplexHeatmap_2.6.2           tidySingleCellExperiment_1.0.0
 [3] magrittr_2.0.1                 scuttle_1.0.4                 
 [5] scran_1.18.7                   scater_1.18.6                 
 [7] SingleCellExperiment_1.12.0    SummarizedExperiment_1.20.0   
 [9] Biobase_2.50.0                 GenomicRanges_1.42.0          
[11] GenomeInfoDb_1.26.7            IRanges_2.24.1                
[13] S4Vectors_0.28.1               BiocGenerics_0.36.1           
[15] MatrixGenerics_1.2.1           matrixStats_0.58.0            
[17] ggplot2_3.3.3                  workflowr_1.6.2               

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