RUVseq control genes - invalid subscript type 'list'
3
1
Entering edit mode
eteleeb ▴ 10
@eteleeb-11118
Last seen 7.7 years ago

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 • 2.3k views
ADD COMMENT
0
Entering edit mode
davide risso ▴ 950
@davide-risso-5075
Last seen 3 days ago
University of Padova

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 COMMENT
0
Entering edit mode
eteleeb ▴ 10
@eteleeb-11118
Last seen 7.7 years ago

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 COMMENT
0
Entering edit mode

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 REPLY
0
Entering edit mode
eteleeb ▴ 10
@eteleeb-11118
Last seen 7.7 years ago

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 COMMENT

Login before adding your answer.

Traffic: 708 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6