In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article is about how to use ggplot2 to map volcanoes. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
Using ggplot2 to draw Volcano Map
Drawing Volcano Map with ggplot2 package
Load R package and case data temp1
Library ('ggplot2') head (temp1,10)-log10FDR logFC Regulate64170 1.971938-2.2884388 Down6674 1.864104-1.2460804 Down7401 1.864104 1.2950939 Up57217 1.864104-1.2676311 Down50613 1.801074 1.6640064 Up3433 1.801074 4.2696415 Up54830 1.801074-1.9012811 Down54886 1.801074-1.5446208 Down6355 1.801074 1.4273926 Up338324 1.801074 0.9592775 Normal
Data interpretation: data frame temp1, row name GeneID, the first column-log10FDR, the larger the data, the significant change of the gene, the second column logFC, the actual representation of log2FC, the multiple of difference change, and the third column of upper and lower information, which is obtained by filtering based on the threshold of the information of the first column and the second column. It is necessary to set this column of information as an ordered factor to facilitate the color setting of subsequent pictures.
Temp1 $Regulate=factor (temp1 $Regulate, levels=c ("Up", "Down", "Normal"), order=T)
Drawing, drawing into a point diagram
P_volcano=ggplot (temp1,aes (x=temp1 $logFC,y=temp1 [, "- log10FDR"]) + geom_point (aes (color=temp1 $Regulate)) + # set point color scale_color_manual (values = c ("Up" = "red", "Down" = "blue", "Normal" = "grey") + labs (x = "log2FC", y = "- log10FDR") + # increase the threshold line: corresponding to FDR=0.05, respectively | | log2FC | = 1 geom_hline (yintercept=-log10, linetype=4) + geom_vline (xintercept=c (- 1), linetype=4) + xlim (- 5) + theme (plot.title = element_text (size = 25 size = "bold", vjust = 0.5, hjust = 0.5), legend.title = element_blank (), legend.text = element_text (size = 18) | Face = "bold"), legend.position = 'right', legend.key.size=unit (0.8), axis.ticks.x=element_blank (), axis.text.x=element_text (size= 15) face = "bold", vjust = 0.5, hjust = 0.5) Axis.text.y=element_text (size = 15 camera face = "bold", vjust = 0.5, hjust = 0.5), axis.title.x = element_text (size = 20 camera face = "bold", vjust = 0.5, hjust = 0.5), axis.title.y = element_text (size = 20 camera face = "bold", vjust = 0.5, hjust = 0.5) Panel.background = element_rect (fill = "transparent", colour = "black"), panel.grid.minor = element_blank (), panel.grid.major = element_blank (), plot.background = element_rect (fill = "transparent", colour = "black") P_volcano Thank you for reading! This is the end of the article on "how to draw a volcano map with ggplot2". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.