A method, system, computer equipment, and medium for constructing an RNA secondary structure tree.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-03
- Publication Date
- 2026-08-14
AI Technical Summary
[0004]点括号表示法在将RNA的二维折叠结构转换为一维线性字符串以线性方式排列,原本存在于外层与内层结构之间的包含与被包含关系,在转换后无法被直观表达和有效保留,丢失了结构元件之间的层级包含关系信息
[0022]本发明提供的一种RNA二级结构树形构建方法具有以下有益效果:本发明通过识别连续点字符标记为多分枝环节点D,解决了现有技术无法识别关键枢纽节点的问题;通过确定D之间的嵌套关系并选取最外层D为根节点,解决了层级包含关系无法保留的问题;通过将最内层无D的茎区定义为茎环节点S,解决了多层嵌套结构难以还原关联关系的问题;通过构建统一的树形结构图,解决了内外层差异被同等对待的问题。综合而言,本发明将点括号线性字符串转换为保留层级特征的树形结构,实现了对RNA二级结构的标准化、层级化表达,为后续精准比对分析奠定了坚实的数据基础。
Smart Images

Figure CN122575460A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of bioinformatics and computational molecular biology, and specifically relates to a method, system, computer equipment, and medium for constructing an RNA secondary structure tree. Background Technology
[0002] The study of RNA secondary structure is a fundamental topic in RNA functional genomics. Since RNA function is highly dependent on its spatial conformation formed by folding, and secondary structure, as a crucial level transitioning from primary to tertiary structure, carries structural information and is relatively easy to compute and analyze, it has become a core entry point for elucidating RNA function, revealing RNA regulatory mechanisms, and discovering novel RNA elements.
[0003] Currently, the mainstream method for representing RNA secondary structures is the dotted bracket notation. This method uses left brackets '(' and right brackets ')' to represent the start and end positions of base pairing, respectively, and a dot '.' to represent regions of bases that have not participated in pairing, thus compressing the two-dimensional folded structure of RNA into a one-dimensional linear string sequence. However, RNA secondary structures inherently possess multi-level and multi-branching topological characteristics: large structural regions may contain multiple nested substructures, and substructures may contain even smaller structural units; outer structures contain inner structures. This is a crucial characteristic of RNA folding. Existing technologies suffer from the following technical problems:
[0004] The dotted-bracket notation transforms the two-dimensional folded structure of RNA into a one-dimensional linear string arranged linearly. The inclusion and contained relationships that originally existed between outer and inner structures cannot be intuitively expressed or effectively preserved after the conversion, resulting in the loss of hierarchical inclusion information between structural elements. When processing RNA with multi-layered nested structures, linear string-based processing methods struggle to accurately reconstruct the relationships between structural elements at different levels. Secondly, this method uses a uniform data structure to process all characters, treating outer and inner brackets equally during alignment. However, in actual sequences, a minor difference in an inner structure may receive the same scoring weight as a significant difference in an outer structure, affecting the accuracy of RNA secondary structure identification and localization. Summary of the Invention
[0005] To address the aforementioned problems, this invention provides a method, system, computer device, and medium for constructing an RNA secondary structure tree.
[0006] To achieve the above objectives, the present invention provides a method for constructing an RNA secondary structure tree, comprising: Obtain the dotted bracket representation sequence of the RNA secondary structure to be processed; the dotted bracket representation sequence consists of characters with position numbers, including left brackets, dots, and right brackets; the dots do not participate in base pairing, and are used to characterize the stem region and multi-branched loop for constructing the tree structure according to their positions.
[0007] A stack structure is used to traverse the dotted bracket sequence character by character. The traversal process includes: when a left bracket is read, it is pushed onto the stack; when a right bracket is read, the left bracket stored at the top of the stack is popped and paired with the current right bracket; the successfully paired left and right brackets determine the base pairing region; the paired base region determines the interval position of each stem region; based on the interval position of each stem region, the continuously distributed dotted character intervals between two adjacent stem regions are identified, and each character in each continuously distributed dotted character interval is marked as a multi-branch node D.
[0008] Determine the structural nesting and inclusion relationship between each multi-branch node D, select the outermost multi-branch ring structure in the structural nesting and inclusion relationship as the global root node of the tree structure, and the remaining stem regions containing multi-branch rings as the intermediate parent nodes of the tree structure, and label them as D; determine the structural hierarchy relationship between each stem region, and define the smallest stem region in the structural hierarchy relationship that does not contain multi-branch nodes D as the stem node S; use each stem node S, stem region, and hairpin ring as the child nodes of the tree structure.
[0009] Based on the global root node, intermediate parent node, and child node, a tree structure diagram is constructed that retains the original topology and hierarchical features of the RNA secondary structure.
[0010] Preferably, the method further includes clustering the RNA secondary structure bracket representation sequences based on the tree structure diagram, specifically including: extracting the topological hierarchy, node distribution, and structural association features of the tree structure diagram; quantifying the structural similarity between each RNA secondary structure bracket representation sequence by comparing the topological hierarchy, node distribution, and structural association relationships between nodes of different tree structure diagrams; and classifying RNA secondary structure bracket representation sequences whose structural similarity meets preset conditions into the same structural cluster, thereby completing the clustering of multiple RNA secondary structure bracket representation sequences.
[0011] Preferably, the method further includes classifying RNA secondary structure dotted bracket sequences based on the tree structure diagram, specifically including: obtaining classification labels for each RNA secondary structure based on clustering results; constructing a training sample set from the tree structure features with classification labels, wherein the tree structure features include topological hierarchy, node distribution, and structural association features; training a classification model based on the training sample set to obtain a structural classification model; and completing the classification of the RNA secondary structure dotted bracket sequences to be tested based on the structural classification model.
[0012] Preferably, the method further includes repairing the defective RNA secondary structure using the tree structure diagram, specifically including: constructing a first tree structure diagram of the defective RNA secondary structure; determining the classification category of the defective RNA secondary structure and obtaining a standard tree structure diagram of the classification category as a second tree structure diagram; comparing the nodes of the first tree structure diagram and the second tree structure diagram to find the stem region nodes missing in the first tree structure diagram relative to the second tree structure diagram; determining the position interval to be repaired in the defective RNA secondary structure based on the relative position of the missing stem region nodes in the second tree structure diagram; generating new base pairs within the position interval to be repaired to form a completed stem region node, thus completing the repair.
[0013] Preferably, the multi-branched loop is used to mark the multi-branched node D; the method for identifying the continuously distributed dot character interval between two adjacent stem regions is as follows: when traversing the dotted bracket representation sequence and encountering a right bracket and its next character is a left bracket, detect the continuous dot character interval between the right bracket and the left bracket, and mark each character in the continuous dot character interval as the multi-branched node D; if there is no dot character between the right bracket and the left bracket, then no multi-branched node D is generated.
[0014] Preferably, the clustering process is unsupervised clustering, which does not require pre-setting classification labels. It relies on the topological hierarchy, node distribution and structural association features of the tree structure itself to complete the automatic clustering of RNA secondary structures.
[0015] Preferably, the step of grouping RNA secondary structure dotted bracket sequences that meet the preset structural similarity conditions into the same structural cluster to complete the clustering process of multiple RNA secondary structure dotted bracket sequences specifically includes: performing a bottom-up hierarchical comparison of two tree structure diagrams; when comparing to the second-level nodes, calculating the proportion of the number of identical nodes to the total number of substructure nodes; if the proportion exceeds a preset value, then determining that the RNA secondary structures corresponding to the two tree structure diagrams meet the clustering conditions and will be grouped into the same structural cluster; wherein, the bottom-up hierarchical comparison process also includes a node merging step; if the nodes compared in the current layer are not the same, the current node is replaced by the intermediate parent node of the current node, and the comparison continues with other nodes in the same layer.
[0016] The present invention also provides an RNA secondary structure tree construction system, comprising: The data acquisition module is used to acquire the dotted bracket representation sequence of the RNA secondary structure to be processed; the dotted bracket representation sequence consists of characters with position numbers, including left brackets, dots, and right brackets; the dots do not participate in base pairing, and according to their positions, they respectively represent the stem region and multi-branched loop used for tree structure construction.
[0017] The pairing module is used to traverse the dotted bracket sequence character by character using a stack structure. The traversal process includes: when a left bracket is read, it is pushed onto the stack; when a right bracket is read, the left bracket stored at the top of the stack is popped and paired with the current right bracket; the successfully paired left and right brackets determine the base pairing region; the paired base region determines the interval position of each stem region; based on the interval position of each stem region, the continuously distributed dotted character intervals between two adjacent stem regions are identified, and each character in each continuously distributed dotted character interval is marked as a multi-branch node D.
[0018] The segmentation module is used to determine the structural nesting and inclusion relationship between each multi-branch node D. The outermost multi-branch ring structure in the structural nesting and inclusion relationship is selected as the global root node of the tree structure, and the remaining stem regions containing multi-branch rings are used as the intermediate parent nodes of the tree structure and marked as D. The structural hierarchy relationship between each stem region is determined, and the smallest stem region in the structural hierarchy relationship that does not contain multi-branch nodes D is defined as the stem node S. Each stem node S, stem region, and hairpin ring are used as the child nodes of the tree structure.
[0019] The construction module is used to construct a tree structure diagram that retains the original topology and hierarchical features of the RNA secondary structure based on the global root node, intermediate parent node, and child nodes.
[0020] The present invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement any of the steps in the RNA secondary structure tree construction method.
[0021] The present invention also provides a computer-readable storage medium storing a computer program that, when loaded by a processor, can execute any of the steps in the RNA secondary structure tree construction method.
[0022] The RNA secondary structure tree construction method provided by this invention has the following beneficial effects: This invention solves the problem of existing technologies being unable to identify key pivot nodes by identifying continuous dot characters as multi-branch node D; it solves the problem of not being able to preserve hierarchical inclusion relationships by determining the nesting relationship between D and selecting the outermost D as the root node; it solves the problem of difficulty in restoring the association relationship in multi-layered nested structures by defining the innermost stem region without D as the stem node S; and it solves the problem of treating inner and outer layer differences equally by constructing a unified tree structure diagram. In summary, this invention converts dotted bracket linear strings into a tree structure that preserves hierarchical features, achieving a standardized and hierarchical expression of RNA secondary structure, laying a solid data foundation for subsequent accurate alignment analysis. Attached Figure Description
[0023] To more clearly illustrate the embodiments and design schemes of the present invention, the accompanying drawings required for this embodiment will be briefly described below. The drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0024] Figure 1 This is a flowchart illustrating a method for constructing a secondary RNA structure tree according to an embodiment of the present invention. Figure 2 This is a schematic diagram of the distribution of the RNAStralign clustering dataset according to an embodiment of the present invention; Figure 3 This describes the sequence conversion process in an embodiment of the present invention; Figure 4 This describes the process of constructing the tree structure according to an embodiment of the present invention. Figure 4 A contains the RNA sequence, the dotted bracket structure, and the simplified structure. Figure 4 B is a secondary structure of RNA. Figure 4 C represents the tree structure construction process; Figure 5 These are two comparison structures from an embodiment of the present invention. Figure 5 A represents two RNA sequences and a dotted bracket structure. Figure 5 The B is a simplification of a two-dot bracket structure. Figure 5 C is a visualization model of two RNA structures. Figure 5 D and Figure 5 E represents the tree comparison process and the node merging process. Figure 5 E represents the process of extracting common child nodes; Figure 6 The number and proportion of each of the five most numerous categories in the 16S rRNA family in this embodiment of the invention; Figure 7 The number and proportion of each of the five most numerous categories in the 16S rRNA family in this embodiment of the invention; Figure 8 The specific features of the RNA secondary structure in each of the five groups with the largest number of 16SrRNA families in this embodiment of the invention; Figure 9 The number and proportion of each of the three largest categories in the RNaseP family in this embodiment of the invention; Figure 10 The specific features of the RNA secondary structure in each of the three groups with the largest number of RNaseP family members in this embodiment of the invention; Figure 11The number and proportion of each of the five largest categories in the SRP family of this invention; Figure 12 The specific features of the RNA secondary structure in each of the five groups with the largest number of SRP family members in this embodiment of the invention; Figure 13 The number and proportion of each category in the two largest categories of the tmRNA family in this embodiment of the invention; Figure 14 The specific features of the secondary structure of each RNA group in the two groups with the largest number of tmRNA families in this embodiment of the invention; Figure 15 The specific structures of 5S rRNA and tRNA in this embodiment of the invention are shown below; Figure 16 These are the five most different categories within the group_I_intron family in this embodiment of the invention; Figure 17 This is the data for each family in the test set of this embodiment of the invention; Figure 18 This refers to the classification data for each family in this embodiment of the invention; Figure 19 The specific comparison process is as follows, according to an embodiment of the present invention; Figure 20 The classification results and specific details of this invention embodiment are as follows; Figure 21 For the RNA structure correction in this embodiment of the invention, Figure 21 In A, the actual structure of RNA is shown. Figure 21 B represents the structure predicted by the REDfold software. Figure 21 C represents the modified RNA structure. Detailed Implementation
[0025] To enable those skilled in the art to better understand and implement the technical solutions of the present invention, the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments. The following embodiments are only used to more clearly illustrate the technical solutions of the present invention and should not be construed as limiting the scope of protection of the present invention.
[0026] This invention provides a method for constructing a secondary structure tree of RNA, specifically as follows: Figure 1 As shown, it includes the following steps: S1. Dataset Selection and Processing The dataset used in this embodiment of the invention is RNAStralign, containing 37,149 sequences. This dataset includes data from eight families: 5S rRNA, 16S rRNA, group I intron, RNase P, SRP, telomerase, tmRNA, and tRNA. This embodiment of the invention uses the same data processing method as MXfold2, removing redundant sequences and sequences longer than 600 bytes, selecting 20,923 sequences, removing false knots, and then performing clustering. Figure 2 The distribution of the clustered dataset is shown in Table 1. Due to the limited data for the telomerase family, it was not included in this study. Table 1 shows the distribution of the RNAStralign dataset. Most families have sequence lengths less than 600 bytes. Since sequences longer than 600 bytes are mainly concentrated in the 16S rRNA family, sequences longer than 600 bytes were removed.
[0027] Table 1. Distribution of the RNAStralign dataset S2, RNA secondary structure transition S201, Sequence Transformation Using a stack, multiple branching loops in the structure are represented by 'D'. For example... Figure 3 As shown, the specific procedure is as follows: Iterate through each element in the RNA secondary structure represented by dotted brackets, pushing '(' onto a stack and recording the current position of each '('). When ')' is encountered, pop one '(' from the stack and record the positions of '(' and ')'. When '(' is encountered again and the previously encountered element is ')', move the last recorded '(' position to the left and set '.' to 'D' until an element other than '.' is encountered. For the last recorded ')', move it to the right and process it in the same way. If there is no '.' in between, no marking is done, but the positions of ')' and '(' need to be recorded as the positions of the multi-branch loop. Repeat the above process until the sequence traversal is complete.
[0028] S202, Construction of Tree Structure like Figure 4As shown, the RNA secondary structure is segmented into each stem region according to the intervals of multiple branch loops. Each substructure of the sequence-transformed RNA secondary structure, except for the multiple branch loops, is converted into a multiple branch loop-stem region structure using the same sequence transformation method. Within each substructure, each sub-stem region within the current stem region is segmented based on the labeled and recorded multiple branch loops and designated as a child node. If the current substructure contains multiple branch loops, it is marked as 'D'; otherwise, it is marked as 'S'. The start and end positions of the segmented stem regions, as well as the stem region length, are recorded, and the start and end positions of each sub-stem region within the current stem region are marked as 'E'. If a segmented sub-stem region contains multiple branch loops, this node is 'D'; otherwise, it is 'S'. The 'D' nodes among the child nodes are then used as parent nodes, and the above steps are repeated until all child nodes become 'S'.
[0029] S3, clustering of RNA secondary structure The clustering process of this invention is unsupervised clustering, which does not require pre-setting classification labels. Secondary RNA structures of the same RNA family are clustered. The first unclustered RNA secondary structure is selected and compared sequentially with the remaining structures according to the constructed tree structure. During the comparison, child nodes of the same parent node are compared as a whole. Equation (1) represents the basic condition satisfied during node comparison, Equation (2) represents the position difference of the overall compared nodes, and Equation (3) represents the current position difference of the remaining compared nodes excluding the first compared node. Here, diff is the position difference of the overall compared nodes, N_diff is the current position difference of the remaining compared nodes excluding the first compared node, dis1 and dis2 are the starting positions of the first compared node, N_dis1 and N_dis2 are the starting positions of the remaining compared nodes, and length1 and length2 are the lengths of the two compared nodes.
[0030] (1) (2) (3) Figure 5 A, Figure 5 B and 5C in the figure are the two sequence structures being compared. Figure 5 D and Figure 5E represents the specific process of merging the secondary structure nodes of two sequences. During the comparison, the comparison is performed layer by layer from bottom to top according to the hierarchical structure of the tree. When comparing the bottom-level nodes, if the structures being compared are different or do not meet the comparison conditions, the sequence is skipped and compared with the next sequence. If the bottom-level nodes are the same and meet the basic conditions for comparison, the nodes of the upper layer are compared. If the nodes of the upper layer are the same, they continue to move up together and continue to compare until the second layer nodes are traversed. If the nodes of the upper layer are different, the node merging operation is performed. Equation (4) is the specific operation of node merging, that is, the middle parent node of the current node replaces the current node and is combined with other nodes of the current layer for comparison. Among them, s1 and s2 are the two layers of nodes being compared, parent refers to the parent node of the current layer node, and layer1 and layer2 represent the layer numbers corresponding to the two layers of nodes being compared.
[0031] (4) When both structural alignment trees have reached the second level, if the number of identical nodes accounts for more than 50% of the total number of substructures, then clustering is considered possible. Figure 5 E shows the process of extracting identical nodes.
[0032] S301 Clustering Effect Analysis Figure 6 This shows the number of clusters each family belongs to after clustering the seven families. Figure 8 It can be seen that the group_I_intron family has the most clusters, indicating that the family structure is relatively complex. This may be related to the fact that some structures within it have significantly different lengths, but the overall structure is the same (this clustering method has a length limit, as shown in formula (1)). The 16S rRNA, RNaseP, SRP, and tmRNA families have relatively few clusters, indicating that the RNA secondary structures in these four families have a large number of identical substructures, and the length differences are not significant when the structures are the same. The 5S rRNA and tRNA families have the fewest clusters, indicating that the sequence lengths of these two families are relatively fixed and the structures have fixed templates, enabling them to form specific secondary structures. This result can be used to correct the structure prediction of RNA secondary structures by other algorithms and can serve as a reference for RNA family classification and functional prediction.
[0033] This invention selects several categories with the largest number of families and significant structural differences from the clustering results for analysis, and statistically analyzes the proportion of each large category in each family and the approximate characteristics of RNA secondary structures in each category. When statistically analyzing the approximate characteristics of RNA secondary structures in each category, this invention selects the RNA secondary structures with the same tree-like structure and the largest number in each category as templates, and summarizes the structural characteristics of this category based on these templates. In the subsequent structural diagrams, black parts represent inner loops or convex loops, blue parts represent hairpin loops, red parts represent multi-branched loops or free bases, green parts represent stem regions, purple parts represent more than 15 consecutive unpaired bases, and unlabeled parts represent the current structure.
[0034] Figure 7 This data represents the number and proportion of the five most numerous and structurally diverse classes of 16S rRNA. According to the clustering results in this embodiment, the top five most numerous classes account for 71% of all data, indicating that 16S rRNA predominates on these five structures. Figure 8 To illustrate the specific characteristics of the secondary structure of each RNA group, in Category 1, for some RNAs, the stem region at position 1 may be absent. The free bases at position 3 may generate more stem regions without multi-branched loops due to RNA length. The multi-branched loop at position 2 is present in all RNAs in Category 1. For some highly complex RNAs, the free bases on both sides may pair and form a multi-branched loop in the stem region on the right, generating more stem regions within this loop. In Category 2, a particular stem region marked in the diagram may be absent for different RNAs, but almost all RNAs in Category 2 contain the stem region with the multi-branched loop shown in the diagram. Influenced by different RNA sequence lengths, more stem regions may be generated at position 4. In Category 3, both stem regions at position 1 are generally present, and the free bases on both sides of position 1 may further form multi-branched loops, generating a stem region on the left. Due to variations in sequence length, the number of stem regions at position 2 may decrease or increase accordingly. In category 4, due to different RNA sequence lengths, the number of stem regions at positions 1 and 3 may increase or decrease. The first layer of multi-branched loops at position 2 may open and transform into free bases due to varying degrees of complexity in the RNA secondary structure. In category 5, the structures are predominantly those shown in the diagram.
[0035] According to the clustering results, this invention found that the RNaseP family mainly falls into three categories. Figure 9 The data shows the number and proportion of the three categories. These three categories account for 76% of the total number, indicating that the RNaseP family is mainly composed of these three structures. Figure 10To illustrate the specific characteristics of each group of RNA secondary structures, in category 1, position 1 may generate a stem region; in position 2, the two stem regions may further develop into multi-branched loops on either side; and in position 3, multiple stem regions may arise due to differences in RNA sequence length. In category 2, the multi-branched loop at position 1 may open and form free bases. Similar to category 2, in category 3, the multi-branched loop at position 1 will also open and form free bases.
[0036] Based on the clustering results, this invention selected the five categories with the largest number of clusters and the most significant structural differences. Figure 11 The chart shows the number of elements in the five most numerous categories and the proportion of each category. These five categories account for 79% of the total, indicating that the SRP family is mostly based on these four structures. Figure 12 The diagram illustrates the specific characteristics of each RNA secondary structure. Categories 1, 2, and 4 are simply structures shown in the figure. It's worth noting that Category 2 may be affected by length, but the general structure remains as shown. Category 5 is the structure obtained by removing the stem region at position 1 in Category 1; it is not shown in the figure. In Category 3, position 1 may produce a stem region containing multiple branching loops, and position 2 may form multiple branching loops.
[0037] According to the clustering results, this invention found that the tmRNA family mostly falls into two categories. Figure 13 Specifically, these two categories account for 65% of the total. This percentage is lower compared to the first three families. Figure 14 Regarding the specific structural characteristics of these two categories, this embodiment of the invention observes the RNA secondary structure of other groups and finds that the structures of other categories are mostly similar to those of category 1. The difference is that at position 1, some stem regions may be added or removed, and a multi-branched ring may be formed.
[0038] 5S rRNA and tRNA have relatively distinct structural features. Figure 15 The images show the specific structures of 5S rRNA and tRNA. 5S rRNA has a "Y"-shaped structure, while tRNA has a "cloverleaf" structure. However, in tRNA, a small portion of the structure at position 1 still forms a stem region.
[0039] group_I_intron: According to the clustering results in this embodiment of the invention, the group_I_intron family has a large number of categories, the data in each category is relatively uniform, and the structure is greatly affected by the length. Figure 16For this embodiment of the invention, five structures with significant differences and greatly affected by length were selected, and features were extracted in conjunction with other categories of RNA secondary structures. In category 1, position 1 may generate a stem region; position 2 may generate a multi-branched loop with surrounding free bases and the stem region; position 3 may further generate a stem region; position 4 may have multiple stem regions around it, and a multi-branched loop may be generated based on the existing stem regions. In category 2, position 1 may generate a stem region due to sequence length; position 2 may generate multiple stem regions, and the multi-branched loop in the stem region at position 2 may break to form free bases. In category 3, position 1 may generate a stem region, and position 2 may generate a stem region containing a multi-branched loop. In category 4, the number of stem regions at position 1 may decrease, and the multi-branched loop may break. The features of category 5 can be referred to those of category 1.
[0040] S4. RNA secondary structure classification based on tree-structure alignment S401. Distribution of the dataset In this embodiment of the invention, the ArchiveII dataset is used as the test set and the sequences used for clustering are removed. Since the 5S rRNA and tRNA features are relatively obvious, they are not used as data for classification. After these data are removed, 977 data entries remain, and the pseudo-knots in the remaining data are removed. Figure 17 This describes the distribution of the remaining data in the ArchiveII dataset. In this embodiment of the invention, based on the clustering results for each family, classes with fewer than 4 occurrences in each family are removed, and the most frequently occurring structure in each of the remaining classes is selected to construct the classification dataset for that family. Figure 18 The number of categories for each family.
[0041] S402, RNA secondary structure classification process.
[0042] The test sequence is compared sequentially with each classification sequence, following the procedure during the comparison. Figure 4 The steps transform the structure of the two sequences into a tree structure. To ensure a high degree of similarity between the structure of the test sequence and the classification sequence, this embodiment of the invention compares the sequences layer by layer from top to bottom according to the constructed tree structure. Figure 19 For details on the comparison process and specific comparison structure, please refer to [reference needed]. Figure 5This embodiment of the invention measures the similarity of structures by setting a comparison score. During the comparison, this embodiment of the invention takes the same part of each layer of nodes for position comparison. When performing position comparison, the position comparison process in the clustering process can be referred to. Unlike the node comparison process in the clustering process, this embodiment of the invention sets different restrictions on the position difference (diff) of the overall comparison nodes, the current position difference (N_diff) of the comparison nodes except the first comparison node, and the stem length difference (length1-length2). Equation (5) is the specific restriction. This embodiment of the invention takes the smaller proportion as the score according to the proportion of the successfully compared common nodes in their respective layers and performs layer deletion operation according to the score. In addition, if the node structures of the two compared layers are completely identical, an additional 0.5 points are added. Equation (6) is the specific process of layer deletion. Where del represents the deletion operation, score represents the comparison score, layer1 is the layer of the test tree, and layer2 is the layer of the feature classification tree.
[0043] (5) (6) In this embodiment of the invention, the alignment scores of each layer are summed to obtain the alignment score of the current test tree. Based on the alignment scores between the current test sequence and each classification sequence, the family corresponding to the classification sequence with the highest alignment score is selected as the family of the current test sequence. If there is more than one highest alignment score, the family corresponding to the classification sequence with the fewest alignments is selected as the family for the current sequencing.
[0044] In addition to the comparison-based classification method described above, this invention also provides an implementation method for training a classification model based on machine learning. The specific steps are as follows: Based on the clustering results, each cluster is treated as an independent classification label. The most frequently occurring tree structure in each cluster is selected as the standard template for that category, and each standard template and its corresponding classification label constitute the initial training sample set. For each training sample, the following features of the tree structure graph are extracted to form a feature vector: topological hierarchy features: maximum tree depth, number of nodes per level; node distribution features: number and distribution ratio of D and S nodes, length distribution of each stem region; structural association features: parent-child relationships between nodes, number and order of sibling child nodes. The extracted feature vector is used as input, and the corresponding classification label is used as output, and a machine learning algorithm is employed for training. Optional algorithms include, but are not limited to: Decision Tree, Support Vector Machine (SVM), Random Forest, or Gradient Boosting Tree. After training, a structural classification model is obtained. For the RNA secondary structure sequence represented by brackets to be tested, it is first converted into a tree structure diagram according to the method described in S2, and the same structural feature vector is extracted; then the feature vector is input into the trained structural classification model, and the model outputs the corresponding classification label, thereby completing the classification processing of the sequence to be tested.
[0045] S403. Classification Results and Analysis Figure 20 To illustrate the classification results and specific situations, since there is relatively little data for unknown categories, no further analysis is performed on the data for unknown categories. Table 2 shows the confusion matrix of the classification results, including the specific misclassification situation for each family. To verify the classification of each family, this embodiment of the invention sets four indicators for Table 2: "TP", "FP", "TN", and "FN". Table 3 shows the specific meaning of each indicator. Based on the meaning of each indicator in Table 3 and the specific misclassification situation in Table 2, this embodiment of the invention calculates the specific values of these four indicators for each family, as shown in Table 4.
[0046] Table 2. Confusion matrix of classification results Table 3. Specific meanings of the classification indicators Table 4. Details of each family classification indicator To examine the performance of the algorithm in each family, the present invention sets three metrics for evaluation: "Precision" (the ratio of correctly classified positive samples to the total number of samples classified as positive), "Recall" (the ratio of correctly classified positive samples to the total number of positive samples), and "F1" (the harmonic mean of the two). Equations (7)-(9) are the specific calculation methods for each metric. Table 5 shows the performance metrics of the algorithm in each family. The algorithm in the present invention performs worse on the 16S rRNA family compared to other families, indicating lower accuracy in classifying the 16S rRNA family and a higher probability of misclassifying other families as 16S rRNA. However, the algorithm in the present invention performs better in terms of accuracy in classifying other families.
[0047] (7) (8) (9) Table 5 Performance metrics for each family To examine the performance of the algorithm in all families, the embodiments of the present invention performed a micro-average evaluation by setting a " (Accuracy performance across all families), (Recall performance across all families), The algorithm is evaluated using three metrics: (10) and (12) the harmonic mean across all families. Equations (10)-(12) are the specific calculation methods, where N is the total number of categories and i is the specific family (similar below). The first row in Table 6 shows the overall performance of the Tree_RNA-Align algorithm in all families in this embodiment of the invention, and the overall effect is good.
[0048] (10) (11) (12) To prevent errors caused by uneven data distribution among families, this embodiment of the invention performs macro-average evaluation by setting " (The average accuracy of all families) (The average recall rate across all families) The evaluation is based on three indicators: (the average of the harmonic mean of all families). Equations (13)-(15) are the specific calculation methods. The second row in Table 6 is the macro-average effect of the Tree_RNA-Align algorithm in the embodiment of the present invention. Due to the low classification accuracy of the 16SrRNA family and the easy misclassification of other families into 16SrRNA, the macro-average effect is slightly lower, but the overall effect is better.
[0049] (13) (14) (15) To prevent the impact of too much or too little data from a particular family on the evaluation results, this embodiment of the invention employs a weighted evaluation. This is achieved by weighting each indicator and averaging the results to reduce the influence of the amount of data from each family on the evaluation outcome. This embodiment of the invention sets up a " (The sum of weighted precision for each family) (The sum of the weighted recall rates of each family), The algorithm is evaluated using three metrics: ("the sum of the weighted harmonic means of each family") and ("the sum of the weighted harmonic means of each family"). Equations (16)-(18) illustrate the specific calculation process, where AllCount is the sum of data for all families. This represents the amount of data for the i-th family. The third row of Table 6 shows the weighted average effect of the Tree_RNA-Align algorithm from this embodiment of the invention. The overall effect is good, indicating that the algorithm of this embodiment is less affected by families with too much or too little data. It is particularly noteworthy that the algorithm of this embodiment runs very fast, with a time complexity of O(log(n)) (where n is the sequence length). Other algorithms, such as bpRNA-Align, have less test data and run slower, making comparison impossible.
[0050] (16) (17) (18) Table 6 Average Results S5. Stem region repair based on RNA secondary structure classification To demonstrate the practical application of the algorithm of this invention, this invention uses REDfold software to predict the RNA secondary structure of the sequence numbered 16s_C.reinhardtii.chloro_domain1 in the ArchiveII dataset and performs stem region repair based on the prediction results. Figure 21A represents the true structure. Figure 21 B represents the predicted RNA secondary structure. In this embodiment of the invention, the RNA secondary structures predicted by REDfold software are converted into tree structures, and appropriate categories are selected based on RNA secondary structure classification using tree structure alignment. Then, the RNA secondary structures predicted by REDfold are partially repaired according to the selected categories. Figure 8 As shown, in this embodiment of the invention, the structure is determined to be similar to category 2 in 16S rRNA based on the classification results. This embodiment of the invention constructs a tree structure to compare the predicted structure and the classified structure. Following the alignment method in RNA secondary structure classification based on tree structure comparison, each stem region in the predicted structure is compared with each stem region in the classified structure. If a stem region in the predicted structure does not appear in the classified structure, a stem region is generated based on its relative position in the classified structure, and surrounding base pairings are removed. Figure 21 In B, in this embodiment of the invention, position 1 is determined according to... Figure 8 At the corresponding position in category 2, the bases of the multi-branched ring are further paired, and the stem region at position 2 is regenerated according to the corresponding stem region position in category 2. Figure 21 C represents the modified RNA secondary structure. The modified RNA structure is closer to the true structure than the unmodified structure, demonstrating the effectiveness of the method. This method can be used to further refine RNA structure predictions for other algorithms and assist in RNA structure prediction and family classification.
[0051] This invention develops a method for RNA secondary structure clustering and classification based on tree-structure alignment, clustering data from seven families: 16S rRNA, group I intron, RNase P, SRP, tmRNA, 5S rRNA, and tRNA. Before clustering, multiple branch loops within each RNA secondary structure are marked, and then each stem region is segmented according to the intervals of these multiple branch loops to construct a tree structure. During clustering, this invention aligns two alignment structures hierarchically from bottom to top within the tree structure, clustering RNA sequences that meet the criteria into one class. Based on the clustering results, this invention displays the possible structures of each family and selects suitable feature structures to construct a classification training sample set. During classification, this invention aligns test sequences and feature sequences layer by layer from top to bottom using a constructed tree structure, setting appropriate scores to accurately and quickly classify RNA secondary structures.
[0052] The Tree_RNA-Align algorithm of this embodiment of the invention showed poor performance in classifying 16S rRNA, but performed well in classifying the group_I_intron, RNaseP, SRP, and tmRNA families. To further evaluate the algorithm, micro-average, macro-average, and weighted average were performed. The results all showed that the algorithm has high accuracy and is very suitable for classifying RNA secondary structures. Subsequent practical applications of the algorithm in RNA secondary structure repair further demonstrated its effectiveness, providing technical support and new ideas for RNA secondary structure prediction and family classification.
[0053] This invention utilizes a classification model built upon tree-like structural features, enabling automated and high-precision classification of RNA secondary structures with excellent generalization ability. It is worth noting that the Tree_RNA-Align algorithm in this embodiment aligns the stem region as a whole, thus it is not suitable for precise structural alignment. The clustering algorithm in this embodiment performs best when clustering within known families. For clustering RNA sequences from unknown families, a more categorized clustering algorithm is recommended. Furthermore, since the clustering algorithm in this embodiment executes sequentially on the dataset, the number of clusters may vary depending on the order of the datasets. However, after multiple tests, this embodiment has found that the clustering results are almost identical.
[0054] Based on the same inventive concept, this invention also provides an RNA secondary structure tree construction system, comprising: The data acquisition module is used to acquire the dotted bracket representation sequence of the RNA secondary structure to be processed; the dotted bracket representation sequence consists of characters with position numbers, including left brackets, dots, and right brackets; the dots do not participate in base pairing, and according to their positions, they respectively represent the stem region and multi-branched loop used for tree structure construction.
[0055] The pairing module is used to traverse the dotted bracket sequence character by character using a stack structure. The traversal process includes: when a left bracket is read, it is pushed onto the stack; when a right bracket is read, the left bracket stored at the top of the stack is popped and paired with the current right bracket; the successfully paired left and right brackets determine the base pairing region; the paired base region determines the interval position of each stem region; based on the interval position of each stem region, the continuously distributed dotted character intervals between two adjacent stem regions are identified, and each character in each continuously distributed dotted character interval is marked as a multi-branch node D.
[0056] The segmentation module is used to determine the structural nesting and inclusion relationship between each multi-branch node D. The outermost multi-branch ring structure in the structural nesting and inclusion relationship is selected as the global root node of the tree structure, and the remaining stem regions containing multi-branch rings are used as the intermediate parent nodes of the tree structure and marked as D. The structural hierarchy relationship between each stem region is determined, and the smallest stem region in the structural hierarchy relationship that does not contain multi-branch nodes D is defined as the stem node S. Each stem node S, stem region, and hairpin ring are used as the child nodes of the tree structure.
[0057] The construction module is used to construct a tree structure diagram that retains the original topology and hierarchical features of the RNA secondary structure based on the global root node, intermediate parent node, and child nodes.
[0058] This invention also provides a computer device. At the hardware level, the computer device includes a processor, an internal bus, a network interface, memory, and non-volatile storage, and may also include other hardware required for business operations. The processor reads the corresponding computer program from the non-volatile storage into the memory and then runs it to implement the RNA secondary structure tree construction method provided above.
[0059] The present invention also provides a computer-readable storage medium storing a computer program that can be used to execute the RNA secondary structure tree construction method provided above.
[0060] Specific limitations regarding the computational system for the RNA two-dimensional tree structure construction method can be found in the limitations described above, and will not be repeated here. Each module in the aforementioned RNA two-dimensional tree structure construction system can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the computer device's memory as software, so that the processor can call and execute the corresponding operations of each module.
[0061] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as the combination of these technical features does not contradict each other, it should be considered within the scope of this specification. Furthermore, the above embodiments only illustrate several implementation methods of this application, and their descriptions are relatively specific and detailed, but they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make several modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A method for constructing a secondary structure tree of RNA, characterized in that, Includes the following steps: Obtain the dotted bracket representation sequence of the secondary structure of the RNA to be processed; the dotted bracket representation sequence consists of characters with position numbers, including left brackets, dots, and right brackets; the dots do not participate in base pairing, and are used to characterize the stem region and multi-branched loop for constructing the tree structure according to their positions; A stack structure is used to traverse the dotted bracket sequence character by character. The traversal process includes: when a left bracket is read, it is pushed onto the stack; when a right bracket is read, the left bracket stored at the top of the stack is popped and paired with the current right bracket; the successfully paired left and right brackets determine the base pairing region; the paired base region determines the interval position of each stem region; based on the interval position of each stem region, the continuously distributed dotted character intervals between two adjacent stem regions are identified, and each character in each continuously distributed dotted character interval is marked as a multi-branch node D; Determine the structural nesting and inclusion relationship between each multi-branch node D, select the outermost multi-branch ring structure in the structural nesting and inclusion relationship as the global root node of the tree structure, and the remaining stem regions containing multi-branch rings as the intermediate parent nodes of the tree structure, and label them as D; determine the structural hierarchy relationship between each stem region, and define the smallest stem region in the structural hierarchy relationship that does not contain multi-branch nodes D as the stem node S; use each stem node S, stem region, and hairpin ring as the child nodes of the tree structure; Based on the global root node, intermediate parent node, and child node, a tree structure diagram is constructed that retains the original topology and hierarchical features of the RNA secondary structure.
2. The method for constructing an RNA secondary structure tree according to claim 1, characterized in that, The method also includes clustering RNA secondary structure bracket representation sequences based on the tree structure diagram, specifically including: extracting the topological hierarchy, node distribution, and structural association features of the tree structure diagram; quantifying the structural similarity between RNA secondary structure bracket representation sequences by comparing the topological hierarchy, node distribution, and structural association relationships between nodes of different tree structure diagrams; and classifying RNA secondary structure bracket representation sequences with structural similarity meeting preset conditions into the same structural cluster to complete the clustering of multiple RNA secondary structure bracket representation sequences.
3. The method for constructing an RNA secondary structure tree according to claim 2, characterized in that, The method also includes classifying RNA secondary structure sequences represented by brackets based on the tree structure diagram. Specifically, this includes: obtaining classification labels for each RNA secondary structure based on clustering results; constructing a training sample set from the tree structure features with classification labels, wherein the tree structure features include topological hierarchy, node distribution, and structural association features; training a classification model based on the training sample set to obtain a structural classification model; and completing the classification of the RNA secondary structure sequences represented by brackets based on the structural classification model.
4. The method for constructing an RNA secondary structure tree according to claim 1, characterized in that, The method also includes repairing defective RNA secondary structures using the tree structure diagram, specifically including: constructing a first tree structure diagram of the defective RNA secondary structure; determining the classification category of the defective RNA secondary structure and obtaining a standard tree structure diagram of the classification category as a second tree structure diagram; comparing the nodes of the first tree structure diagram and the second tree structure diagram to find the stem nodes missing in the first tree structure diagram relative to the second tree structure diagram; determining the position interval to be repaired in the defective RNA secondary structure based on the relative position of the missing stem nodes in the second tree structure diagram; generating new base pairs within the position interval to be repaired to form a completed stem node, thus completing the repair.
5. The method for constructing an RNA secondary structure tree according to claim 1, characterized in that, The multi-branched loop is used to mark the multi-branched node D; the method for identifying the continuously distributed dot character interval between two adjacent stem regions is as follows: when traversing the dotted parenthesis representation sequence and encountering a right parenthesis and its next character is a left parenthesis, detect the continuous dot character interval between the right parenthesis and the left parenthesis, and mark each character in the continuous dot character interval as the multi-branched node D; if there is no dot character between the right parenthesis and the left parenthesis, then no multi-branched node D is generated.
6. The method for constructing an RNA secondary structure tree according to claim 2, characterized in that, The clustering process is unsupervised clustering, which does not require pre-setting classification labels. It relies on the topological hierarchy, node distribution and structural association features of the tree structure itself to complete the automatic clustering of RNA secondary structures.
7. The method for constructing an RNA secondary structure tree according to claim 2, characterized in that, The process of grouping RNA secondary structure sequences represented by brackets that meet preset structural similarity conditions into the same structural cluster, and completing the clustering process of multiple RNA secondary structure sequences represented by brackets, specifically includes: performing a bottom-up hierarchical comparison of two tree structure diagrams; when comparing to the second-level nodes, calculating the proportion of the number of identical nodes to the total number of substructure nodes; if the proportion exceeds a preset value, then the RNA secondary structures corresponding to the two tree structure diagrams are determined to meet the clustering conditions and will be grouped into the same structural cluster; wherein, the bottom-up hierarchical comparison process also includes a node merging step; if the nodes compared in the current layer are not the same, the current node is replaced by the intermediate parent node of the current node, and the comparison continues with other nodes in the same layer.
8. A system for constructing a secondary structure tree of RNA, characterized in that, include: The data acquisition module is used to acquire the dotted bracket representation sequence of the RNA secondary structure to be processed; the dotted bracket representation sequence consists of characters with position numbers, including left brackets, dots, and right brackets; the dots do not participate in base pairing and, based on their positions, respectively characterize the stem region and multi-branched loop used for constructing the tree structure; The pairing module is used to traverse the dotted bracket sequence character by character using a stack structure. The traversal process includes: when a left bracket is read, it is pushed onto the stack; when a right bracket is read, the left bracket stored at the top of the stack is popped and paired with the current right bracket; the successfully paired left and right brackets determine the base pairing region; the paired base region determines the interval position of each stem region; based on the interval position of each stem region, the continuously distributed dotted character intervals between two adjacent stem regions are identified, and each character in each continuously distributed dotted character interval is marked as a multi-branch node D; The segmentation module is used to determine the structural nesting and inclusion relationship between each multi-branch node D. The outermost multi-branch ring structure in the structural nesting and inclusion relationship is selected as the global root node of the tree structure, and the remaining stem regions containing multi-branch rings are used as the intermediate parent nodes of the tree structure and marked as D. The structural hierarchy relationship between each stem region is determined, and the smallest stem region in the structural hierarchy relationship that does not contain multi-branch nodes D is defined as the stem node S. Each stem node S, stem region, and hairpin ring are used as the child nodes of the tree structure. The construction module is used to construct a tree structure diagram that retains the original topology and hierarchical features of the RNA secondary structure based on the global root node, intermediate parent node, and child nodes.
9. A computer device, comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is loaded by the processor, it is able to perform the steps of the method according to any one of claims 1 to 7.