The article presenting sabinaHSBM has been published in Methods in Ecology and Evolution. It is the first R package that makes the degree-corrected hierarchical stochastic block model (HSBM) available to ecologists for link prediction and ecological network reconstruction. The open-access paper is led by Herlander Lima (Estación Biológica de Doñana, CSIC) and Jennifer Morales-Barbero (Universidad Autónoma de Madrid), together with Rubén G. Mateo, Ignacio Morales-Castilla and Miguel Á. Rodríguez (University of Alcalá).
Ecological network data are often incomplete or error-prone because of sampling limitations, detection failures and taxonomic uncertainty, which leads to missing links (false negatives) and spurious links (false positives). The HSBM is among the most effective tools for reconstructing networks under such conditions, but its original implementation, in the Python-based graph-tool library, had remained largely inaccessible to ecologists. sabinaHSBM provides a user-friendly and flexible workflow from R.
- A three-step workflow: preparing the input data, estimating posterior link probabilities and reconstructing the network.
- Features: detection of undocumented and spurious links, exploration of hierarchical structure, propagation of uncertainty, cross-validation, flexible thresholding, probabilistic evaluation metrics and two link prediction methods (estimating all link probabilities or identifying only undocumented ones).
- Case study: using a global dataset of carnivore–parasite associations, the inferred groupings were phylogenetically clustered and, of the ten highest-probability links, eight had published evidence despite being absent from the original data.
Because graph-tool runs only on Unix systems, the package is accompanied by a ready-to-use Docker image that makes installation easier on Windows, macOS and Linux.
For more information:
- Article in Methods in Ecology and Evolution (open access)
- Package repository on GitHub, with code and documentation
- Data and code archived on Zenodo
- sabinaHSBM Docker image
Reference: Lima, H., Morales-Barbero, J., Mateo, R. G., Morales-Castilla, I. and Rodríguez, M. Á. (2026). sabinaHSBM: An R package for link prediction and network reconstruction using hierarchical stochastic block models. Methods in Ecology and Evolution, 17: 2285-2294.
This work was funded by the Spanish State Research Agency (CGL2017-86926-P, PID2021-124187NB-I00 and PID2023-152329OB-I00).