-
Notifications
You must be signed in to change notification settings - Fork 0
/
forimmue.R
35 lines (30 loc) · 1.14 KB
/
forimmue.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
setwd("TCGA-BRCA/cibersortx/")
library(dplyr)
library(tidyr)
library(tibble)
library(ggpubr)
library(RColorBrewer)
forr<-read.table("CXXXRS.java",sep='\t',row.name=1)
for1<-forr[2:1056,1:22]
for1col<-forr[1,1:22]
colnames(for1)<-for1col
dat <- for1 %>% rownames_to_column("Sample") %>%
gather(key = Cell_type,value = Proportion,-Sample)
dat$Proportion<-as.numeric(dat$Proportion)
it<-ggplot(dat,aes(Sample,Proportion,fill = Cell_type)) +
geom_bar(stat = "identity") +
labs(fill = "Cell Type",x = "Patients",y = "Cell Type Proportion") +
scale_y_continuous(expand = c(0.01,0)) +
theme_classic() +
theme(axis.text.x = element_blank(),
axis.ticks.x = element_blank(),
legend.position = "bottom",
legend.key.size = unit(0.08, 'cm'),
legend.title = element_blank(),
legend.text = element_text(size=7))
mypalette <- colorRampPalette(brewer.pal(8,"Set3"))
it<-it+scale_fill_manual(values = mypalette(22))
https://www.nceas.ucsb.edu/sites/default/files/2020-04/colorPaletteCheatsheet.pdf
mypalette <- colorspace::diverge_hsv(22)
scale_fill_manual(values = mypalette) //paire boxplot, cell type :)
ggsave("it.pdf",it)