50行ぐらいでRとBioCを理解した気になる講義です。
RとBioconductorの講義資料を置いておきます。
Ustはこちら。http://www.ustream.tv/channel/mntv
R
<<<
demo(graphics)
# R
52.0/(1.63*1.63)
w <- 52.0
h <- 1.63
w/h^2
22*h^2
# function
a <- c(50,1.60)
b <- c(60,1.60)
c <- c(70,1.60)
a[1]/a[2]^2
bmi <- function(x) { x[1]/x[2]^2 }
bmi(a)
# quit and session
q()
# matrix and apply
wh <- matrix(c(50,60,70,1.60,1.60,1.60), ncol=2)
wh[,1]/wh[,2]^2
summary(wh)
?summary
example(summary)
# push q key
example(summary)
apply(wh,1,bmi)
>>>
BioC
<<<
# BioC
library(affy)
e <- justRMA()
is(e)
head( exprs(e) )
write.table(exprs(e), "e.txt", sep="\t", eol="\n", quote=F, row.names=T, col.names=F)
# interesting genes
library('genefilter')
# template matching
e.cor <- genefinder(e, 1, 10, method = "euclidean", scale = "none")
e.cor
exprs(e[e.cor$`100001_at`$indices])
library(annotate)
# T-test
t.filter <- ttest(c(1,1,1,1,2,2,2,2), p=0.01)
t.filterfun <- filterfun(t.filter)
which.t <- genefilter(exprs(e), t.filterfun)
sum(which.t)
e.t <- e[which.t]
e.t
# clustering and drawing heatmap
pdf("heatmap.pdf", paper="a4")
heatmap(exprs(e.t))
dev.off()
>>>
詳しくは以下の本を参照してください。
{{amazon '4501622601
RとBioconductorの講義資料を置いておきます。
Ustはこちら。http://www.ustream.tv/channel/mntv
R
<<<
demo(graphics)
# R
52.0/(1.63*1.63)
w <- 52.0
h <- 1.63
w/h^2
22*h^2
# function
a <- c(50,1.60)
b <- c(60,1.60)
c <- c(70,1.60)
a[1]/a[2]^2
bmi <- function(x) { x[1]/x[2]^2 }
bmi(a)
# quit and session
q()
# matrix and apply
wh <- matrix(c(50,60,70,1.60,1.60,1.60), ncol=2)
wh[,1]/wh[,2]^2
summary(wh)
?summary
example(summary)
# push q key
example(summary)
apply(wh,1,bmi)
>>>
BioC
<<<
# BioC
library(affy)
e <- justRMA()
is(e)
head( exprs(e) )
write.table(exprs(e), "e.txt", sep="\t", eol="\n", quote=F, row.names=T, col.names=F)
# interesting genes
library('genefilter')
# template matching
e.cor <- genefinder(e, 1, 10, method = "euclidean", scale = "none")
e.cor
exprs(e[e.cor$`100001_at`$indices])
library(annotate)
# T-test
t.filter <- ttest(c(1,1,1,1,2,2,2,2), p=0.01)
t.filterfun <- filterfun(t.filter)
which.t <- genefilter(exprs(e), t.filterfun)
sum(which.t)
e.t <- e[which.t]
e.t
# clustering and drawing heatmap
pdf("heatmap.pdf", paper="a4")
heatmap(exprs(e.t))
dev.off()
>>>
詳しくは以下の本を参照してください。
{{amazon '4501622601
コメント
コメントを投稿