ijuric / MAPS

18 stars 11 forks source link

VGAM pospoisson model fails with "Error in if (one.more) { : missing value where TRUE/FALSE needed" #41

Open jaavedm opened 3 years ago

jaavedm commented 3 years ago

I hope you can help me with a problem I'm having while processing my HiChip data using the positive poison model of MAPS. Specifically, I'm getting this error in the script MAPS_regression_and_peak_caller.r. The specific function that is failing is the line

fit <- vglm(count ~ logl + loggc + logm + logdist + logShortCount, family = pospoisson(), data = mm)

in the function pospoisson_regression

The error message I get is Error in if (one.more) { : missing value where TRUE/FALSE needed The error coming from VGAM vglm, and I think the data that MAPS is feeding to this function could be bad.

The error only occurs while trying to process chromosome chr1, and I've attached a simplified repro code here with the failing input file.

library(VGAM)
mm <- read.table("reg_raw.chr1.AllCellTypes_H3K27ac_withInput.30k.and.txt", header=T, sep="\t", stringsAsFactors=F)
fit <- vglm(count ~ logl + loggc + logm + logdist + logShortCount, family = pospoisson(), data = mm)
Error in if (one.more) { : missing value where TRUE/FALSE needed

reg_raw.chr1.AllCellTypes_H3K27ac_withInput.30k.and.txt

Here is my session info for R

> sessionInfo()
R version 4.0.2 (2020-06-22)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.2 LTS

Matrix products: default
BLAS:   /opt/apps/R-4.0.2/lib/R/lib/libRblas.so
LAPACK: /opt/apps/R-4.0.2/lib/R/lib/libRlapack.so

locale:
 [1] LC_CTYPE=C.UTF-8       LC_NUMERIC=C           LC_TIME=C.UTF-8
 [4] LC_COLLATE=C.UTF-8     LC_MONETARY=C.UTF-8    LC_MESSAGES=C.UTF-8
 [7] LC_PAPER=C.UTF-8       LC_NAME=C              LC_ADDRESS=C
[10] LC_TELEPHONE=C         LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] splines   stats4    stats     graphics  grDevices utils     datasets
[8] methods   base

other attached packages:
[1] VGAM_1.1-5

loaded via a namespace (and not attached):
[1] compiler_4.0.2 tools_4.0.2
yxian9 commented 3 years ago

Reverted the VGAM version to 1.1-3 shall solve the problem.