hansenlab / minfi

Devel repository for minfi
58 stars 68 forks source link

controlStripPlot: bug when only one control sample #90

Closed lcougnaud closed 7 years ago

lcougnaud commented 7 years ago

I would like to use the controlStripPlot function for different control types. There is only one feature present for one of the controls, which leads to the following error:

Error in UseMethod("melt", data) : 
  no applicable method for 'melt' applied to an object of class "c('double', 'numeric')"

because a numeric vector is extracted instead of a matrix in line: ctlWide <- log2(r[ctrlAddress, ]) Replacing it by: ctlWide <- log2(r[ctrlAddress, , drop = FALSE]) solves the issue. Would it be possible to include this fix in a new version? Or is there a more optimal code? Thanks in advance!

kasperdanielhansen commented 7 years ago

Done in minfi 1.21.4. Not sure this is worth backporting to the release branch. In the future you can edit files directly on Github and send the edits as a "Pull request"; that makes it even easier for authors.

Thanks, Kasper

On Wed, Jan 11, 2017 at 9:02 AM, lcougnaud notifications@github.com wrote:

I would like to use the controlStripPlot function for different control types. There is only one feature present for one of the controls, which leads to the following error:

Error in UseMethod("melt", data) : no applicable method for 'melt' applied to an object of class "c('double', 'numeric')"

because a numeric vector is extracted instead of a matrix in line: ctlWide <- log2(r[ctrlAddress, ]) Replacing it by: ctlWide <- log2(r[ctrlAddress, , drop = FALSE]) solves the issue. Would it be possible to include this fix in a new version? Or is there a more optimal code? Thanks in advance!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kasperdanielhansen/minfi/issues/90, or mute the thread https://github.com/notifications/unsubscribe-auth/AEuhn2fnJkyxlQMpWvZGjPQxkEaMcDb9ks5rRODfgaJpZM4LgnIg .

lcougnaud commented 7 years ago

Thanks for your prompt response! This solves the issue. Thanks also for all the work in the minfi package, this is a very useful tool for pre-processing and analysis of Illumina Infinium DNA methylation arrays.