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

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to