Last updated: 2022-09-12

Checks: 6 1

Knit directory: humanCardiacFibroblasts/

This reproducible R Markdown analysis was created with workflowr (version 1.7.0). 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(20210903) 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 9b017be. 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:    .DS_Store
    Ignored:    .Rhistory
    Ignored:    .Rproj.user/
    Ignored:    data/GSEA/
    Ignored:    data/humanFibroblast/
    Ignored:    figure/DEgenesGZplusSG_Groups.Rmd/.DS_Store

Untracked files:
    Untracked:  figure/mergeHumanSamplesPlusGraz.Rmd/top marker 20-1.pdf
    Untracked:  figure/mergeHumanSamplesPlusGraz.Rmd/top marker 20-1.png

Unstaged changes:
    Modified:   analysis/assignLabelshumanHeartsPlusGrazInt.Rmd
    Modified:   analysis/integrateAcrossPatientsGZplusSG.Rmd
    Modified:   analysis/mergeHumanSamplesPlusGraz.Rmd
    Modified:   figure/integrateAcrossPatientsGZplusSG.Rmd/top marker 0-1.pdf
    Modified:   figure/integrateAcrossPatientsGZplusSG.Rmd/top marker 0-1.png
    Modified:   figure/integrateAcrossPatientsGZplusSG.Rmd/top marker 1-1.pdf
    Modified:   figure/integrateAcrossPatientsGZplusSG.Rmd/top marker 1-1.png
    Modified:   figure/integrateAcrossPatientsGZplusSG.Rmd/top marker 10-1.pdf
    Modified:   figure/integrateAcrossPatientsGZplusSG.Rmd/top marker 10-1.png
    Modified:   figure/integrateAcrossPatientsGZplusSG.Rmd/top marker 11-1.pdf
    Modified:   figure/integrateAcrossPatientsGZplusSG.Rmd/top marker 11-1.png
    Modified:   figure/integrateAcrossPatientsGZplusSG.Rmd/top marker 2-1.pdf
    Modified:   figure/integrateAcrossPatientsGZplusSG.Rmd/top marker 2-1.png
    Modified:   figure/integrateAcrossPatientsGZplusSG.Rmd/top marker 3-1.pdf
    Modified:   figure/integrateAcrossPatientsGZplusSG.Rmd/top marker 3-1.png
    Modified:   figure/integrateAcrossPatientsGZplusSG.Rmd/top marker 4-1.pdf
    Modified:   figure/integrateAcrossPatientsGZplusSG.Rmd/top marker 4-1.png
    Modified:   figure/integrateAcrossPatientsGZplusSG.Rmd/top marker 5-1.pdf
    Modified:   figure/integrateAcrossPatientsGZplusSG.Rmd/top marker 5-1.png
    Modified:   figure/integrateAcrossPatientsGZplusSG.Rmd/top marker 6-1.pdf
    Modified:   figure/integrateAcrossPatientsGZplusSG.Rmd/top marker 6-1.png
    Modified:   figure/integrateAcrossPatientsGZplusSG.Rmd/top marker 7-1.pdf
    Modified:   figure/integrateAcrossPatientsGZplusSG.Rmd/top marker 7-1.png
    Modified:   figure/integrateAcrossPatientsGZplusSG.Rmd/top marker 8-1.pdf
    Modified:   figure/integrateAcrossPatientsGZplusSG.Rmd/top marker 8-1.png
    Modified:   figure/integrateAcrossPatientsGZplusSG.Rmd/top marker 9-1.pdf
    Modified:   figure/integrateAcrossPatientsGZplusSG.Rmd/top marker 9-1.png
    Modified:   figure/mergeHumanSamplesPlusGraz.Rmd/top marker 0-1.pdf
    Modified:   figure/mergeHumanSamplesPlusGraz.Rmd/top marker 0-1.png
    Modified:   figure/mergeHumanSamplesPlusGraz.Rmd/top marker 1-1.pdf
    Modified:   figure/mergeHumanSamplesPlusGraz.Rmd/top marker 1-1.png
    Modified:   figure/mergeHumanSamplesPlusGraz.Rmd/top marker 10-1.pdf
    Modified:   figure/mergeHumanSamplesPlusGraz.Rmd/top marker 10-1.png
    Modified:   figure/mergeHumanSamplesPlusGraz.Rmd/top marker 11-1.pdf
    Modified:   figure/mergeHumanSamplesPlusGraz.Rmd/top marker 11-1.png
    Modified:   figure/mergeHumanSamplesPlusGraz.Rmd/top marker 12-1.pdf
    Modified:   figure/mergeHumanSamplesPlusGraz.Rmd/top marker 12-1.png
    Modified:   figure/mergeHumanSamplesPlusGraz.Rmd/top marker 13-1.pdf
    Modified:   figure/mergeHumanSamplesPlusGraz.Rmd/top marker 13-1.png
    Modified:   figure/mergeHumanSamplesPlusGraz.Rmd/top marker 14-1.pdf
    Modified:   figure/mergeHumanSamplesPlusGraz.Rmd/top marker 14-1.png
    Modified:   figure/mergeHumanSamplesPlusGraz.Rmd/top marker 15-1.pdf
    Modified:   figure/mergeHumanSamplesPlusGraz.Rmd/top marker 15-1.png
    Modified:   figure/mergeHumanSamplesPlusGraz.Rmd/top marker 16-1.pdf
    Modified:   figure/mergeHumanSamplesPlusGraz.Rmd/top marker 16-1.png
    Modified:   figure/mergeHumanSamplesPlusGraz.Rmd/top marker 17-1.pdf
    Modified:   figure/mergeHumanSamplesPlusGraz.Rmd/top marker 17-1.png
    Modified:   figure/mergeHumanSamplesPlusGraz.Rmd/top marker 18-1.pdf
    Modified:   figure/mergeHumanSamplesPlusGraz.Rmd/top marker 18-1.png
    Modified:   figure/mergeHumanSamplesPlusGraz.Rmd/top marker 19-1.pdf
    Modified:   figure/mergeHumanSamplesPlusGraz.Rmd/top marker 19-1.png
    Modified:   figure/mergeHumanSamplesPlusGraz.Rmd/top marker 2-1.pdf
    Modified:   figure/mergeHumanSamplesPlusGraz.Rmd/top marker 2-1.png
    Modified:   figure/mergeHumanSamplesPlusGraz.Rmd/top marker 3-1.pdf
    Modified:   figure/mergeHumanSamplesPlusGraz.Rmd/top marker 3-1.png
    Modified:   figure/mergeHumanSamplesPlusGraz.Rmd/top marker 4-1.pdf
    Modified:   figure/mergeHumanSamplesPlusGraz.Rmd/top marker 4-1.png
    Modified:   figure/mergeHumanSamplesPlusGraz.Rmd/top marker 5-1.pdf
    Modified:   figure/mergeHumanSamplesPlusGraz.Rmd/top marker 5-1.png
    Modified:   figure/mergeHumanSamplesPlusGraz.Rmd/top marker 6-1.pdf
    Modified:   figure/mergeHumanSamplesPlusGraz.Rmd/top marker 6-1.png
    Modified:   figure/mergeHumanSamplesPlusGraz.Rmd/top marker 7-1.pdf
    Modified:   figure/mergeHumanSamplesPlusGraz.Rmd/top marker 7-1.png
    Modified:   figure/mergeHumanSamplesPlusGraz.Rmd/top marker 8-1.pdf
    Modified:   figure/mergeHumanSamplesPlusGraz.Rmd/top marker 8-1.png
    Modified:   figure/mergeHumanSamplesPlusGraz.Rmd/top marker 9-1.pdf
    Modified:   figure/mergeHumanSamplesPlusGraz.Rmd/top marker 9-1.png
    Modified:   metadata2.txt

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/assignLabelshumanHeartsPlusGrazInt.Rmd) and HTML (docs/assignLabelshumanHeartsPlusGrazInt.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 141fae8 mluetge 2022-07-06 assign labels
html 141fae8 mluetge 2022-07-06 assign labels

load packages

suppressPackageStartupMessages({
  library(SingleCellExperiment)
  library(tidyverse)
  library(Seurat)
  library(magrittr)
  library(dplyr)
  library(purrr)
  library(ggplot2)
  library(here)
  library(runSeurat3)
  library(ggsci)
  library(ggpubr)
  library(pheatmap)
  library(viridis)
  library(sctransform)
})

load data

basedir <- here()
seurat <- readRDS(file = paste0(basedir, 
                              "/data/humanHeartsPlusGraz_intPatients_merged", 
                              "_seurat.rds"))
Idents(seurat) <- seurat$seurat_clusters

assign labels

seurat$label <- "other"
seurat$label[which(seurat$seurat_clusters %in% c("4","6","7"))] <- "Endothelial"
seurat$label[which(seurat$seurat_clusters %in% c("5"))] <- "Tcell"
seurat$label[which(seurat$seurat_clusters %in% c("2"))] <- "Cardiomyocyte"
seurat$label[which(seurat$seurat_clusters %in% c("0"))] <- "Fibroblast"
seurat$label[which(seurat$seurat_clusters %in% c("1","8"))] <- "Perivascular"
seurat$label[which(seurat$seurat_clusters %in% c("3"))] <- "MonocyteMacrophage"

color vectors

colPal <- pal_igv()(length(levels(seurat)))
colTec <- pal_jama()(length(unique(seurat$technique)))
colSmp <- c(pal_uchicago()(8), pal_npg()(8), pal_aaas()(10))[1:length(unique(seurat$dataset))]
colCond <- pal_npg()(length(unique(seurat$cond)))
colID <- c(pal_jco()(10), pal_npg()(10), pal_jama()(10))[1:length(unique(seurat$ID))]
colOrig <- pal_aaas()(length(unique(seurat$origin)))
colIso <- pal_nejm()(length(unique(seurat$isolation)))
colProc <- pal_aaas()(length(unique(seurat$processing)))
colLab <- pal_futurama()(length(unique(seurat$label)))

names(colPal) <- levels(seurat)
names(colTec) <- unique(seurat$technique)
names(colSmp) <- unique(seurat$dataset)
names(colCond) <- unique(seurat$cond)
names(colID) <- unique(seurat$ID)
names(colOrig) <- unique(seurat$origin)
names(colIso) <- unique(seurat$isolation)
names(colProc) <- unique(seurat$processing)
names(colLab) <- unique(seurat$label)

vis data

clusters

DimPlot(seurat, reduction = "umap", cols=colPal)+
  theme_bw() +
  theme(axis.text = element_blank(), axis.ticks = element_blank(), 
        panel.grid.minor = element_blank()) +
  xlab("UMAP1") +
  ylab("UMAP2")

Version Author Date
141fae8 mluetge 2022-07-06

label

DimPlot(seurat, reduction = "umap",  group.by = "label", cols=colLab)+
  theme_bw() +
  theme(axis.text = element_blank(), axis.ticks = element_blank(), 
        panel.grid.minor = element_blank()) +
  xlab("UMAP1") +
  ylab("UMAP2")

Version Author Date
141fae8 mluetge 2022-07-06

technique

DimPlot(seurat, reduction = "umap", group.by = "technique", cols=colTec)+
  theme_bw() +
  theme(axis.text = element_blank(), axis.ticks = element_blank(), 
        panel.grid.minor = element_blank()) +
  xlab("UMAP1") +
  ylab("UMAP2")

Version Author Date
141fae8 mluetge 2022-07-06

Sample

DimPlot(seurat, reduction = "umap", group.by = "dataset", cols=colSmp)+
  theme_bw() +
  theme(axis.text = element_blank(), axis.ticks = element_blank(), 
        panel.grid.minor = element_blank()) +
  xlab("UMAP1") +
  ylab("UMAP2")

Version Author Date
141fae8 mluetge 2022-07-06

ID

DimPlot(seurat, reduction = "umap", group.by = "ID", cols=colID)+
  theme_bw() +
  theme(axis.text = element_blank(), axis.ticks = element_blank(), 
        panel.grid.minor = element_blank()) +
  xlab("UMAP1") +
  ylab("UMAP2")

Version Author Date
141fae8 mluetge 2022-07-06

Origin

DimPlot(seurat, reduction = "umap", group.by = "origin", cols=colOrig)+
  theme_bw() +
  theme(axis.text = element_blank(), axis.ticks = element_blank(), 
        panel.grid.minor = element_blank()) +
  xlab("UMAP1") +
  ylab("UMAP2")

Version Author Date
141fae8 mluetge 2022-07-06

isolation

DimPlot(seurat, reduction = "umap", group.by = "isolation", cols=colIso)+
  theme_bw() +
  theme(axis.text = element_blank(), axis.ticks = element_blank(), 
        panel.grid.minor = element_blank()) +
  xlab("UMAP1") +
  ylab("UMAP2")

Version Author Date
141fae8 mluetge 2022-07-06

cond

DimPlot(seurat, reduction = "umap", group.by = "cond", cols=colCond)+
  theme_bw() +
  theme(axis.text = element_blank(), axis.ticks = element_blank(), 
        panel.grid.minor = element_blank()) +
  xlab("UMAP1") +
  ylab("UMAP2")

Version Author Date
141fae8 mluetge 2022-07-06

processing

DimPlot(seurat, reduction = "umap", group.by = "processing", cols=colProc)+
  theme_bw() +
  theme(axis.text = element_blank(), axis.ticks = element_blank(), 
        panel.grid.minor = element_blank()) +
  xlab("UMAP1") +
  ylab("UMAP2")

Version Author Date
141fae8 mluetge 2022-07-06

cnt tables

per patient

## total cells per patient
knitr::kable(table(seurat$ID))
Var1 Freq
GZ1 2740
GZ10 3731
GZ11 3991
GZ12 3818
GZ13 9882
GZ2 1684
GZ3 2396
GZ4 545
GZ5 781
GZ6 491
GZ7 653
GZ8 3921
GZ9 4908
SG29 1242
SG30 236
SG31 1192
SG32 1428
SG33 6286
SG34 620
SG35 2363
## celltype per patient counts
knitr::kable(table(seurat$label, seurat$ID))
GZ1 GZ10 GZ11 GZ12 GZ13 GZ2 GZ3 GZ4 GZ5 GZ6 GZ7 GZ8 GZ9 SG29 SG30 SG31 SG32 SG33 SG34 SG35
Cardiomyocyte 208 1102 298 115 2204 108 234 44 38 12 88 711 650 108 47 178 40 211 173 304
Endothelial 448 404 803 1146 2236 430 577 180 243 154 134 775 1004 169 70 258 578 244 105 580
Fibroblast 760 994 838 1137 2286 642 830 139 261 154 227 1144 1490 153 41 352 313 399 116 767
MonocyteMacrophage 301 486 661 221 895 84 119 54 31 63 17 352 641 271 14 124 68 2147 50 206
other 65 101 28 29 228 35 65 8 27 4 46 82 54 14 4 22 35 32 6 30
Perivascular 679 502 1192 1083 1720 304 492 86 155 68 121 731 939 82 56 230 306 162 141 381
Tcell 279 142 171 87 313 81 79 34 26 36 20 126 130 445 4 28 88 3091 29 95
## celltype percentages per patient
datLab <- data.frame(table(seurat$label, seurat$ID))
colnames(datLab) <- c("label", "ID", "cnt")
datPat <- data.frame(table(seurat$ID))
colnames(datPat) <- c("ID", "total")
datFrac <- datLab %>% left_join(., datPat, by="ID") %>% 
  mutate(percentage = cnt*100/total)
knitr::kable(datFrac)
label ID cnt total percentage
Cardiomyocyte GZ1 208 2740 7.5912409
Endothelial GZ1 448 2740 16.3503650
Fibroblast GZ1 760 2740 27.7372263
MonocyteMacrophage GZ1 301 2740 10.9854015
other GZ1 65 2740 2.3722628
Perivascular GZ1 679 2740 24.7810219
Tcell GZ1 279 2740 10.1824818
Cardiomyocyte GZ10 1102 3731 29.5363173
Endothelial GZ10 404 3731 10.8281962
Fibroblast GZ10 994 3731 26.6416510
MonocyteMacrophage GZ10 486 3731 13.0259984
other GZ10 101 3731 2.7070490
Perivascular GZ10 502 3731 13.4548378
Tcell GZ10 142 3731 3.8059501
Cardiomyocyte GZ11 298 3991 7.4668003
Endothelial GZ11 803 3991 20.1202706
Fibroblast GZ11 838 3991 20.9972438
MonocyteMacrophage GZ11 661 3991 16.5622651
other GZ11 28 3991 0.7015786
Perivascular GZ11 1192 3991 29.8672012
Tcell GZ11 171 3991 4.2846404
Cardiomyocyte GZ12 115 3818 3.0120482
Endothelial GZ12 1146 3818 30.0157150
Fibroblast GZ12 1137 3818 29.7799895
MonocyteMacrophage GZ12 221 3818 5.7883709
other GZ12 29 3818 0.7595600
Perivascular GZ12 1083 3818 28.3656365
Tcell GZ12 87 3818 2.2786799
Cardiomyocyte GZ13 2204 9882 22.3031775
Endothelial GZ13 2236 9882 22.6269986
Fibroblast GZ13 2286 9882 23.1329690
MonocyteMacrophage GZ13 895 9882 9.0568711
other GZ13 228 9882 2.3072253
Perivascular GZ13 1720 9882 17.4053835
Tcell GZ13 313 9882 3.1673750
Cardiomyocyte GZ2 108 1684 6.4133017
Endothelial GZ2 430 1684 25.5344418
Fibroblast GZ2 642 1684 38.1235154
MonocyteMacrophage GZ2 84 1684 4.9881235
other GZ2 35 1684 2.0783848
Perivascular GZ2 304 1684 18.0522565
Tcell GZ2 81 1684 4.8099762
Cardiomyocyte GZ3 234 2396 9.7662771
Endothelial GZ3 577 2396 24.0818030
Fibroblast GZ3 830 2396 34.6410684
MonocyteMacrophage GZ3 119 2396 4.9666110
other GZ3 65 2396 2.7128548
Perivascular GZ3 492 2396 20.5342237
Tcell GZ3 79 2396 3.2971619
Cardiomyocyte GZ4 44 545 8.0733945
Endothelial GZ4 180 545 33.0275229
Fibroblast GZ4 139 545 25.5045872
MonocyteMacrophage GZ4 54 545 9.9082569
other GZ4 8 545 1.4678899
Perivascular GZ4 86 545 15.7798165
Tcell GZ4 34 545 6.2385321
Cardiomyocyte GZ5 38 781 4.8655570
Endothelial GZ5 243 781 31.1139565
Fibroblast GZ5 261 781 33.4186940
MonocyteMacrophage GZ5 31 781 3.9692702
other GZ5 27 781 3.4571063
Perivascular GZ5 155 781 19.8463508
Tcell GZ5 26 781 3.3290653
Cardiomyocyte GZ6 12 491 2.4439919
Endothelial GZ6 154 491 31.3645621
Fibroblast GZ6 154 491 31.3645621
MonocyteMacrophage GZ6 63 491 12.8309572
other GZ6 4 491 0.8146640
Perivascular GZ6 68 491 13.8492872
Tcell GZ6 36 491 7.3319756
Cardiomyocyte GZ7 88 653 13.4762634
Endothelial GZ7 134 653 20.5206738
Fibroblast GZ7 227 653 34.7626340
MonocyteMacrophage GZ7 17 653 2.6033691
other GZ7 46 653 7.0444104
Perivascular GZ7 121 653 18.5298622
Tcell GZ7 20 653 3.0627871
Cardiomyocyte GZ8 711 3921 18.1331293
Endothelial GZ8 775 3921 19.7653660
Fibroblast GZ8 1144 3921 29.1762306
MonocyteMacrophage GZ8 352 3921 8.9773017
other GZ8 82 3921 2.0913032
Perivascular GZ8 731 3921 18.6432033
Tcell GZ8 126 3921 3.2134660
Cardiomyocyte GZ9 650 4908 13.2436838
Endothelial GZ9 1004 4908 20.4563977
Fibroblast GZ9 1490 4908 30.3585982
MonocyteMacrophage GZ9 641 4908 13.0603097
other GZ9 54 4908 1.1002445
Perivascular GZ9 939 4908 19.1320293
Tcell GZ9 130 4908 2.6487368
Cardiomyocyte SG29 108 1242 8.6956522
Endothelial SG29 169 1242 13.6070853
Fibroblast SG29 153 1242 12.3188406
MonocyteMacrophage SG29 271 1242 21.8196457
other SG29 14 1242 1.1272142
Perivascular SG29 82 1242 6.6022544
Tcell SG29 445 1242 35.8293076
Cardiomyocyte SG30 47 236 19.9152542
Endothelial SG30 70 236 29.6610169
Fibroblast SG30 41 236 17.3728814
MonocyteMacrophage SG30 14 236 5.9322034
other SG30 4 236 1.6949153
Perivascular SG30 56 236 23.7288136
Tcell SG30 4 236 1.6949153
Cardiomyocyte SG31 178 1192 14.9328859
Endothelial SG31 258 1192 21.6442953
Fibroblast SG31 352 1192 29.5302013
MonocyteMacrophage SG31 124 1192 10.4026846
other SG31 22 1192 1.8456376
Perivascular SG31 230 1192 19.2953020
Tcell SG31 28 1192 2.3489933
Cardiomyocyte SG32 40 1428 2.8011204
Endothelial SG32 578 1428 40.4761905
Fibroblast SG32 313 1428 21.9187675
MonocyteMacrophage SG32 68 1428 4.7619048
other SG32 35 1428 2.4509804
Perivascular SG32 306 1428 21.4285714
Tcell SG32 88 1428 6.1624650
Cardiomyocyte SG33 211 6286 3.3566656
Endothelial SG33 244 6286 3.8816417
Fibroblast SG33 399 6286 6.3474388
MonocyteMacrophage SG33 2147 6286 34.1552657
other SG33 32 6286 0.5090678
Perivascular SG33 162 6286 2.5771556
Tcell SG33 3091 6286 49.1727649
Cardiomyocyte SG34 173 620 27.9032258
Endothelial SG34 105 620 16.9354839
Fibroblast SG34 116 620 18.7096774
MonocyteMacrophage SG34 50 620 8.0645161
other SG34 6 620 0.9677419
Perivascular SG34 141 620 22.7419355
Tcell SG34 29 620 4.6774194
Cardiomyocyte SG35 304 2363 12.8650021
Endothelial SG35 580 2363 24.5450698
Fibroblast SG35 767 2363 32.4587389
MonocyteMacrophage SG35 206 2363 8.7177317
other SG35 30 2363 1.2695726
Perivascular SG35 381 2363 16.1235717
Tcell SG35 95 2363 4.0203132
ggbarplot(datFrac, x="ID", y="percentage",
          fill = "label",
          palette = colLab) +
  rotate_x_text(angle = 90)

Version Author Date
141fae8 mluetge 2022-07-06

per cond

## total cells per cond
knitr::kable(table(seurat$cond))
Var1 Freq
HH 30251
InfCardiomyopathy 1428
inflamation 236
Myocarditis 19801
Perimyocarditis 1192
## celltype per cond counts
knitr::kable(table(seurat$label, seurat$cond))
HH InfCardiomyopathy inflamation Myocarditis Perimyocarditis
Cardiomyocyte 5080 40 47 1528 178
Endothelial 6368 578 70 3264 258
Fibroblast 7889 313 41 4448 352
MonocyteMacrophage 3256 68 14 3343 124
other 522 35 4 332 22
Perivascular 6167 306 56 2671 230
Tcell 969 88 4 4215 28
## celltype percentages per cond
datLab <- data.frame(table(seurat$label, seurat$cond))
colnames(datLab) <- c("label", "cond", "cnt")
datPat <- data.frame(table(seurat$cond))
colnames(datPat) <- c("cond", "total")
datFrac <- datLab %>% left_join(., datPat, by="cond") %>% 
  mutate(percentage = cnt*100/total)
knitr::kable(datFrac)
label cond cnt total percentage
Cardiomyocyte HH 5080 30251 16.792833
Endothelial HH 6368 30251 21.050544
Fibroblast HH 7889 30251 26.078477
MonocyteMacrophage HH 3256 30251 10.763281
other HH 522 30251 1.725563
Perivascular HH 6167 30251 20.386103
Tcell HH 969 30251 3.203200
Cardiomyocyte InfCardiomyopathy 40 1428 2.801120
Endothelial InfCardiomyopathy 578 1428 40.476191
Fibroblast InfCardiomyopathy 313 1428 21.918768
MonocyteMacrophage InfCardiomyopathy 68 1428 4.761905
other InfCardiomyopathy 35 1428 2.450980
Perivascular InfCardiomyopathy 306 1428 21.428571
Tcell InfCardiomyopathy 88 1428 6.162465
Cardiomyocyte inflamation 47 236 19.915254
Endothelial inflamation 70 236 29.661017
Fibroblast inflamation 41 236 17.372881
MonocyteMacrophage inflamation 14 236 5.932203
other inflamation 4 236 1.694915
Perivascular inflamation 56 236 23.728814
Tcell inflamation 4 236 1.694915
Cardiomyocyte Myocarditis 1528 19801 7.716782
Endothelial Myocarditis 3264 19801 16.484016
Fibroblast Myocarditis 4448 19801 22.463512
MonocyteMacrophage Myocarditis 3343 19801 16.882986
other Myocarditis 332 19801 1.676683
Perivascular Myocarditis 2671 19801 13.489218
Tcell Myocarditis 4215 19801 21.286804
Cardiomyocyte Perimyocarditis 178 1192 14.932886
Endothelial Perimyocarditis 258 1192 21.644295
Fibroblast Perimyocarditis 352 1192 29.530201
MonocyteMacrophage Perimyocarditis 124 1192 10.402685
other Perimyocarditis 22 1192 1.845638
Perivascular Perimyocarditis 230 1192 19.295302
Tcell Perimyocarditis 28 1192 2.348993
ggbarplot(datFrac, x="cond", y="percentage",
          fill = "label",
          palette = colLab) +
  rotate_x_text(angle = 90)

Version Author Date
141fae8 mluetge 2022-07-06

vis marker for celltype assignment

heatmap

genes <- data.frame(gene=rownames(seurat)) %>% 
    mutate(geneID=gsub("^.*\\.", "", gene)) 

selGenesAll <- read_tsv(file = paste0(basedir,
                                      "/data/markerLabels.txt")) %>% 
  left_join(., genes, by = "geneID")

Idents(seurat) <- seurat$seurat_clusters
pOut <- avgHeatmap(seurat = seurat, selGenes = selGenesAll,
                  colVecIdent = colPal, 
                  ordVec=levels(seurat),
                  gapVecR=NULL, gapVecC=NULL,cc=T,
                  cr=F, condCol=F)

Version Author Date
141fae8 mluetge 2022-07-06
Idents(seurat) <- seurat$label
pOut <- avgHeatmap(seurat = seurat, selGenes = selGenesAll,
                  colVecIdent = colLab, 
                  ordVec=levels(seurat),
                  gapVecR=NULL, gapVecC=NULL,cc=T,
                  cr=F, condCol=F)

Version Author Date
141fae8 mluetge 2022-07-06

Dotplot

DotPlot(seurat, assay="RNA", features = selGenesAll$gene, scale =T,
        cluster.idents = T) +
  scale_color_viridis_c() +
  coord_flip() +
  theme(axis.text.x = element_text(angle = 90, hjust = 1)) +
  scale_x_discrete(breaks=selGenesAll$gene, labels=selGenesAll$geneID) +
  xlab("") + ylab("")

Version Author Date
141fae8 mluetge 2022-07-06
Idents(seurat) <- seurat$seurat_clusters
DotPlot(seurat, assay="RNA", features = selGenesAll$gene, scale =T,
        cluster.idents = T) +
  scale_color_viridis_c() +
  coord_flip() +
  theme(axis.text.x = element_text(angle = 90, hjust = 1)) +
  scale_x_discrete(breaks=selGenesAll$gene, labels=selGenesAll$geneID) +
  xlab("") + ylab("")

Version Author Date
141fae8 mluetge 2022-07-06

save seurat object

saveRDS(seurat, file = paste0(basedir, 
                              "/data/humanHeartsPlusGraz_intPatients_merged", 
                              "labeled_seurat.rds"))

session info

sessionInfo()
R version 4.2.1 (2022-06-23)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Big Sur ... 10.16

Matrix products: default
BLAS:   /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats4    stats     graphics  grDevices utils     datasets  methods  
[8] base     

other attached packages:
 [1] sctransform_0.3.4           viridis_0.6.2              
 [3] viridisLite_0.4.1           pheatmap_1.0.12            
 [5] ggpubr_0.4.0                ggsci_2.9                  
 [7] runSeurat3_0.1.0            here_1.0.1                 
 [9] magrittr_2.0.3              sp_1.5-0                   
[11] SeuratObject_4.1.1          Seurat_4.1.1               
[13] forcats_0.5.2               stringr_1.4.1              
[15] dplyr_1.0.10                purrr_0.3.4                
[17] readr_2.1.2                 tidyr_1.2.0                
[19] tibble_3.1.8                ggplot2_3.3.6              
[21] tidyverse_1.3.2             SingleCellExperiment_1.18.0
[23] SummarizedExperiment_1.26.1 Biobase_2.56.0             
[25] GenomicRanges_1.48.0        GenomeInfoDb_1.32.3        
[27] IRanges_2.30.1              S4Vectors_0.34.0           
[29] BiocGenerics_0.42.0         MatrixGenerics_1.8.1       
[31] matrixStats_0.62.0         

loaded via a namespace (and not attached):
  [1] utf8_1.2.2             reticulate_1.26        tidyselect_1.1.2      
  [4] htmlwidgets_1.5.4      grid_4.2.1             Rtsne_0.16            
  [7] munsell_0.5.0          codetools_0.2-18       ica_1.0-3             
 [10] future_1.28.0          miniUI_0.1.1.1         withr_2.5.0           
 [13] spatstat.random_2.2-0  colorspace_2.0-3       progressr_0.11.0      
 [16] highr_0.9              knitr_1.40             rstudioapi_0.14       
 [19] ROCR_1.0-11            ggsignif_0.6.3         tensor_1.5            
 [22] listenv_0.8.0          labeling_0.4.2         git2r_0.30.1          
 [25] GenomeInfoDbData_1.2.8 polyclip_1.10-0        bit64_4.0.5           
 [28] farver_2.1.1           rprojroot_2.0.3        parallelly_1.32.1     
 [31] vctrs_0.4.1            generics_0.1.3         xfun_0.32             
 [34] R6_2.5.1               bitops_1.0-7           spatstat.utils_2.3-1  
 [37] cachem_1.0.6           DelayedArray_0.22.0    assertthat_0.2.1      
 [40] vroom_1.5.7            promises_1.2.0.1       scales_1.2.1          
 [43] googlesheets4_1.0.1    rgeos_0.5-9            gtable_0.3.1          
 [46] globals_0.16.1         goftest_1.2-3          workflowr_1.7.0       
 [49] rlang_1.0.5            splines_4.2.1          rstatix_0.7.0         
 [52] lazyeval_0.2.2         gargle_1.2.0           spatstat.geom_2.4-0   
 [55] broom_1.0.1            yaml_2.3.5             reshape2_1.4.4        
 [58] abind_1.4-5            modelr_0.1.9           backports_1.4.1       
 [61] httpuv_1.6.5           tools_4.2.1            ellipsis_0.3.2        
 [64] spatstat.core_2.4-4    jquerylib_0.1.4        RColorBrewer_1.1-3    
 [67] ggridges_0.5.3         Rcpp_1.0.9             plyr_1.8.7            
 [70] zlibbioc_1.42.0        RCurl_1.98-1.8         rpart_4.1.16          
 [73] deldir_1.0-6           pbapply_1.5-0          cowplot_1.1.1         
 [76] zoo_1.8-10             haven_2.5.1            ggrepel_0.9.1         
 [79] cluster_2.1.4          fs_1.5.2               data.table_1.14.2     
 [82] scattermore_0.8        lmtest_0.9-40          reprex_2.0.2          
 [85] RANN_2.6.1             googledrive_2.0.0      whisker_0.4           
 [88] fitdistrplus_1.1-8     hms_1.1.2              patchwork_1.1.2       
 [91] mime_0.12              evaluate_0.16          xtable_1.8-4          
 [94] readxl_1.4.1           gridExtra_2.3          compiler_4.2.1        
 [97] KernSmooth_2.23-20     crayon_1.5.1           htmltools_0.5.3       
[100] mgcv_1.8-40            later_1.3.0            tzdb_0.3.0            
[103] lubridate_1.8.0        DBI_1.1.3              dbplyr_2.2.1          
[106] MASS_7.3-58.1          Matrix_1.4-1           car_3.1-0             
[109] cli_3.3.0              parallel_4.2.1         igraph_1.3.4          
[112] pkgconfig_2.0.3        plotly_4.10.0          spatstat.sparse_2.1-1 
[115] xml2_1.3.3             bslib_0.4.0            XVector_0.36.0        
[118] rvest_1.0.3            digest_0.6.29          RcppAnnoy_0.0.19      
[121] spatstat.data_2.2-0    rmarkdown_2.16         cellranger_1.1.0      
[124] leiden_0.4.2           uwot_0.1.14            shiny_1.7.2           
[127] lifecycle_1.0.1        nlme_3.1-159           jsonlite_1.8.0        
[130] carData_3.0-5          fansi_1.0.3            pillar_1.8.1          
[133] lattice_0.20-45        fastmap_1.1.0          httr_1.4.4            
[136] survival_3.4-0         glue_1.6.2             png_0.1-7             
[139] bit_4.0.4              stringi_1.7.8          sass_0.4.2            
[142] irlba_2.3.5            future.apply_1.9.0    
date()
[1] "Mon Sep 12 13:18:27 2022"

sessionInfo()
R version 4.2.1 (2022-06-23)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Big Sur ... 10.16

Matrix products: default
BLAS:   /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats4    stats     graphics  grDevices utils     datasets  methods  
[8] base     

other attached packages:
 [1] sctransform_0.3.4           viridis_0.6.2              
 [3] viridisLite_0.4.1           pheatmap_1.0.12            
 [5] ggpubr_0.4.0                ggsci_2.9                  
 [7] runSeurat3_0.1.0            here_1.0.1                 
 [9] magrittr_2.0.3              sp_1.5-0                   
[11] SeuratObject_4.1.1          Seurat_4.1.1               
[13] forcats_0.5.2               stringr_1.4.1              
[15] dplyr_1.0.10                purrr_0.3.4                
[17] readr_2.1.2                 tidyr_1.2.0                
[19] tibble_3.1.8                ggplot2_3.3.6              
[21] tidyverse_1.3.2             SingleCellExperiment_1.18.0
[23] SummarizedExperiment_1.26.1 Biobase_2.56.0             
[25] GenomicRanges_1.48.0        GenomeInfoDb_1.32.3        
[27] IRanges_2.30.1              S4Vectors_0.34.0           
[29] BiocGenerics_0.42.0         MatrixGenerics_1.8.1       
[31] matrixStats_0.62.0         

loaded via a namespace (and not attached):
  [1] utf8_1.2.2             reticulate_1.26        tidyselect_1.1.2      
  [4] htmlwidgets_1.5.4      grid_4.2.1             Rtsne_0.16            
  [7] munsell_0.5.0          codetools_0.2-18       ica_1.0-3             
 [10] future_1.28.0          miniUI_0.1.1.1         withr_2.5.0           
 [13] spatstat.random_2.2-0  colorspace_2.0-3       progressr_0.11.0      
 [16] highr_0.9              knitr_1.40             rstudioapi_0.14       
 [19] ROCR_1.0-11            ggsignif_0.6.3         tensor_1.5            
 [22] listenv_0.8.0          labeling_0.4.2         git2r_0.30.1          
 [25] GenomeInfoDbData_1.2.8 polyclip_1.10-0        bit64_4.0.5           
 [28] farver_2.1.1           rprojroot_2.0.3        parallelly_1.32.1     
 [31] vctrs_0.4.1            generics_0.1.3         xfun_0.32             
 [34] R6_2.5.1               bitops_1.0-7           spatstat.utils_2.3-1  
 [37] cachem_1.0.6           DelayedArray_0.22.0    assertthat_0.2.1      
 [40] vroom_1.5.7            promises_1.2.0.1       scales_1.2.1          
 [43] googlesheets4_1.0.1    rgeos_0.5-9            gtable_0.3.1          
 [46] globals_0.16.1         goftest_1.2-3          workflowr_1.7.0       
 [49] rlang_1.0.5            splines_4.2.1          rstatix_0.7.0         
 [52] lazyeval_0.2.2         gargle_1.2.0           spatstat.geom_2.4-0   
 [55] broom_1.0.1            yaml_2.3.5             reshape2_1.4.4        
 [58] abind_1.4-5            modelr_0.1.9           backports_1.4.1       
 [61] httpuv_1.6.5           tools_4.2.1            ellipsis_0.3.2        
 [64] spatstat.core_2.4-4    jquerylib_0.1.4        RColorBrewer_1.1-3    
 [67] ggridges_0.5.3         Rcpp_1.0.9             plyr_1.8.7            
 [70] zlibbioc_1.42.0        RCurl_1.98-1.8         rpart_4.1.16          
 [73] deldir_1.0-6           pbapply_1.5-0          cowplot_1.1.1         
 [76] zoo_1.8-10             haven_2.5.1            ggrepel_0.9.1         
 [79] cluster_2.1.4          fs_1.5.2               data.table_1.14.2     
 [82] scattermore_0.8        lmtest_0.9-40          reprex_2.0.2          
 [85] RANN_2.6.1             googledrive_2.0.0      whisker_0.4           
 [88] fitdistrplus_1.1-8     hms_1.1.2              patchwork_1.1.2       
 [91] mime_0.12              evaluate_0.16          xtable_1.8-4          
 [94] readxl_1.4.1           gridExtra_2.3          compiler_4.2.1        
 [97] KernSmooth_2.23-20     crayon_1.5.1           htmltools_0.5.3       
[100] mgcv_1.8-40            later_1.3.0            tzdb_0.3.0            
[103] lubridate_1.8.0        DBI_1.1.3              dbplyr_2.2.1          
[106] MASS_7.3-58.1          Matrix_1.4-1           car_3.1-0             
[109] cli_3.3.0              parallel_4.2.1         igraph_1.3.4          
[112] pkgconfig_2.0.3        plotly_4.10.0          spatstat.sparse_2.1-1 
[115] xml2_1.3.3             bslib_0.4.0            XVector_0.36.0        
[118] rvest_1.0.3            digest_0.6.29          RcppAnnoy_0.0.19      
[121] spatstat.data_2.2-0    rmarkdown_2.16         cellranger_1.1.0      
[124] leiden_0.4.2           uwot_0.1.14            shiny_1.7.2           
[127] lifecycle_1.0.1        nlme_3.1-159           jsonlite_1.8.0        
[130] carData_3.0-5          fansi_1.0.3            pillar_1.8.1          
[133] lattice_0.20-45        fastmap_1.1.0          httr_1.4.4            
[136] survival_3.4-0         glue_1.6.2             png_0.1-7             
[139] bit_4.0.4              stringi_1.7.8          sass_0.4.2            
[142] irlba_2.3.5            future.apply_1.9.0