Nucleic Acids ResearchBioinformaticsPeer-reviewed journal article
LazySampling and LinearSampling: Fast Stochastic Sampling of RNA Secondary Structure with Applications to SARS-CoV-2
He ZhangiD, Sizhen LiiD, Liang ZhangiD, David H. MathewsiD, Liang HuangiD
Abstract
Many RNAs fold into multiple structures at equilibrium. The classical stochastic sampling algorithm can sample secondary structures according to their probabilities in the Boltzmann ensemble, and is widely used. However, this algorithm, consisting of a bottom-up partition function phase followed by a top-down sampling phase, suffers from three limitations: (a) the formulation and implementation of the sampling phase are unnecessarily complicated; (b) the sampling phase repeatedly recalculates many redundant recursions already done during the partition function phase; (c) the partition function runtime scales cubically with the sequence length. These issues prevent stochastic sampling from being used for very long RNAs such as the full genomes of SARS-CoV-2. To address these problems, we first adopt a hypergraph framework under which the sampling algorithm can be greatly simplified. We then present three sampling algorithms under this framework, among which the LazySampling algorithm is the fastest by eliminating redundant work in the sampling phase via on-demand caching. Based on LazySampling, we further replace the cubic-time partition function by a linear-time approximate one, and derive LinearSampling, an end-to-end linear-time sampling algorithm that is orders of magnitude faster than the standard one. For instance, LinearSampling is 176x faster (38.9s vs. 1.9h) than Vienna RNAsubopt on the full genome of Ebola virus (18,959 nt). More importantly, LinearSampling is the first RNA structure sampling algorithm to scale up to the full-genome of SARS-CoV-2 without local window constraints, taking only 69.2 seconds on its reference sequence (29,903 nt). The resulting sample correlates well with the experimentally-guided structures. On the SARS-CoV-2 genome, LinearSampling finds 23 regions of 15 nt with high accessibilities, which are potential targets for COVID-19 diagnostics and drug design. See code: https://github.com/LinearFold/LinearSampling
- Citations
- 13
- FWCI
- 0.65
- Field percentile
- top 38%
Reproducibility ledger
Nobody has reported trying to reproduce this paper yet. Did you replicate an experiment or run the code? Your report saves the next lab a week.
Sign in to file a reproducibility report.
Related papers
- LinearTurboFold: Linear-Time Global Prediction of Conserved Structures for RNA Homologs with Applications to SARS-CoV-2
Sizhen Li, He Zhang, … Liang Huang·Proceedings of the National Academy of SciencesPeer-reviewed·Dec 9, 2021
- LinAliFold and CentroidLinAliFold: Fast RNA consensus secondary structure prediction for aligned sequences using beam search methods
Tsukasa Fukunaga, Michiaki Hamada·Bioinformatics AdvancesPeer-reviewed·Jan 1, 2022
- RNAxplorer: Harnessing the Power of Guiding Potentials for Sampling RNA Landscapes
Gregor Entzian, Ivo L. Hofacker, … Andrea Tanzer A·BioinformaticsPeer-reviewed·Feb 3, 2021
- Efficient and scalable modelling of cotranscriptional RNA folding with deterministic and iterative RNA structure sampling
Eliot Courtney, Edric K. Choi, … Max Ward·bioRxiv·Apr 24, 2026
- LinearFold: Linear-Time Prediction of RNA Secondary Structures
Dezhong Deng, Kai Zhao, … Liang Huang·bioRxiv·Feb 14, 2018
- LinearCapR: Linear-time computation of per-nucleotide structural-context probabilities of RNA without base-pair span limits
Takumi Otagaki, Hiroaki Hosokawa, … Kiyoshi Asai·BioinformaticsPeer-reviewed·Jun 1, 2026