hansenlab / minfi

Devel repository for minfi
58 stars 68 forks source link

Error in controlStripPlot() #80

Closed wudustan closed 7 years ago

wudustan commented 7 years ago

In the function controlStripPlot() (line 45 of qc.R)

if (!is.null(sampNames)) colnames(ctlWide) <- sampNames

ctlWide is a numeric and can not be assigned colnames(). I assume this was changed from names() which works fine. I have tried the most recent (not devel) version of minfi and the error still persists.

The error returns:

Error in colnames<-(*tmp*, value = c("687L", "686L", : attempt to set 'colnames' on an object with less than two dimensions

Further down in the same function (line 50, qc.R) it also tries to do this for the green channel.

I also have had issues with preprocessFunnorm() but I have yet to trace the issue. It may be related since it was cropping up in the same analysis.

Cheers

Jfortin1 commented 7 years ago

I cannot reproduce the error. Is it still causing you problem?

wudustan commented 7 years ago

Hi,

Yes, I just ran this today and I still get the same issue. The reason this issue occurs is that I am running qcReport() on a mixed rgSet made from combineArrays() including 450k and 850k data.

"TARGET REMOVAL" in 450k has two IDs "13643320" and "42790394"

In EPIC the IDs are "39773404", "42790394".

Since the first IDs differ between the two arrays, using combineArrays() upstream removes the first ID and so the resulting combined rgSet includes only one "TARGET REMOVAL" ID: "42790394"

Having only one probe to test means that the ctlWide <- log2(r[ctrlAddress, ]) ends up being a vector with no columns and crashes the script.

Running part of controlStripPlot on this:

> controlType <- "TARGET REMOVAL"
> ctrlAddress <- getControlAddress(rgSet, controlType = controlType)
> ctlWide <- log2(r[ctrlAddress, ])
> if (!is.null(sampNames))
+ colnames(ctlWide) <- sampNames
Error in `colnames<-`(`*tmp*`, value = c("9989540034_R06C01", "9989540034_R05C01",  : 
  attempt to set 'colnames' on an object with less than two dimensions

Doing the same for another control type with multiple probes results in

> controlType <- "BISULFITE CONVERSION I"
> ctrlAddress <- getControlAddress(rgSet, controlType = controlType)
> ctlWide <- log2(r[ctrlAddress, ])
> if (!is.null(sampNames))
+ colnames(ctlWide) <- sampNames
> 

This works fine.

kasperdanielhansen commented 7 years ago

We have drop=FALSE in the devel version on GitHub. That should fix the problem. Not clear when that was added, but it is a while ago. I'm closing the report since I assume it is fixed in devel.