Last updated: 2022-10-19
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 3ac3709. 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: analysis/figure/
Ignored: data/GSEA/
Ignored: data/humanFibroblast/
Ignored: figure/DEgenesGZplusSG_Groups.Rmd/.DS_Store
Unstaged changes:
Modified: analysis/assignLabelshumanHeartsPlusGrazInt.Rmd
Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.
These are the previous versions of the repository in which changes were
made to the R Markdown
(analysis/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 | 3ac3709 | mluetge | 2022-10-13 | add macrophage markers to heatmap |
| html | 3ac3709 | mluetge | 2022-10-13 | add macrophage markers to heatmap |
| Rmd | 8f79da0 | mluetge | 2022-10-13 | update label |
| html | 8f79da0 | mluetge | 2022-10-13 | update label |
| Rmd | e6d0c3c | mluetge | 2022-09-26 | add final human samples |
| html | e6d0c3c | mluetge | 2022-09-26 | add final human samples |
| 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 |
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)
})
basedir <- here()
seurat <- readRDS(file = paste0(basedir,
"/data/humanHeartsPlusGraz_intPatients_merged",
"_seurat.rds"))
Idents(seurat) <- seurat$seurat_clusters
## two patients with <250 nuclei --> exclude from downstream analysis
table(seurat$ID)
GZ1 GZ10 GZ11 GZ12 GZ13 GZ14 GZ15 GZ16 GZ17 GZ18 GZ19 GZ2 GZ20 GZ21 GZ22 GZ23
2740 3731 3991 3818 9882 1268 4439 436 1370 2280 111 1684 2706 1442 1998 841
GZ24 GZ3 GZ4 GZ5 GZ6 GZ7 GZ8 GZ9 SG29 SG30 SG31 SG32 SG33 SG34 SG35
1480 2396 545 781 491 653 3921 4908 1242 236 1192 1428 6286 620 2363
seurat <- subset(seurat, ID %in% c("GZ19", "SG30"), invert=T)
table(seurat$ID)
GZ1 GZ10 GZ11 GZ12 GZ13 GZ14 GZ15 GZ16 GZ17 GZ18 GZ2 GZ20 GZ21 GZ22 GZ23 GZ24
2740 3731 3991 3818 9882 1268 4439 436 1370 2280 1684 2706 1442 1998 841 1480
GZ3 GZ4 GZ5 GZ6 GZ7 GZ8 GZ9 SG29 SG31 SG32 SG33 SG34 SG35
2396 545 781 491 653 3921 4908 1242 1192 1428 6286 620 2363
seurat$label <- "other"
seurat$label[which(seurat$integrated_snn_res.0.4 %in% c("2","9","7"))] <- "Endothelial"
seurat$label[which(seurat$integrated_snn_res.0.4 %in% c("10"))] <- "EndoEC"
seurat$label[which(seurat$integrated_snn_res.0.4 %in% c("12"))] <- "LEC"
seurat$label[which(seurat$integrated_snn_res.0.4 %in% c("4"))] <- "Tcell"
seurat$label[which(seurat$integrated_snn_res.0.4 %in% c("3"))] <- "Cardiomyocyte"
seurat$label[which(seurat$integrated_snn_res.0.4 %in% c("0"))] <- "Fibroblast"
seurat$label[which(seurat$integrated_snn_res.0.4 %in% c("1"))] <- "Perivascular"
seurat$label[which(seurat$integrated_snn_res.0.4 %in% c("8"))] <- "SMC"
seurat$label[which(seurat$integrated_snn_res.0.4 %in% c("5"))] <- "resMacrophage"
seurat$label[which(seurat$integrated_snn_res.0.4 %in% c("6"))] <- "infMacrophage"
seurat$label[which(seurat$integrated_snn_res.0.4 %in% c("11"))] <- "NeuralCells"
seurat$label[which(seurat$integrated_snn_res.0.4 %in% c("13"))] <- "Adipocytes"
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 <- c(pal_futurama()(8), pal_uchicago()(6))[1: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)
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")

DimPlot(seurat, reduction = "umap", cols=colPal,
shuffle = T)+
theme_void()

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")

DimPlot(seurat, reduction = "umap", group.by = "label", cols=colLab,
shuffle = T)+
theme_void()

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")

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")

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

DimPlot(seurat, reduction = "umap", group.by = "ID", cols=colID,
shuffle = T)+
theme_void()

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

DimPlot(seurat, reduction = "umap", group.by = "origin", cols=colOrig,
shuffle = T)+
theme_void()

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")

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")

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")

## 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 |
| 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 |
| 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 | GZ2 | GZ20 | GZ21 | GZ22 | GZ23 | GZ24 | GZ3 | GZ4 | GZ5 | GZ6 | GZ7 | GZ8 | GZ9 | SG29 | SG31 | SG32 | SG33 | SG34 | SG35 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Adipocytes | 0 | 61 | 0 | 0 | 3 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 2 | 1 | 0 | 0 | 41 | 4 | 2 | 0 | 0 | 5 | 8 | 0 | 0 |
| Cardiomyocyte | 208 | 1098 | 299 | 117 | 2207 | 50 | 117 | 25 | 71 | 328 | 108 | 46 | 58 | 159 | 54 | 117 | 234 | 45 | 39 | 12 | 88 | 714 | 650 | 109 | 178 | 40 | 212 | 173 | 304 |
| EndoEC | 94 | 25 | 33 | 23 | 174 | 4 | 8 | 14 | 3 | 133 | 93 | 159 | 8 | 3 | 9 | 4 | 163 | 55 | 27 | 37 | 5 | 16 | 349 | 19 | 51 | 29 | 36 | 12 | 30 |
| Endothelial | 335 | 381 | 775 | 1123 | 2065 | 319 | 1057 | 58 | 190 | 503 | 326 | 1081 | 250 | 270 | 211 | 272 | 403 | 125 | 217 | 118 | 121 | 752 | 657 | 147 | 206 | 550 | 219 | 92 | 550 |
| Fibroblast | 715 | 983 | 841 | 1110 | 2217 | 316 | 1095 | 88 | 368 | 623 | 638 | 622 | 99 | 314 | 68 | 268 | 812 | 135 | 261 | 150 | 220 | 1144 | 1466 | 140 | 347 | 306 | 401 | 115 | 759 |
| infMacrophage | 162 | 108 | 275 | 65 | 288 | 19 | 109 | 32 | 106 | 18 | 29 | 36 | 38 | 113 | 31 | 29 | 43 | 22 | 11 | 19 | 5 | 120 | 228 | 187 | 36 | 19 | 1270 | 10 | 76 |
| LEC | 42 | 15 | 11 | 42 | 113 | 3 | 33 | 1 | 2 | 14 | 37 | 16 | 0 | 6 | 6 | 10 | 50 | 4 | 1 | 0 | 13 | 27 | 31 | 2 | 2 | 14 | 2 | 1 | 18 |
| NeuralCells | 59 | 32 | 27 | 22 | 202 | 10 | 77 | 11 | 28 | 29 | 29 | 20 | 15 | 30 | 7 | 10 | 35 | 7 | 27 | 3 | 12 | 65 | 32 | 15 | 23 | 28 | 24 | 6 | 29 |
| Perivascular | 562 | 452 | 1084 | 965 | 1516 | 347 | 1321 | 66 | 151 | 394 | 274 | 374 | 724 | 645 | 299 | 586 | 432 | 68 | 118 | 55 | 68 | 584 | 864 | 86 | 191 | 254 | 142 | 122 | 335 |
| resMacrophage | 137 | 380 | 384 | 154 | 611 | 72 | 223 | 24 | 225 | 75 | 56 | 101 | 143 | 331 | 91 | 77 | 76 | 32 | 20 | 44 | 13 | 240 | 409 | 136 | 88 | 46 | 898 | 41 | 129 |
| SMC | 187 | 71 | 116 | 131 | 301 | 92 | 214 | 16 | 39 | 124 | 49 | 125 | 79 | 83 | 38 | 71 | 93 | 23 | 38 | 17 | 55 | 160 | 136 | 18 | 43 | 67 | 29 | 23 | 61 |
| Tcell | 239 | 125 | 146 | 66 | 185 | 36 | 185 | 101 | 187 | 39 | 44 | 126 | 28 | 44 | 27 | 35 | 53 | 28 | 22 | 36 | 12 | 95 | 84 | 383 | 27 | 70 | 3045 | 25 | 72 |
## 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 |
|---|---|---|---|---|
| Adipocytes | GZ1 | 0 | 2740 | 0.0000000 |
| Cardiomyocyte | GZ1 | 208 | 2740 | 7.5912409 |
| EndoEC | GZ1 | 94 | 2740 | 3.4306569 |
| Endothelial | GZ1 | 335 | 2740 | 12.2262774 |
| Fibroblast | GZ1 | 715 | 2740 | 26.0948905 |
| infMacrophage | GZ1 | 162 | 2740 | 5.9124088 |
| LEC | GZ1 | 42 | 2740 | 1.5328467 |
| NeuralCells | GZ1 | 59 | 2740 | 2.1532847 |
| Perivascular | GZ1 | 562 | 2740 | 20.5109489 |
| resMacrophage | GZ1 | 137 | 2740 | 5.0000000 |
| SMC | GZ1 | 187 | 2740 | 6.8248175 |
| Tcell | GZ1 | 239 | 2740 | 8.7226277 |
| Adipocytes | GZ10 | 61 | 3731 | 1.6349504 |
| Cardiomyocyte | GZ10 | 1098 | 3731 | 29.4291075 |
| EndoEC | GZ10 | 25 | 3731 | 0.6700616 |
| Endothelial | GZ10 | 381 | 3731 | 10.2117395 |
| Fibroblast | GZ10 | 983 | 3731 | 26.3468239 |
| infMacrophage | GZ10 | 108 | 3731 | 2.8946663 |
| LEC | GZ10 | 15 | 3731 | 0.4020370 |
| NeuralCells | GZ10 | 32 | 3731 | 0.8576789 |
| Perivascular | GZ10 | 452 | 3731 | 12.1147146 |
| resMacrophage | GZ10 | 380 | 3731 | 10.1849370 |
| SMC | GZ10 | 71 | 3731 | 1.9029751 |
| Tcell | GZ10 | 125 | 3731 | 3.3503082 |
| Adipocytes | GZ11 | 0 | 3991 | 0.0000000 |
| Cardiomyocyte | GZ11 | 299 | 3991 | 7.4918567 |
| EndoEC | GZ11 | 33 | 3991 | 0.8268604 |
| Endothelial | GZ11 | 775 | 3991 | 19.4186921 |
| Fibroblast | GZ11 | 841 | 3991 | 21.0724129 |
| infMacrophage | GZ11 | 275 | 3991 | 6.8905036 |
| LEC | GZ11 | 11 | 3991 | 0.2756201 |
| NeuralCells | GZ11 | 27 | 3991 | 0.6765222 |
| Perivascular | GZ11 | 1084 | 3991 | 27.1611125 |
| resMacrophage | GZ11 | 384 | 3991 | 9.6216487 |
| SMC | GZ11 | 116 | 3991 | 2.9065397 |
| Tcell | GZ11 | 146 | 3991 | 3.6582310 |
| Adipocytes | GZ12 | 0 | 3818 | 0.0000000 |
| Cardiomyocyte | GZ12 | 117 | 3818 | 3.0644316 |
| EndoEC | GZ12 | 23 | 3818 | 0.6024096 |
| Endothelial | GZ12 | 1123 | 3818 | 29.4133054 |
| Fibroblast | GZ12 | 1110 | 3818 | 29.0728130 |
| infMacrophage | GZ12 | 65 | 3818 | 1.7024620 |
| LEC | GZ12 | 42 | 3818 | 1.1000524 |
| NeuralCells | GZ12 | 22 | 3818 | 0.5762179 |
| Perivascular | GZ12 | 965 | 3818 | 25.2750131 |
| resMacrophage | GZ12 | 154 | 3818 | 4.0335254 |
| SMC | GZ12 | 131 | 3818 | 3.4311158 |
| Tcell | GZ12 | 66 | 3818 | 1.7286537 |
| Adipocytes | GZ13 | 3 | 9882 | 0.0303582 |
| Cardiomyocyte | GZ13 | 2207 | 9882 | 22.3335357 |
| EndoEC | GZ13 | 174 | 9882 | 1.7607772 |
| Endothelial | GZ13 | 2065 | 9882 | 20.8965796 |
| Fibroblast | GZ13 | 2217 | 9882 | 22.4347298 |
| infMacrophage | GZ13 | 288 | 9882 | 2.9143898 |
| LEC | GZ13 | 113 | 9882 | 1.1434932 |
| NeuralCells | GZ13 | 202 | 9882 | 2.0441206 |
| Perivascular | GZ13 | 1516 | 9882 | 15.3410241 |
| resMacrophage | GZ13 | 611 | 9882 | 6.1829589 |
| SMC | GZ13 | 301 | 9882 | 3.0459421 |
| Tcell | GZ13 | 185 | 9882 | 1.8720907 |
| Adipocytes | GZ14 | 0 | 1268 | 0.0000000 |
| Cardiomyocyte | GZ14 | 50 | 1268 | 3.9432177 |
| EndoEC | GZ14 | 4 | 1268 | 0.3154574 |
| Endothelial | GZ14 | 319 | 1268 | 25.1577287 |
| Fibroblast | GZ14 | 316 | 1268 | 24.9211356 |
| infMacrophage | GZ14 | 19 | 1268 | 1.4984227 |
| LEC | GZ14 | 3 | 1268 | 0.2365931 |
| NeuralCells | GZ14 | 10 | 1268 | 0.7886435 |
| Perivascular | GZ14 | 347 | 1268 | 27.3659306 |
| resMacrophage | GZ14 | 72 | 1268 | 5.6782334 |
| SMC | GZ14 | 92 | 1268 | 7.2555205 |
| Tcell | GZ14 | 36 | 1268 | 2.8391167 |
| Adipocytes | GZ15 | 0 | 4439 | 0.0000000 |
| Cardiomyocyte | GZ15 | 117 | 4439 | 2.6357288 |
| EndoEC | GZ15 | 8 | 4439 | 0.1802208 |
| Endothelial | GZ15 | 1057 | 4439 | 23.8116693 |
| Fibroblast | GZ15 | 1095 | 4439 | 24.6677180 |
| infMacrophage | GZ15 | 109 | 4439 | 2.4555080 |
| LEC | GZ15 | 33 | 4439 | 0.7434107 |
| NeuralCells | GZ15 | 77 | 4439 | 1.7346249 |
| Perivascular | GZ15 | 1321 | 4439 | 29.7589547 |
| resMacrophage | GZ15 | 223 | 4439 | 5.0236540 |
| SMC | GZ15 | 214 | 4439 | 4.8209056 |
| Tcell | GZ15 | 185 | 4439 | 4.1676053 |
| Adipocytes | GZ16 | 0 | 436 | 0.0000000 |
| Cardiomyocyte | GZ16 | 25 | 436 | 5.7339450 |
| EndoEC | GZ16 | 14 | 436 | 3.2110092 |
| Endothelial | GZ16 | 58 | 436 | 13.3027523 |
| Fibroblast | GZ16 | 88 | 436 | 20.1834862 |
| infMacrophage | GZ16 | 32 | 436 | 7.3394495 |
| LEC | GZ16 | 1 | 436 | 0.2293578 |
| NeuralCells | GZ16 | 11 | 436 | 2.5229358 |
| Perivascular | GZ16 | 66 | 436 | 15.1376147 |
| resMacrophage | GZ16 | 24 | 436 | 5.5045872 |
| SMC | GZ16 | 16 | 436 | 3.6697248 |
| Tcell | GZ16 | 101 | 436 | 23.1651376 |
| Adipocytes | GZ17 | 0 | 1370 | 0.0000000 |
| Cardiomyocyte | GZ17 | 71 | 1370 | 5.1824818 |
| EndoEC | GZ17 | 3 | 1370 | 0.2189781 |
| Endothelial | GZ17 | 190 | 1370 | 13.8686131 |
| Fibroblast | GZ17 | 368 | 1370 | 26.8613139 |
| infMacrophage | GZ17 | 106 | 1370 | 7.7372263 |
| LEC | GZ17 | 2 | 1370 | 0.1459854 |
| NeuralCells | GZ17 | 28 | 1370 | 2.0437956 |
| Perivascular | GZ17 | 151 | 1370 | 11.0218978 |
| resMacrophage | GZ17 | 225 | 1370 | 16.4233577 |
| SMC | GZ17 | 39 | 1370 | 2.8467153 |
| Tcell | GZ17 | 187 | 1370 | 13.6496350 |
| Adipocytes | GZ18 | 0 | 2280 | 0.0000000 |
| Cardiomyocyte | GZ18 | 328 | 2280 | 14.3859649 |
| EndoEC | GZ18 | 133 | 2280 | 5.8333333 |
| Endothelial | GZ18 | 503 | 2280 | 22.0614035 |
| Fibroblast | GZ18 | 623 | 2280 | 27.3245614 |
| infMacrophage | GZ18 | 18 | 2280 | 0.7894737 |
| LEC | GZ18 | 14 | 2280 | 0.6140351 |
| NeuralCells | GZ18 | 29 | 2280 | 1.2719298 |
| Perivascular | GZ18 | 394 | 2280 | 17.2807018 |
| resMacrophage | GZ18 | 75 | 2280 | 3.2894737 |
| SMC | GZ18 | 124 | 2280 | 5.4385965 |
| Tcell | GZ18 | 39 | 2280 | 1.7105263 |
| Adipocytes | GZ2 | 1 | 1684 | 0.0593824 |
| Cardiomyocyte | GZ2 | 108 | 1684 | 6.4133017 |
| EndoEC | GZ2 | 93 | 1684 | 5.5225653 |
| Endothelial | GZ2 | 326 | 1684 | 19.3586698 |
| Fibroblast | GZ2 | 638 | 1684 | 37.8859857 |
| infMacrophage | GZ2 | 29 | 1684 | 1.7220903 |
| LEC | GZ2 | 37 | 1684 | 2.1971496 |
| NeuralCells | GZ2 | 29 | 1684 | 1.7220903 |
| Perivascular | GZ2 | 274 | 1684 | 16.2707838 |
| resMacrophage | GZ2 | 56 | 1684 | 3.3254157 |
| SMC | GZ2 | 49 | 1684 | 2.9097387 |
| Tcell | GZ2 | 44 | 1684 | 2.6128266 |
| Adipocytes | GZ20 | 0 | 2706 | 0.0000000 |
| Cardiomyocyte | GZ20 | 46 | 2706 | 1.6999261 |
| EndoEC | GZ20 | 159 | 2706 | 5.8758315 |
| Endothelial | GZ20 | 1081 | 2706 | 39.9482631 |
| Fibroblast | GZ20 | 622 | 2706 | 22.9859571 |
| infMacrophage | GZ20 | 36 | 2706 | 1.3303769 |
| LEC | GZ20 | 16 | 2706 | 0.5912786 |
| NeuralCells | GZ20 | 20 | 2706 | 0.7390983 |
| Perivascular | GZ20 | 374 | 2706 | 13.8211382 |
| resMacrophage | GZ20 | 101 | 2706 | 3.7324464 |
| SMC | GZ20 | 125 | 2706 | 4.6193644 |
| Tcell | GZ20 | 126 | 2706 | 4.6563193 |
| Adipocytes | GZ21 | 0 | 1442 | 0.0000000 |
| Cardiomyocyte | GZ21 | 58 | 1442 | 4.0221914 |
| EndoEC | GZ21 | 8 | 1442 | 0.5547850 |
| Endothelial | GZ21 | 250 | 1442 | 17.3370319 |
| Fibroblast | GZ21 | 99 | 1442 | 6.8654646 |
| infMacrophage | GZ21 | 38 | 1442 | 2.6352288 |
| LEC | GZ21 | 0 | 1442 | 0.0000000 |
| NeuralCells | GZ21 | 15 | 1442 | 1.0402219 |
| Perivascular | GZ21 | 724 | 1442 | 50.2080444 |
| resMacrophage | GZ21 | 143 | 1442 | 9.9167822 |
| SMC | GZ21 | 79 | 1442 | 5.4785021 |
| Tcell | GZ21 | 28 | 1442 | 1.9417476 |
| Adipocytes | GZ22 | 0 | 1998 | 0.0000000 |
| Cardiomyocyte | GZ22 | 159 | 1998 | 7.9579580 |
| EndoEC | GZ22 | 3 | 1998 | 0.1501502 |
| Endothelial | GZ22 | 270 | 1998 | 13.5135135 |
| Fibroblast | GZ22 | 314 | 1998 | 15.7157157 |
| infMacrophage | GZ22 | 113 | 1998 | 5.6556557 |
| LEC | GZ22 | 6 | 1998 | 0.3003003 |
| NeuralCells | GZ22 | 30 | 1998 | 1.5015015 |
| Perivascular | GZ22 | 645 | 1998 | 32.2822823 |
| resMacrophage | GZ22 | 331 | 1998 | 16.5665666 |
| SMC | GZ22 | 83 | 1998 | 4.1541542 |
| Tcell | GZ22 | 44 | 1998 | 2.2022022 |
| Adipocytes | GZ23 | 0 | 841 | 0.0000000 |
| Cardiomyocyte | GZ23 | 54 | 841 | 6.4209275 |
| EndoEC | GZ23 | 9 | 841 | 1.0701546 |
| Endothelial | GZ23 | 211 | 841 | 25.0891795 |
| Fibroblast | GZ23 | 68 | 841 | 8.0856124 |
| infMacrophage | GZ23 | 31 | 841 | 3.6860880 |
| LEC | GZ23 | 6 | 841 | 0.7134364 |
| NeuralCells | GZ23 | 7 | 841 | 0.8323424 |
| Perivascular | GZ23 | 299 | 841 | 35.5529132 |
| resMacrophage | GZ23 | 91 | 841 | 10.8204518 |
| SMC | GZ23 | 38 | 841 | 4.5184304 |
| Tcell | GZ23 | 27 | 841 | 3.2104637 |
| Adipocytes | GZ24 | 1 | 1480 | 0.0675676 |
| Cardiomyocyte | GZ24 | 117 | 1480 | 7.9054054 |
| EndoEC | GZ24 | 4 | 1480 | 0.2702703 |
| Endothelial | GZ24 | 272 | 1480 | 18.3783784 |
| Fibroblast | GZ24 | 268 | 1480 | 18.1081081 |
| infMacrophage | GZ24 | 29 | 1480 | 1.9594595 |
| LEC | GZ24 | 10 | 1480 | 0.6756757 |
| NeuralCells | GZ24 | 10 | 1480 | 0.6756757 |
| Perivascular | GZ24 | 586 | 1480 | 39.5945946 |
| resMacrophage | GZ24 | 77 | 1480 | 5.2027027 |
| SMC | GZ24 | 71 | 1480 | 4.7972973 |
| Tcell | GZ24 | 35 | 1480 | 2.3648649 |
| Adipocytes | GZ3 | 2 | 2396 | 0.0834725 |
| Cardiomyocyte | GZ3 | 234 | 2396 | 9.7662771 |
| EndoEC | GZ3 | 163 | 2396 | 6.8030050 |
| Endothelial | GZ3 | 403 | 2396 | 16.8196995 |
| Fibroblast | GZ3 | 812 | 2396 | 33.8898164 |
| infMacrophage | GZ3 | 43 | 2396 | 1.7946578 |
| LEC | GZ3 | 50 | 2396 | 2.0868114 |
| NeuralCells | GZ3 | 35 | 2396 | 1.4607679 |
| Perivascular | GZ3 | 432 | 2396 | 18.0300501 |
| resMacrophage | GZ3 | 76 | 2396 | 3.1719533 |
| SMC | GZ3 | 93 | 2396 | 3.8814691 |
| Tcell | GZ3 | 53 | 2396 | 2.2120200 |
| Adipocytes | GZ4 | 1 | 545 | 0.1834862 |
| Cardiomyocyte | GZ4 | 45 | 545 | 8.2568807 |
| EndoEC | GZ4 | 55 | 545 | 10.0917431 |
| Endothelial | GZ4 | 125 | 545 | 22.9357798 |
| Fibroblast | GZ4 | 135 | 545 | 24.7706422 |
| infMacrophage | GZ4 | 22 | 545 | 4.0366972 |
| LEC | GZ4 | 4 | 545 | 0.7339450 |
| NeuralCells | GZ4 | 7 | 545 | 1.2844037 |
| Perivascular | GZ4 | 68 | 545 | 12.4770642 |
| resMacrophage | GZ4 | 32 | 545 | 5.8715596 |
| SMC | GZ4 | 23 | 545 | 4.2201835 |
| Tcell | GZ4 | 28 | 545 | 5.1376147 |
| Adipocytes | GZ5 | 0 | 781 | 0.0000000 |
| Cardiomyocyte | GZ5 | 39 | 781 | 4.9935980 |
| EndoEC | GZ5 | 27 | 781 | 3.4571063 |
| Endothelial | GZ5 | 217 | 781 | 27.7848912 |
| Fibroblast | GZ5 | 261 | 781 | 33.4186940 |
| infMacrophage | GZ5 | 11 | 781 | 1.4084507 |
| LEC | GZ5 | 1 | 781 | 0.1280410 |
| NeuralCells | GZ5 | 27 | 781 | 3.4571063 |
| Perivascular | GZ5 | 118 | 781 | 15.1088348 |
| resMacrophage | GZ5 | 20 | 781 | 2.5608195 |
| SMC | GZ5 | 38 | 781 | 4.8655570 |
| Tcell | GZ5 | 22 | 781 | 2.8169014 |
| Adipocytes | GZ6 | 0 | 491 | 0.0000000 |
| Cardiomyocyte | GZ6 | 12 | 491 | 2.4439919 |
| EndoEC | GZ6 | 37 | 491 | 7.5356415 |
| Endothelial | GZ6 | 118 | 491 | 24.0325866 |
| Fibroblast | GZ6 | 150 | 491 | 30.5498982 |
| infMacrophage | GZ6 | 19 | 491 | 3.8696538 |
| LEC | GZ6 | 0 | 491 | 0.0000000 |
| NeuralCells | GZ6 | 3 | 491 | 0.6109980 |
| Perivascular | GZ6 | 55 | 491 | 11.2016293 |
| resMacrophage | GZ6 | 44 | 491 | 8.9613035 |
| SMC | GZ6 | 17 | 491 | 3.4623218 |
| Tcell | GZ6 | 36 | 491 | 7.3319756 |
| Adipocytes | GZ7 | 41 | 653 | 6.2787136 |
| Cardiomyocyte | GZ7 | 88 | 653 | 13.4762634 |
| EndoEC | GZ7 | 5 | 653 | 0.7656968 |
| Endothelial | GZ7 | 121 | 653 | 18.5298622 |
| Fibroblast | GZ7 | 220 | 653 | 33.6906585 |
| infMacrophage | GZ7 | 5 | 653 | 0.7656968 |
| LEC | GZ7 | 13 | 653 | 1.9908116 |
| NeuralCells | GZ7 | 12 | 653 | 1.8376723 |
| Perivascular | GZ7 | 68 | 653 | 10.4134763 |
| resMacrophage | GZ7 | 13 | 653 | 1.9908116 |
| SMC | GZ7 | 55 | 653 | 8.4226646 |
| Tcell | GZ7 | 12 | 653 | 1.8376723 |
| Adipocytes | GZ8 | 4 | 3921 | 0.1020148 |
| Cardiomyocyte | GZ8 | 714 | 3921 | 18.2096404 |
| EndoEC | GZ8 | 16 | 3921 | 0.4080592 |
| Endothelial | GZ8 | 752 | 3921 | 19.1787809 |
| Fibroblast | GZ8 | 1144 | 3921 | 29.1762306 |
| infMacrophage | GZ8 | 120 | 3921 | 3.0604438 |
| LEC | GZ8 | 27 | 3921 | 0.6885998 |
| NeuralCells | GZ8 | 65 | 3921 | 1.6577404 |
| Perivascular | GZ8 | 584 | 3921 | 14.8941597 |
| resMacrophage | GZ8 | 240 | 3921 | 6.1208875 |
| SMC | GZ8 | 160 | 3921 | 4.0805917 |
| Tcell | GZ8 | 95 | 3921 | 2.4228513 |
| Adipocytes | GZ9 | 2 | 4908 | 0.0407498 |
| Cardiomyocyte | GZ9 | 650 | 4908 | 13.2436838 |
| EndoEC | GZ9 | 349 | 4908 | 7.1108394 |
| Endothelial | GZ9 | 657 | 4908 | 13.3863081 |
| Fibroblast | GZ9 | 1466 | 4908 | 29.8696007 |
| infMacrophage | GZ9 | 228 | 4908 | 4.6454768 |
| LEC | GZ9 | 31 | 4908 | 0.6316218 |
| NeuralCells | GZ9 | 32 | 4908 | 0.6519967 |
| Perivascular | GZ9 | 864 | 4908 | 17.6039120 |
| resMacrophage | GZ9 | 409 | 4908 | 8.3333333 |
| SMC | GZ9 | 136 | 4908 | 2.7709861 |
| Tcell | GZ9 | 84 | 4908 | 1.7114914 |
| Adipocytes | SG29 | 0 | 1242 | 0.0000000 |
| Cardiomyocyte | SG29 | 109 | 1242 | 8.7761675 |
| EndoEC | SG29 | 19 | 1242 | 1.5297907 |
| Endothelial | SG29 | 147 | 1242 | 11.8357488 |
| Fibroblast | SG29 | 140 | 1242 | 11.2721417 |
| infMacrophage | SG29 | 187 | 1242 | 15.0563607 |
| LEC | SG29 | 2 | 1242 | 0.1610306 |
| NeuralCells | SG29 | 15 | 1242 | 1.2077295 |
| Perivascular | SG29 | 86 | 1242 | 6.9243156 |
| resMacrophage | SG29 | 136 | 1242 | 10.9500805 |
| SMC | SG29 | 18 | 1242 | 1.4492754 |
| Tcell | SG29 | 383 | 1242 | 30.8373591 |
| Adipocytes | SG31 | 0 | 1192 | 0.0000000 |
| Cardiomyocyte | SG31 | 178 | 1192 | 14.9328859 |
| EndoEC | SG31 | 51 | 1192 | 4.2785235 |
| Endothelial | SG31 | 206 | 1192 | 17.2818792 |
| Fibroblast | SG31 | 347 | 1192 | 29.1107383 |
| infMacrophage | SG31 | 36 | 1192 | 3.0201342 |
| LEC | SG31 | 2 | 1192 | 0.1677852 |
| NeuralCells | SG31 | 23 | 1192 | 1.9295302 |
| Perivascular | SG31 | 191 | 1192 | 16.0234899 |
| resMacrophage | SG31 | 88 | 1192 | 7.3825503 |
| SMC | SG31 | 43 | 1192 | 3.6073826 |
| Tcell | SG31 | 27 | 1192 | 2.2651007 |
| Adipocytes | SG32 | 5 | 1428 | 0.3501401 |
| Cardiomyocyte | SG32 | 40 | 1428 | 2.8011204 |
| EndoEC | SG32 | 29 | 1428 | 2.0308123 |
| Endothelial | SG32 | 550 | 1428 | 38.5154062 |
| Fibroblast | SG32 | 306 | 1428 | 21.4285714 |
| infMacrophage | SG32 | 19 | 1428 | 1.3305322 |
| LEC | SG32 | 14 | 1428 | 0.9803922 |
| NeuralCells | SG32 | 28 | 1428 | 1.9607843 |
| Perivascular | SG32 | 254 | 1428 | 17.7871148 |
| resMacrophage | SG32 | 46 | 1428 | 3.2212885 |
| SMC | SG32 | 67 | 1428 | 4.6918768 |
| Tcell | SG32 | 70 | 1428 | 4.9019608 |
| Adipocytes | SG33 | 8 | 6286 | 0.1272669 |
| Cardiomyocyte | SG33 | 212 | 6286 | 3.3725740 |
| EndoEC | SG33 | 36 | 6286 | 0.5727012 |
| Endothelial | SG33 | 219 | 6286 | 3.4839325 |
| Fibroblast | SG33 | 401 | 6286 | 6.3792555 |
| infMacrophage | SG33 | 1270 | 6286 | 20.2036271 |
| LEC | SG33 | 2 | 6286 | 0.0318167 |
| NeuralCells | SG33 | 24 | 6286 | 0.3818008 |
| Perivascular | SG33 | 142 | 6286 | 2.2589882 |
| resMacrophage | SG33 | 898 | 6286 | 14.2857143 |
| SMC | SG33 | 29 | 6286 | 0.4613427 |
| Tcell | SG33 | 3045 | 6286 | 48.4409800 |
| Adipocytes | SG34 | 0 | 620 | 0.0000000 |
| Cardiomyocyte | SG34 | 173 | 620 | 27.9032258 |
| EndoEC | SG34 | 12 | 620 | 1.9354839 |
| Endothelial | SG34 | 92 | 620 | 14.8387097 |
| Fibroblast | SG34 | 115 | 620 | 18.5483871 |
| infMacrophage | SG34 | 10 | 620 | 1.6129032 |
| LEC | SG34 | 1 | 620 | 0.1612903 |
| NeuralCells | SG34 | 6 | 620 | 0.9677419 |
| Perivascular | SG34 | 122 | 620 | 19.6774194 |
| resMacrophage | SG34 | 41 | 620 | 6.6129032 |
| SMC | SG34 | 23 | 620 | 3.7096774 |
| Tcell | SG34 | 25 | 620 | 4.0322581 |
| Adipocytes | SG35 | 0 | 2363 | 0.0000000 |
| Cardiomyocyte | SG35 | 304 | 2363 | 12.8650021 |
| EndoEC | SG35 | 30 | 2363 | 1.2695726 |
| Endothelial | SG35 | 550 | 2363 | 23.2754972 |
| Fibroblast | SG35 | 759 | 2363 | 32.1201862 |
| infMacrophage | SG35 | 76 | 2363 | 3.2162505 |
| LEC | SG35 | 18 | 2363 | 0.7617435 |
| NeuralCells | SG35 | 29 | 2363 | 1.2272535 |
| Perivascular | SG35 | 335 | 2363 | 14.1768938 |
| resMacrophage | SG35 | 129 | 2363 | 5.4591621 |
| SMC | SG35 | 61 | 2363 | 2.5814642 |
| Tcell | SG35 | 72 | 2363 | 3.0469742 |
ordVec <- datFrac %>% dplyr::filter(label=="Tcell") %>%
arrange(., percentage)
ggbarplot(datFrac, x="ID", y="percentage",
fill = "label",
palette = colLab,
order= ordVec$ID) +
rotate_x_text(angle = 90)

## total cells per cond
knitr::kable(table(seurat$cond))
| Var1 | Freq |
|---|---|
| HH | 36012 |
| InfCardiomyopathy | 1428 |
| Myocarditis | 32300 |
| Perimyocarditis | 1192 |
## celltype per cond counts
knitr::kable(table(seurat$label, seurat$cond))
| HH | InfCardiomyopathy | Myocarditis | Perimyocarditis | |
|---|---|---|---|---|
| Adipocytes | 71 | 5 | 53 | 0 |
| Cardiomyocyte | 5473 | 40 | 2169 | 178 |
| EndoEC | 644 | 29 | 892 | 51 |
| Endothelial | 6756 | 550 | 5861 | 206 |
| Fibroblast | 8510 | 306 | 7458 | 347 |
| infMacrophage | 1295 | 19 | 2154 | 36 |
| LEC | 261 | 14 | 239 | 2 |
| NeuralCells | 442 | 28 | 421 | 23 |
| Perivascular | 7719 | 254 | 4915 | 191 |
| resMacrophage | 2820 | 46 | 2302 | 88 |
| SMC | 1186 | 67 | 1203 | 43 |
| Tcell | 835 | 70 | 4633 | 27 |
## 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 |
|---|---|---|---|---|
| Adipocytes | HH | 71 | 36012 | 0.1971565 |
| Cardiomyocyte | HH | 5473 | 36012 | 15.1977119 |
| EndoEC | HH | 644 | 36012 | 1.7882928 |
| Endothelial | HH | 6756 | 36012 | 18.7604132 |
| Fibroblast | HH | 8510 | 36012 | 23.6310119 |
| infMacrophage | HH | 1295 | 36012 | 3.5960235 |
| LEC | HH | 261 | 36012 | 0.7247584 |
| NeuralCells | HH | 442 | 36012 | 1.2273687 |
| Perivascular | HH | 7719 | 36012 | 21.4345218 |
| resMacrophage | HH | 2820 | 36012 | 7.8307231 |
| SMC | HH | 1186 | 36012 | 3.2933467 |
| Tcell | HH | 835 | 36012 | 2.3186716 |
| Adipocytes | InfCardiomyopathy | 5 | 1428 | 0.3501401 |
| Cardiomyocyte | InfCardiomyopathy | 40 | 1428 | 2.8011204 |
| EndoEC | InfCardiomyopathy | 29 | 1428 | 2.0308123 |
| Endothelial | InfCardiomyopathy | 550 | 1428 | 38.5154062 |
| Fibroblast | InfCardiomyopathy | 306 | 1428 | 21.4285714 |
| infMacrophage | InfCardiomyopathy | 19 | 1428 | 1.3305322 |
| LEC | InfCardiomyopathy | 14 | 1428 | 0.9803922 |
| NeuralCells | InfCardiomyopathy | 28 | 1428 | 1.9607843 |
| Perivascular | InfCardiomyopathy | 254 | 1428 | 17.7871148 |
| resMacrophage | InfCardiomyopathy | 46 | 1428 | 3.2212885 |
| SMC | InfCardiomyopathy | 67 | 1428 | 4.6918768 |
| Tcell | InfCardiomyopathy | 70 | 1428 | 4.9019608 |
| Adipocytes | Myocarditis | 53 | 32300 | 0.1640867 |
| Cardiomyocyte | Myocarditis | 2169 | 32300 | 6.7151703 |
| EndoEC | Myocarditis | 892 | 32300 | 2.7616099 |
| Endothelial | Myocarditis | 5861 | 32300 | 18.1455108 |
| Fibroblast | Myocarditis | 7458 | 32300 | 23.0897833 |
| infMacrophage | Myocarditis | 2154 | 32300 | 6.6687307 |
| LEC | Myocarditis | 239 | 32300 | 0.7399381 |
| NeuralCells | Myocarditis | 421 | 32300 | 1.3034056 |
| Perivascular | Myocarditis | 4915 | 32300 | 15.2167183 |
| resMacrophage | Myocarditis | 2302 | 32300 | 7.1269350 |
| SMC | Myocarditis | 1203 | 32300 | 3.7244582 |
| Tcell | Myocarditis | 4633 | 32300 | 14.3436533 |
| Adipocytes | Perimyocarditis | 0 | 1192 | 0.0000000 |
| Cardiomyocyte | Perimyocarditis | 178 | 1192 | 14.9328859 |
| EndoEC | Perimyocarditis | 51 | 1192 | 4.2785235 |
| Endothelial | Perimyocarditis | 206 | 1192 | 17.2818792 |
| Fibroblast | Perimyocarditis | 347 | 1192 | 29.1107383 |
| infMacrophage | Perimyocarditis | 36 | 1192 | 3.0201342 |
| LEC | Perimyocarditis | 2 | 1192 | 0.1677852 |
| NeuralCells | Perimyocarditis | 23 | 1192 | 1.9295302 |
| Perivascular | Perimyocarditis | 191 | 1192 | 16.0234899 |
| resMacrophage | Perimyocarditis | 88 | 1192 | 7.3825503 |
| SMC | Perimyocarditis | 43 | 1192 | 3.6073826 |
| Tcell | Perimyocarditis | 27 | 1192 | 2.2651007 |
ggbarplot(datFrac, x="cond", y="percentage",
fill = "label",
palette = colLab) +
rotate_x_text(angle = 90)

TcellGrp <- read_tsv(paste0(basedir, "/data/assignTcellGrp.txt"))
IDtoTcell <- data.frame(ID=seurat$ID) %>% left_join(., TcellGrp, by="ID")
seurat$TcellGrp <- IDtoTcell$TcellGrp
table(seurat$TcellGrp)
Ctrl TcellHigh TcellLow
36012 24666 10254
table(seurat$TcellGrp, seurat$ID)
GZ1 GZ10 GZ11 GZ12 GZ13 GZ14 GZ15 GZ16 GZ17 GZ18 GZ2 GZ20 GZ21
Ctrl 0 3731 3991 3818 9882 0 0 0 0 0 0 0 1442
TcellHigh 2740 0 0 0 0 0 4439 436 1370 0 0 2706 0
TcellLow 0 0 0 0 0 1268 0 0 0 2280 1684 0 0
GZ22 GZ23 GZ24 GZ3 GZ4 GZ5 GZ6 GZ7 GZ8 GZ9 SG29 SG31 SG32
Ctrl 1998 841 1480 0 0 0 0 0 3921 4908 0 0 0
TcellHigh 0 0 0 0 545 0 491 0 0 0 1242 0 1428
TcellLow 0 0 0 2396 0 781 0 653 0 0 0 1192 0
SG33 SG34 SG35
Ctrl 0 0 0
TcellHigh 6286 620 2363
TcellLow 0 0 0
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)

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)

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("")

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("")

genesDat <- data.frame(EnsID=rownames(seurat)) %>%
mutate(gene=gsub(".*\\.", "", EnsID))
selGenes <- data.frame(gene=c("CD2", "TNNT2", "PECAM1", "NRG1", "PROX1",
"PDGFRA", "RGS5", "MYH11", "C1QA", "NRXN1",
"PLIN1")) %>%
left_join(., genesDat, by="gene")
pList <- sapply(selGenes$EnsID, function(x){
p <- VlnPlot(object = seurat, features = x,
group.by = "label",
cols = colLab, pt.size = 0
) +
theme(legend.position = "none")
plot(p)
})












pList <- sapply(selGenes$EnsID, function(x){
p <- VlnPlot(object = seurat, features = x,
group.by = "label",
cols = colLab, pt.size = 0.3
) +
theme(legend.position = "none")
plot(p)
})












## list with all gene names for mapping of EnsIDs
genesDat <- data.frame(EnsID=rownames(seurat)) %>%
mutate(gene=gsub(".*\\.", "", EnsID))
## selected genes to plot
selGenes <- data.frame(gene=c("BMP2", "BMP4", "BMPR1A", "BMPR2")) %>%
left_join(., genesDat, by="gene")
## plotting loop order=F
pList <- sapply(selGenes$EnsID, function(x){
p <- FeaturePlot(seurat, reduction = "umap",
features = x,
cols=c("lightgrey", "darkred"),
order = F)+
theme(legend.position="right")
plot(p)
})




## plotting loop order=T
pList <- sapply(selGenes$EnsID, function(x){
p <- FeaturePlot(seurat, reduction = "umap",
features = x,
cols=c("lightgrey", "darkred"),
order = T)+
theme(legend.position="right")
plot(p)
})




seuratSub <- subset(seurat, label=="Fibroblast")
## assay data
clusterAssigned <- as.data.frame(seuratSub$ID) %>%
dplyr::mutate(cell=rownames(.))
colnames(clusterAssigned)[1] <- "ident"
seuratDat <- GetAssayData(seuratSub)
## genes of interest
genes <- data.frame(gene=rownames(seuratSub)) %>%
mutate(geneID=gsub("^.*\\.", "", gene)) %>% filter(geneID %in% selGenes$gene)
## matrix with averaged cnts per ident
logNormExpres <- as.data.frame(t(as.matrix(
seuratDat[which(rownames(seuratDat) %in% genes$gene),])))
logNormExpres <- logNormExpres %>% dplyr::mutate(cell=rownames(.)) %>%
dplyr::left_join(.,clusterAssigned, by=c("cell")) %>%
dplyr::select(-cell) %>% dplyr::group_by(ident) %>%
dplyr::summarise_all(mean)
write.table(logNormExpres,
file=paste0(basedir, "/data/BmpCntsFibroblastsPerPatient.txt"),
row.names = F, col.names = T, sep = "\t", quote = F)
saveRDS(seurat, file = paste0(basedir,
"/data/humanHeartsPlusGraz_intPatients_merged",
"labeled_seurat.rds"))
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.5 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.2 Seurat_4.2.0
[13] forcats_0.5.2 stringr_1.4.1
[15] dplyr_1.0.10 purrr_0.3.5
[17] readr_2.1.3 tidyr_1.2.1
[19] tibble_3.1.8 ggplot2_3.3.6
[21] tidyverse_1.3.2 SingleCellExperiment_1.18.1
[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.2.0
[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.2 generics_0.1.3 xfun_0.33
[34] R6_2.5.1 ggbeeswarm_0.6.0 bitops_1.0-7
[37] spatstat.utils_2.3-1 cachem_1.0.6 DelayedArray_0.22.0
[40] assertthat_0.2.1 vroom_1.6.0 promises_1.2.0.1
[43] scales_1.2.1 googlesheets4_1.0.1 beeswarm_0.4.0
[46] rgeos_0.5-9 gtable_0.3.1 globals_0.16.1
[49] goftest_1.2-3 workflowr_1.7.0 rlang_1.0.6
[52] splines_4.2.1 rstatix_0.7.0 lazyeval_0.2.2
[55] gargle_1.2.1 spatstat.geom_2.4-0 broom_1.0.1
[58] yaml_2.3.5 reshape2_1.4.4 abind_1.4-5
[61] modelr_0.1.9 backports_1.4.1 httpuv_1.6.6
[64] tools_4.2.1 ellipsis_0.3.2 spatstat.core_2.4-4
[67] jquerylib_0.1.4 RColorBrewer_1.1-3 ggridges_0.5.4
[70] Rcpp_1.0.9 plyr_1.8.7 zlibbioc_1.42.0
[73] RCurl_1.98-1.9 rpart_4.1.16 deldir_1.0-6
[76] pbapply_1.5-0 cowplot_1.1.1 zoo_1.8-11
[79] haven_2.5.1 ggrepel_0.9.1 cluster_2.1.4
[82] fs_1.5.2 data.table_1.14.2 scattermore_0.8
[85] lmtest_0.9-40 reprex_2.0.2 RANN_2.6.1
[88] googledrive_2.0.0 whisker_0.4 fitdistrplus_1.1-8
[91] hms_1.1.2 patchwork_1.1.2 mime_0.12
[94] evaluate_0.17 xtable_1.8-4 readxl_1.4.1
[97] gridExtra_2.3 compiler_4.2.1 KernSmooth_2.23-20
[100] crayon_1.5.2 htmltools_0.5.3 mgcv_1.8-40
[103] later_1.3.0 tzdb_0.3.0 lubridate_1.8.0
[106] DBI_1.1.3 dbplyr_2.2.1 MASS_7.3-58.1
[109] Matrix_1.5-1 car_3.1-0 cli_3.4.1
[112] parallel_4.2.1 igraph_1.3.5 pkgconfig_2.0.3
[115] plotly_4.10.0 spatstat.sparse_2.1-1 xml2_1.3.3
[118] vipor_0.4.5 bslib_0.4.0 XVector_0.36.0
[121] rvest_1.0.3 digest_0.6.29 RcppAnnoy_0.0.19
[124] spatstat.data_2.2-0 rmarkdown_2.17 cellranger_1.1.0
[127] leiden_0.4.3 uwot_0.1.14 shiny_1.7.2
[130] lifecycle_1.0.3 nlme_3.1-159 jsonlite_1.8.2
[133] carData_3.0-5 fansi_1.0.3 pillar_1.8.1
[136] lattice_0.20-45 ggrastr_1.0.1 fastmap_1.1.0
[139] httr_1.4.4 survival_3.4-0 glue_1.6.2
[142] png_0.1-7 bit_4.0.4 stringi_1.7.8
[145] sass_0.4.2 irlba_2.3.5.1 future.apply_1.9.1
date()
[1] "Wed Oct 19 17:31:47 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.5 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.2 Seurat_4.2.0
[13] forcats_0.5.2 stringr_1.4.1
[15] dplyr_1.0.10 purrr_0.3.5
[17] readr_2.1.3 tidyr_1.2.1
[19] tibble_3.1.8 ggplot2_3.3.6
[21] tidyverse_1.3.2 SingleCellExperiment_1.18.1
[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.2.0
[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.2 generics_0.1.3 xfun_0.33
[34] R6_2.5.1 ggbeeswarm_0.6.0 bitops_1.0-7
[37] spatstat.utils_2.3-1 cachem_1.0.6 DelayedArray_0.22.0
[40] assertthat_0.2.1 vroom_1.6.0 promises_1.2.0.1
[43] scales_1.2.1 googlesheets4_1.0.1 beeswarm_0.4.0
[46] rgeos_0.5-9 gtable_0.3.1 globals_0.16.1
[49] goftest_1.2-3 workflowr_1.7.0 rlang_1.0.6
[52] splines_4.2.1 rstatix_0.7.0 lazyeval_0.2.2
[55] gargle_1.2.1 spatstat.geom_2.4-0 broom_1.0.1
[58] yaml_2.3.5 reshape2_1.4.4 abind_1.4-5
[61] modelr_0.1.9 backports_1.4.1 httpuv_1.6.6
[64] tools_4.2.1 ellipsis_0.3.2 spatstat.core_2.4-4
[67] jquerylib_0.1.4 RColorBrewer_1.1-3 ggridges_0.5.4
[70] Rcpp_1.0.9 plyr_1.8.7 zlibbioc_1.42.0
[73] RCurl_1.98-1.9 rpart_4.1.16 deldir_1.0-6
[76] pbapply_1.5-0 cowplot_1.1.1 zoo_1.8-11
[79] haven_2.5.1 ggrepel_0.9.1 cluster_2.1.4
[82] fs_1.5.2 data.table_1.14.2 scattermore_0.8
[85] lmtest_0.9-40 reprex_2.0.2 RANN_2.6.1
[88] googledrive_2.0.0 whisker_0.4 fitdistrplus_1.1-8
[91] hms_1.1.2 patchwork_1.1.2 mime_0.12
[94] evaluate_0.17 xtable_1.8-4 readxl_1.4.1
[97] gridExtra_2.3 compiler_4.2.1 KernSmooth_2.23-20
[100] crayon_1.5.2 htmltools_0.5.3 mgcv_1.8-40
[103] later_1.3.0 tzdb_0.3.0 lubridate_1.8.0
[106] DBI_1.1.3 dbplyr_2.2.1 MASS_7.3-58.1
[109] Matrix_1.5-1 car_3.1-0 cli_3.4.1
[112] parallel_4.2.1 igraph_1.3.5 pkgconfig_2.0.3
[115] plotly_4.10.0 spatstat.sparse_2.1-1 xml2_1.3.3
[118] vipor_0.4.5 bslib_0.4.0 XVector_0.36.0
[121] rvest_1.0.3 digest_0.6.29 RcppAnnoy_0.0.19
[124] spatstat.data_2.2-0 rmarkdown_2.17 cellranger_1.1.0
[127] leiden_0.4.3 uwot_0.1.14 shiny_1.7.2
[130] lifecycle_1.0.3 nlme_3.1-159 jsonlite_1.8.2
[133] carData_3.0-5 fansi_1.0.3 pillar_1.8.1
[136] lattice_0.20-45 ggrastr_1.0.1 fastmap_1.1.0
[139] httr_1.4.4 survival_3.4-0 glue_1.6.2
[142] png_0.1-7 bit_4.0.4 stringi_1.7.8
[145] sass_0.4.2 irlba_2.3.5.1 future.apply_1.9.1