[R] Microarray analysis

Friederike Barthel fbarthel at hotmail.com
Fri Nov 3 21:16:32 CET 2006


Dear List

I am currently running a microarray analysis on the dataset schizo and would 
like to filter out all genes with a low variance. However, when running the 
code detailed below, I end up with 12,500 genes in my final set rather than 
the 10,000 I was looking for. Can anyone pinpoint where I am going wrong?

***********reading in data**********

schizo<-read.table("octassign_data.txt",header=T, sep="\t")

dim(schizo)

head(schizo)

attach(schizo)

***********creating matrix and calculating variance across probesets********

x<-c(1:20000)

y<-c(2:151)

schizo.matrix<-data.matrix(schizo[,y])

varprobe<-c(var(schizo.matrix[x,]))

hist(varprobe)

**************filter out low variance*************

top10000 <- which(rank(varprobe)>10000)

schizo.sub<-schizo[top10000,]
>dim(schizo.sub)
[1] 12500   151



More information about the R-help mailing list