[BioC] Error: incorrect number of dimensions AND (subscript) logical subscript too long

S Peri biocperi at yahoo.com
Tue Aug 17 18:44:24 CEST 2004


Dear Group, 
 
I am analyzing Affy dataset from Harvard Brain CEL
database. 

I am working on the data from an experiment where 50
samples were analyzed.  I exported the expressions to
a matrix. 

>gliexp <- exprs(justRMA())
> dim(gliexp)
[1] 12625    49


I sorted out samples on the pathological state (4
categories).  Now I want to do SAM and t-test on any
of the 2 samples. 

I made these 4 categories into 0,1,2 and 3. This was
made in a class file : Brain.cl

I wrote a function where values from 0 and 1 will give
me the means from 0 and 1.

My function:

>BrainFc <- function(exp,cl){
+X0 = X[,cl==0]
+X1 = X[,cl==1]
+return(apply(X0,1,mean) - apply(X1,1,mean))}

>myBrainFcs <- BrainFc(gliexp,Brain.cl)
Error in X[, CL == 0] : incorrect number of dimensions


I do not understand why am I getting this error.

I checked to see dim of my expression matrix:
> dim(gliexp)
[1] 12625    49

I have 50 samples, here I see 49.

Is this is the source of error? If so what should I
do?


I also did the following by reading previous messages
from BioC mailing lists:

> gliexp_genes <- gliexp[1:12625,]
> myBrainFcs <- BrainFc(gliexp_genes,Brain.cl)

Error in BrainFc(gliexp_genes, Brain.cl) : (subscript)
logical subscript too long


After this I do not have any option to write to BioC
for some help. 

Please help me where I am doing wrong.

Thank you

PS



More information about the Bioconductor mailing list