ggloor / ALDEx_bioc

ALDEx_bioc is the working directory for updating bioconductor
26 stars 13 forks source link

Adding Scale Uncertainty Fails #71

Closed DrLMee closed 7 months ago

DrLMee commented 7 months ago

Greetings,

I'd like to use ALDEx2 for DA analysis using ASV counts but I'm coming into issues when I try to apply a gamma to aldex.clr

This works fine using the example dataset

x <- aldex.clr(selex, conds, mc.samples = 128, verbose = T, gamma = 1e-3)

However, with my own data, aldex.clr works fine without applying scale uncertainty, as below

clr <- aldex.clr(data, conds, mc.samples = 128, verbose = T)

but fails when I try to incorporate it, in this way

clr <- aldex.clr(data, conds, mc.samples = 128, verbose = T, gamma = 1e-3)

conditions vector supplied operating in serial mode removed rows with sums equal to zero data format is OK dirichlet samples complete aldex.scaleSim: adjusting samples to reflect scale uncertainty. sampling from the default scale model. Error in colMeans(x, na.rm = TRUE) : 'x' must be numeric

My data looks like this

Screenshot 2024-02-14 at 10 04 47

Screenshot 2024-02-14 at 10 05 49

... etc to the end of the dataframe, the same as the selex dataset

Screenshot 2024-02-14 at 10 07 30

I've also tried inputting data as a numeric matrix but I get the same error.

Any ideas ? Have I overlooked something obvious ? Thanks in advance!

DrLMee commented 7 months ago

Nevermind, I've figured it out! My condition vector still had removed factor levels in there and it worked once I removed those.