zellerlab / siamcat

R package for Statistical Inference of Associations between Microbial Communities And host phenoType
https://siamcat.embl.de/
51 stars 16 forks source link

error when running model.evaluation.plot with verbose = 3 #32

Closed sophiepaschke closed 1 year ago

sophiepaschke commented 2 years ago

Hello! I ran into an issue when using the model.evaluation.plot function:

model.evaluation.plot(siamcat.object, fn.plot = paste(output.prefix, "figure.SIAMCAT.eval.pdf", sep="_"), verbose = 3)

the output in the console I get is

+ starting model.evaluation.plot
+ plotting ROC
Error in mean(aucs) : object 'aucs' not found

I first checked the source code and saw that 'aucs' was defined as

aucs = eval.data$auroc.all

so I looked for eval_data(siamcat.object), which seemed fine and contained all the variables, but somehow 'eval.data' wasn't created by the function (I could however create it myself, as well as the 'aucs' object, but then the code stopped at the next object 'aucspr.all'). After trying a few other things I finally realised that 'mean(aucs)' was only required when verbose was set >1, and indeed the code runs fine if I set it to 1 instead of 3. Still thought I'd signal the issue just in case :)

Cheers!

jakob-wirbel commented 2 years ago

Dear @sophiepaschke Thank you so much for catching this bug! I'm currently working on the next version of SIAMCAT and this error will be fixed then in the new version :) Thanks again Jakob