1 Introduction

RNA is a long chain of nucleotides acid molecule which consists of A (Adenine), U (Uracil), G (Guanine) and C (Cytosine). The four-base arrangement allows RNA to have a variety of functions that can play a role in genetic coding, translation, regulation, and gene expression. The search for the secondary structure of RNA sequence has been widely used as the first step in understanding biological functions [1]. The RNA secondary structure folds itself by forming hydrogen bonds between G-C, A-U, and G-U. Therefore, the prediction of RNA secondary structure is returned to predict all hydrogen connections from the primary structure of the sequence. Many components can be identified in the secondary structure, such as stacked pairs or stacks, hairpin loop, multi-branched loop or Multi-loops, bulge loop, and internal loop. The component structures can be represented by a schematic representation or arc representation, as shown in Fig. 1.

Fig. 1.
figure 1

(a) Typical RNA Secondary Structure. (b) Arc representation of a typical RNA secondary structure. This image was created using jViz.Rna [2].

Pseudoknots usually contains not well-nested base pairs, as shown in Fig. 1(b). These non-nested base pairs make the presence of pseudoknots in RNA sequences more difficult to predict by dynamic programming, which use a recursive scoring system to identify paired stems. The general problem of predicting minimum free energy structures with pseudoknots has been shown to be NP-complete [3].

The dynamic programming (DP) is the first computational approach used to predict RNA structure [4,5,6,7,8]. It can be seen that the temporal and spatial complexity of the prediction algorithm for dynamic programming is high, which is not good for the algorithm to make predictions for long sequence because it will take more time and resources. The other prediction approaches are based on heuristic methods and thermodynamics models [9,10,11,12,13].

In this paper, we propose a novel efficient simulated annealing algorithm to predict nucleic acid secondary structure with pseudoknots. The performance of our algorithm compared with RNA structure method using PseudoBase [14] benchmark instances. The comparison result shows that our algorithm is more accurate and competitive with higher sensitivity and specificity values.

2 Problem Defines

For a given RNA sequence X = 5’−x1x2xn−3’ of length n, M(X) is the mapping string of complementary base-pairs of X, M(X) = (m1, m2, …, mi, …, mn). Each mi corresponds to the form of \( \left( {i,j,k} \right) \), which is called k successive base pairs, where \( i \) and \( j \) are the base position, where k is the number of successive base pair, and two constraints must be satisfied:

Base Pairs Constraint:

If \( \left( {i,j,k} \right) \in M \), then {(xi, xj), (xi+1, xj-1), …, (xi+k-1, xj-k+1)} \( \in \) {(A, U), (G, C), (G, U)} in RNA.

K Successive Base Pairs Constraint:

If \( \left( {i,j,k} \right) \in M \), then \( j - i > 2*MinStem + Minloop \), \( MinStem \ge 2 \), \( Minloop \ge 3 \) and \( k \ge MinStem \), where MinStem is the minimum number of stack and MinLoop is the minimum number of loop (Fig. 2). Such as there must be at least \( Minloop \) unpaired bases in a hairpin loop.

Fig. 2.
figure 2

A graphical illustration of a MinStem and MinLoop

3 The Proposed Approach

3.1 Set of K Successive Base Pairs

In computer-simulated base pairing, we do not pair individual bases but use successive base pairs. We reduced the range of all possible base pairs by setting MinStem and MinLoop parameters. Assume that there are three variables i, j, k, which \( i \) and \( j \) are the base position, where k is the number of successive base pair. According to the above Fig. 2, we can be seen that i, j, k need to satisfy the following three constraints:

$$ 1 \le i \le RNA.Length - 2 *MinStem - MinLoop + 1 $$
(2)
$$ i + 2 *MinStem + MinLoop \le j \le n $$
(3)
$$ MinStem \le k \le \left( {j - i - MinLoop} \right)/2 $$
(4)

3.2 Evaluation Function

For most MFE based RNA secondary structure prediction algorithm, the complex thermodynamic model is often used to evaluate candidate solutions [15]. There are no useful information to guide the candidate solution to find lower neighbor energy state. Consequently, the convergence of these MFE based prediction algorithms is very slow. However, among all of the secondary structure, only the successive base pairs stack structure \( \Delta G_{S} \) provide negative free energy which contributes to the reduction of free energy. The stability of RNA sequence can also be approximately evaluated by successive base pairs stacks.

Let M(X) is the mapping string of complementary base pairs of X, M(X) = (m1, m2, …, mi, …, mn). Each mi corresponds to the form of \( \left( {i,j,k} \right) \), where mi .k equals k, group is the number of stems, then the following formula:

$$ F\left( {M\left( X \right)} \right) = \left\{ {\begin{array}{*{20}c} {TotalBP \times AverageBP^{2} ,\varvec{if}\,PesudoGroup < MaxPesudoGroup} \\ {TotalBP \times AverageBP^{2} \times \frac{{\left( {TotalGroup - PesudoGroup} \right)}}{ TotalGroup},\varvec{else}} \\ \end{array} } \right. $$
(5)

Where PseudoknotGroup is the predicted number of pseudoknot by the algorithm, and MaxPesudoKnot is the expected number of pseudoknot.

$$ TotalBasePair = \sum\nolimits_{i = 1}^{n} {m_{i} .k} $$
(6)
$$ AverageBasePair = TotalBasepair /group $$
(7)

3.3 Overall Algorithm

The process of natural RNA folding to its minimal free energy state is very similar to the annealing process. In addition, compared with other heuristic prediction algorithms, such as genetic algorithms, the SA algorithm has faster convergence. Therefore, the paper proposes a new method to predict the RNA secondary structure with pseudoknots based on SA framework. This algorithm framework is as follows:

figure a

4 Experiments Result

The computational result of our algorithm is compared with IPknot [16], TT2NE [17], CyloFold [18] on 10 benchmark instances in PseudoBase RNA database. The evaluate indicators are sensitivity (SN) and specificity (SP) [19], as shown in Eq. (8).

$$ SN = TP \div TP + FN,SP = TP \div TP + FP $$
(8)

Where TP represents the number of correctly predicted base pairs; FP represents the number of incorrectly predicted base pairs; FN represents the number of unpredicted base pairs compared to the known structure. When the prediction results are accurate, both SN and SP should be close to 100%.

The comparisons of the proposed method with the other methods are shown in Table 1. In terms of sensitivity, the proposed method provides the best results in six sequences, yields not the worst result in remaining sequences. In terms of specificity, the proposed method yields the best results in three sequences, similar result in five sequences, and inferior results in two sequences. On average, from all sequences, the proposed method outperforms the other methods in all measure. It has average sensitivity and specificity of 92.6% and 84.3% respectively.

Table 1. Comparison results with sensitivity and specificity indicator

5 Conclusion

This paper proposes efficient SA algorithm for the RNA secondary structure predicting with pseudoknots, combined with the evaluation function to compensate for the high time complexity of the free energy calculation model. The algorithm sets the MinStem and MinLoop parameters to determine the pseudoknot structure formed by the base pair cross-combination, and optimizes the pool of candidate solutions, thereby reducing the time cost of the algorithm. We use the evaluation function to further reduce the time consumption of RNA secondary structure prediction algorithms. Moreover, the performance of our algorithm is compared with state of art algorithms using ten PseudoBase benchmark instances, and the comparison result shows that our algorithm is more accurate and competitive with higher sensitivity and specificity values.