rwehrens / BatchCorrMetabolomics

Supplementary material for the paper "Improved batch correction in untargeted MS-based metabolomics" by R. Wehrens, et al. Metabolomics, 2016.
15 stars 9 forks source link

doBC result NA #5

Open qwdf2 opened 5 years ago

qwdf2 commented 5 years ago

Trying to use doBC but only getting a logical with NAs on return.

I checked that all the inputs where the same as the example data and there doesn't seem to be an issue. Not sure why it's not outputting anything.

> M2c <- doBC(data[,2], ref.idx = ref.idx,
+             batch.idx = batch_labels$Batch, method = "rlm",
+             seq.idx = batch_labels$SeqNr)
> 
> M2c
 [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[38] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[75] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
stanstrup commented 3 years ago

I ran into the same. I think there is a bug such that it fails if there is only one batch. The responsible line is: if (length(tooFew) > length(levels(Bref))-2)

rwehrens commented 3 years ago

Guys,

could I remind you that this package is not meant (and never was meant) to be used as a practical application. The package was written and was published to illustrate the BC approach in the corresponding paper. Feel free to take all code you like and transform it into something more useful...

Cheers, Ron

On 06-10-2021 14:53, Jan Stanstrup wrote:

I ran into the same. I think there is a bug such that it fails if there is only one batch. The responsible line is: |if (length(tooFew) > length(levels(Bref))-2)|

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/rwehrens/BatchCorrMetabolomics/issues/5#issuecomment-936180944, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABL4226JXGHMLYHMWOKJEBLUFRBGHANCNFSM4GGUXRLQ. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.