bioRxiv Science⌕ Search

bioRxiv · 10.1101/2025.10.28.684773

sabinaHSBM: An R package for link prediction network reconstruction using Hierarchical Stochastic Block Models

Abstract

O_LINetwork analysis is a powerful framework for investigating complex systems across disciplines, including ecology, where it helps uncover patterns in predator-prey, host- parasite, or plant-pollinator interactions. However, ecological network data are often incomplete or error-prone due to sampling limitations, detection failures, and taxonomic uncertainty--leading to missing (false negative) and spurious (false positive) links that obscure structure and hinder inference. The hierarchical stochastic block model (HSBM), particularly in its degree-corrected form, is among the most effective tools for reconstructing networks under such uncertainty. Despite its robustness, the primary implementation of HSBM in the Python-based graph-tool library has remained largely inaccessible to ecologists. C_LIO_LIHere, we introduce sabinaHSBM, the first R package that makes degree-corrected HSBM broadly available through a user-friendly, flexible workflow. By bridging a gap between advanced network modeling and widely used ecological analysis platforms, sabinaHSBM facilitates network reconstruction and link prediction from binary bipartite data. The workflow involves three main steps: (1) preparing input data, (2) estimating posterior link probabilities, and (3) reconstructing the network. The package supports detection of undocumented and spurious links, exploration of hierarchical structure, and propagation of uncertainty throughout. Key features include cross-validation, flexible thresholding, probabilistic evaluation metrics, and two link prediction modes: estimating all link probabilities or identifying undocumented ones. C_LIO_LIWe illustrate the packages functionality through a case study using a published global dataset of carnivore-parasite associations, showing that inferred groupings are phylogenetically clustered. To assess predictive accuracy, we examined the top 10 highest-probability links identified by the model and found published evidence for 8, despite their absence from the original dataset. This highlights the models ability to recover biologically meaningful but underreported interactions. C_LIO_LIBy integrating all components of HSBM-based reconstruction into an accessible R package, sabinaHSBM empowers researchers to improve relational data quality and uncover overlooked patterns in complex ecological networks and beyond. C_LI

Source connections

Explore related subjects

Keep this discovery

Explore connections, maps & timelines

BibTeXRIS

Lima, H., Morales-Barbero, J., Mateo, R. G., Morales-Castilla, I., Rodriguez, M. A.. 2025-10-29. sabinaHSBM: An R package for link prediction network reconstruction using Hierarchical Stochastic Block Models. https://doi.org/10.1101/2025.10.28.684773

Cite the original work for its findings. Save a collection to share your selection of sources.

KEEP EXPLORING

Related preprints

A leaf-carbon economy model to explain the adaptive value of low vs. high leaf mass per area as a function of habitat productivity

Plant traits interact with environmental conditions to determine plant fitness. In particular, plant species with low leaf mass per area (LMA) are more common in high fertility soils and forest gaps, while plant species with high LMA are more common in low fertility soils and in shaded forest understories. It is not yet known why the adaptive value of LMA changes as a function of environmental productivity. We present a model for plant growth as a function of LMA and productivity. Our model relies on an empirically derived relationship between LMA and leaf lifespan. We are able to explain why species with lower LMA are successful in high productivity environments including environments with high availability of either light or soil nutrients, by showing that the LMA which maximizes growth rate decreases with increasing rate of carbon assimilation. We show that low LMA species are better at taking advantage of the 'high interest' environment of high productivity habitats by reinvesting assimilated carbon in new leaves and earning compound interest, while high LMA species grow more efficiently in the 'low interest' environment of low productivity habitats. This tradeoff sheds light on the adaptive value of LMA as it relates to environmental productivity.

ecology↗

Species differentiate water uptake depths within a narrow vertical zone in temperate grasslands

Whether and under which conditions coexisting species in temperate grasslands differentiate their water uptake within the shallow soil layer they share is central to understanding hydrological niche differentiation in these ecosystems. In this field study, we quantified water uptake depth of 28 coexisting herbaceous species across 74 temperate grassland plots in three regions of Germany using oxygen stable isotopes and soil water content measured at multiple depths. Species consistently differed in water uptake depth across all regions, consistent with hydrological niche differentiation. This differentiation was largely confined to the upper 30 cm of soil and became stronger as overall soil moisture declined, with plants accessing water at greater depths in drier plots. In contrast, the vertical distribution of soil moisture was unrelated to either uptake depth or species differentiation. Despite pronounced species level variation, broad herbaceous functional classifications, including grasses versus forbs and fibrous versus taprooted species, showed substantial overlap in water uptake depth. Together, our results show that hydrological niche differentiation in temperate grasslands is expressed through fine scale differences among species within a shared shallow soil domain, becomes more pronounced under drier conditions, and is poorly captured by broad herbaceous functional classifications.

ecology↗

Fungal-bacterial interactions enhance bacterial but constrain fungal resistance and recovery to extreme heat across soil moisture levels

Soil fungi and bacteria are key drivers of nutrient cycling and plant productivity in terrestrial ecosystems, yet their responses to climate extremes are rarely studied as interacting partners rather than in isolation. Moreover, it remains largely unknown how fungal-bacterial interactions regulate fungal and bacterial stability under climate extremes, particularly resistance (immediate responses to climate extremes) and recovery (responses after climate extremes cease). Here, we conducted a soil microcosm experiment with a bacterial species (Pseudomonas putida KT2440) paired with one of four Trichoderma species (T. hamatum, T. atroviride, T. koningiopsis, and T. harzianum). These fungal-bacterial pairs were then exposed to a 5-day heat event (40 {degrees}C/32 {degrees}C, day/night) followed by a 14-day recovery period (25 {degrees}C/17 {degrees}C, day/night), at two soil moisture levels (30% and 5% gravimetric water content). Our results show that fungal-bacterial interactions asymmetrically affect fungal and bacterial responses to extreme heat. Trichoderma species facilitated the resistance and recovery of P. putida density (CFUs) to extreme heat, whereas P. putida constrained the resistance and recovery of fungal biomass (ergosterol) to extreme heat, regardless of soil moisture conditions. Moreover, faster-growing Trichoderma species were associated with greater facilitation of bacterial resistance and recovery. Bacterial density also covaried positively with fungal biomass during heat stress under both soil moisture conditions, suggesting that net fungal facilitation enhances bacterial persistence under extreme heat. Together, our findings reveal that fungal-bacterial interactions can stabilize one microbial partner while increasing the vulnerability of the other, highlighting the contrasting consequences of biotic interactions under climate extremes.

ecology↗