Hi all,
I'm trying to install the TxDb.Hsapiens.UCSC.hg38.knownGene package, but getting pretty stumped at an error to do with C stack usage.
source("http://www.bioconductor.org/biocLite.R")
biocLite("TxDb.Hsapiens.UCSC.hg38.knownGene")
BioC_mirror: https://bioconductor.org Using Bioconductor 3.6 (BiocInstaller 1.28.0), R 3.4.2 (2017-09-28). Installing package(s) ‘TxDb.Hsapiens.UCSC.hg38.knownGene’ trying URL 'https://bioconductor.org/packages/3.6/data/annotation/src/contrib/TxDb.Hsapiens.UCSC.hg38.knownGene_3.4.0.tar.gz' Content type 'application/x-gzip' length 31934087 bytes (30.5 MB) ================================================== downloaded 30.5 MB * installing *source* package ‘TxDb.Hsapiens.UCSC.hg38.knownGene’ ... ** R ** inst ** preparing package for lazy loading ** help *** installing help indices ** building package indices ** testing if installed package can be loaded Error: package or namespace load failed for ‘TxDb.Hsapiens.UCSC.hg38.knownGene’: .onLoad failed in loadNamespace() for 'TxDb.Hsapiens.UCSC.hg38.knownGene', details: call: NULL error: C stack usage 7969316 is too close to the limit Error: loading failed Execution halted ERROR: loading failed * removing ‘/home/dunnin01/R/x86_64-pc-linux-gnu-library/3.4/TxDb.Hsapiens.UCSC.hg38.knownGene’ The downloaded source packages are in ‘/tmp/RtmpkCKEiJ/downloaded_packages’ installation path not writeable, unable to update packages: boot, class,
Can anyone suggest how I might fix this? Here is my session info. Many thanks,
R version 3.4.2 (2017-09-28) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Ubuntu 16.04.3 LTS Matrix products: default BLAS: /usr/lib/atlas-base/atlas/libblas.so.3.0 LAPACK: /usr/lib/atlas-base/atlas/liblapack.so.3.0 locale: [1] LC_CTYPE=en_GB.UTF-8 LC_NUMERIC=C [3] LC_TIME=en_GB.UTF-8 LC_COLLATE=en_GB.UTF-8 [5] LC_MONETARY=en_GB.UTF-8 LC_MESSAGES=en_GB.UTF-8 [7] LC_PAPER=en_GB.UTF-8 LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] BiocInstaller_1.28.0 loaded via a namespace (and not attached): [1] compiler_3.4.2 tools_3.4.2

Same problem here:
I tried Martin's suggestion to install without test; now the error occurs when I try to load the package.
Session Info
I have debugged it a bit and it seems the error is triggered by .onLoad in zzz.R
I can trigger it manually with
Note: The error appears when I execute the command the second time. Observe:
anders@merlot:~$ R R version 3.4.2 (2017-09-28) -- "Short Summer" Copyright (C) 2017 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. Natural language support but running in an English locale R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > AnnotationDbi::loadDb( "~/R/x86_64-pc-linux-gnu-library/3.4/TxDb.Hsapiens.UCSC.hg19.knownGene/extdata/TxDb.Hsapiens.UCSC.hg19.knownGene.sqlite" ) Loading required package: GenomicFeatures Loading required package: BiocGenerics Loading required package: parallel Attaching package: ‘BiocGenerics’ The following objects are masked from ‘package:parallel’: clusterApply, clusterApplyLB, clusterCall, clusterEvalQ, clusterExport, clusterMap, parApply, parCapply, parLapply, parLapplyLB, parRapply, parSapply, parSapplyLB The following objects are masked from ‘package:stats’: IQR, mad, sd, var, xtabs The following objects are masked from ‘package:base’: anyDuplicated, append, as.data.frame, cbind, colMeans, colnames, colSums, do.call, duplicated, eval, evalq, Filter, Find, get, grep, grepl, intersect, is.unsorted, lapply, lengths, Map, mapply, match, mget, order, paste, pmax, pmax.int, pmin, pmin.int, Position, rank, rbind, Reduce, rowMeans, rownames, rowSums, sapply, setdiff, sort, table, tapply, union, unique, unsplit, which, which.max, which.min Loading required package: S4Vectors Loading required package: stats4 Attaching package: ‘S4Vectors’ The following object is masked from ‘package:base’: expand.grid Loading required package: IRanges Loading required package: GenomeInfoDb Loading required package: GenomicRanges Loading required package: AnnotationDbi Loading required package: Biobase Welcome to Bioconductor Vignettes contain introductory material; view with 'browseVignettes()'. To cite Bioconductor, see 'citation("Biobase")', and for packages 'citation("pkgname")'. Error in AnnotationDbi:::.getMetaValue(dbconn(txdb), "DBSCHEMAVERSION") : invalid DB file > AnnotationDbi::loadDb( "~/R/x86_64-pc-linux-gnu-library/3.4/TxDb.Hsapiens.UCSC.hg19.knownGene/extdata/TxDb.Hsapiens.UCSC.hg19.knownGene.sqlite" ) Error: C stack usage 7970340 is too close to the limit >Could it be that the sqlite file in the repo got corrupted?
It's not the sqlite file. I've dug a bit deeper. Evidence points to the GenomicFeatures package.
See here:
I start with a fresh R session
I connect to the sqlite file:
> conn <- AnnotationDbi::dbFileConnect( "tmp/TxDb.Hsapiens.UCSC.hg19.knownGene/inst/extdata/TxDb.Hsapiens.UCSC.hg19.knownGene.sqlite" )Now, I load all packages that GenomicFeature depends on
I check something in the database. This still works:
Now I load GenomicFeatures, and then, the same command suddenly fails:
Does BiocInstaller::biocValid() provide any insight? Mark's download of TxDb... v. 3.4.0 from Bioc v. 3.6 is not consistent with most of your package versions (from Bioc v.3.5., e.g., GenomicFeatures 1.28.5 versus 1.30.0).
And the version of the TxDb package you're trying to load (maybe packageVersion("TxDb...") would work?). Also, at the end of the day, it'll be at least an 'update your Bioconductor installation' response, since we can't update Bioc 3.5 packages.
I've just noticed that I had not yet updated to the newest Bioc release, so I just did a BiocUpgrade. However, the error persists. Also, the issue happens with other db packages, too.
For example:
If I run, in a fresh R session, "library( org.Hs.db.eg )", and then, "library( GenomicFeatures )", this works.
If, however, again in a fresh R session, i first issue "library( GenomicFeatures )", and then "library( org.Hs.db.eg )", this fails with the C stack error.
So, it depends on the order in which the packages are loaded. It seems that GenomicFeatures has to be loaded after any annotation database package. This, however, does not work for TxDb packages, because they depend on GenomicFeatures and so load that first.
This is now with GenomicFeatures 1.30.0.
Full session info:
I managed to rid my system of the error. I had noticed that it has nothing to do with the annotation packages at all, because S4 as a whole was broken: The "C stack limit" error happened whenever I called any S4 method after loading GenomicFeatures. So, I updated all those base installation packages that biocUpgrade and update.packages usually skip because the system library directory is not writable. Not sure which of them it was but that did it; now everything works.