Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
L

LinearFold

> 编程语言
Open source

The new source code of the LinearFold, linear-time prediction for RNA secondary structures

197 stars0 likes1 views
WebsiteGitHub

About

The new source code of the LinearFold, linear-time prediction for RNA secondary structures

This codebase replaces the now deprecated version: https://github.com/abentu0101/LinearFold. This version fixes many bugs and design problems in the old version.

LinearFold: Linear-Time Prediction for RNA Secondary Structures

This repository contains the C++ source code for the LinearFold project, the first linear-time prediction algorithm/software for RNA secondary structures.

LinearFold: Linear-Time Approximate RNA Folding by 5’-to-3’ Dynamic Programming and Beam Search. Bioinformatics, Volume 35, Issue 14, July 2019, Pages i295–i304. ISMB 2019

Liang Huang*, He Zhang**, Dezhong Deng**, Kai Zhao, Kaibo Liu, David Hendrix, David Mathews

* corresponding author

** contributed equally

Web server: http://linearfold.org

Dependencies

GCC 4.8.5 or above; python3

To Compile

make

To Run

The LinearFold parser can be run with:

echo SEQUENCE | ./linearfold [OPTIONS]

OR

cat SEQ_OR_FASTA_FILE | ./linearfold [OPTIONS]

Both FASTA format and pure-sequence format are supported for input.

OPTIONS:

--beamsize BEAM_SIZE or -b BEAM_SIZE 

The beam size (default 100). Use 0 for infinite beam.

--Vienna or -V

Switches LinearFold-C (by default) to LinearFold-V.

--fasta

Specify that the input is in fasta format. (default FALSE)

--verbose or -v

Prints out energy of each loop in the structure. (default False)

--sharpturn

Enable sharpturn in prediction. (default False)

--eval

Enable eval mode, which can calculate free energy for a given structure of a sequence. (default False)

--constraints

Enable adding specific constraints in prediction (default False). The constraint sequence should have the same length as the RNA sequence. "? . ( )" indicates a position for which the proper matching is unknown, unpaired, left or right parenthesis respectively. The parentheses must be well-banlanced and non-crossing.

--zuker

output Zuker suboptimal structures, (DEFAULT=FALSE)

--delta

compute Zuker suboptimal structures with scores or energies(-V, kcal/mol) in a centain range of the optimum, (DEFAULT=5.0)

--shape 

use SHAPE reactivity data to guide structure predictions
Please refer to this link for the SHAPE data format: https://rna.urmc.rochester.edu/Text/File_Formats.html#SHAPE

--dangles INT or -d INT

the way to treat "dangling end" energies for bases adjacent to helices in free ends and multi-loops, (only supporting 0 or 2, DEFAULT=2)
--dangles 0, ignores dangling ends
--dangles 2, dangling energies are added for the bases adjacent to a helix on both sides in any case

To Visualize

LinearFold is able to visualize the structure using a circular plot.

To draw a circular plot, run command:

cat TARGET_FILE | ./draw_circular_plot 

TARGET_FILE contains one sequence and its structure; see "ecoli_tRNA" file as an example.

Example Run Predict

…

Example Run Predict with constraints

…

Example Run Predict and output suboptimal structures

…

Example Run SHAPE-guided structure prediction

echo GCCUGGUGACCAUAGCGAGUCGGUACCACCCCUUCCCAUCCCGAACAGGACCGUGAAACGACUCCGCGCCGAUGAUAGUGCGGAUUCCCGUGUGAAAGUAGGUCAUCGCCAGGC | ./linearfold -V --shape example.shape
GCCUGGUGACCAUAGCGAGUCGGUACCACCCCUUCCCAUCCCGAACAGGACCGUGAAACGACUCCGCGCCGAUGAUAGUGCGGAUUCCCGUGUGAAAGUAGGUCAUCGCCAGGC
((((((........((((((((.(((............(((......)))..)))...))))).)))..(((((((..(((...(((......))).))).))))))))))))) (-66.30)

Example Run Predict (-d0 option: ignoring dangling ends)

echo GGGCUCGUAGAUCAGCGGUAGAUCGCUUCCUUCGCAAGGAAGCCCUGGGUUCAAAUCCCAGCGAGUCCACCA | ./linearfold -V -d0
GGGCUCGUAGAUCAGCGGUAGAUCGCUUCCUUCGCAAGGAAGCCCUGGGUUCAAAUCCCAGCGAGUCCACCA
(((((((..((((.......))))((((((((...)))))))).(((((.......)))))))))))).... (-25.50)

Example Run Eval

…

Example: Draw Circular Plot

cat ecoli_tRNA | ./draw_circular_plot

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

C++

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言