R基础-09.任意基因任意癌症表达量和临床性状关联
参考视频【生信技能树】生信人应该这样学R语言
代码为自己学习总结
rm(list = ls())
options(stringsAsFactors = F)
#Ovarian serous Cystadenocarcinoma(TCGA,Nature 2011)
#All complete Tumors (316 samples)/1 Genes
#Gene Set/Pathway is altered in 28 (8.9%) of queried samples
a = read.table('plot-data-ARHGAP18-TCGA-OV-cbioportal.txt',header = T, sep = '\t', fill = T)
colnames(a) = c('id','stage','gene','mut')
dat = a
library(BiocManager)
BiocManager::install("metaBMA")#每次都要安装???
library(ggstatsplot)
ggbetweenstats(data = dat,x=stage,y = gene)
library(ggplot2)
ggsave('plot-data-ARHGAP18-TCGA-OV-cbioportal.png')
#Change method
#Compute the analysis of variance
res.aov <- aov(gene ~ stage,data = dat)
# Summary of the analysis
summary(res.aov)
TukeyHSD(res.aov)