written in front
[How to draw this picture] The series of pictures are all from VIP群
the students' questions. The tweet is only a reproduction of the picture, and does not mean that the author agrees with the form of the picture. Students are welcome to analyze interesting pictures in the group.
Pictures of this issue
❝Han G, Yang G, Hao D, et al. 9p21 loss confers a cold tumor immune microenvironment and primary resistance to immune checkpoint therapy. Nat Commun. 2021;12(1):5606. Published 2021 Sep 23. doi:10.1038/s41467-021-25894-9
❞
The changes in the expression of 28 immune regulatory genes were analyzed from 9p21-WT
tumor to tumor in different cancer types .9p21-loss
Reproduce results
Sample data and code collection
点赞
, 在看
This article, share it in the circle of friends 集赞30个
and 保留30分钟
send the screenshot to WeChat mzbj0002
to receive it.
Canoe notes permanent VIP plan
"rights and interests:"
All tweet sample data and codes of Muzhou Notes ( updated in real time "in the VIP group" ).
data+code Muzhou Notes "Scientific Research Exchange Group" .
"TOLL:"
"169¥/person" . You can add WeChat: mzbj0002
transfer, or directly reward at the end of the article. Muzhou Note "2022VIP" can directly pay "70¥" to upgrade.
drawing
# data example
library(dplyr)
data <- data.frame(type =sort(rep(paste0('cancer',LETTERS[seq(1,15)]),15)),
gene = rep(paste0('gene',1:15),15),
Log2FC = runif(225,-1,1),
pvalue = runif(225,0.000001,1))
head(data)
## plot
library(ggplot2)
p1 <- ggplot(data,aes(x=type ,y= gene)) +
geom_point(aes(size=-log10(pvalue), fill=Log2FC),
shape=21,
color="black") +
scale_fill_gradient2(name = 'Log2FC\n(Expression)',
limit = c(-1.001,1.001),
breaks = c(-1.0,-0.5,0.0,0.5,1.0),
low='#444283',
high='#943934',
mid="white",
midpoint = 0)+
scale_size_continuous(name = '-Log10 qvalue',
limit = c(-0.001,3.1),
breaks = c(0,1,2,3))+
geom_hline(yintercept=c(5.5, 10.5))+
labs(x=NULL,
y=NULL,
title = "Expression of immunomodulatory genes (9p21-Loss vs 9p21-WT)")+
theme_bw()+
theme(panel.grid = element_blank(),
legend.key = element_blank(),
plot.title = element_text(hjust = 0.5, size = 12),
axis.text =element_text(size = 10, color = "black"),
axis.text.y = element_blank(),
axis.text.x=element_text(angle=45,hjust = 0.5,vjust=0.5))
p1
# rect anotate
anotate <- data %>% distinct(gene,.keep_all = T)
head(anotate)
p2 <- ggplot(anotate,aes(x = 0,y = gene,label= gene )) +
geom_text()+
annotate("rect",
ymin = c(0.5,5.5,10.5), ymax = c(5.5,10.5,15.5),
xmin = -5, xmax = 0.7,
fill = c('#ecf7fb','#fffbe7','#ffe7df'),
alpha = 0.5)+
theme_void()
p2
# patch
library(patchwork)
library(cowplot)
p2+p1+plot_layout(nrow= 1,
width = c(1, 2))
ggsave('bubble_heatmep.pdf',width = 10,height = 5)
❝You can adjust it a little bit in AI later~
❞
previous content
How to draw this picture | Correlation Analysis Lollipop Chart
(Free tutorial + code collection) | Follow Cell to learn drawing series collection
R actual combat | Lasso regression model establishment and variable screening
Follow NC to map | Advanced interaction network diagram (protein + enrichment pathway) (Cytoscape)
R actual combat | Add a circle to the clustering (ggunchull)