Question: GSA error with any ExpressionSets
gravatar for epercamh
16 months ago by
epercamh0 wrote:


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:

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')
y=as.numeric(c(rep(1,dim(x)[2]/2), rep(2,dim(x)[2]/2)))
for(i in 1:50){
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:

write.csv2(X, 'Xgse1397exprs.csv')
Y=as.numeric(c(rep(1,dim(X)[2]/2), rep(2,dim(X)[2]/2)))
for(i in 1:50){
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$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.



ADD COMMENTlink modified 16 months ago by Martin Morgan ♦♦ 21k • written 16 months ago by epercamh0

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

ADD REPLYlink written 16 months ago by Lluís R310

Hi 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!


ADD REPLYlink written 16 months ago by epercamh0

sessionInfo 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:

> sessionInfo()

Before the line where the errors are produced

ADD REPLYlink modified 16 months ago • written 16 months ago by Lluís R310
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.2.0
Traffic: 173 users visited in the last hour