[BioC] Please Explain the code from Lab 5: Cluster Analysis and Lab 6: Classification

dibakar ray dibakar at hub.nic.in
Wed Sep 17 13:47:43 MEST 2003


Sorry to bother you people with my silly questions.
Following codes are from Lab5 and Lab6 pdf files available at the web site.
I could understand the following code.
===================================
 > data(golubTrain)
 > X <- exprs(golubTrain)
 > X[X < 100] <- 100
 > X[X > 16000] <- 16000
 > mmfilt <- function(r = 5, d = 500, na.rm = TRUE) {
+ function(x) {
+ minval <- min(x, na.rm = na.rm)
+ maxval <- max(x, na.rm = na.rm)
+ (maxval/minval > r) && (maxval - minval > d)
+ }
+ }
 > mmfun <- mmfilt()
 > ffun <- filterfun(mmfun)
 > sub <- genefilter(X, ffun)
 > sum(sub)
[1] 3051
 > X <- X[sub, ]
 > X <- log2(X)
==========================
But I am unable to understand this portion -
============= ===================
 > golubTrainSub <- golubTrain[sub, ]
 > golubTrainSub at exprs <- X
 > Y <- golubTrainSub$ALL.AML
#I understand the following line
 > Y <- paste(golubTrain$ALL.AML, golubTrain$T.B.cell)

# DO NOT UNDERSTAND THE FOLLOWING ONE.
 > Y <- sub("NA", "", Y)
========================================================

 From Lab6 Code, the following is OK
================================
 > data(golubTrain)
 > data(golubMerge)
 > data(golubTest)
 > gTrn <- GolubTrans(golubTrain)
 > gTest <- GolubTrans(golubTest)
 > gMerge <- GolubTrans(golubMerge)
 > mmfun <- mmfilt()
 > ffun <- filterfun(mmfun)
 > sub <- genefilter(gTrn, ffun)

But why we need to set the following element False?

 > sub[c(2401, 3398, 4168)] <- FALSE


Thanks
Dibakar Ray



More information about the Bioconductor mailing list