**0**wrote:

Hi!

My name is Enrique Pérez. I need help because I have been trying to run GSA() function, but I have had the next error all the time:

Error in rr[rneg > rpos] = -1 * rr[rneg > rpos] : NAs are not allowed in subscripted assignments

I observed three things. At first, when I remove same rows of the exprs(ExpressionSet), sometimes, the function runs correctly. The problem is that I can not run it with my whole expr(ExpressionSet), what is that I want.

Second, when I change the gensets, kegg gensets insted of random gensets, I get error again.

Furthermore, if I increase the amount of rows of my ExpressionSet, sometimes, I will run the GSA function correctly.

In order to someone could get the same error when he or she uses the function, I have written the code with the gse1397data:

#gse1397 data: library(GSA) data(gse1397,package="tamidata") data(gse1397.gsc,package="tamidata") gsc = gse1397.gsc gruposGrandes = which(sapply(geneIds(gsc),length) > 50) gsc = gsc[gruposGrandes] gse = gse1397 tipo.num = as.numeric(pData(gse)[,"type"]) #run the GSA funtion with a expression matrix mxn=72x8, because that is the dimension of my ExpressionSet which I want analyse. The genset selection is random: x=exprs(gse1397)[1:dim(exprs(MFEScounts))[1], 1:dim(exprs(MFEScounts))[2]] write.csv2(x, 'xgse1397exprs.csv') x<-read.csv2("xgse1397exprs.csv") rownames(x)=x[,1] x=x[,-1] y=as.numeric(c(rep(1,dim(x)[2]/2), rep(2,dim(x)[2]/2))) genenames=rownames(x) genesets=vector("list",50) for(i in 1:50){ genesets[[i]]=sample(rownames(x),size=30) } x.gsa=GSA(x, y, genenames = genenames, genesets = genesets, resp.type="Two class unpaired",nperms=100) #If I run the above code, but I change the dimension of the ExpressionSet, I will run correctly the GSA funtion. In fact, I found that, in this case, the minimum number of row I need in order to run correctly the GSA function is 102: Z=102 X=exprs(gse1397)[1:Z,1:8] write.csv2(X, 'Xgse1397exprs.csv') X<-read.csv2("Xgse1397exprs.csv") rownames(X)=X[,1] X=X[,-1] Y=as.numeric(c(rep(1,dim(X)[2]/2), rep(2,dim(X)[2]/2))) genenamesX=rownames(X) genesetsX=vector("list",50) for(i in 1:50){ genesetsX[[i]]=sample(rownames(X),size=100) } X.gsa=GSA(X, Y, genenames = genenamesX, genesets = genesetsX, resp.type="Two class unpaired",nperms=100) ##With my data:

I can not show my data because the investigation is not over yet, but my data is an ExpressionSet with 72 rows and 8 columns. When I try to run GSA funtion with my ExpressionSet, I get the same error:

Error in rr[rneg > rpos] = -1 * rr[rneg > rpos] : NAs are not allowed in subscripted assignments In addition: Warning messages: 1: In init.fit$sd < s0 : longer object length is not a multiple of shorter object length 2: In sd + s0 : longer object length is not a multiple of shorter object length

And I only can avoid this error if I remove some rows, which I don't want to do because I can not remove such an important information from my ExpressionSet. So, I'd like know how avoid this kind of errors with any matrix data or expression data and know why I'm getting this error.

Please, if someone could help my with my problem I would be very very greatful.

Enrique

**20k**• written 5 months ago by epercamh •

**0**

Which is your sessionInfo? Did you check for NAs in your datasets `anyis.na(exprs(dataset)))`? I wouldn't expect any but there might be one or several in those data sets.

210Hi Luis!

At first, Thanks for asnwering me!

I'm so sorry, but I don't really understand about what do you mean with sessionInfo, but I supose you mean my data. I'm sure is because of my English, it's not very good, but I'm trying improving everyday.

In my data set I haven't any NAs, that's why I'm going crazy with this error. I've checked for NAs, missing values, and so on... . But I can't understand why, if I use my data set or, for example, gse1397 data with a dimension expression matrix 72x8 or similar, in order to make it similar to my data set, I get such an error, but if I remove some values, which aren't NAs, I don't get this error.

Again, thanks for answering me!

Enrique

0sessionInfo is a function of R which explains which is your environment in R and the version of packages you are using. You need to do:

Before the line where the errors are produced

210