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
❝「Title:」Typing characteristics of metabolism-related genes in osteoporosis
「Journal:」Front. Pharmacol.
「Doi:」https://doi.org/10.1016/j.eja.2022.126692
❞
read picture
❝The expression difference box plot represents the difference in expression levels of GPR31, GATM, DDB2, ARMCX1, RPS6, BTBD3, ADAMTSL4, COQ6, B3GNT2, and CD9 genes among the three isoforms.
❞
Nothing special. The box plot drawn before:
Follow Cell to learn graphing | 3. Box plot + scatter + significant difference test
Follow Nat Commun to learn graphing | 1. Batch boxplot + scatter + difference analysis
Follow Nat Commun to learn graphing | 4. Paired box plot + difference analysis
Follow Cell to learn graphing | box plot + scatter (inter-group + intra-group difference analysis)
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.
"Chuzhou Notes 2022 VIP can receive it for free" .
❝Note: 2022 will soon pass, for the convenience of readers and friends, it is now launched
❞木舟笔记永久VIP
at a price169¥
.2022VIP
Only pay the difference to upgrade.木舟笔记永久VIP
Enjoy all the resources of this account (except for limited courses), and no VIP plans will be launched in the future.
Muzhou Notes 2022 VIP Plan
"rights and interests:"
"2022" Muzhou Notes all tweet sample data and codes ( "updated in real time in the VIP group" ).
data+code Muzhou Notes "Scientific Research Exchange Group" .
"Half price" purchase
跟着Cell学作图系列合集
(free tutorial + code collection) | Follow Cell to learn drawing series collection .
"TOLL:"
"99¥/person" . You can add WeChat: mzbj0002
transfer, or directly reward at the end of the article.
drawing
# loda data ana preprocess
mRNA <- read.csv("All_mRNA_FPKM.csv",header=T,row.names=1)
#log2
bar_mat <- t(log2(mRNA+1))
# group info
anno <- read.csv("sample_index.csv",header=T,row.names=1)
anno$type2 <- anno$Type
anno <- anno[rownames(bar_mat),]
bar_mat <- bar_mat[rownames(anno),]
bar_mat<- as.data.frame(bar_mat)
bar_mat$sam <- anno$Type
## plot
library(RColorBrewer)
library(ggpubr)
library(ggplot2)
bar_mat$sam<-factor(bar_mat$sam,levels=c("C1","C2","C3","C4"))
# comparisons
my_comparisons <- list(c("C1", "C2"),
c("C1", "C3"),
c("C1", "C4"))
# gene list
gc <- head( colnames(bar_mat), -1)
#开始批量绘制
plist<-list()
for (i in 1:length(gc)){
bar_tmp<-bar_mat[,c(gc[i],"sam")]
colnames(bar_tmp)<-c("Expression","sam")
pb1<- ggplot(data = bar_tmp,aes(x = sam,
y = Expression ,
fill = sam))+
scale_fill_manual(values = mycol[c(7,5,3,1)]) +
geom_violin(alpha = 0.4, position = position_dodge(width = .75),
size = 0.8, color="black") +
geom_boxplot(notch = TRUE, outlier.size = -1,
color="black", lwd=0.8, alpha = 0.7) +
geom_point(shape = 21, size=2,
position = position_jitterdodge(),
color="black", alpha = 1) +
theme_bw() +
ylab("Log12(FPKM+1)") +
xlab(gc[i]) +
theme(axis.text.x = element_text(size = 12, color = "black"),
axis.ticks = element_line(size=0.2, color="black"),
axis.ticks.length = unit(0.2, "cm"),
legend.position = "none",
panel.background = element_blank(),
panel.grid = element_blank(),
axis.title = element_text(size = 12),
axis.text = element_text(size = 12)) +
stat_compare_means(method="t.test",hide.ns = F,comparisons =my_comparisons,label="p.signif")
plist[[i]]<-pb1
}
# cowplot
library(cowplot)
p <- plot_grid(plotlist = plist, ncol = 5)
## save
ggsave("boxplot1208.pdf",width = 14,height = 20)
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)