Question: Error in zlm function model matrix
gravatar for jka8119
15 months ago by
jka811910 wrote:


I getting an error below with MAST:

scaRaw <- FromMatrix(as.matrix(fibronorm), fibroidentities, subset(genes, genes$primerid %in% row.names(fibronorm)))
cdr2 <-colSums(assay(scaRaw)>0)
colData(scaRaw)$cngeneson <- scale(cdr2)

zlmCond <- zlm(~condition+cngeneson, scaRaw)

Error in object@modelMatrix[pos, , drop = FALSE] :
  (subscript) logical subscript too long


Not sure what the reason is. I never encountered this error before when using the zlm function.


R version 3.4.2 (2017-09-28)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Red Hat Enterprise Linux Server release 6.6 (Santiago)

Matrix products: default
BLAS/LAPACK: /local/system/opt/R/3.4.2/lib/

 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C
 [9] LC_ADDRESS=C               LC_TELEPHONE=C

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

other attached packages:
 [1] scran_1.6.2                BiocParallel_1.12.0
 [3] scater_1.6.0               ggplot2_2.2.1
 [5] MAST_1.6.0                 SingleCellExperiment_1.0.0
 [7] SummarizedExperiment_1.8.0 DelayedArray_0.4.1
 [9] matrixStats_0.53.1         Biobase_2.38.0
[11] GenomicRanges_1.30.0       GenomeInfoDb_1.14.0
[13] IRanges_2.12.0             S4Vectors_0.16.0
[15] BiocGenerics_0.24.0

loaded via a namespace (and not attached):
 [1] dynamicTreeCut_1.63-1   viridis_0.4.0           httr_1.3.1
 [4] edgeR_3.20.1            splines_3.4.2           bit64_0.9-7
 [7] viridisLite_0.2.0       shiny_1.0.5             assertthat_0.2.0
[10] statmod_1.4.30          blob_1.1.0              GenomeInfoDbData_0.99.1
[13] vipor_0.4.5             progress_1.1.2          RSQLite_2.0
[16] lattice_0.20-35         glue_1.2.0              limma_3.34.1
[19] digest_0.6.12           XVector_0.18.0          colorspace_1.3-2
[22] htmltools_0.3.6         httpuv_1.3.5            Matrix_1.2-11
[25] plyr_1.8.4              XML_3.98-1.9            pkgconfig_2.0.1
[28] biomaRt_2.34.2          zlibbioc_1.24.0         xtable_1.8-2
[31] scales_0.5.0            tibble_1.3.4            DT_0.2
[34] lazyeval_0.2.1          magrittr_1.5            mime_0.5
[37] memoise_1.1.0           FNN_1.1                 beeswarm_0.2.3
[40] shinydashboard_0.6.1    tools_3.4.2             data.table_1.10.4-3
[43] prettyunits_1.0.2       stringr_1.2.0           munsell_0.4.3
[46] locfit_1.5-9.1          AnnotationDbi_1.40.0    bindrcpp_0.2
[49] compiler_3.4.2          rlang_0.1.4             rhdf5_2.22.0
[52] grid_3.4.2              RCurl_1.95-4.8          tximport_1.6.0
[55] htmlwidgets_0.9         rjson_0.2.15            igraph_1.2.1
[58] bitops_1.0-6            gtable_0.2.0            abind_1.4-5
[61] DBI_0.7                 reshape2_1.4.2          R6_2.2.2
[64] zoo_1.8-0               gridExtra_2.3           dplyr_0.7.4
[67] bit_1.1-12              bindr_0.1               stringi_1.1.5
[70] ggbeeswarm_0.6.0        Rcpp_0.12.16

mast • 275 views
ADD COMMENTlink written 15 months ago by jka811910

It looks like you have a mismash of Bioconductor 3.7 and 3.6.  What does `BiocInstaller::biocValid()` report?  Did you install MAST off of github, or via Bioconductor?

ADD REPLYlink written 15 months ago by Andrew_McDavid190

Thanks. I installed the source package using 'install.packages'. BiocInstaller::biocValid() reports it to be too new.

ADD REPLYlink written 15 months ago by jka811910

Yup.  Downgrade MAST to version 1.4.1 (here: or upgrade to R 3.5 and Bioconductor 3.7.

ADD REPLYlink written 15 months ago by Andrew_McDavid190

Still getting the same issue after reinstalling MAST (v 1.4.1). Perhaps i am having an issue with the version of limma i have?

ADD REPLYlink written 15 months ago by jka811910

Restart R, verify that you are running bioconductor 3.6 with BiocInstaller::biocValid() and make sure you aren't reloading from disk any "stale" objects that were created when you had mismatched package versions.  Checking that you can run the equivalent code in the MAITAnalysis vignette should serve a positive control.  I still suspect version mismatching of some sort is at fault here.

ADD REPLYlink written 15 months ago by Andrew_McDavid190

I ended up upgrading to Bioconductor 3.7 and R 3.5, MAST 1.6.0. That eventually solved the problem. Thanks for the help.

ADD REPLYlink written 15 months ago by jka811910
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 283 users visited in the last hour