大神一句話,菜鳥(niǎo)跑半年。我不是大神,但我可以縮短你走彎路的半年~ 就像歌兒唱的那樣,,如果你不知道該往哪兒走,,就留在這學(xué)點(diǎn)生信好不好~ 這里有豆豆和花花的學(xué)習(xí)歷程,,從新手到進(jìn)階,,生信路上有你有我,! 大年初六,加油油,。 本文題目出自生信技能樹(shù)R語(yǔ)言學(xué)習(xí)視頻,,文末有鏈接:從CLL內(nèi)置數(shù)據(jù)集的表達(dá)矩陣中找TP53基因的表達(dá)量 rm(list=ls()) options(stringsAsFactors = F) if(!suppressMessages(require('hgu95av2.db')))BiocManager::install('hgu95av2.db') if(!suppressMessages(require('CLL')))BiocManager::install('CLL') if(!suppressMessages(require(tidyverse)))install.packages('tidyverse') if(!suppressMessages(require(ggpubr)))install.packages('ggpubr') suppressMessages(library(hgu95av2.db)) suppressMessages(library(CLL)) suppressMessages(library(ggpubr))
data(sCLLex) # sCLLex exprSet <>#探針的表達(dá)量 exprSet[1:4,1:4] #> CLL11.CEL CLL12.CEL CLL13.CEL CLL14.CEL #> 1000_at 5.743132 6.219412 5.523328 5.340477 #> 1001_at 2.285143 2.291229 2.287986 2.295313 #> 1002_f_at 3.309294 3.318466 3.354423 3.327130 #> 1003_s_at 1.085264 1.117288 1.084010 1.103217 pd <>#sampleID與disease的對(duì)應(yīng)關(guān)系 head(pd) #> SampleID Disease #> CLL11.CEL CLL11 progres. #> CLL12.CEL CLL12 stable #> CLL13.CEL CLL13 progres. #> CLL14.CEL CLL14 progres. #> CLL15.CEL CLL15 progres. #> CLL16.CEL CLL16 progres.
p2s <>#探針與symbol的對(duì)應(yīng)關(guān)系 head(p2s) #> probe_id symbol #> 1 1000_at MAPK3 #> 2 1001_at TIE1 #> 3 1002_f_at CYP2C19 #> 4 1003_s_at CXCR5 #> 5 1004_at CXCR5 #> 6 1005_at DUSP1
p3 <>'TP53')
# boxplot [find TP53 has 3 probe IDs] probe_tp53 <> for(i in 1:3){ boxplot(exprSet[probe_tp53[i],] ~ pd$Disease) }
#用ggpubr作圖 #http://www./english/articles/24-ggpubr-publication-ready-p#lots/ expd <> expd[1:4,1:4] #> rowname CLL11.CEL CLL12.CEL CLL13.CEL #> 1 1000_at 5.743132 6.219412 5.523328 #> 2 1001_at 2.285143 2.291229 2.287986 #> 3 1002_f_at 3.309294 3.318466 3.354423 #> 4 1003_s_at 1.085264 1.117288 1.084010 expd2 <> key = 'sample', value = 'exp',-1) pd <> head(pd) #> rowname SampleID Disease #> 1 CLL11.CEL CLL11 progres. #> 2 CLL12.CEL CLL12 stable #> 3 CLL13.CEL CLL13 progres. #> 4 CLL14.CEL CLL14 progres. #> 5 CLL15.CEL CLL15 progres. #> 6 CLL16.CEL CLL16 progres. expd3 <>'sample'='rowname')) i=1 ###可換1,2 for(i in 1:3){ p <> x = 'Disease', y = 'exp', color = 'Disease', palette =c('#00AFBB', '#E7B800', '#FC4E07'), add = 'jitter', shape = 'Disease') print(p) }
|