RGLab / MAST

Tools and methods for analysis of single cell assay data in R
224 stars 57 forks source link

zlm error: Error in parse(text = x, keep.source = FALSE) : <text>:2:0: unexpected end of input #114

Closed hellocita closed 5 years ago

hellocita commented 5 years ago

Dear sir/madam, I was using MAST recently for single cell analysis, and had meet an error during use of zlm function, and cannot figure out how to solve it. I am appreciated if you could help to solve it. Here is the code I use, error message, and the sessionInfo during the process:

  1. R script data(vbetaFA) zlmVbeta <- zlm(~ Stim.Condition, subset(vbetaFA, ncells==1)[1:10,], method='glmer', ebayes=F, silent=T)

2.error message Error in parse(text = x, keep.source = FALSE) :

:2:0: unexpected end of input 1: ~ ^ 3.sessionInfo: R> sessionInfo() R version 3.4.0 (2017-04-21) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Debian GNU/Linux 9 (stretch) Matrix products: default BLAS: /usr/lib/libblas/libblas.so.3.7.0 LAPACK: /usr/lib/lapack/liblapack.so.3.7.0 locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 [7] LC_PAPER=en_US.UTF-8 LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] stats4 parallel stats graphics grDevices utils datasets [8] methods base other attached packages: [1] MAST_1.4.1 SummarizedExperiment_1.8.1 [3] DelayedArray_0.4.1 matrixStats_0.52.2 [5] GenomicRanges_1.30.1 GenomeInfoDb_1.14.0 [7] RColorBrewer_1.1-2 rsvd_1.0.0 [9] NMF_0.21.0 cluster_2.0.6 [11] rngtools_1.2.4 pkgmaker_0.22 [13] registry_0.5 stringr_1.4.0 [15] knitr_1.21 data.table_1.12.0 [17] reshape2_1.4.3 limma_3.34.5 [19] GSEABase_1.40.1 graph_1.56.0 [21] annotate_1.56.1 XML_3.98-1.9 [23] AnnotationDbi_1.40.0 IRanges_2.12.0 [25] S4Vectors_0.16.0 Biobase_2.38.0 [27] BiocGenerics_0.24.0 GGally_1.4.0 [29] ggplot2_3.1.0 Seurat_3.0.0.9000 loaded via a namespace (and not attached): [1] Rtsne_0.15 colorspace_1.4-1 ggridges_0.5.1 [4] XVector_0.18.0 listenv_0.7.0 npsurv_0.4-0 [7] ggrepel_0.8.0 bit64_0.9-7 codetools_0.2-15 [10] splines_3.4.0 R.methodsS3_1.7.1 doParallel_1.0.11 [13] lsei_1.2-0 jsonlite_1.6 gridBase_0.4-7 [16] ica_1.0-2 png_0.1-7 R.oo_1.22.0 [19] compiler_3.4.0 httr_1.4.0 assertthat_0.2.1 [22] Matrix_1.2-17 lazyeval_0.2.2 htmltools_0.3.6 [25] tools_3.4.0 igraph_1.1.0 GenomeInfoDbData_1.0.0 [28] gtable_0.3.0 glue_1.3.1 RANN_2.6.1 [31] dplyr_0.8.0.1 Rcpp_1.0.1 gdata_2.18.0 [34] ape_5.3 nlme_3.1-131 iterators_1.0.10 [37] gbRd_0.4-11 lmtest_0.9-36 xfun_0.5 [40] globals_0.12.4 irlba_2.3.3 gtools_3.8.1 [43] future_1.12.0 zlibbioc_1.24.0 MASS_7.3-47 [46] zoo_1.8-5 scales_1.0.0 memoise_1.1.0 [49] reticulate_1.11.1 pbapply_1.4-0 reshape_0.8.8 [52] stringi_1.4.3 RSQLite_2.0 foreach_1.4.4 [55] caTools_1.17.1.2 bibtex_0.4.2 Rdpack_0.10-1 [58] SDMTools_1.1-221 rlang_0.3.3 pkgconfig_2.0.2 [61] bitops_1.0-6 lattice_0.20-35 ROCR_1.0-7 [64] purrr_0.3.2 htmlwidgets_1.3 labeling_0.3 [67] cowplot_0.9.4 bit_1.1-14 tidyselect_0.2.5 [70] plyr_1.8.4 magrittr_1.5 R6_2.4.0 [73] gplots_3.0.1.1 DBI_0.7 pillar_1.3.1 [76] withr_2.1.2 fitdistrplus_1.0-14 abind_1.4-5 [79] survival_2.41-3 RCurl_1.95-4.10 tibble_2.1.1 [82] future.apply_1.2.0 tsne_0.1-3 crayon_1.3.4 [85] KernSmooth_2.23-15 plotly_4.8.0 grid_3.4.0 [88] blob_1.1.0 metap_1.1 digest_0.6.18 [91] xtable_1.8-3 tidyr_0.8.3 R.utils_2.8.0 [94] munsell_0.5.0 viridisLite_0.3.0 Thank you!
gfinak commented 5 years ago

I can repro this issue, with method='glmer' ebayes = FALSE. so this: zlm(~Stim.Condition,sca=subset(vbetaFA,ncells==1)[1:10,],method="bayesglm", ebayes = TRUE) works, but this zlm(~Stim.Condition,sca=subset(vbetaFA,ncells==1)[1:10,],method="glmer", ebayes = FALSE) gives the observed error.

gfinak commented 5 years ago

@amcdavid we could use your input here, the error is in a long stack of object construction.

amcdavid commented 5 years ago

@hellocita is trying to run a random effects model with lmer, but didn't include any random effects. If a random effect is specified, it works just fine. This model is statistical non-sense but does serve to illustrate the functionality:

zlmVbeta <- zlm(~ Stim.Condition + (1|Well), subset(vbetaFA, ncells==1)[1:10,], method='glmer', ebayes=F, silent=T)

Set method = 'bayesglm' if there aren't any random effects.

We could try to signal a more intelligible error here. We do some fairly dark magic to the formula to be able to run arbitrary likelihood ratio tests and it's probably not ever going to 100% robust.

hellocita commented 5 years ago

I see, Thank you for your kindly answer!