Unclear why. Only happens for some examples of counts input.
For example:
library(spatialDE)
ncells <- 10
ngenes <- 100
## Setting a seed to get counts for which stabilize() doesn't work
set.seed(42)
counts <- matrix(rpois(ncells * ngenes, lambda = 3),
nrow = ngenes, ncol = ncells
)
stabilized <- stabilize(counts)
all(is.na(stabilized))
#> [1] TRUE
head(stabilized)
#> V1 V2 V3 V4 V5 V6 V7 V8 V9 V10
#> [1,] NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
#> [2,] NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
#> [3,] NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
#> [4,] NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
#> [5,] NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
#> [6,] NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
Unclear why. Only happens for some examples of counts input.
For example:
Session info
``` r devtools::session_info() #> ─ Session info ─────────────────────────────────────────────────────────────── #> setting value #> version R Under development (unstable) (2020-10-28 r79382) #> os macOS Catalina 10.15.7 #> system x86_64, darwin17.0 #> ui X11 #> language (EN) #> collate en_US.UTF-8 #> ctype en_US.UTF-8 #> tz Europe/Brussels #> date 2021-01-11 #> #> ─ Packages ─────────────────────────────────────────────────────────────────── #> package * version date lib source #> assertthat 0.2.1 2019-03-21 [1] CRAN (R 4.1.0) #> basilisk 1.3.6 2021-01-08 [1] Bioconductor #> basilisk.utils 1.3.4 2021-01-08 [1] Bioconductor #> callr 3.5.1 2020-10-13 [1] CRAN (R 4.1.0) #> cli 2.2.0 2020-11-20 [1] CRAN (R 4.1.0) #> crayon 1.3.4 2017-09-16 [1] CRAN (R 4.1.0) #> desc 1.2.0 2018-05-01 [1] CRAN (R 4.1.0) #> devtools 2.3.2 2020-09-18 [1] CRAN (R 4.1.0) #> digest 0.6.27 2020-10-24 [1] CRAN (R 4.1.0) #> ellipsis 0.3.1 2020-05-15 [1] CRAN (R 4.1.0) #> evaluate 0.14 2019-05-28 [1] CRAN (R 4.1.0) #> fansi 0.4.1 2020-01-08 [1] CRAN (R 4.1.0) #> filelock 1.0.2 2018-10-05 [1] CRAN (R 4.1.0) #> fs 1.5.0 2020-07-31 [1] CRAN (R 4.1.0) #> glue 1.4.2 2020-08-27 [1] CRAN (R 4.1.0) #> highr 0.8 2019-03-20 [1] CRAN (R 4.1.0) #> htmltools 0.5.0 2020-06-16 [1] CRAN (R 4.1.0) #> jsonlite 1.7.2 2020-12-09 [1] CRAN (R 4.1.0) #> knitr 1.30 2020-09-22 [1] CRAN (R 4.1.0) #> lattice 0.20-41 2020-04-02 [2] CRAN (R 4.1.0) #> lifecycle 0.2.0 2020-03-06 [1] CRAN (R 4.1.0) #> magrittr 2.0.1 2020-11-17 [1] CRAN (R 4.1.0) #> Matrix 1.3-2 2021-01-06 [2] CRAN (R 4.1.0) #> memoise 1.1.0 2017-04-21 [1] CRAN (R 4.1.0) #> pkgbuild 1.2.0 2020-12-15 [1] CRAN (R 4.1.0) #> pkgload 1.1.0 2020-05-29 [1] CRAN (R 4.1.0) #> prettyunits 1.1.1 2020-01-24 [1] CRAN (R 4.1.0) #> processx 3.4.5 2020-11-30 [1] CRAN (R 4.1.0) #> ps 1.5.0 2020-12-05 [1] CRAN (R 4.1.0) #> purrr 0.3.4 2020-04-17 [1] CRAN (R 4.1.0) #> R6 2.5.0 2020-10-28 [1] CRAN (R 4.1.0) #> rappdirs 0.3.1 2016-03-28 [1] CRAN (R 4.1.0) #> Rcpp 1.0.5 2020-07-06 [1] CRAN (R 4.1.0) #> remotes 2.2.0 2020-07-21 [1] CRAN (R 4.1.0) #> reticulate 1.18 2020-10-25 [1] CRAN (R 4.1.0) #> rlang 0.4.10 2020-12-30 [1] CRAN (R 4.1.0) #> rmarkdown 2.6 2020-12-14 [1] CRAN (R 4.1.0) #> rprojroot 2.0.2 2020-11-15 [1] CRAN (R 4.1.0) #> sessioninfo 1.1.1 2018-11-05 [1] CRAN (R 4.1.0) #> spatialDE * 0.1.2 2021-01-11 [1] Bioconductor #> stringi 1.5.3 2020-09-09 [1] CRAN (R 4.1.0) #> stringr 1.4.0 2019-02-10 [1] CRAN (R 4.1.0) #> testthat 3.0.1 2020-12-18 [1] Github (r-lib/testthat@e99155a) #> usethis 2.0.0 2020-12-10 [1] CRAN (R 4.1.0) #> withr 2.3.0 2020-09-22 [1] CRAN (R 4.1.0) #> xfun 0.20 2021-01-06 [1] CRAN (R 4.1.0) #> yaml 2.2.1 2020-02-01 [1] CRAN (R 4.1.0) #> #> [1] /Users/milan/Library/R/4.1/library #> [2] /Library/Frameworks/R.framework/Versions/4.1/Resources/library ```