LinearKnot: Linear-Time Approximation of the Pseudoknot Partition Function
Milan Gautam, David H. Mathews, Liang Huang
Key points
From the paper's conclusion- We present LinearKnot, a linear-time approximation of DP03 in three passes: (a) LinearPartition gives pseudoknot-free weights; (b) a second pass builds tables that estimate each partial stem's crossing partner; and (c) a third scans a left-to-right reformulation of DP03 that reserves the 5' nucleotides in the pseudoknot helix for subsequent pairing, keeping the states with the largest estimated co
Abstract
Pseudoknots, where two or more helices cross, are central to many functional RNAs, including frameshifting signals, telomerase RNA, riboswitches and viral genomes. With arbitrary pseudoknots, finding the minimum free energy structure is NP-hard, so most RNA secondary structure prediction tools only consider pseudoknot-free structures. Dirks and Pierce (DP03) pioneered the first pseudoknot partition function, which underlies NUPACK's pseudoknot model, but it takes $O(n^5)$ time and $O(n^4)$ memory, making it practical only for very short sequences. Linear-time approximate dynamic programming, as in LinearFold and LinearPartition, does not transfer easily to DP03: a partial pseudoknot leaves a gap filled by its crossing partner, whose complementary sequence may still lie ahead of the scan, so it cannot be ranked by its inside weight. We present LinearKnot, a linear-time approximation of DP03 in three passes: (a) LinearPartition gives pseudoknot-free weights; (b) a second pass builds tables that estimate each partial stem's crossing partner; and (c) a third scans a left-to-right reformulation of DP03 that reserves the 5' nucleotides in the pseudoknot helix for subsequent pairing, keeping the states with the largest estimated contribution. Without pruning, this reformulation computes DP03's pseudoknot recursion exactly, so the only approximation is which states the beam keeps. End-to-end, time grows linearly ($n^{1.01}$) and memory marginally above linear ($n^{1.15}$) from 1,000 to 9,392 nt. LinearKnot folds the 9,392 nt Rous sarcoma virus genome in 2.4 hours and 90.5 GB, where exact DP03 would need an estimated 40,000 years and 54 million GB, and matches exact DP03 base-pair probabilities on 418 PseudoBase RNAs with a median RMSD of $9.2\times10^{-7}$. Our code is available at https://github.com/gautammilan/LinearKnot.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- LinearKnot: linear-time ensemble analysis of RNA density-2 pseudoknots under hierarchical foldingbioRxiv · 2026
- Alignment of RNA secondary structures with arbitrary pseudoknots using structural sequencesBMC Bioinformatics · 2026
- One partition function call to rule them all: Efficiently computing the equilibrium landscape of multiple nucleic acid strandsarXiv · 2026
- SparseDesign: Scaling Exact Coding-Sequence DesignarXiv · 2026
- KnitNet: Learning to Search at Inference Time for Exact RNA Inverse DesignarXiv · 2026
- Single-Exponential FPT Algorithms for Minimum Bisection and Matching Cut via a New Unbreakable DecompositionarXiv · 2026