Last updated: 2022-09-26

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 cd902dd. 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

Unstaged changes:
    Modified:   analysis/assignLabelshumanHeartsPlusGrazInt.Rmd
    Modified:   analysis/integrateAcrossPatientsGZplusSG.Rmd
    Modified:   analysis/mergeHumanSamplesPlusGraz.Rmd
    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 cd902dd mluetge 2022-09-12 add human cardiac samples GZ and SG
html cd902dd mluetge 2022-09-12 add human cardiac samples GZ and SG
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("2","6","7"))] <- "Endothelial"
seurat$label[which(seurat$seurat_clusters %in% c("5"))] <- "Tcell"
seurat$label[which(seurat$seurat_clusters %in% c("4"))] <- "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 <- c(pal_igv()(12),
            pal_aaas()(10))[1:length(levels(seurat))]
colTec <- pal_jama()(length(unique(seurat$technique)))
colSmp <- c(pal_uchicago()(9), pal_npg()(10), pal_aaas()(10), 
            pal_jama()(7))[1:length(unique(seurat$dataset))]
colCond <- pal_npg()(length(unique(seurat$cond)))
colID <- c(pal_jco()(10), pal_npg()(10), pal_futurama()(10),
           pal_d3()(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
cd902dd mluetge 2022-09-12
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
cd902dd mluetge 2022-09-12
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
cd902dd mluetge 2022-09-12
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
cd902dd mluetge 2022-09-12
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
cd902dd mluetge 2022-09-12
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
cd902dd mluetge 2022-09-12
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
cd902dd mluetge 2022-09-12
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
cd902dd mluetge 2022-09-12
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
cd902dd mluetge 2022-09-12
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
GZ14 1268
GZ15 4439
GZ16 436
GZ17 1370
GZ18 2280
GZ19 111
GZ2 1684
GZ20 2706
GZ21 1442
GZ22 1998
GZ23 841
GZ24 1480
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 GZ14 GZ15 GZ16 GZ17 GZ18 GZ19 GZ2 GZ20 GZ21 GZ22 GZ23 GZ24 GZ3 GZ4 GZ5 GZ6 GZ7 GZ8 GZ9 SG29 SG30 SG31 SG32 SG33 SG34 SG35
Cardiomyocyte 208 1098 299 116 2206 50 116 25 71 328 1 108 46 58 159 54 117 234 45 39 12 88 714 650 109 47 178 40 212 173 304
Endothelial 442 411 810 1152 2259 323 1067 72 193 643 30 425 1242 258 273 226 285 592 180 244 155 131 783 1025 165 74 257 581 257 104 581
Fibroblast 718 984 841 1110 2222 316 1095 90 368 624 16 640 624 99 314 68 268 815 136 261 150 220 1146 1468 141 42 347 307 402 115 759
MonocyteMacrophage 299 487 659 221 898 91 330 56 331 93 17 85 137 184 444 123 106 118 54 31 63 18 359 638 321 14 124 65 2170 51 204
other 59 93 27 22 205 10 77 11 28 29 1 30 20 15 30 7 11 37 8 27 3 53 69 34 15 0 23 33 32 6 29
Perivascular 746 523 1201 1096 1813 439 1536 80 190 517 33 322 497 803 728 337 657 523 90 156 72 123 742 999 103 55 234 320 170 145 397
Tcell 268 135 154 101 279 39 218 102 189 46 13 74 140 25 50 26 36 77 32 23 36 20 108 94 388 4 29 82 3043 26 89
## 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 442 2740 16.1313869
Fibroblast GZ1 718 2740 26.2043796
MonocyteMacrophage GZ1 299 2740 10.9124088
other GZ1 59 2740 2.1532847
Perivascular GZ1 746 2740 27.2262774
Tcell GZ1 268 2740 9.7810219
Cardiomyocyte GZ10 1098 3731 29.4291075
Endothelial GZ10 411 3731 11.0158135
Fibroblast GZ10 984 3731 26.3736264
MonocyteMacrophage GZ10 487 3731 13.0528009
other GZ10 93 3731 2.4926293
Perivascular GZ10 523 3731 14.0176896
Tcell GZ10 135 3731 3.6183329
Cardiomyocyte GZ11 299 3991 7.4918567
Endothelial GZ11 810 3991 20.2956652
Fibroblast GZ11 841 3991 21.0724129
MonocyteMacrophage GZ11 659 3991 16.5121523
other GZ11 27 3991 0.6765222
Perivascular GZ11 1201 3991 30.0927086
Tcell GZ11 154 3991 3.8586820
Cardiomyocyte GZ12 116 3818 3.0382399
Endothelial GZ12 1152 3818 30.1728654
Fibroblast GZ12 1110 3818 29.0728130
MonocyteMacrophage GZ12 221 3818 5.7883709
other GZ12 22 3818 0.5762179
Perivascular GZ12 1096 3818 28.7061289
Tcell GZ12 101 3818 2.6453641
Cardiomyocyte GZ13 2206 9882 22.3234163
Endothelial GZ13 2259 9882 22.8597450
Fibroblast GZ13 2222 9882 22.4853269
MonocyteMacrophage GZ13 898 9882 9.0872293
other GZ13 205 9882 2.0744789
Perivascular GZ13 1813 9882 18.3464886
Tcell GZ13 279 9882 2.8233151
Cardiomyocyte GZ14 50 1268 3.9432177
Endothelial GZ14 323 1268 25.4731861
Fibroblast GZ14 316 1268 24.9211356
MonocyteMacrophage GZ14 91 1268 7.1766562
other GZ14 10 1268 0.7886435
Perivascular GZ14 439 1268 34.6214511
Tcell GZ14 39 1268 3.0757098
Cardiomyocyte GZ15 116 4439 2.6132012
Endothelial GZ15 1067 4439 24.0369453
Fibroblast GZ15 1095 4439 24.6677180
MonocyteMacrophage GZ15 330 4439 7.4341068
other GZ15 77 4439 1.7346249
Perivascular GZ15 1536 4439 34.6023879
Tcell GZ15 218 4439 4.9110160
Cardiomyocyte GZ16 25 436 5.7339450
Endothelial GZ16 72 436 16.5137615
Fibroblast GZ16 90 436 20.6422018
MonocyteMacrophage GZ16 56 436 12.8440367
other GZ16 11 436 2.5229358
Perivascular GZ16 80 436 18.3486239
Tcell GZ16 102 436 23.3944954
Cardiomyocyte GZ17 71 1370 5.1824818
Endothelial GZ17 193 1370 14.0875912
Fibroblast GZ17 368 1370 26.8613139
MonocyteMacrophage GZ17 331 1370 24.1605839
other GZ17 28 1370 2.0437956
Perivascular GZ17 190 1370 13.8686131
Tcell GZ17 189 1370 13.7956204
Cardiomyocyte GZ18 328 2280 14.3859649
Endothelial GZ18 643 2280 28.2017544
Fibroblast GZ18 624 2280 27.3684211
MonocyteMacrophage GZ18 93 2280 4.0789474
other GZ18 29 2280 1.2719298
Perivascular GZ18 517 2280 22.6754386
Tcell GZ18 46 2280 2.0175439
Cardiomyocyte GZ19 1 111 0.9009009
Endothelial GZ19 30 111 27.0270270
Fibroblast GZ19 16 111 14.4144144
MonocyteMacrophage GZ19 17 111 15.3153153
other GZ19 1 111 0.9009009
Perivascular GZ19 33 111 29.7297297
Tcell GZ19 13 111 11.7117117
Cardiomyocyte GZ2 108 1684 6.4133017
Endothelial GZ2 425 1684 25.2375297
Fibroblast GZ2 640 1684 38.0047506
MonocyteMacrophage GZ2 85 1684 5.0475059
other GZ2 30 1684 1.7814727
Perivascular GZ2 322 1684 19.1211401
Tcell GZ2 74 1684 4.3942993
Cardiomyocyte GZ20 46 2706 1.6999261
Endothelial GZ20 1242 2706 45.8980044
Fibroblast GZ20 624 2706 23.0598670
MonocyteMacrophage GZ20 137 2706 5.0628234
other GZ20 20 2706 0.7390983
Perivascular GZ20 497 2706 18.3665928
Tcell GZ20 140 2706 5.1736881
Cardiomyocyte GZ21 58 1442 4.0221914
Endothelial GZ21 258 1442 17.8918169
Fibroblast GZ21 99 1442 6.8654646
MonocyteMacrophage GZ21 184 1442 12.7600555
other GZ21 15 1442 1.0402219
Perivascular GZ21 803 1442 55.6865465
Tcell GZ21 25 1442 1.7337032
Cardiomyocyte GZ22 159 1998 7.9579580
Endothelial GZ22 273 1998 13.6636637
Fibroblast GZ22 314 1998 15.7157157
MonocyteMacrophage GZ22 444 1998 22.2222222
other GZ22 30 1998 1.5015015
Perivascular GZ22 728 1998 36.4364364
Tcell GZ22 50 1998 2.5025025
Cardiomyocyte GZ23 54 841 6.4209275
Endothelial GZ23 226 841 26.8727705
Fibroblast GZ23 68 841 8.0856124
MonocyteMacrophage GZ23 123 841 14.6254459
other GZ23 7 841 0.8323424
Perivascular GZ23 337 841 40.0713436
Tcell GZ23 26 841 3.0915577
Cardiomyocyte GZ24 117 1480 7.9054054
Endothelial GZ24 285 1480 19.2567568
Fibroblast GZ24 268 1480 18.1081081
MonocyteMacrophage GZ24 106 1480 7.1621622
other GZ24 11 1480 0.7432432
Perivascular GZ24 657 1480 44.3918919
Tcell GZ24 36 1480 2.4324324
Cardiomyocyte GZ3 234 2396 9.7662771
Endothelial GZ3 592 2396 24.7078464
Fibroblast GZ3 815 2396 34.0150250
MonocyteMacrophage GZ3 118 2396 4.9248748
other GZ3 37 2396 1.5442404
Perivascular GZ3 523 2396 21.8280467
Tcell GZ3 77 2396 3.2136895
Cardiomyocyte GZ4 45 545 8.2568807
Endothelial GZ4 180 545 33.0275229
Fibroblast GZ4 136 545 24.9541284
MonocyteMacrophage GZ4 54 545 9.9082569
other GZ4 8 545 1.4678899
Perivascular GZ4 90 545 16.5137615
Tcell GZ4 32 545 5.8715596
Cardiomyocyte GZ5 39 781 4.9935980
Endothelial GZ5 244 781 31.2419974
Fibroblast GZ5 261 781 33.4186940
MonocyteMacrophage GZ5 31 781 3.9692702
other GZ5 27 781 3.4571063
Perivascular GZ5 156 781 19.9743918
Tcell GZ5 23 781 2.9449424
Cardiomyocyte GZ6 12 491 2.4439919
Endothelial GZ6 155 491 31.5682281
Fibroblast GZ6 150 491 30.5498982
MonocyteMacrophage GZ6 63 491 12.8309572
other GZ6 3 491 0.6109980
Perivascular GZ6 72 491 14.6639511
Tcell GZ6 36 491 7.3319756
Cardiomyocyte GZ7 88 653 13.4762634
Endothelial GZ7 131 653 20.0612557
Fibroblast GZ7 220 653 33.6906585
MonocyteMacrophage GZ7 18 653 2.7565084
other GZ7 53 653 8.1163859
Perivascular GZ7 123 653 18.8361409
Tcell GZ7 20 653 3.0627871
Cardiomyocyte GZ8 714 3921 18.2096404
Endothelial GZ8 783 3921 19.9693956
Fibroblast GZ8 1146 3921 29.2272379
MonocyteMacrophage GZ8 359 3921 9.1558276
other GZ8 69 3921 1.7597552
Perivascular GZ8 742 3921 18.9237439
Tcell GZ8 108 3921 2.7543994
Cardiomyocyte GZ9 650 4908 13.2436838
Endothelial GZ9 1025 4908 20.8842706
Fibroblast GZ9 1468 4908 29.9103504
MonocyteMacrophage GZ9 638 4908 12.9991850
other GZ9 34 4908 0.6927465
Perivascular GZ9 999 4908 20.3545232
Tcell GZ9 94 4908 1.9152404
Cardiomyocyte SG29 109 1242 8.7761675
Endothelial SG29 165 1242 13.2850242
Fibroblast SG29 141 1242 11.3526570
MonocyteMacrophage SG29 321 1242 25.8454106
other SG29 15 1242 1.2077295
Perivascular SG29 103 1242 8.2930757
Tcell SG29 388 1242 31.2399356
Cardiomyocyte SG30 47 236 19.9152542
Endothelial SG30 74 236 31.3559322
Fibroblast SG30 42 236 17.7966102
MonocyteMacrophage SG30 14 236 5.9322034
other SG30 0 236 0.0000000
Perivascular SG30 55 236 23.3050847
Tcell SG30 4 236 1.6949153
Cardiomyocyte SG31 178 1192 14.9328859
Endothelial SG31 257 1192 21.5604027
Fibroblast SG31 347 1192 29.1107383
MonocyteMacrophage SG31 124 1192 10.4026846
other SG31 23 1192 1.9295302
Perivascular SG31 234 1192 19.6308725
Tcell SG31 29 1192 2.4328859
Cardiomyocyte SG32 40 1428 2.8011204
Endothelial SG32 581 1428 40.6862745
Fibroblast SG32 307 1428 21.4985994
MonocyteMacrophage SG32 65 1428 4.5518207
other SG32 33 1428 2.3109244
Perivascular SG32 320 1428 22.4089636
Tcell SG32 82 1428 5.7422969
Cardiomyocyte SG33 212 6286 3.3725740
Endothelial SG33 257 6286 4.0884505
Fibroblast SG33 402 6286 6.3951639
MonocyteMacrophage SG33 2170 6286 34.5211581
other SG33 32 6286 0.5090678
Perivascular SG33 170 6286 2.7044225
Tcell SG33 3043 6286 48.4091632
Cardiomyocyte SG34 173 620 27.9032258
Endothelial SG34 104 620 16.7741935
Fibroblast SG34 115 620 18.5483871
MonocyteMacrophage SG34 51 620 8.2258065
other SG34 6 620 0.9677419
Perivascular SG34 145 620 23.3870968
Tcell SG34 26 620 4.1935484
Cardiomyocyte SG35 304 2363 12.8650021
Endothelial SG35 581 2363 24.5873889
Fibroblast SG35 759 2363 32.1201862
MonocyteMacrophage SG35 204 2363 8.6330935
other SG35 29 2363 1.2272535
Perivascular SG35 397 2363 16.8006771
Tcell SG35 89 2363 3.7663986
ggbarplot(datFrac, x="ID", y="percentage",
          fill = "label",
          palette = colLab) +
  rotate_x_text(angle = 90)

Version Author Date
cd902dd mluetge 2022-09-12
141fae8 mluetge 2022-07-06

per cond

## total cells per cond
knitr::kable(table(seurat$cond))
Var1 Freq
HH 36012
InfCardiomyopathy 1428
inflamation 236
Myocarditis 32411
Perimyocarditis 1192
## celltype per cond counts
knitr::kable(table(seurat$label, seurat$cond))
HH InfCardiomyopathy inflamation Myocarditis Perimyocarditis
Cardiomyocyte 5471 40 47 2169 178
Endothelial 7482 581 74 6846 257
Fibroblast 8520 307 42 7490 347
MonocyteMacrophage 4119 65 14 4469 124
other 513 33 0 475 23
Perivascular 8899 320 55 6139 234
Tcell 1008 82 4 4823 29
## 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 5471 36012 15.192158
Endothelial HH 7482 36012 20.776408
Fibroblast HH 8520 36012 23.658780
MonocyteMacrophage HH 4119 36012 11.437854
other HH 513 36012 1.424525
Perivascular HH 8899 36012 24.711207
Tcell HH 1008 36012 2.799067
Cardiomyocyte InfCardiomyopathy 40 1428 2.801120
Endothelial InfCardiomyopathy 581 1428 40.686275
Fibroblast InfCardiomyopathy 307 1428 21.498599
MonocyteMacrophage InfCardiomyopathy 65 1428 4.551821
other InfCardiomyopathy 33 1428 2.310924
Perivascular InfCardiomyopathy 320 1428 22.408964
Tcell InfCardiomyopathy 82 1428 5.742297
Cardiomyocyte inflamation 47 236 19.915254
Endothelial inflamation 74 236 31.355932
Fibroblast inflamation 42 236 17.796610
MonocyteMacrophage inflamation 14 236 5.932203
other inflamation 0 236 0.000000
Perivascular inflamation 55 236 23.305085
Tcell inflamation 4 236 1.694915
Cardiomyocyte Myocarditis 2169 32411 6.692172
Endothelial Myocarditis 6846 32411 21.122458
Fibroblast Myocarditis 7490 32411 23.109438
MonocyteMacrophage Myocarditis 4469 32411 13.788529
other Myocarditis 475 32411 1.465552
Perivascular Myocarditis 6139 32411 18.941100
Tcell Myocarditis 4823 32411 14.880750
Cardiomyocyte Perimyocarditis 178 1192 14.932886
Endothelial Perimyocarditis 257 1192 21.560403
Fibroblast Perimyocarditis 347 1192 29.110738
MonocyteMacrophage Perimyocarditis 124 1192 10.402685
other Perimyocarditis 23 1192 1.929530
Perivascular Perimyocarditis 234 1192 19.630872
Tcell Perimyocarditis 29 1192 2.432886
ggbarplot(datFrac, x="cond", y="percentage",
          fill = "label",
          palette = colLab) +
  rotate_x_text(angle = 90)

Version Author Date
cd902dd mluetge 2022-09-12
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
cd902dd mluetge 2022-09-12
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
cd902dd mluetge 2022-09-12
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
cd902dd mluetge 2022-09-12
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
cd902dd mluetge 2022-09-12
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.1                
[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.4        
[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.6           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.4.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.2        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 26 17:13:41 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.1                
[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.4        
[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.6           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.4.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.2        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