I am trying to use RUVs to normalise my data. I have 12 samples which are replicated in pairs.
i.e. I can specify my differences like this:
differences = matrix(data= seq(1,12,by=1), byrow=TRUE, nrow=6)
where each row is a biological replicate
I create a "counts" matrix which is n X 12 matrix of the read counts of my genes. I create a vector "geneNames" which lists all the genes in the count matrix.
I call the RUVs function as such:
RUVs(counts, geneNames, k=1, differences)
However, I am getting the following error:
Error in Y[scIdx[ii, jj], , drop = FALSE] :
no 'dimnames' attribute for array
Please note my "counts" matrix is not a data.frame but simply a numeric matrix.
I then tried using the newSeqExpressionSet function:
x = as.factor(rep(c(1,2,3,4,5,6), each=2)) set = newSeqExpressionSet(as.matrix(counts), phenoData = data.frame(x,row.names=geneNames))
RUVs(set, genes, k=1, differences)
However, I get the following error:
Error in Y[scIdx[ii, jj], , drop = FALSE] : subscript out of bounds
Could someone suggest to me how I could modify my commands to make this work ?
Thank you !