Question: RUVseq control genes - invalid subscript type 'list'
1
gravatar for eteleeb
3.4 years ago by
eteleeb10
eteleeb10 wrote:

Hi, 

I am using RUVseq for removing unwanted variation with a number of housekeeping genes as control genes but I got this error: 

Error in Ycenter[, cIdx] : invalid subscript type 'list'

This is the code I use: 

batchCorrectedSet <- RUVg(as.matrix(countTable), control.genes, k=1)

Also, if I remove "as.matrix" from the command I got this error: 

unable to find an inherited method for function ‘RUVg’ for signature ‘"data.frame", "data.frame", "numeric"’

Any help will be appreciated. Thank you. 

-A

ruvseq • 794 views
ADD COMMENTlink modified 3.4 years ago • written 3.4 years ago by eteleeb10
Answer: RUVseq control genes - invalid subscript type 'list'
0
gravatar for davide risso
3.4 years ago by
davide risso830
University of Padova
davide risso830 wrote:

Hi,

the first error is because your object "control.genes" is a list, while the function requires a vector (of integer or characters). Note that this can happen if control.genes is a data.frame (data.frames are lists), which is what I'm guessing from the second error.  If that's the case, make sure than when you're extracting the proper column, it's character (or integer) and not a factor.

As for your second error, the first argument of RUVg needs to be a matrix, it will not work with data.frames. Your first call using as.matrix is fine.

ADD COMMENTlink written 3.4 years ago by davide risso830
Answer: RUVseq control genes - invalid subscript type 'list'
0
gravatar for eteleeb
3.4 years ago by
eteleeb10
eteleeb10 wrote:

Thank you Davide for your reply. I am reading the housekeeping genes as a data.frame and selection the first column that has the gene IDs. I used as.vector() but now I am having this error: 

Error in Ycenter[, cIdx] : subscript out of bounds

Thank you. 

ADD COMMENTlink written 3.4 years ago by eteleeb10

You have to make sure that all the IDs in the control.genes vector are present in countTable.

You can use the intersect() or the match() functions to ensure that. Something along these lines should work:

mycontrols <- intersect(control.genes, rownames(countTable))
batchCorrectedSet <- RUVg(as.matrix(countTable), mycontrols, k=1)

Provided that your countTable object has row.names.

ADD REPLYlink written 3.4 years ago by davide risso830
Answer: RUVseq control genes - invalid subscript type 'list'
0
gravatar for eteleeb
3.4 years ago by
eteleeb10
eteleeb10 wrote:

Oops!. I see the problem now. I have transcript IDs in the count table instead of gene IDs. Thank you Davide for your help. I greatly appreciate it. 

ADD COMMENTlink written 3.4 years ago by eteleeb10
Please log in to add an answer.

Help
Access

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