microbiome / mia

Microbiome analysis
https://microbiome.github.io/mia/
Artistic License 2.0
46 stars 25 forks source link

Fix pseudocount bug for missing values in assay #451

Closed RiboRings closed 9 months ago

RiboRings commented 9 months ago

Hi!

I fixed this bug from OMA arising when pseudocount is given. It was due to missing values in assay:

library(mia)
data("HintikkaXOData", package = "mia")
mae <- HintikkaXOData
transformAssay(mae[[3]], assay.type = "signals",
               MARGIN = "features",
               method = "z", pseudocount = TRUE)

# Error in if (pseudocount && any(mat < 0)) { : 
#   missing value where TRUE/FALSE needed