Skip to content

testDTU error during locFDR calculation #35

@Tijs-dot

Description

@Tijs-dot

Hi,

I have tried using satuRn in a dataset for differential isoform usage on the transcript level. I really like the package, and previously it worked on another dataset for me. However, for this dataset (which is very similar to the previous one) I get an error when the algorithm is computing local FDR. I get the error:
Error in if (bett[2] > 0) bett = bet + 0.1 * solve(V, Y - mu)/(1 + 1/j^2) :
missing value where TRUE/FALSE needed

The way I understand it is that during the first time locfdr_locmle() is called, it fills the mlests with NA values, since my bett[2] is 0.77 (so if (bett[2] >= 0) {mle = rep(NA, 6)). Then the second time locfdr_locmle() is called, it tries to use the values from mlests, but these have been set to NA. Can you help me with this issue? I am not sure if this is something that I am supposed to "fix" or not, but this error feels more technical to me rather than that the input data is bad, but I do not understand the statistics behind it. I hope you can help me and I am curious if you have any insights in this.

Best wishes,
Tijs

    #### start code from locFDR package
    N <- length(zvalues_mid)
    b <- 4.3 * exp(-0.26 * log(N, 10))
    med <- median(zvalues_mid)
    sc <- diff(quantile(zvalues_mid)[c(2, 4)]) / (2 * qnorm(.75))
    # initial MLEs of empirical null parameters
    mlests <- locfdr_locmle(zvalues_mid, xlim = c(med, b * sc))

    lo <- min(zvalues_mid)
    up <- max(zvalues_mid)
    bre <- 120
    breaks <- seq(lo, up, length = bre)
    zzz <- pmax(pmin(zvalues_mid, up), lo)
    zh <- hist(zzz, breaks = breaks, plot = FALSE)
    x <- (breaks[-1] + breaks[-length(breaks)]) / 2
    sw <- 0
    X <- cbind(1, poly(x, df = 7))
    zh <- hist(zzz, breaks = breaks, plot = FALSE)
    y <- zh$counts
    f <- glm(y ~ poly(x, df = 7), poisson)$fit

    Cov.in <- list(x = x, X = X, f = f, sw = sw)
    ml.out <- locfdr_locmle(zvalues_mid,
        xlim = c(mlests[1], b * mlests[2]),
        d = mlests[1], s = mlests[2], Cov.in = Cov.in
    ) # updated MLEs of empirical null parameters
    mlests <- ml.out$mle
    #### end code from locFDR package



R session information

sessioninfo::session_info()

─ Session info ───────────────────────────────────────────────────────────────────────────────────────────────────────
setting value
version R version 4.4.3 (2025-02-28)
os AlmaLinux 9.5 (Teal Serval)
system x86_64, linux-gnu
ui RStudio
language (EN)
collate en_US.UTF-8
ctype en_US.UTF-8
tz Europe/Brussels
date 2025-04-14
rstudio 2024.12.0+467 Kousa Dogwood (server)
pandoc 3.2 @ /usr/lib/rstudio-server/bin/quarto/bin/tools/x86_64/ (via rmarkdown)
quarto 1.5.57 @ /usr/lib/rstudio-server/bin/quarto/bin/quarto

─ Packages ───────────────────────────────────────────────────────────────────────────────────────────────────────────
package * version date (UTC) lib source
abind 1.4-8 2024-09-12 [1] CRAN (R 4.4.1)
annotate 1.82.0 2024-04-30 [1] Bioconductor 3.19 (R 4.4.0)
AnnotationDbi * 1.66.0 2024-05-01 [1] Bioconductor 3.19 (R 4.4.0)
Biobase * 2.64.0 2024-04-30 [1] Bioconductor 3.19 (R 4.4.0)
BiocFileCache 2.12.0 2024-04-30 [1] Bioconductor 3.19 (R 4.4.0)
BiocGenerics * 0.50.0 2024-04-30 [1] Bioconductor 3.19 (R 4.4.0)
BiocManager 1.30.25 2024-08-28 [1] CRAN (R 4.4.1)
BiocParallel * 1.38.0 2024-04-30 [1] Bioconductor 3.19 (R 4.4.0)
biomaRt 2.60.1 2024-06-26 [1] Bioconductor 3.19 (R 4.4.1)
Biostrings 2.72.1 2024-06-02 [1] Bioconductor 3.19 (R 4.4.0)
bit 4.6.0 2025-03-06 [1] CRAN (R 4.4.3)
bit64 4.6.0-1 2025-01-16 [1] CRAN (R 4.4.3)
bitops 1.0-9 2024-10-03 [1] CRAN (R 4.4.1)
blob 1.2.4 2023-03-17 [1] CRAN (R 4.4.0)
boot 1.3-31 2024-08-28 [2] CRAN (R 4.4.3)
bslib 0.9.0 2025-01-30 [1] CRAN (R 4.4.3)
cachem 1.1.0 2024-05-16 [1] CRAN (R 4.4.0)
cli 3.6.4 2025-02-13 [1] CRAN (R 4.4.3)
codetools 0.2-20 2024-03-31 [2] CRAN (R 4.4.3)
colorspace 2.1-1 2024-07-26 [1] CRAN (R 4.4.1)
conflicted * 1.2.0 2023-02-01 [1] CRAN (R 4.4.0)
crayon 1.5.3 2024-06-20 [1] CRAN (R 4.4.0)
curl 6.2.2 2025-03-24 [1] CRAN (R 4.4.3)
data.table * 1.17.0 2025-02-22 [1] CRAN (R 4.4.3)
DBI 1.2.3 2024-06-02 [1] CRAN (R 4.4.0)
dbplyr 2.5.0 2024-03-19 [1] CRAN (R 4.4.0)
DelayedArray 0.30.1 2024-05-07 [1] Bioconductor 3.19 (R 4.4.0)
DESeq2 * 1.44.0 2024-04-30 [1] Bioconductor 3.19 (R 4.4.0)
DEXSeq * 1.50.0 2024-04-30 [1] Bioconductor 3.19 (R 4.4.0)
digest 0.6.37 2024-08-19 [1] CRAN (R 4.4.1)
dplyr * 1.1.4 2023-11-17 [1] CRAN (R 4.4.0)
evaluate 1.0.3 2025-01-10 [1] CRAN (R 4.4.3)
fastmap 1.2.0 2024-05-15 [1] CRAN (R 4.4.0)
filelock 1.0.3 2023-12-11 [1] CRAN (R 4.4.0)
forcats * 1.0.0 2023-01-29 [1] CRAN (R 4.4.0)
genefilter 1.86.0 2024-04-30 [1] Bioconductor 3.19 (R 4.4.0)
geneplotter 1.82.0 2024-04-30 [1] Bioconductor 3.19 (R 4.4.0)
generics 0.1.3 2022-07-05 [1] CRAN (R 4.4.0)
GenomeInfoDb * 1.40.1 2024-05-24 [1] Bioconductor 3.19 (R 4.4.0)
GenomeInfoDbData 1.2.12 2024-05-22 [1] Bioconductor
GenomicRanges * 1.56.2 2024-10-09 [1] Bioconductor 3.19 (R 4.4.1)
ggplot2 * 3.5.2 2025-04-09 [1] CRAN (R 4.4.3)
glue 1.8.0 2024-09-30 [1] CRAN (R 4.4.1)
gtable 0.3.6 2024-10-25 [1] CRAN (R 4.4.1)
hms 1.1.3 2023-03-21 [1] CRAN (R 4.4.0)
htmltools 0.5.8.1 2024-04-04 [1] CRAN (R 4.4.0)
httr 1.4.7 2023-08-15 [1] CRAN (R 4.4.0)
httr2 1.1.2 2025-03-26 [1] CRAN (R 4.4.3)
hwriter 1.3.2.1 2022-04-08 [1] CRAN (R 4.4.0)
IRanges * 2.38.1 2024-07-03 [1] Bioconductor 3.19 (R 4.4.1)
jquerylib 0.1.4 2021-04-26 [1] CRAN (R 4.4.0)
jsonlite 2.0.0 2025-03-27 [1] CRAN (R 4.4.3)
KEGGREST 1.44.1 2024-06-19 [1] Bioconductor 3.19 (R 4.4.0)
knitr 1.50 2025-03-16 [1] CRAN (R 4.4.3)
lattice 0.22-6 2024-03-20 [2] CRAN (R 4.4.3)
lifecycle 1.0.4 2023-11-07 [1] CRAN (R 4.4.0)
limma 3.60.6 2024-10-02 [1] Bioconductor 3.19 (R 4.4.1)
locfdr 1.1-8 2015-07-15 [1] CRAN (R 4.4.3)
locfit 1.5-9.12 2025-03-05 [1] CRAN (R 4.4.3)
lubridate * 1.9.4 2024-12-08 [1] CRAN (R 4.4.3)
magrittr 2.0.3 2022-03-30 [1] CRAN (R 4.4.0)
Matrix 1.7-2 2025-01-23 [2] CRAN (R 4.4.3)
MatrixGenerics * 1.16.0 2024-04-30 [1] Bioconductor 3.19 (R 4.4.0)
matrixStats * 1.5.0 2025-01-07 [1] CRAN (R 4.4.3)
memoise 2.0.1 2021-11-26 [1] CRAN (R 4.4.0)
munsell 0.5.1 2024-04-01 [1] CRAN (R 4.4.0)
pbapply 1.7-2 2023-06-27 [1] CRAN (R 4.4.0)
pillar 1.10.2 2025-04-05 [1] CRAN (R 4.4.3)
pkgconfig 2.0.3 2019-09-22 [1] CRAN (R 4.4.0)
png 0.1-8 2022-11-29 [1] CRAN (R 4.4.0)
prettyunits 1.2.0 2023-09-24 [1] CRAN (R 4.4.0)
progress 1.2.3 2023-12-06 [1] CRAN (R 4.4.1)
purrr * 1.0.4 2025-02-05 [1] CRAN (R 4.4.3)
R6 2.6.1 2025-02-15 [1] CRAN (R 4.4.3)
rappdirs 0.3.3 2021-01-31 [1] CRAN (R 4.4.0)
RColorBrewer * 1.1-3 2022-04-03 [1] CRAN (R 4.4.0)
Rcpp 1.0.14 2025-01-12 [1] CRAN (R 4.4.3)
readr * 2.1.5 2024-01-10 [1] CRAN (R 4.4.0)
rlang 1.1.5 2025-01-17 [1] CRAN (R 4.4.3)
rmarkdown 2.29 2024-11-04 [1] CRAN (R 4.4.1)
Rsamtools 2.20.0 2024-04-30 [1] Bioconductor 3.19 (R 4.4.0)
RSQLite 2.3.9 2024-12-03 [1] CRAN (R 4.4.2)
rstudioapi 0.17.1 2024-10-22 [1] CRAN (R 4.4.1)
S4Arrays 1.4.1 2024-05-20 [1] Bioconductor 3.19 (R 4.4.0)
S4Vectors * 0.42.1 2024-07-03 [1] Bioconductor 3.19 (R 4.4.1)
sass 0.4.9 2024-03-15 [1] CRAN (R 4.4.0)
satuRn * 1.12.0 2024-04-30 [1] Bioconductor 3.19 (R 4.4.2)
scales 1.3.0 2023-11-28 [1] CRAN (R 4.4.0)
sessioninfo 1.2.3 2025-02-05 [1] CRAN (R 4.4.3)
SparseArray 1.4.8 2024-05-24 [1] Bioconductor 3.19 (R 4.4.0)
stageR 1.26.0 2024-05-01 [1] Bioconductor 3.19 (R 4.4.1)
statmod 1.5.0 2023-01-06 [1] CRAN (R 4.4.0)
stringi 1.8.7 2025-03-27 [1] CRAN (R 4.4.3)
stringr * 1.5.1 2023-11-14 [1] CRAN (R 4.4.0)
SummarizedExperiment * 1.34.0 2024-05-01 [1] Bioconductor 3.19 (R 4.4.0)
survival 3.8-3 2024-12-17 [1] CRAN (R 4.4.3)
tibble * 3.2.1 2023-03-20 [1] CRAN (R 4.4.0)
tidyr * 1.3.1 2024-01-24 [1] CRAN (R 4.4.0)
tidyselect 1.2.1 2024-03-11 [1] CRAN (R 4.4.0)
tidyverse * 2.0.0 2023-02-22 [1] CRAN (R 4.4.0)
timechange 0.3.0 2024-01-18 [1] CRAN (R 4.4.0)
tzdb 0.5.0 2025-03-15 [1] CRAN (R 4.4.3)
UCSC.utils 1.0.0 2024-04-30 [1] Bioconductor 3.19 (R 4.4.0)
vctrs 0.6.5 2023-12-01 [1] CRAN (R 4.4.0)
withr 3.0.2 2024-10-28 [1] CRAN (R 4.4.1)
xfun 0.52 2025-04-02 [1] CRAN (R 4.4.3)
XML 3.99-0.18 2025-01-01 [1] CRAN (R 4.4.3)
xml2 1.3.8 2025-03-14 [1] CRAN (R 4.4.3)
xtable 1.8-4 2019-04-21 [1] CRAN (R 4.4.0)
XVector 0.44.0 2024-04-30 [1] Bioconductor 3.19 (R 4.4.0)
yaml 2.3.10 2024-07-26 [1] CRAN (R 4.4.1)
zlibbioc 1.50.0 2024-04-30 [1] Bioconductor 3.19 (R 4.4.0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions