How to draw this picture | Bubble heat map (gene expression pan-cancer analysis)

21f0767716166ce5f963532ef97a1b74.jpeg

bubble_cover

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

0d7e7ea693b0cc9b56c51c236e471ebc.png
image-20221230233154825
98a3a04aad4ac9d1c9cdc9dc02ddb1c8.png
image-20221230233532195

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-WTtumor to tumor in different cancer types .9p21-loss

Reproduce results

22ee5dbff2ac69f23714ef305ef5605c.png

Sample data and code collection

点赞, 在看This article, share it in the circle of friends 集赞30个and 保留30分钟send the screenshot to WeChat mzbj0002to receive it.

Canoe notes permanent VIP plan

"rights and interests:"

  1. All tweet sample data and codes of Muzhou Notes ( updated in real time "in the VIP group" ).

    5fa33fecf320c5118340b72f6d645c44.png
    data+code
  2. Muzhou Notes "Scientific Research Exchange Group" .

"TOLL:"

"169¥/person" . You can add WeChat: mzbj0002transfer, or directly reward at the end of the article. Muzhou Note "2022VIP" can directly pay "70¥" to upgrade.

18821d7fa57546a1f0feea3651c6fe7a.png

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)
f406c1b72f1b66c3f88cb562f1509f15.png
result

You can adjust it a little bit in AI later~

previous content

  1. CNS Chart Reappearance | Biological Information Analysis | R Drawing Resource Sharing & Discussion Group!

  2. How to draw this picture | A bit complicated scatter plot

  3. How to draw this picture | Correlation Analysis Lollipop Chart

  4. Group student letter | Front Immunol | A simple routine for screening early diagnostic markers based on serum proteome

  5. (Free tutorial + code collection) | Follow Cell to learn drawing series collection

  6. Q&A | How to draw beautiful illustrations in papers?

  7. Follow Cell to learn drawing | Mulberry map (ggalluvial)

  8. R actual combat | Lasso regression model establishment and variable screening

  9. Follow NC to map | Advanced interaction network diagram (protein + enrichment pathway) (Cytoscape)

  10. R actual combat | Add a circle to the clustering (ggunchull)

  11. R actual combat | NGS data time series analysis (maSigPro)

  12. Learn to draw with Cell | Venn Diagram (ggVennDiagram)


af04e43a560acc0a0cf583fa862030e0.png
Canoe Notes Matrix

Guess you like

Origin blog.csdn.net/weixin_45822007/article/details/128510084