Repository navigation
Error in xgb.get.handle(object): 'xgb.Booster' object is corrupted or is from an incompatible xgboost version. #447
Copy link
Copy link
Closed
Description
My command:
bamba_ret = bambu(
reads = bam_file,
annotations = gtf_file,
genome = fna_file,
quant = FALSE,
ncore = 8
)The error:
Error: BiocParallel errors
1 remote errors, element index: 1
0 unevaluated and other errors
first remote error:
Error in xgb.get.handle(object): 'xgb.Booster' object is corrupted or is from an incompatible xgboost version.
Traceback:
1. bambu(reads = bam_file, annotations = gtf_file, genome = fna_file,
. quant = FALSE, ncore = 8)
2. bambu.processReads(reads, annotations, genomeSequence = genome,
. readClass.outputDir = rcOutDir, yieldSize, bpParameters,
. stranded, verbose, isoreParameters, trackReads = trackReads,
. fusionMode = fusionMode, lowMemory = lowMemory)
3. bplapply(names(reads), function(bamFileName) {
. bambu.processReadsByFile(bam.file = reads[bamFileName], genomeSequence = genomeSequence,
. annotations = annotations, readClass.outputDir = readClass.outputDir,
. stranded = stranded, min.readCount = min.readCount, fitReadClassModel = fitReadClassModel,
. min.exonOverlap = min.exonOverlap, defaultModels = defaultModels,
. returnModel = returnModel, verbose = verbose, lowMemory = lowMemory,
. trackReads = trackReads, fusionMode = fusionMode)
. }, BPPARAM = bpParameters)
4. bplapply(names(reads), function(bamFileName) {
. bambu.processReadsByFile(bam.file = reads[bamFileName], genomeSequence = genomeSequence,
. annotations = annotations, readClass.outputDir = readClass.outputDir,
. stranded = stranded, min.readCount = min.readCount, fitReadClassModel = fitReadClassModel,
. min.exonOverlap = min.exonOverlap, defaultModels = defaultModels,
. returnModel = returnModel, verbose = verbose, lowMemory = lowMemory,
. trackReads = trackReads, fusionMode = fusionMode)
. }, BPPARAM = bpParameters)
5. .bpinit(manager = manager, X = X, FUN = FUN, ARGS = ARGS, BPPARAM = BPPARAM,
. BPOPTIONS = BPOPTIONS, BPREDO = BPREDO)
I've tried restarting the R kernel, but that did not help. It appears that the xgboost version that I've installed (xgboost_2.1.1.1) is not compatible with the model utilized by default by bambu.
I don't see any version specifications for xgboost in the README or elsewhere. Which versions of xgboost are compatible with the default model?
sessionInfo
R version 4.3.3 (2024-02-29)
Platform: x86_64-conda-linux-gnu (64-bit)
Running under: Ubuntu 22.04.4 LTS
Matrix products: default
BLAS/LAPACK: /home/nickyoungblut/miniforge3/envs/ont_10x/lib/libopenblasp-r0.3.27.so; LAPACK version 3.12.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
time zone: America/Los_Angeles
tzcode source: system (glibc)
attached base packages:
[1] stats4 stats graphics grDevices utils datasets methods
[8] base
other attached packages:
[1] bambu_3.4.0 BSgenome_1.70.1
[3] rtracklayer_1.62.0 BiocIO_1.12.0
[5] Biostrings_2.70.1 XVector_0.42.0
[7] SummarizedExperiment_1.32.0 Biobase_2.62.0
[9] GenomicRanges_1.54.1 GenomeInfoDb_1.38.1
[11] IRanges_2.36.0 S4Vectors_0.40.2
[13] BiocGenerics_0.48.1 MatrixGenerics_1.14.0
[15] matrixStats_1.3.0 ArcRUtils_0.1.0
[17] ggplot2_3.5.1 tidyr_1.3.1
[19] dplyr_1.1.4
loaded via a namespace (and not attached):
[1] DBI_1.2.3 bitops_1.0-7 biomaRt_2.58.0
[4] rlang_1.1.3 magrittr_2.0.3 compiler_4.3.3
[7] RSQLite_2.3.7 GenomicFeatures_1.54.1 png_0.1-8
[10] vctrs_0.6.5 stringr_1.5.1 pkgconfig_2.0.3
[13] crayon_1.5.2 fastmap_1.1.1 dbplyr_2.5.0
[16] utf8_1.2.4 Rsamtools_2.18.0 purrr_1.0.2
[19] bit_4.0.5 zlibbioc_1.48.0 cachem_1.0.8
[22] jsonlite_1.8.8 progress_1.2.3 blob_1.2.4
[25] DelayedArray_0.28.0 uuid_1.2-0 BiocParallel_1.36.0
[28] parallel_4.3.3 prettyunits_1.2.0 R6_2.5.1
[31] stringi_1.8.4 xgboost_2.1.1.1 Rcpp_1.0.12
[34] IRkernel_1.3.2 base64enc_0.1-3 Matrix_1.6-5
[37] tidyselect_1.2.1 abind_1.4-5 yaml_2.3.8
[40] codetools_0.2-20 curl_5.1.0 lattice_0.22-6
[43] tibble_3.2.1 withr_3.0.0 KEGGREST_1.42.0
[46] evaluate_0.23 BiocFileCache_2.10.1 xml2_1.3.6
[49] BiocManager_1.30.23 pillar_1.9.0 filelock_1.0.3
[52] generics_0.1.3 RCurl_1.98-1.14 IRdisplay_1.1
[55] hms_1.1.3 munsell_0.5.1 scales_1.3.0
[58] glue_1.7.0 tools_4.3.3 data.table_1.15.2
[61] GenomicAlignments_1.38.0 pbdZMQ_0.3-11 XML_3.99-0.16.1
[64] grid_4.3.3 AnnotationDbi_1.64.1 colorspace_2.1-0
[67] GenomeInfoDbData_1.2.11 repr_1.1.7 restfulr_0.0.15
[70] cli_3.6.2 rappdirs_0.3.3 fansi_1.0.6
[73] S4Arrays_1.2.0 gtable_0.3.5 digest_0.6.35
[76] SparseArray_1.2.2 rjson_0.2.21 memoise_2.0.1
[79] htmltools_0.5.8.1 lifecycle_1.0.4 httr_1.4.7
[82] bit64_4.0.5
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
nick-youngblut commentedon Sep 16, 2024
I see that this issue might be addressed with #386.
In that PR, I don't see any info on the original and updated versions. Which version of xgboost was used to train the default model, and which was used to create the updated models for the PR?
andredsim commentedon Sep 20, 2024
Thanks for reporting this.
Did you install Bambu via BioConductor or Github? Was your installation of xgboost separate or part of the dependency installation?
If possible I would recommend updating to R >4.4 and reinstalling Bambu to the latest version 3.5.1 using Bioconductor which should install a compatible version of xgboost (v1.7.8.1 from what I just tested). It is good to know that the latest version of xgboost is causing this error, so we will need to be ready once the compatible version is no longer compatible with R.
Let me know if updating R/Bambu/downgrading xgboost solves your issue.
Kind Regards,
Andre Sim
nick-youngblut commentedon Sep 21, 2024
Thanks for the suggestion.
Do you constrain the supported versions of xgboost in the package setup? I don't see any such constraints on xgboost in the DESCRIPTION.
If there are no version constraints, why would a re-install of bambu install anything other than the latest version of xgboost, which is now in v2, while you are testing on v1.7 ("v1.7.8.1 from what I just tested")?
andredsim commentedon Sep 23, 2024
The cran version of xgboost is still v1.7.8 (https://cran.rstudio.com/web/packages/xgboost/index.html) which is what bioconductor will install as a dependency I believe. To confirm if thats correct , may I ask if you installed xgboost independantly or via bioconductor? Presumably in the next bioconductor release xgboosts version will incrase to v2 so we will make sure to either constrain the version or make sure its compatible thanks to your report.
nick-youngblut commentedon Sep 23, 2024
The lastest conda-forge version of xgboost is 2.1.1.
I used the bambu Bioconda recipe, which does not specify particular xgboost versions.
It might be best to contact the authors of this bioconda recipe:
cying111 commentedon Sep 24, 2024
Hi @nick-youngblut ,
thanks for reporting this.
However, I believe there must be some confusion here. As you know, xgboost can refer to both the software or the R package. For bambu, the xgboost version is always referring to that of the R xgboost package, so if you check the latest version of that on cran, it is v1.7.8.1, which is the same version that is in bioconductor, see attached here:

Hope this clarifies your question!
Thanks,
Ying
SwiftSeal commentedon Feb 19, 2025
Hi both,
I am experiencing the same issue via conda - is there a solution for this? I'm using
xgboost v1.7.8.1which should be compatible. I also can't installR>4.4as:Cheers,
Moray
SwiftSeal commentedon Feb 19, 2025
Quick update - the method which has brought me closest to a working (?) install is:
conda install bioconductor-bambu r-biocmanager r-devtools>R library(devtools)>R install_github("GoekeLab/bambu")This method resulted in
xgboost_2.1.4.1being reported insessionInfo()- not sure how this occurs if CRAN is at 1.7*So I followed this up with
install.packages("xgboost")This brought me to
xgboost_1.7.8.1but the same error occurs.Full session info is:
N-Hoffmann commentedon Feb 26, 2025
Hi all,
I'm experiencing the same issue when I use Bambu in the recent
bioconda::bioconductor-bambuenvironments. It works in the bambu-3.0.8 release, but not in the 3.4.0 and 3.8.3 releases.As @nick-youngblut mentioned, the Bioconda recipe doesn't specifiy a version for
r-xgboost. In the bioconda envs, the 3.4.0 release has xgboost version 2.1.2.1 while the 3.0.8 release has version 1.7.1.1 .For now I managed to work around it for Bambu 3.4.0 by specifying in my environment:
I used xgboost 1.7.6 here because it was the latest version before 2.0.3 in conda. I hope this helps you @SwiftSeal (also it's strange that you have bambu_3.9.3 if you installed it via conda ? It should be 3.8.3 from what I understand).
Best regards,
Nicolaï
SwiftSeal commentedon Feb 26, 2025
Hi @N-Hoffmann
Aye some confusion there - I installed bambu via conda then patched it via
devtools::install_github. But your method worked (with the addition ofr-biocmanager). It now begins to run, but quickly encounters:I might open a separate issue for that as seems unrelated to this.
EDIT:
Turns out that was just an OOM - runs fine after increasing memory
saberiato commentedon Mar 17, 2025
This has resolved my issue:
matejkubovcak commentedon Jul 9, 2025
Latest version installed either via BiocManager or conda not working, still the xgboost issue but 3.0.8 installed via conda works, thank you !
alanlamsiu commentedon Jul 11, 2025
Hi @nick-youngblut @cying111. Is there any update on this issue? I tried several versions of xgboost, including 1.3.1.1, 1.3.2.1 and 1.7.8.1, with the latest bambu version, but the error of incorrect xgboost version persists.
jechia commentedon Dec 12, 2025
Hi, I just tried installing the xgboost 1.7.8.1, then I installed the bambu from github with install_github("GoekeLab/bambu"). It seems like this solved the issue. Importantly, you need to clear the cache. just in case wrong version of xgboost.
cying111 commentedon Dec 12, 2025
Hi @alanlamsiu and all, thanks for the helpful discussion. It seems that this error is related to loading pre-trained model object which is using an previous xgboost version. Will post an update here when it's resolved.
Thanks!
Ying
diekhans commentedon Dec 17, 2025
I would appreciate it if this was actually fixed and tested in a release. We spent a lot of time trying to get Bambu to work with different versions of xgboost including 1.7.8.1 and got the same error. As this ticket remains open, we have to conclude that Bambu is no longer supported and report this to reviewers that requested we run it,
yinshiyi commentedon Jan 10, 2026
Hi @cying111,
I am writing to follow up on this, if you have a fix for it yet?
I was able to get 3.4 working using @N-Hoffmann 's method
conda create -n bambu bioconda::bioconductor-bambu=3.4.0 conda-forge::r-xgboost=1.7.6=cpu_r43had0c348_6But it would be nice to get 3.8 features
conda create -n bambu bioconda::bioconductor-bambu=3.8.3 conda-forge::r-xgboost=1.7.6=cpu_r43had0c348_6Could not solve for environment specs
The following packages are incompatible
├─ bioconductor-bambu 3.8.3* is installable and it requires
│ └─ r-base >=4.4,<4.5.0a0 , which can be installed;
└─ r-xgboost ==1.7.6 cpu_r43had0c348_6 is not installable because it requires
└─ r-base >=4.3,<4.4.0a0 , which conflicts with any installable versions previously reported.
cying111 commentedon Jan 13, 2026
Hi @yinshiyi , we are working in to push the changes to bioconductor. For now, you can use this branch: https://github.com/GoekeLab/bambu/tree/xgboost_bug_fix This branch should work well with xgboost3.1.2.1 and R4.5.2
Once the fix is pushed, we will update here and you can switch back to the Bioconductor version.
cying111 commentedon Jan 23, 2026
Hi all,
We have recently pushed a fix to the issue related to xgboost, and now it should work well without the need to downgrade xgboost version anymore. The fix has been pushed to bioconductor, so downloading directly from Bioconductor would work.
Please feel free to give it a try and let us know if there are further issues.
For now, I will close this issue. Feel free to re-open it if you still face the issue
Thank you
rnaomics commentedon Jul 10, 2026
rebeelouise commentedon Oct 7, 2026
Hi,
It seems xgboost has been updated recently, and after installing fresh, this error has re-emerged....