rm(list=ls())
##this Rcode is used for 1):extract target gene expression from GSE file; and 2) draw box plot
##annotation is accomplished by relevant bioconductor package
##----------------
##GSE matrix file download
if(F){
suppressPackageStartupMessages(library(GEOquery))
eSet <- getGEO('GSE3325', destdir=".",
AnnotGPL = F,
getGPL = F)
#getGPL = F: no GPL will be downloaded
#getGPL = T: a GPLxxx.SOFT file will be downloaded
save(eSet,file='GSE3325_eSet.Rdata')
}
##----------------
##row exprSet(rownames are probeids) and phenotype preparation
load('GSE3325_eSet.Rdata')
b = eSet[[1]]
raw_exprSet=exprs(b)
raw_exprSet[1:4,1:4]
phe=pData(b)
phe$title
library(stringr)
group_list= tolower(str_split(as.character(phe$title),' ',simplify = T)[,2])
# head(group_list);table(group_list)
#identical(rownames(phe),colnames(raw_exprSet)) # the return value must be TRUE
save(raw_exprSet,group_list,
file='GSE3325_raw_exprSet.Rdata')
##----------------
##annotation and pickout intersted genes
rm(list=ls())
load(file='GSE3325_raw_exprSet.Rdata')
#annotation with bioconductor package
suppressPackageStartupMessages(library(hgu133plus2.db))
eg2probe=toTable(hgu133plus2SYMBOL)
#input intersted gene symbol
eg2probe[eg2probe$symbol=='TRAF4',]
raw_exprSet[1:4,1:4]
exprSet=log2(raw_exprSet)
##extract intersted gene expression
exprSet_select <- exprSet[eg2probe[eg2probe$symbol=='TRAF4',]$probe_id,]
##pick out the most max value of rowMeans
dat=data.frame(gene= exprSet_select[which.max(rowMeans(exprSet_select)),],
mut= group_list)
head(dat)
#-----------------
#visualization
if(require('ggpubr')){
library(ggpubr)
# google search : ggpubr boxplot add p-value
# http://www.sthda.com/english/articles/24-ggpubr-publication-ready-plots/76-add-p-values-and-significance-levels-to-ggplots/
p <- ggboxplot(dat, x = "mut", y = "gene",
color = "mut", palette = "jco",
add = "jitter")
# Add p-value
p + stat_compare_means()
}
if(require('ggstatsplot')){
library(ggstatsplot)
ggbetweenstats(data = dat, x = mut, y = gene)
}
if(require('ggplot2')){
library(ggplot2)
ggplot(dat,aes(x=mut,y=gene))+
geom_boxplot()+
theme_bw()
}
GEO提取任意基因表達(dá)量(bioconductor包注釋)
最后編輯于 :
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。
相關(guān)閱讀更多精彩內(nèi)容
- 分析基因芯片的數(shù)據(jù),提取出差異表達(dá)的基因這次試驗(yàn)的數(shù)據(jù)來(lái)源于文獻(xiàn):https://www.ncbi.nlm.nih...
- 這是ggplot2可視化專題的第一個(gè)實(shí)例操作 ggplot2的基本思路見前文總論:基于ggplot2的RNA-se...
- R基礎(chǔ)-08.任意基因任意癌癥表達(dá)量分組的生存分析 參考視頻【生信技能樹】生信人應(yīng)該這樣學(xué)R語(yǔ)言代碼為自己學(xué)習(xí)總結(jié)...
- 今天感恩節(jié)哎,感謝一直在我身邊的親朋好友。感恩相遇!感恩不離不棄。 中午開了第一次的黨會(huì),身份的轉(zhuǎn)變要...