c++ 舞伴配对问题_R绘图:配对样本差异表达作图ggpubr
生活随笔
收集整理的這篇文章主要介紹了
c++ 舞伴配对问题_R绘图:配对样本差异表达作图ggpubr
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
R繪圖往期回顧:
R繪圖:唱一半的歌,畫一半的圖 gghalves
R繪圖:gggibbous,基于ggplot2的Moon charts
R繪圖:ggeconodist,基于ggplot2的另類箱圖
R語言學習系列之“多變的熱圖”
螞蟻金服在線可視化引擎 G2
R繪圖:無與倫比的華麗風行(桑基圖)
R繪圖:相關性分析與作圖(單基因相關性)
R繪圖:相關性分析與作圖R繪圖
ggsci: 高大上的論文配色,一文解決配色問題
R繪圖 ggpubr: 為學術而生
TCGA數據分析系列之火山圖
R繪圖 雷達圖-單基因泛癌差異表達的另類展現形式
現實中有很多數據都是配對的,最常見的就是癌和癌旁,ggpubr包的ggpaired函數可以實現配對樣本的統計和作圖
加載數據
rm(list = ls()) library(tidyverse) library(ggpubr) pairdata<-read.table('pair.txt',header = T,sep = 't')ggpaired用法
ggpaired(data, cond1, cond2, x = NULL, y = NULL, id = NULL,color = "black", fill = "white", palette = NULL, width = 0.5,point.size = 1.2, line.size = 0.5, line.color = "black",title = NULL, xlab = "Condition", ylab = "Value",facet.by = NULL, panel.labs = NULL, short.panel.labs = TRUE,label = NULL, font.label = list(size = 11, color = "black"),label.select = NULL, repel = FALSE, label.rectangle = FALSE,ggtheme = theme_pubr(), ...)ggpaired函數有兩種不同的方式做圖,第一種是這樣的
ggpaired(pairdata, cond1 = "condition1", cond2 = "condition2",fill = "condition", palette = "jco")加上P值
ggpaired(pairdata, cond1 = "condition1", cond2 = "condition2",fill = "condition", palette = "jco")+stat_compare_means(method = "t.test",paired = TRUE,label.y = 100)那么如果是三組數據做配對分析呢?這個時候可以把數據轉換成長數據,我們用tidyverse包中的gather函數來實現
drawdata<- pairdata %>% gather("condition", "value", -ID)此時數據就變成了長數據
用第二種方式作圖
ggpaired(drawdata, x = 'condition', y = 'value',id='ID',color = 'condition', palette = "jco", line.color = "gray", line.size = 0.4,short.panel.labs = FALSE)+stat_compare_means(method = "anova", label.y = 100)用樣本兩兩之間的配對T檢驗
my_comparisons <- list( c("condition1", "condition2"), c("condition1", "condition3"), c("condition2", "condition3") ) ggpaired(drawdata, x = 'condition', y = 'value',id='ID',color = 'condition', palette = "jco", line.color = "gray", line.size = 0.4,short.panel.labs = FALSE)+stat_compare_means(aes(label = ..p.signif..),method = "t.test",paired = TRUE, comparisons = my_comparisons)單基因泛癌分析鏈接
TCGA單基因免疫相關泛癌分析(應要求,對出圖添加更細致的描述)?mp.weixin.qq.comTCGA單基因免疫相關泛癌分析-進階版本?mp.weixin.qq.com公眾號“生信小課堂”
TCGA數據分析課程:
生物信息學教學?m.study.163.com零基礎-手把手教你重復一篇6.2分的生信文章(完整版)?mp.weixin.qq.com總結
以上是生活随笔為你收集整理的c++ 舞伴配对问题_R绘图:配对样本差异表达作图ggpubr的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 同一事务中未提交的写能读到吗_03、My
- 下一篇: 友盟消息推送服务器demo,友盟消息推送