-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmemo.R
126 lines (107 loc) · 20.9 KB
/
memo.R
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
PTsub_seurat
Tsub_seurat
Monosub_seurat
exp = [email protected]["ENSG00000005471",]
#TGgene=CIBERSORT celltype marker gene
TGgene=c('ENSG00000005471','ENSG00000150967','ENSG00000072818','ENSG00000087085','ENSG00000102575','ENSG00000042980','ENSG00000134028','ENSG00000156140','ENSG00000169252','ENSG00000204472','ENSG00000163568','ENSG00000161905','ENSG00000012779','ENSG00000116748','ENSG00000101280','ENSG00000164512','ENSG00000128383','ENSG00000239713','ENSG00000128284','ENSG00000221963','ENSG00000103569','ENSG00000128805','ENSG00000137486','ENSG00000141505','ENSG00000161944','ENSG00000104043','ENSG00000230223','ENSG00000172232','ENSG00000112182','ENSG00000153064','ENSG00000043039','ENSG00000127152','ENSG00000140379','ENSG00000110987','ENSG00000162373','ENSG00000125864','ENSG00000123095','ENSG00000023445','ENSG00000136573','ENSG00000138756','ENSG00000101425','ENSG00000157764','ENSG00000174672','ENSG00000109743','ENSG00000113303','ENSG00000173715','ENSG00000118292','ENSG00000171860','ENSG00000197405','ENSG00000134830','ENSG00000178538','ENSG00000164047','ENSG00000137757','ENSG00000150636','ENSG00000108702','ENSG00000181374','ENSG00000276409','ENSG00000102970','ENSG00000275385','ENSG00000172724','ENSG00000115009','ENSG00000102962','ENSG00000274736','ENSG00000275302','ENSG00000271503','ENSG00000108688','ENSG00000108700','ENSG00000118971','ENSG00000184451','ENSG00000121807','ENSG00000183625','ENSG00000160791','ENSG00000112486','ENSG00000126353','ENSG00000117281','ENSG00000134061','ENSG00000177455','ENSG00000158477','ENSG00000158485','ENSG00000158481','ENSG00000158473','ENSG00000158488','ENSG00000116824','ENSG00000090659','ENSG00000012124','ENSG00000122223','ENSG00000198821','ENSG00000139193','ENSG00000178562','ENSG00000167851','ENSG00000105383','ENSG00000104894','ENSG00000004468','ENSG00000167286','ENSG00000198851','ENSG00000160654','ENSG00000010610','ENSG00000101017',
'ENSG00000102245','ENSG00000110448','ENSG00000013725','ENSG00000129226','ENSG00000110848','ENSG00000173762','ENSG00000125726','ENSG00000137101','ENSG00000105369','ENSG00000007312','ENSG00000121594','ENSG00000114013','ENSG00000153563','ENSG00000172116','ENSG00000153283','ENSG00000158825','ENSG00000164045','ENSG00000154162','ENSG00000148600','ENSG00000105810','ENSG00000170956','ENSG00000124469','ENSG00000205923','ENSG00000126759','ENSG00000133048','ENSG00000064886','ENSG00000182022','ENSG00000147119','ENSG00000105205','ENSG00000153923','ENSG00000132514','ENSG00000069493','ENSG00000111729','ENSG00000172243','ENSG00000155962','ENSG00000092009','ENSG00000171812','ENSG00000206561','ENSG00000163751','ENSG00000117322','ENSG00000146592','ENSG00000096006','ENSG00000109943','ENSG00000100122','ENSG00000184371','ENSG00000164400','ENSG00000119535','ENSG00000077984','ENSG00000163599','ENSG00000100448','ENSG00000172543','ENSG00000169245','ENSG00000169248','ENSG00000156234','ENSG00000163734','ENSG00000163735','ENSG00000138755','ENSG00000163464','ENSG00000180871','ENSG00000160683','ENSG00000172215','ENSG00000147231','ENSG00000135929','ENSG00000111012','ENSG00000276644','ENSG00000035664','ENSG00000164935','ENSG00000164821','ENSG00000170456','ENSG00000100150','ENSG00000065357','ENSG00000278535','ENSG00000108771','ENSG00000167261','ENSG00000197635','ENSG00000134765','ENSG00000158050','ENSG00000145088','ENSG00000105246','ENSG00000184349','ENSG00000122877','ENSG00000197561','ENSG00000159023','ENSG00000072134','ENSG00000134954','ENSG00000117036','ENSG00000124019','ENSG00000185442','ENSG00000164125','ENSG00000117560','ENSG00000135722','ENSG00000179639','ENSG00000104921','ENSG00000072694','ENSG00000162747','ENSG00000085265','ENSG00000132704','ENSG00000182511',
'ENSG00000126262','ENSG00000090554','ENSG00000119686','ENSG00000125740','ENSG00000049768','ENSG00000171051','ENSG00000171049','ENSG00000187474','ENSG00000111816','ENSG00000151474','ENSG00000126391','ENSG00000180340','ENSG00000104290','ENSG00000197093','ENSG00000166573','ENSG00000162676','ENSG00000099998','ENSG00000010310','ENSG00000176533','ENSG00000115523','ENSG00000076716','ENSG00000183671','ENSG00000174946','ENSG00000125245','ENSG00000169508','ENSG00000183150','ENSG00000170128','ENSG00000140030','ENSG00000100351','ENSG00000228315',
'ENSG00000197465','ENSG00000145649','ENSG00000100453','ENSG00000100450','ENSG00000113088','ENSG00000197540','ENSG00000084110','ENSG00000101336','ENSG00000140287','ENSG00000163666','ENSG00000152804','ENSG00000177374','ENSG00000277075','ENSG00000273802','ENSG00000160883','ENSG00000241106','ENSG00000196735','ENSG00000213652','ENSG00000150540','ENSG00000105991','ENSG00000163106','ENSG00000173083','ENSG00000196639','ENSG00000173110','ENSG00000135914','ENSG00000003147','ENSG00000163600','ENSG00000131203','ENSG00000137959','ENSG00000186803','ENSG00000111537','ENSG00000211898','ENSG00000211891','ENSG00000211899','ENSG00000211592','ENSG00000206066','ENSG00000140749','ENSG00000113302','ENSG00000081985','ENSG00000112115','ENSG00000115604','ENSG00000115607','ENSG00000115008','ENSG00000125538','ENSG00000115602','ENSG00000138684','ENSG00000111536','ENSG00000134460','ENSG00000100385','ENSG00000164399','ENSG00000113520','ENSG00000077238','ENSG00000113525','ENSG00000091181','ENSG00000104432','ENSG00000168685','ENSG00000145839','ENSG00000140968','ENSG00000113263','ENSG00000177272','ENSG00000178342','ENSG00000125498','ENSG00000189013','ENSG00000221957','ENSG00000240403','ENSG00000111796','ENSG00000205810',
'ENSG00000183542','ENSG00000134539','ENSG00000150045','ENSG00000139187','ENSG00000213809','ENSG00000219941','ENSG00000115919','ENSG00000089692','ENSG00000167618','ENSG00000078081','ENSG00000213658','ENSG00000182866','ENSG00000138795','ENSG00000138039','ENSG00000239998',
'ENSG00000239961','ENSG00000131042','ENSG00000203896','ENSG00000281005','ENSG00000118308','ENSG00000204482','ENSG00000226979','ENSG00000227507','ENSG00000213316','ENSG00000112799','ENSG00000122224','ENSG00000185247','ENSG00000111837','ENSG00000111885','ENSG00000172469','ENSG00000073803','ENSG00000104814','ENSG00000168067','ENSG00000164114','ENSG00000173926','ENSG00000019169','ENSG00000105613','ENSG00000165471','ENSG00000103313','ENSG00000112818','ENSG00000257335','ENSG00000243156','ENSG00000262406','ENSG00000008516','ENSG00000100985','ENSG00000163563','ENSG00000184313','ENSG00000156738','ENSG00000149534','ENSG00000149516','ENSG00000110077','ENSG00000178860','ENSG00000059728','ENSG00000118513','ENSG00000170476','ENSG00000168060','ENSG00000116701','ENSG00000204475','ENSG00000123405','ENSG00000165028','ENSG00000105374','ENSG00000162711','ENSG00000135577','ENSG00000086288','ENSG00000167207','ENSG00000074771','ENSG00000130751','ENSG00000196436','ENSG00000135838','ENSG00000119508','ENSG00000162068','ENSG00000198400','ENSG00000085840','ENSG00000099985','ENSG00000108405','ENSG00000083454','ENSG00000078589','ENSG00000181631','ENSG00000174944','ENSG00000175591','ENSG00000159339','ENSG00000137819','ENSG00000115687','ENSG00000009709','ENSG00000163346','ENSG00000204965','ENSG00000188389','ENSG00000197646','ENSG00000095464','ENSG00000152256','ENSG00000008438','ENSG00000100100','ENSG00000078795','ENSG00000144837','ENSG00000146070','ENSG00000149527','ENSG00000166289',
'ENSG00000126822','ENSG00000183395','ENSG00000168081','ENSG00000163736','ENSG00000110841','ENSG00000180644','ENSG00000186652','ENSG00000135362','ENSG00000242221','ENSG00000168229','ENSG00000125384','ENSG00000160013','ENSG00000213402','ENSG00000144724','ENSG00000213413','ENSG00000115828','ENSG00000041353','ENSG00000116191','ENSG00000185989','ENSG00000068831','ENSG00000152689','ENSG00000107551','ENSG00000117602','ENSG00000143839','ENSG00000102032','ENSG00000169891','ENSG00000090104','ENSG00000127074','ENSG00000169385','ENSG00000169413','ENSG00000165496','ENSG00000225093','ENSG00000052749','ENSG00000114767','ENSG00000134321','ENSG00000196218','ENSG00000163221','ENSG00000180739','ENSG00000155307','ENSG00000169432','ENSG00000075826','ENSG00000188404','ENSG00000184702','ENSG00000164402','ENSG00000129158','ENSG00000183918','ENSG00000088827','ENSG00000142178','ENSG00000089012','ENSG00000137078','ENSG00000154839','ENSG00000141293','ENSG00000117090','ENSG00000158714','ENSG00000074803','ENSG00000221955','ENSG00000110446','ENSG00000160326','ENSG00000130876','ENSG00000137571','ENSG00000103056','ENSG00000130768','ENSG00000185338','ENSG00000079263','ENSG00000061656','ENSG00000269404','ENSG00000107742','ENSG00000126752','ENSG00000064225','ENSG00000136840','ENSG00000111728','ENSG00000035720','ENSG00000127954','ENSG00000168952','ENSG00000233402','ENSG00000073861','ENSG00000081059','ENSG00000100721','ENSG00000135605','ENSG00000129566','ENSG00000104055','ENSG00000137462','ENSG00000196664','ENSG00000101916','ENSG00000121895','ENSG00000125355','ENSG00000123610','ENSG00000173535','ENSG00000141655','ENSG00000240505','ENSG00000048462','ENSG00000186827','ENSG00000125735','ENSG00000050730','ENSG00000172236','ENSG00000277734','ENSG00000076604','ENSG00000163519',
'ENSG00000211789','ENSG00000211788','ENSG00000211791','ENSG00000211801','ENSG00000211795','ENSG00000211793','ENSG00000211751','ENSG00000211829','ENSG00000124731','ENSG00000095970','ENSG00000112195','ENSG00000071575','ENSG00000130529','ENSG00000119121','ENSG00000165409','ENSG00000075234','ENSG00000074966','ENSG00000077498','ENSG00000160185','ENSG00000242366','ENSG00000197888','ENSG00000100373','ENSG00000136059','ENSG00000112299','ENSG00000112303','ENSG00000093134','ENSG00000128218','ENSG00000111186','ENSG00000154764','ENSG00000115085','ENSG00000124256','ENSG00000205189','ENSG00000011590','ENSG00000152518','ENSG00000176293','ENSG00000197279','ENSG00000204789','ENSG00000159885','ENSG00000187607','ENSG00000083812','ENSG00000198342')
for (i in TGgene){
test = [email protected][i,]
exp <- rbind(exp,test)
}
exp_real <-exp[rownames(exp)!="exp",]
rownames(exp_real) <- TGgene
dim(exp_real)
[1] 529 3807
write.table(exp_real, file = "Monosub_CIBERSORT.txt", sep="\t", row.names=TRUE)
exp_real <- read.table(file = "Monosub_CIBERSORT.txt", sep="\t", header=TRUE)
CIBERSORT <- read.table(file="CIBERSORT_marker_gene_compare_DGIST.txt", sep='\t', header=TRUE)
rownames(CIBERSORT) <- CIBERSORT[,1]
CIBERSORT <- CIBERSORT[,-1]
> CIBERSORT$
CIBERSORT$Gene.symbol CIBERSORT$NK.cells.activated
CIBERSORT$B.cells.naive CIBERSORT$Monocytes
CIBERSORT$B.cells.memory CIBERSORT$Macrophages.M0
CIBERSORT$Plasma.cells CIBERSORT$Macrophages.M1
CIBERSORT$T.cells.CD8 CIBERSORT$Macrophages.M2
CIBERSORT$T.cells.CD4.naive CIBERSORT$Dendritic.cells.resting
CIBERSORT$T.cells.CD4.memory.resting CIBERSORT$Dendritic.cells.activated
CIBERSORT$T.cells.CD4.memory.activated CIBERSORT$Mast.cells.resting
CIBERSORT$T.cells.follicular.helper CIBERSORT$Mast.cells.activated
CIBERSORT$T.cells.regulatory..Tregs. CIBERSORT$Eosinophils
CIBERSORT$T.cells.gamma.delta CIBERSORT$Neutrophils
CIBERSORT$NK.cells.resting
celltype <- as.matrix(CIBERSORT$Neutrophils)
rownames(celltype) <- rownames(CIBERSORT)
CT_corr=c()
for (i in c(1:length(colnames(exp_real)))){
table <- cbind(exp_real[,i],celltype[,1])
colnames(table) <- c("DGIST","CIBERSORT")
corr <- cor(table)[1,2]
CT_corr <- cbind(CT_corr,corr)
}
colnames(CT_corr) <- colnames(exp_real)
celltypes = "Neutrophils"
pdf(paste0("DGIST_Monosub_",celltypes,".pdf"),width=12, height=9)
df = data.frame(x=Monosub_seurat@[email protected][, "tSNE_1"],
y=Monosub_seurat@[email protected][, "tSNE_2"],
expression=CT_corr[1,])
ggplot(df,aes(x=x, y=y, colour=expression),mar=c(0,0,3,0)) +
ggtitle(paste0(celltypes, " Correlation")) +
geom_point(size=1) +
scale_colour_gradientn(colours = rev(brewer.pal(11, "RdBu"))) +
ylab("Component 2") +
xlab("Component 1") +
theme_bw() +
theme(text = element_text(size=20),
panel.grid.major=element_blank(),
panel.grid.minor=element_blank(),
axis.line=element_line(size=1),
axis.ticks=element_line(size=1),
legend.text=element_text(size=20),
legend.title=element_blank(),
legend.key=element_blank(),
axis.text.x = element_text(size=20)
)
dev.off()
TGgene=c('AATK','ABCB7','ACAP2','ADIPOR1','AGFG1','AHNAK','AIF1','AKAP13','AKAP8','ANKS1A','ANXA1','AP1G1','APAF1','APBB3','ARF5','ARL8B','ARNT','ASGR2','ATG3','ATP6V0D1','AZIN1','BCL10','BCL2L11','BEST1','BNIP2','BPI','BTAF1','BTK','C3AR1','CALCOCO2','CAMKK2','CAPN2','CAPN3','CAPNS1','CARS2','CASP5','CAST','CBX6','CCR2','CD101','CD163','CD1E','CD244','CD300C','CD33','CD4','CD48','CD93','CDC40','CDK9','CEACAM4','CECR5','CEPT1','CFP','CLEC10A','CLEC1A','CLEC3B','CLEC4A','CLEC4E','CLEC5A','CLIP1','COL4A3BP','COMMD9','COQ2','CSF1R','CSF3R','CSNK1A1','CTBP2','CUL5','CX3CR1','CXCR2','CXorf21','CYBB','CYSLTR2','DCTN4','DDX21','DDX3X','DENND1A','DHX57','DHX8','DLG4','DNAH17','DNAJC13','DOK2','DOK3','DPEP2','EIF1B','EIF4E2','ELL','ETF1','ETV3','EWSR1','F13A1','FAM32A','FBXL5','FBXO11','FCAR','FCER1A','FCER1G','FCN1','FGL2','FGR','FKBP15','FNDC3A','FOLR2','FOLR3','FPR2','GABARAP','GALNT3','GGA1','GIT2','GNA13','GNMT','GPR162','GPR183','GRPEL1','H2AFY','HADHA','HCK','HIC1','HIF1A','HIPK1','HK3','HNRNPU','HRH2','HSPA6','HUS1','IL10RA','IL17RA','IMPDH1','IQGAP1','IQSEC2','JMJD1C','JMJD6','KCNC3','KCNMB1','KDM6B','KIAA1033','KLHL18','KSR1','LILRA1','LILRA2','LILRA5','LILRB1','LILRB2','LILRB3','LRRFIP1','LST1','LTBR','LY86','LYL1','MAN2C1','MAP2K1','MAP3K11','MAP3K2','MAP3K3','MAPK14','MAPK6','MARCO','MARK3','MBOAT7','MED13L','MEFV','METTL9','MIOS','MMP17','MNDA','MNT','MPHOSPH6','MS4A4A','MS4A6A','MTF1','MTHFR','MTMR14','MTMR3','MYO1F','NCF4','NCOA4','NDST2','NEK4','NKIRAS2','NPLOC4','NSFL1C','NUBP1','NUP214','OGFR','OSBPL11','OSM','P2RY13','PADI4','PANK2','PCTP','PDE6H','PGGT1B','PGLS','PHKG2','PHLDA2','PIAS1','PIKFYVE','PILRA','PLAA','PLD2','PLEK','PLP2','PNP','POU2F2','PPM1A','PPM1F','PPP1CB','PRKACA','PSTPIP1','PTCH2','PTEN','PTGIR','PTP4A2','PTPN18','QKI','RAB5A','RABGEF1','RARA','RBM41','REEP4','RELA','RETN','RGS19','RHOA','RHOG','RHOT1','RIN2','RIOK3','RLIM','RNASE2','RPGRIP1','RPH3A','RPS6KC1','RTN3','S100A10','S100A12','S100A6','SAMSN1','SAR1A','SEC11A','SEMA6B','SERP1','SETX','SH3BP2','SIGLEC9','SIK3','SIN3B','SLC11A1','SLC38A10','SNX17','SOCS3','SPEN','SPG11','SRC','STAB1','STRN4','STX12','STX5','SUN1','SUPT6H','TBK1','TGOLN2','TLR7','TLR8','TMBIM4','TMEM104','TMEM11','TMEM110','TMEM127','TMEM9B','TNFRSF8','TPD52L2','TREM1','TREX1','TSEN34','TSPO','TTLL4','TYROBP','UBE2D1','UBR2','UBXN2B','UPK3A','USP15','USP4','USP48','USP8','VASP','VENTX','VNN3','WAS','WDR11','WTAP','WWP2','YTHDF3','ZBTB7A','ZDHHC3','ZFC3H1','ZMYM4','ZNF668','ZNF710','ZNF787')
exp = [email protected]["ENSG00000204472",]
#TGgene=CIBERSORT celltype marker gene
TGgene=c("ENSG00000181409","ENSG00000131269","ENSG00000114331","ENSG00000159346","ENSG00000173744","ENSG00000124942","ENSG00000204472","ENSG00000170776","ENSG00000105127","ENSG00000064999","ENSG00000135046","ENSG00000166747","ENSG00000120868","ENSG00000113108","ENSG00000004059","ENSG00000134108","ENSG00000143437","ENSG00000161944","ENSG00000144848","ENSG00000159720","ENSG00000155096","ENSG00000142867","ENSG00000153094","ENSG00000167995","ENSG00000140299","ENSG00000101425","ENSG00000095564","ENSG00000010671","ENSG00000171860","ENSG00000136436","ENSG00000110931","ENSG00000162909","ENSG00000092529","ENSG00000126247","ENSG00000134905","ENSG00000137757","ENSG00000153113","ENSG00000183741","ENSG00000121807","ENSG00000134256","ENSG00000177575","ENSG00000158488","ENSG00000122223","ENSG00000167850","ENSG00000105383","ENSG00000010610","ENSG00000117091","ENSG00000125810","ENSG00000168438","ENSG00000136807","ENSG00000105352","ENSG00000134255","ENSG00000126759","ENSG00000132514","ENSG00000150048","ENSG00000163815","ENSG00000111729","ENSG00000166523","ENSG00000258227","ENSG00000130779","ENSG00000113163","ENSG00000110442","ENSG00000173085","ENSG00000182578","ENSG00000119535","ENSG00000113712","ENSG00000175029","ENSG00000166266","ENSG00000168329","ENSG00000180871","ENSG00000120280","ENSG00000165168","ENSG00000152207","ENSG00000132912","ENSG00000165732","ENSG00000215301","ENSG00000119522","ENSG00000163214","ENSG00000067596","ENSG00000132535","ENSG00000187775","ENSG00000138246","ENSG00000147443","ENSG00000146094","ENSG00000167261","ENSG00000114784","ENSG00000135930","ENSG00000105656","ENSG00000120705","ENSG00000117036","ENSG00000182944","ENSG00000124491","ENSG00000105058","ENSG00000118564","ENSG00000138081","ENSG00000186431","ENSG00000179639","ENSG00000158869","ENSG00000085265","ENSG00000127951","ENSG00000000938","ENSG00000119321","ENSG00000102531","ENSG00000165457","ENSG00000110203","ENSG00000171049","ENSG00000170296","ENSG00000115339","ENSG00000100083","ENSG00000139436","ENSG00000120063","ENSG00000124713","ENSG00000250510","ENSG00000169508","ENSG00000109519","ENSG00000113648","ENSG00000084754","ENSG00000101336","ENSG00000177374","ENSG00000100644","ENSG00000163349","ENSG00000160883","ENSG00000153187","ENSG00000113749","ENSG00000173110","ENSG00000136273","ENSG00000110324","ENSG00000177663","ENSG00000106348","ENSG00000140575","ENSG00000124313","ENSG00000171988","ENSG00000070495","ENSG00000131398","ENSG00000145936","ENSG00000132510","ENSG00000114648","ENSG00000141068","ENSG00000104974","ENSG00000239998","ENSG00000187116","ENSG00000104972","ENSG00000131042","ENSG00000204577","ENSG00000124831","ENSG00000204482","ENSG00000111321","ENSG00000112799","ENSG00000104903","ENSG00000140400","ENSG00000169032","ENSG00000173327","ENSG00000169967","ENSG00000198909",
"ENSG00000112062","ENSG00000069956","ENSG00000019169","ENSG00000075413","ENSG00000125505","ENSG00000123066","ENSG00000103313","ENSG00000197006","ENSG00000164654","ENSG00000198598","ENSG00000163563","ENSG00000070444","ENSG00000135698","ENSG00000110079","ENSG00000110077","ENSG00000188786","ENSG00000177000","ENSG00000163719","ENSG00000100330","ENSG00000142347","ENSG00000100365","ENSG00000266412","ENSG00000166507","ENSG00000114904","ENSG00000168256","ENSG00000182446","ENSG00000088833","ENSG00000103274","ENSG00000126883","ENSG00000060491","ENSG00000144909","ENSG00000099985","ENSG00000181631","ENSG00000159339","ENSG00000125779","ENSG00000141179","ENSG00000139053","ENSG00000164219","ENSG00000130313","ENSG00000156873","ENSG00000181649","ENSG00000033800","ENSG00000115020","ENSG00000085514","ENSG00000137055","ENSG00000129219","ENSG00000115956","ENSG00000102007","ENSG00000198805","ENSG00000028277","ENSG00000100614","ENSG00000100034","ENSG00000213639","ENSG00000072062","ENSG00000140368","ENSG00000117425","ENSG00000171862","ENSG00000160013","ENSG00000184007","ENSG00000072135","ENSG00000112531","ENSG00000144566","ENSG00000154710","ENSG00000131759","ENSG00000089682","ENSG00000168476","ENSG00000173039","ENSG00000104918","ENSG00000171700","ENSG00000067560","ENSG00000177105","ENSG00000126858","ENSG00000132669","ENSG00000101782","ENSG00000131263","ENSG00000169385","ENSG00000092200","ENSG00000089169","ENSG00000136643","ENSG00000133318","ENSG00000197747","ENSG00000163221","ENSG00000197956","ENSG00000155307","ENSG00000079332","ENSG00000140612","ENSG00000167680","ENSG00000120742","ENSG00000107290","ENSG00000087266","ENSG00000129450","ENSG00000160584","ENSG00000127511","ENSG00000018280","ENSG00000157637","ENSG00000115234","ENSG00000184557","ENSG00000065526","ENSG00000104133","ENSG00000197122","ENSG00000010327","ENSG00000090372","ENSG00000117758","ENSG00000162236","ENSG00000164828","ENSG00000109111","ENSG00000183735","ENSG00000152291","ENSG00000196664","ENSG00000101916","ENSG00000155957","ENSG00000109066","ENSG00000178307","ENSG00000135956","ENSG00000175348","ENSG00000120949","ENSG00000101150","ENSG00000124731","ENSG00000213689","ENSG00000170892","ENSG00000100300","ENSG00000135912","ENSG00000011600","ENSG00000072401","ENSG00000024048","ENSG00000215114","ENSG00000100373","ENSG00000135655","ENSG00000114316","ENSG00000090686","ENSG00000138592","ENSG00000125753","ENSG00000151650","ENSG00000093134","ENSG00000015285","ENSG00000120008","ENSG00000146457","ENSG00000198373","ENSG00000185728","ENSG00000178951","ENSG00000163812","ENSG00000133858","ENSG00000146463","ENSG00000167394","ENSG00000140548","ENSG00000142409")
for (i in TGgene){
test = [email protected][i,]
exp <- rbind(exp,test)
}
exp_real <-exp[rownames(exp)!="exp",]
rownames(exp_real) <- TGgene
celltypes = "Monocytes"
cols <- c('#D5D8DC',brewer.pal(9, "Reds"))
pdf(paste0("Monocyte_subcluster_Xcell.pdf"),width=12, height=9)
df = data.frame(x=Monosub_seurat@[email protected][, "tSNE_1"],
y=Monosub_seurat@[email protected][, "tSNE_2"],
expression=colSums(exp_real))
ggplot(df,aes(x=x, y=y, colour=expression),mar=c(0,0,3,0)) +
ggtitle(paste0("Xcell signature gene exp : ",celltypes)) +
geom_point(size=1) +
scale_colour_gradientn(colours = rev(brewer.pal(11, "RdBu"))) +
ylab("Component 2") +
xlab("Component 1") +
theme_bw() +
theme(text = element_text(size=20),
panel.grid.major=element_blank(),
panel.grid.minor=element_blank(),
axis.line=element_line(size=1),
axis.ticks=element_line(size=1),
legend.text=element_text(size=20),
legend.title=element_blank(),
legend.key=element_blank(),
axis.text.x = element_text(size=20)
)
dev.off()