-
Notifications
You must be signed in to change notification settings - Fork 0
/
exp7ImmuneCellDeconv.Rmd
65 lines (40 loc) · 1.56 KB
/
exp7ImmuneCellDeconv.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
---
title: "Immune Deconvolution Analysis"
author: "Sara Gosline"
date: "2023-04-03"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
## Load immune deconv files
We have run the immune cell deconvolution on both the spatial data and the sorted data as a baseline.
```{r loadData}
source("spleenDataFormatting.R")
###add in the sorted cell signature?
spatial<-read.table('deconv/spatialProtMat-mcpcounter-LM7c.tsv',header=T,sep='\t',row.names=1,check.names=F)
sorted<-read.table("deconv/globalProtMat-mcpcounter-LM7c.tsv",header=T,sep='\t',row.names=1,check.names=F)
library(pheatmap)
pheatmap(spatial)#,filename = 'spatialProtImmune.pdf',cellheight = 10)
pheatmap(sorted)#,filename='sortedProtImmune.pdf',cellheight=10)
```
Now we want to map the scores to the spatialProt object. first we need to go through our voxel annotation strategy that we established -- using sorted cells to label
spatial. Now we can use that to label the heatmaps.
```{r voxel annotation}
```
## Plotting cell scores by voxel
```{r gridplot, echo=FALSE}
#library(spammer)
#library(SingleCellExperiment) ##remove this once we update package
source('spatialProtUtils.R')
colData(spat.prot)<-cbind(colData(spat.prot),t(spatial))
p1<-plotSigGrid(spat.prot,"B.cells")
p2<-plotSigGrid(spat.prot,"T8.cells")
p3<-plotSigGrid(spat.prot,"Granulocytes")
p4<-plotSigGrid(spat.prot,"NK.cells")
p5<-plotSigGrid(spat.prot,"MO")
p6<-plotSigGrid(spat.prot,"DC")
pl<-cowplot::plot_grid(p1,p2,p3,p4,p5,p6,nrow=3)
pl
ggsave("ImmCellPlots.pdf",pl,height=10,width=12)
```