Methylation prediction method based on structural prior and multi-scale signal decomposition
Patent Information
- Application Number
- CN202610829319.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-10
- Publication Date
- 2026-08-18
- Estimated Expiration
- 2046-06-10
AI Technical Summary
[0005]第一,对中心待测位点相关的距离、方向和结构约束建模不足
本发明在碱基token嵌入的基础上,引入各序列位置到中心待测位点的相对距离嵌入和上下游方向嵌入,并通过可学习权重对三类嵌入进行融合,形成中心感知序列表征。该设计使模型在输入阶段即可获得每个碱基相对于中心位点的位置关系,从而增强对中心邻域序列环境的表达能力。
Smart Images

Figure CN122417145B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of bioinformatics, and in particular to a methylation prediction method based on structural priors and multi-scale signal decomposition. Background Technology
[0002] 5-Methylcytosine (5mC) is an important epigenetic modification of DNA in eukaryotes, closely related to gene expression regulation, chromatin state maintenance, cell differentiation, and disease development. Accurate prediction of 5mC sites in DNA sequences is helpful for analyzing gene regulatory mechanisms and screening disease-related epigenetic markers.
[0003] Currently, 5mC site detection mainly relies on experimental methods such as bisulfite sequencing. While these methods offer high accuracy, they typically suffer from high experimental costs, complex procedures, long processing times, and stringent sample handling requirements, making them unsuitable for large-scale sample and high-throughput rapid analysis. Therefore, developing computational prediction methods based on DNA sequences has practical application value.
[0004] Existing computational methods mainly include sequence modeling methods based on convolutional neural networks, recurrent neural networks, or Transformers. Although these methods can extract local motif features or long-range contextual information to some extent, they still have the following shortcomings in the task of predicting single bases at the center site.
[0005] First, there is insufficient modeling of distance, orientation, and structural constraints related to the central target site. Most methods treat DNA sequences as ordinary one-dimensional character sequences, mainly relying on standard position encoding, relative position encoding, convolution, or self-attention mechanisms to extract features, lacking explicit modeling of distance decay related to the central target base, upstream and downstream directional relationships, and the periodic structural trends of DNA.
[0006] Second, it is difficult to simultaneously achieve single-base localization and local perturbation resistance modeling. 5mC prediction requires attention to fine-grained sequence signals of the central site and its neighborhood, while local sequence features may simultaneously contain effective motif information and weak perturbation noise. Single-scale convolution or ordinary Transformer coding is easily affected by local fluctuations; while excessive smoothing, downsampling or global compression may lose key local details.
[0007] Third, there is a lack of mutual verification and fusion mechanisms among different feature sources around the central site. Existing methods typically integrate different features by splicing, adding, or using a single fusion layer, which makes it difficult to ensure that structure-related information and local signal information interact effectively around the central site to be tested, and also lacks representation consistency constraints for the central neighborhood. Summary of the Invention
[0008] To address the aforementioned issues, this invention provides a methylation prediction method based on structural priors and multi-scale signal decomposition. This method constructs a fixed-length DNA sequence window centered on the base to be tested. First, it fuses base information, center distance information, and upstream / downstream direction information to form a center-aware sequence representation. Then, it extracts structural prior features and local signal features through structural and signal branches, respectively. Next, it uses the center site features as anchors for cross-branch mutual verification and obtains fused features through gating mechanisms and center neighborhood aggregation. During the training phase, a center window consistency constraint is further introduced to improve the coordination of the bi-branch representation within the center neighborhood. Finally, it outputs the 5mC methylation prediction probability of the center site.
[0009] This method can enhance the model's ability to utilize neighborhood information of the central site, reduce the impact of distant irrelevant sequences and local weak perturbations on the prediction results, and improve the stability of central site methylation prediction.
[0010] The methylation prediction method based on structural prior and multi-scale signal decomposition provided by this invention includes the following steps: S1: Obtain the original DNA sequence window, convert the bases of the original DNA sequence window into discrete integer codes, and form a DNA sequence coding matrix; S2: Generate three types of embedding representations based on the DNA sequence coding matrix, perform weighted fusion of the three types of embedding representations to generate a base embedding characterization; normalize the base embedding characterization to generate a multidimensional center-sensing sequence characterization; S3: Construct a DNA structure bias matrix based on the multidimensional center-sensing sequence characterization, and perform multi-scale signal decomposition and branching to generate signal feature representation; S4: Based on the padding mask, extract structural features from the multidimensional center-aware sequence representation and the DNA structure bias matrix to generate a structural feature representation; S5: Perform center anchor point mutual verification and context aggregation on the signal feature representation and the structural feature representation, and then perform vector concatenation to generate a center fusion feature representation; S6: Perform feature transformation on the central fusion feature representation, and then normalize it using the Sigmoid function to output the methylation prediction probability value of the central site.
[0011] In summary, the present invention has at least the following beneficial effects: This invention, based on base token embedding, introduces relative distance embedding from each sequence position to the central target site and upstream / downstream directional embedding. It then fuses these three types of embeddings using learnable weights to form a center-aware sequence representation. This design allows the model to obtain the positional relationship of each base relative to the central site during the input stage, thereby enhancing its ability to express the sequence environment of the central neighborhood.
[0012] This invention constructs a structural prior bias matrix that includes phase terms (simulating the trend related to the DNA helix cycle), center distance decay, and relative distance binning information, and injects it as an additive attention bias into the first few layers of a self-attention encoder. This design introduces structural constraints related to the center site in the shallow coding stage, while retaining the free representation ability of subsequent coding layers, which helps to improve the model's ability to model positional relationships and structurally related features.
[0013] This invention employs multiple one-dimensional convolutional signal decomposition units with different dilation rates in the signal branch to decompose sequence features into background and detail components, and applies a channel-by-channel learnable soft thresholding contraction to the detail components. This design can suppress weak perturbation noise and preserve local key details without downsampling, improving the model's ability to extract effective sequence signals near the center point.
[0014] This invention uses the central site features of structural and signal branches as query vectors, and performs anchor point cross-attention between structure and signal, and signal and structure respectively, to achieve bidirectional supplementation and mutual verification fusion of the two types of features around the central site. This design can reduce the evidence conflicts caused by simple splicing fusion and improve the targeting of the fusion process for the central site prediction task.
[0015] This invention applies a cosine similarity-based margin-type consistency constraint to the feature representations of structural and signal branches only within a defined window around the central site. This design makes the training objective more focused on the neighborhood of the methylation site, reducing optimization interference from irrelevant information at distant points, thereby improving training stability and the reliability of central site prediction. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, 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.
[0017] Figure 1 This is a model architecture diagram of the present invention; Figure 2 This is the ROC curve of the test set in this invention; Figure 3 This is a graph showing the average input contribution of highly methylated and lowly methylated samples near the central site in this invention. Figure 4 This is the input contribution heatmap of the independent test set chr22 samples in this invention; Figure 5This is a heatmap showing the structural bias of the structural branches around the central site in this invention. Detailed Implementation
[0018] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0019] The following is in conjunction with the appendix Figures 1 to 5 The present invention will be described in further detail below.
[0020] like Figure 1 As shown, the methylation prediction method based on structural priors and multi-scale signal decomposition includes the following steps: Step 1: Preprocess the DNA sequence.
[0021] Obtain the raw DNA sequence coding matrix B represents the number of DNA sequences input each time, and L represents the length of each DNA sequence. Each base or symbol of the DNA sequence is encoded as a discrete integer to generate a multidimensional sequence embedding representation. d represents the embedding dimension. The encoding rules are shown in Table 1: Table 1: Base / Symbol Encoding Rules PAD 0 A 1 T 2 C 3 G 4 N 5 Step 2: Construct a multidimensional center-sensory sequence representation.
[0022] For the i-th position in the input sequence, first construct three types of embeddings.
[0023] Embedded representation is: ; In the formula, This represents the base vector at position i. The integer code representing the i-th base. This represents the learnable base embedding matrix.
[0024] Calculate the center distance from the i-th position to the center point c. for: ; Map the center distance to a distance embedding: ; In the formula, Let represent the distance vector at position i. This represents the learnable distance embedding matrix.
[0025] Define the direction label based on the relative relationship between the i-th position and the center point. : ; The directional embedding is represented as: ; In the formula, This represents the direction vector of the i-th position. This represents the learnable directional embedding matrix.
[0026] We perform learnable weighted fusion of the three types of embeddings. Let the weights of the three types of embeddings be... for: ; In the formula, This represents the original weight parameters.
[0027] in: ; The comprehensive embedding of the i-th bit is: ; In the formula, This represents the fusion vector of the i-th position; , , These represent the weighting coefficients for base insertion, distance insertion, and orientation insertion, respectively.
[0028] The fused embeddings are normalized and regularized to obtain the final input representation:
[0029] In the formula, E represents the multidimensional sequence embedding representation, which serves as the common input to the subsequent structural feature encoding module and the multi-scale signal decomposition module.
[0030] This module is used to convert discrete DNA base sequences into continuous vector representations and explicitly incorporate information related to the central site. For methylation prediction tasks, the target is usually a CpG site or a specific base site at the center of the sequence, and the upstream and downstream sequences do not contribute equally to the methylation state of this site. Therefore, conventional base intercalation alone is insufficient to fully characterize the "positional relationship of a base relative to the central site".
[0031] In addition to basic base embedding, this model introduces both "distance embedding from the center site" and "directional embedding relative to the center site," enabling it to perceive the relative spatial relationship between each base and the methylation site to be predicted at the input layer. This design enhances the model's ability to identify the upstream and downstream sequence environment of the center site, making it suitable for prediction scenarios where methylation levels are significantly affected by local sequence context.
[0032] Step 3: Construct structural branches.
[0033] The DNA structure bias matrix consists of three parts: ; In the formula, This indicates the phase bias of the DNA helix. This indicates the distance decay bias related to the center site. This indicates the relative distance between the buckets.
[0034] Spiral phase bias: In one embodiment, the fundamental angular frequency is set based on the average periodicity of approximately 10.5 bp of the DNA double helix; in other embodiments, the periodicity parameter can also be preset or learned based on species, sequence type, or training data. Therefore, the fundamental angular frequency is defined. : ; First, local structural states are extracted using one-dimensional convolution: ; In the formula, C represents the local structural feature vector, and E represents the multidimensional sequence embedding representation.
[0035] Then, the location-related structure score is obtained through linear mapping: ; In the formula, Let W represent the structural score of the i-th position, and let W represent the linear mapping weight matrix. This represents the local structural feature vector of the i-th position.
[0036] Adjust the angular frequency of the i-th position based on the relevant structural fraction: ; In the formula, This represents the angular frequency adjustment factor. This indicates the angular frequency adjustment parameter. This represents the angular frequency scaling parameter. This represents the dynamic angular frequency of the i-th position. This represents the fundamental angular frequency.
[0037] By accumulating the diagonal frequencies position by position, we obtain the phase at the i-th position: ; In the formula, Let represent the cumulative phase at position i, and k represent the traversal index for the summation. This represents the dynamic angular frequency of the k-th position; The phase difference between any two positions i and j is: ; In the formula, This represents the phase difference between positions i and j. Indicates the phase at position i. This indicates the phase at position j.
[0038] To avoid phase values exceeding the period range, the phase difference is periodically normalized: ; The spiral phase bias is obtained: ; In the formula, This represents the spiral phase offset value corresponding to positions i and j. This represents the spiral phase weighting coefficient. This indicates the spiral phase bias term.
[0039] This step enhances the structural relevance of base pairs in similar helical phases during attention calculations.
[0040] Central site distance attenuation bias: Define the linear distance between any two positions i and j: ; In the formula, This represents the absolute distance between positions i and j.
[0041] Define the normalized distance from position i to the center point c: ; In the formula, Let i represent the normalized distance from position i to the center, and L represent the total length of the sequence.
[0042] For location (i, j), construct the center-related attenuation coefficient: ; In the formula, This represents the attenuation coefficients at positions i and j. Indicates the basic attenuation parameter. This represents the distance weight parameter.
[0043] The center distance attenuation bias is obtained: ; In the formula, This represents the distance attenuation offset value corresponding to positions i and j.
[0044] This bias term moderately suppresses the attention computation of locations that are too far apart, while preserving the model's ability to learn distant associations from the data.
[0045] Relative distance bin offset: To enhance the model's ability to model sequential relationships at different distance scales, location distance will be used. Mapping to K distance buckets, where K is a preset positive integer, preferably 16, 32, 64, or 128. In one embodiment, K is 64.
[0046] ; In the formula, This represents the bucket index corresponding to positions i and j; Linear bucketing is used for near-distance pairs with a distance less than or equal to a threshold T, while logarithmic bucketing is used for mid- to far-distance pairs with a distance greater than T. T can be set according to the input sequence length or task requirements, and is preferably 16–128 bp. In one embodiment, T is set to a threshold around 31 or 32 bp.
[0047] Each distance bucket corresponds to a learnable bias value: ; In the formula, This represents the bucket offset value corresponding to positions i and j.
[0048] This design enables the model to distinguish between close, medium, and far-distance base relationships, thereby improving the ability to model long sequences.
[0049] The final structural bias matrix is: ; For its own positional relationship, set the diagonal terms to zero: ; The As an additional bias term for the attention score in the structural feature encoding module.
[0050] This module is used to explicitly introduce prior structural information about the DNA sequence into the self-attention mechanism, including the DNA helical cycle relationship, the relative distance relationship between bases, and the distance decay relationship associated with the central methylation site.
[0051] This method does not model DNA sequences as ordinary text sequences. Instead, it constructs a structural bias matrix before attention calculation, enabling the model to consider both the DNA double helix periodicity and the correlation of central methylation sites when learning base dependencies. Since DNA methylation states are influenced by local sequence conformations, upstream and downstream CpG sequence environments, and potential structural patterns, this structural bias helps improve the model's ability to capture methylation-related sequence patterns.
[0052] The structural feature encoding module includes N self-attention encoding layers or Transformer encoding layers, where N is an integer greater than or equal to 1; preferably, N is 2–12. In one embodiment, N is 3.
[0053] Let the first Layer input is Then the query, key, and value are respectively: ; ; ; In the formula, , , This represents the linear projection weight of the l-th layer.
[0054] A DNA structure prior bias is introduced into the first M layers of an N-layer coding layer, where M is a positive integer less than or equal to N; preferably, M < N, so that the shallow coding layers receive structural prior guidance while preserving the free representational ability of subsequent coding layers. In one embodiment, N=3, M=2: ; In the formula, This represents the attention score of the l-th layer. This represents the attention head dimension. This represents the DNA structure bias matrix. This represents the padding mask.
[0055] For the remaining layers, the attention scores are: ; In the formula, N represents the total number of codes.
[0056] Then, the attention weights are calculated: ; In the formula, This represents the attention weights of the l-th layer.
[0057] And obtain the attention output: ; In the formula, This represents the attention output of the l-th layer.
[0058] The output of this layer is obtained after residual connections, layer normalization, and a feedforward network: ; ; In the formula, This represents the updated output feature tensor of the l-th layer. This represents the input feature tensor of the (l+1)th layer.
[0059] After N layers of encoding, the structure branch output is obtained: ; In the formula, This represents the final structural feature.
[0060] This module is used to capture structural contextual dependencies related to methylation states in DNA sequences. Unlike ordinary Transformer encoders, this module explicitly introduces a DNA structure bias matrix into the self-attention computation, enabling the model to not only automatically learn positional dependencies based on data, but also utilize prior information such as DNA helix period, relative distances, and central site-related decay.
[0061] This method injects DNA structure bias as part of the attention score into the Transformer, enabling the model to simultaneously consider sequence semantic features and structurally relevant features in long-sequence methylation prediction. This design is beneficial for identifying periodic sequence patterns, central neighborhood structural patterns, and longer-range contextual dependencies associated with methylation levels.
[0062] Step 4: Construct signal decomposition branches.
[0063] Initialize the input embedding using a one-dimensional convolution: ; In the formula, This represents the initialization feature of a one-dimensional convolution.
[0064] The signal decomposition branch comprises r signal decomposition blocks, where r is an integer greater than or equal to 2; each signal decomposition block may employ one-dimensional convolution with different dilation rates to form a multi-scale receptive field. In one embodiment, r = 2.
[0065] Will Input r signal decomposition blocks sequentially. For the m-th signal decomposition block, its expansion rate... Defined as: ; when hour: ; For the m-th signal decomposition block, the input is... First, the background signal is estimated using ordinary convolution and dilated convolution: ; In the formula, This represents the estimated background signal for the m-th block. This represents the input features of the m-th block.
[0066] Then extract the original detail signal: ; In the formula, This represents the original detail signal of the m-th block.
[0067] Define the learnable threshold: ; In the formula, This indicates that the m-th block can learn a soft threshold. This represents the threshold generation parameter for the m-th block.
[0068] Soft thresholding is applied to the original detail signal: ; Then the gating coefficient was calculated. : ; In the formula, This represents the detail gating weight coefficient.
[0069] And update the background display: ; The two signal decomposition blocks, the first and second blocks, respectively output detailed features: ; Combine the two: ; Mapping back to a unified dimension: ; In the formula, This represents the weight matrix mapping the detail dimensions.
[0070] Finally, the signal branch output is obtained through background-detail gating fusion: ; ; In the formula, This represents the background gating weight matrix. This represents the second final background feature. This represents the detail weighting balance parameter.
[0071] This module is used to separate background signals and local detail signals from the central site-sensing sequence representation. For DNA methylation prediction, methylation levels can be influenced by a wide range of sequence background factors, such as local GC content, CpG density, and sequence composition trends, as well as by specific motifs or local base combinations near the central site. Therefore, this module extracts both background and detail features simultaneously through multi-scale signal decomposition.
[0072] This method introduces multiple signal decomposition blocks with different hole convolution dilation rates at the sequence feature level, thereby separating background components and detail components at different receptive field scales.
[0073] Step 5: Perform central verification and integration.
[0074] Anchor point features corresponding to the center site are extracted from both the structural feature representation and the signal feature representation: ; In the formula, The central anchor point feature represents the structural branch. This indicates the central anchor point characteristic of the signal branch. Indicates structural branching characteristics, This indicates the characteristics of signal branching.
[0075] Based on the central anchor point feature of the structural branches As a query vector, using signal branch features As keys and values, compute cross-branch attention from the structure to the signal direction: ; In the formula, Represents the structural branch query vector. The query weight matrix represents the structural branches. Indicates the signal branch key. The key weight matrix represents the signal branch. Indicates the signal branch value. The value weight matrix represents the signal branch.
[0076] Calculate attention weights: ; In the formula, d represents the cross-branch attention weight from structure to signal, and d represents the feature dimension.
[0077] The structural anchor point representation is obtained after supplementation and enhancement by the signal branch: ; Based on the central anchor point characteristics of the signal branch As a query vector, using signal branch features As keys and values, calculate cross-branch attention of the signal to the structural direction: ; In the formula, This represents the signal branch query vector. The query weight matrix represents the signal branch. Indicates the branch key of the structure. The key weight matrix represents the structural branches. Indicates the structure branch value, The value weight matrix represents the structural branches.
[0078] Calculate attention weights: ; In the formula, This represents the cross-branch attention weights from signal to structure.
[0079] The signal anchor point representation is obtained after supplementation and enhancement by structural branches: ; The enhanced structural anchors and enhanced signal anchors are spliced together, and the anchor fusion gating coefficient is calculated. : ; In the formula, This indicates vector concatenation; , This indicates the gating layer weight.
[0080] Obtain the central anchor point mutual verification fusion representation : ; In the formula, This indicates element-wise multiplication.
[0081] This module adaptively determines the relative contributions of structural and signal cross-validation features through gating, enabling the model to dynamically select more reliable branch information based on the characteristic states of different DNA sequence samples. Thus, the central anchor cross-validation interaction unit achieves bidirectional supplementation, mutual verification, and adaptive fusion of structural and signal features around a central site.
[0082] While completing the mutual verification fusion of the central anchor point, we further perform centrally weighted context aggregation on the full sequence features of the structural branches and signal branches.
[0083] Define the learnable Gaussian radius: ; In the formula, This represents a learnable scalar.
[0084] Gaussian weights are calculated based on the distance to the center point. : ; In the formula, This represents the distance from position i to the center c.
[0085] Normalize the Gaussian weights for all positions: ; Weighted aggregation is performed on the structural feature representation and the signal feature representation respectively: ; In the formula, The central context representing the structural branch, This indicates the central context of the signal branch.
[0086] Calculate context fusion gating coefficients : ; In the formula, , This indicates the context gating layer weight.
[0087] Obtain the central context fusion representation : ; In the formula, This indicates normalization.
[0088] This module uses a learnable Gaussian weighting method with the center point as the peak value to focus on aggregating the contextual environment near the center point, while allowing distant locations to participate in representation construction under the influence of weights. Therefore, this model can further integrate the overall sequence environment information around the center point, building upon the mutual verification features obtained from the center anchor point.
[0089] After completing the mutual verification interaction of central anchor points and the aggregation of central context, in order to further ensure that the structural branches and signal branches form a consistent feature expression around the central methylation site, this module introduces a central window consistency check constraint during the training phase.
[0090] Specifically, let the center point be c, and the radius of the center window be... Then select the central neighborhood window. : ; From the structural branch features respectively and signal branch characteristics The representation within the central window is extracted, and the cosine similarity between corresponding features is calculated. If the similarity between two branches within the central window is lower than the preset margin, a consistency penalty is applied. ; In the formula, This represents the consistency loss of the central window, where t represents the consistency margin parameter. This represents the feature vector of the structural branch at position i. This represents the eigenvector of the signal branch at position i.
[0091] During training, the model is jointly optimized using the main task loss and the consistency loss: ; In the formula, L represents the total loss of joint optimization. This represents the consistency loss weight. The loss represents the main task loss, which uses binary cross-entropy with logits to measure the deviation between the predicted value of the center site and the true methylation label.
[0092] The central verification fusion and consistency constraint module is used to perform bidirectional interaction, mutual supplementation and mutual verification fusion of structural feature branches and signal feature branches with the methylation site to be predicted as the center, and further aggregate the contextual information related to the central site.
[0093] The core objective of DNA methylation prediction is to determine the methylation level at a specific central site. The methylation state of this central site can be influenced by DNA sequence structural relationships, as well as by local sequence signals, background composition features, and subtle perturbations. Therefore, relying solely on a single structural branch or a single signal branch can easily result in a single source of features; while directly splicing two branches makes it difficult to ensure that both types of features are effectively integrated around the central methylation site.
[0094] This module uses the central methylation site as an interaction anchor, enabling the central representation of the structural branch to extract information related to the central site from the full-sequence features of the signal branch, and vice versa. Thus, the structural branch can obtain supplementary information at the local sequence signal level through the signal branch, and the signal branch can obtain supplementary information at the DNA structure-dependent level through the structural branch, thereby forming a dual-branch mutual verification mechanism.
[0095] Meanwhile, this module further summarizes the overall sequence environment near the central site through a center-weighted context aggregation method, enabling the model to simultaneously obtain the mutual verification and fusion features of the central site itself and the context features of the central neighborhood.
[0096] Step 6: Output the methylation prediction probability.
[0097] Finally, the central anchor point mutual verification fusion representation will be used. Fusion representation with central context By splicing the data, we obtain the central fusion feature representation: ; The predicted logit is obtained through a multilayer perceptron: ; ; ; In the formula, This represents the learnable weight matrix of the first layer. This represents the learnable bias vector of the first layer, and o represents the predicted logit. This represents the learnable weight matrix of the second layer. This represents the learnable bias vector for the second layer.
[0098] The predicted values are mapped to the (0,1) interval using the Sigmoid function: ; In the formula, This represents the predicted probability of 5mC methylation.
[0099] Experimental verification: To illustrate the feasibility and predictive performance of this method, in one embodiment, the model was trained, validated, and tested using chromosome-level independently partitioned data. This embodiment was used to evaluate the model's predictive performance on independent chromosomes not involved in training and to observe its adaptability to different chromosomal sequence backgrounds.
[0100] This embodiment does not use random fragment mixing partitioning, but adopts chromosome-level partitioning, so that the training set, validation set and test set do not overlap at the chromosome level, thereby reducing the possibility that adjacent fragments or homologous local sequences appear in the training set and test set at the same time.
[0101] I. Data Sources and Preprocessing.
[0102] The training samples were constructed from WGBS (whole genome bisulfite sequencing) data from the NIH Roadmap Epigenomics Consortium. Preprocessing steps may include filtering for low-coverage sites, excluding sex chromosome and mitochondrial sites, tag normalization, and truncating a fixed-length DNA sequence window centered on the CpG site to be tested.
[0103] II. Data partitioning.
[0104] Training set: chr1.fasta to chr20.fasta.
[0105] Validation set: chr21.fasta.
[0106] Independent test set: chr22.fasta.
[0107] The training, validation, and test sets are non-overlapping at the chromosome level. The optimal model is selected based on the Matthews correlation coefficient (MCC) on the validation set chr21 and is finally evaluated on the independent test set chr22.
[0108] III. Sample labeling and evaluation tasks.
[0109] In one embodiment, the model takes a fixed-length DNA sequence truncated from the cytosine site to be predicted as input and uses the methylation level of that central site as a label. The model output is the predicted 5mC methylation value of the central site, which can be used for continuous methylation level assessment or to distinguish between high and low methylation states based on preset thresholds. For example, samples with a methylation ratio of not less than 80% can be defined as high methylation, and samples with a methylation ratio of not more than 20% can be defined as low methylation. Based on this, this embodiment uses indicators such as Accuracy, MCC, ROC, and AUC to evaluate classification performance, and uses indicators such as Pearson, Spearman, MAE, and RMSE to evaluate continuous prediction performance.
[0110] IV. Model Configuration and Training Strategies: Optimizer: AdamW.
[0111] Learning rate: 1e-4.
[0112] Loss: Main task loss (BCEWithLogitsLoss) + Central window consistency loss ( ).
[0113] Regularization: 20% dropout.
[0114] During training, the model file saving strategy is to retain the final model and the optimal model on the validation set.
[0115] V. Evaluation Indicators.
[0116] To comprehensively evaluate the model's predictive ability for 5mC methylation state and methylation level, the following indicators were used in the experiment: Accuracy: Used to evaluate the overall accuracy of predictions.
[0117] MCC (Matthews correlation coefficient): Used to measure the overall classification quality under class imbalance conditions.
[0118] ROC AUC (Receiver Operating Characteristic Area Under Curve): Used to evaluate the overall distinguishing ability of highly methylated categories relative to the rest of the samples.
[0119] Pearson correlation coefficient: used to evaluate the linear correlation between predicted values and actual methylation levels.
[0120] Spearman's rank correlation coefficient: used to evaluate the rank correlation between predicted values and actual methylation levels.
[0121] Macro-F1 (Macro-average F1 score): Used to evaluate the macro-average performance of F1 scores for each category.
[0122] MAE (Mean Absolute Error): Used to measure the mean absolute error in the prediction of continuous methylation levels.
[0123] RMSE (Root Mean Square Error): A measure of the root mean square error in the prediction of continuous methylation levels.
[0124] Among them, MCC and ROC AUC have good explanatory power for scenarios with imbalanced class distribution; Pearson, Spearman, MAE and RMSE are used to illustrate that the model can not only distinguish states, but also continuously predict methylation levels.
[0125] VI. Indicator Results.
[0126] The optimal checkpoint is selected based on the MCC of the validation set chr21, and the final test is performed on the independent test set chr22. The results are shown in Table 2: Table 2: Model Performance Comparison Results Validation set 0.3137 95.46% 0.7636 0.9167 0.8872 0.6939 0.6464 0.0442 0.1202 test set 0.3079 94.95% 0.7944 0.9439 0.9052 0.6593 0.6789 0.0461 0.1286 like Figure 2The results show that, under the chromosome-level independent testing conditions of this embodiment, the model achieved an accuracy of 94.95%, MCC of 0.7944, ROC AUC of 0.9439, and Pearson score of 0.9052 on the chr22 test set. These results serve as experimental evidence that the model in this embodiment exhibits good predictive performance.
[0127] Meanwhile, the MAE on the test set was 0.0461 and the RMSE was 0.1286, indicating that there is a certain correspondence between the model output and the actual methylation level in this embodiment, which can be used to help illustrate the model's ability to fit continuous changes in methylation level.
[0128] VII. Interpretability Analysis.
[0129] like Figure 3 This shows the average normalized input contribution of highly methylated and low methylated samples within a ±256 bp range around the central cytosine site on the independent test set chr22. The horizontal axis represents the relative position (bp) with respect to the central cytosine site, and the vertical axis represents the average contribution strength of that position to the model prediction.
[0130] Figure 3 The results show that the average input contribution distribution differs between highly methylated and low-methylated samples in the neighborhood of the central site, especially exhibiting different contribution intensities in certain regions near the central site. This suggests a correlation between the model's predictions and the sequence location characteristics of the central neighborhood, and can serve as supplementary information explaining the model's focus on the neighborhood of the central site.
[0131] Figure 4 This is a heatmap of input contributions for multiple samples in the independent test set chr22. Each row represents a sample (the upper half represents highly methylated samples, and the lower half represents low-methylated samples), with the horizontal axis indicating the relative position with respect to the central cytosine site. The intensity of the color indicates the strength of the contribution of that position to the model prediction: red / warm tones represent a positive contribution (promoting the model's prediction of high methylation), and blue / cool tones represent a negative contribution (promoting the model's prediction of low methylation). The darker the color, the greater the contribution.
[0132] Figure 4 The results show that the input contribution distribution differs slightly near the central site for samples with different methylation states. This suggests that the model may utilize local sequence information within the central neighborhood during prediction, rather than relying solely on global average features.
[0133] like Figure 5This paper presents a heatmap of structural bias in the Transformer model of this invention, within a range of ±256 bp around the central point. The horizontal axis represents the relative position as a key, and the vertical axis represents the relative position as a query. The colors, from yellow (high value) to purple (low value), represent the normalized structural bias intensity; the brighter the color, the stronger the mutual influence (bias) between the pairs at that position.
[0134] Figure 5 The results show that the bias matrix generated by the structural branches exhibits a certain non-uniform distribution and positional correlation pattern in the neighborhood of the central site. This result indicates that the structural prior bias can differentially adjust the attention weights at different relative positions, providing supplementary explanation for incorporating positional relationship information into the model. The results from the validation set and independent test set show that the model of this invention exhibits good stability and generalization ability under chromosome-level independent partitioning conditions. Since the test set chr22 was not involved in the training and validation selection processes, its results can more objectively reflect the model's adaptability to new chromosomal sequence backgrounds. The results of MCC=0.7944 and ROC AUC=0.9439 on the independent test set indicate that even with an imbalanced distribution of methylation data categories, the model of this invention can still achieve reliable comprehensive classification results.
[0135] This effect is consistent with the model structure design of this invention. First, the multidimensional center-aware sequence representation encodes base content, center distance, and upstream / downstream orientation, enabling the model to organize features around the predicted center site from the input stage, reducing interference from irrelevant distant sequences in center site discrimination. Second, the hierarchical prior bias introduces prior constraints related to distance, orientation, and structural trends in the pre-encoder layer, enabling the model to more effectively extract positional relationships related to methylation state. Third, the multi-scale signal decomposition branch preserves local details and suppresses invalid fluctuations, while the center-query cross-branch fusion allows structural and signal evidence to mutually corroborate each other around the center site, thereby improving the stability of high-methylation state identification.
[0136] For intermediate methylation states, their true labels lie in a continuous transitional range between hypomethylation and hypermethylation. Furthermore, these samples typically exhibit blurred class boundaries and uneven distribution in real-world data, making their evaluation inherently more challenging than that of the high- and low-methylation extremes. Despite these data distribution characteristics, the model still achieves good results on comprehensive metrics such as MCC, ROCAUC, Pearson, MAE, and RMSE, demonstrating that the method of this invention maintains effective discriminative and continuous predictive capabilities even under conditions of truly uneven methylation data.
[0137] In summary, the experimental results show that the center-sensing structure-signal mutual verification fusion model proposed in this invention can achieve high accuracy, strong class discrimination ability and good fitting ability of continuous methylation level under independent chromosome testing conditions, verifying the effectiveness and application value of this technical solution in DNA 5mC methylation prediction task.
[0138] The above are merely preferred embodiments of the invention and are not intended to limit the invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the invention should be included within the protection scope of the invention.
Claims
1. A methylation prediction method based on structural priors and multi-scale signal decomposition, characterized in that, Includes the following steps: S1: Obtain the original DNA sequence window, convert the bases of the original DNA sequence window into discrete integer codes, and form a DNA sequence coding matrix; S2: Generate three types of embedding representations based on the DNA sequence coding matrix, and perform weighted fusion of the three types of embedding representations to generate a base embedding characterization; The base embedding characterization is normalized to generate a multidimensional center-sensing sequence characterization; S3: Construct a DNA structure bias matrix based on the multidimensional center-sensing sequence characterization, and perform multi-scale signal decomposition and branching to generate signal feature representation; S4: Based on the padding mask, extract structural features from the multidimensional center-aware sequence representation and the DNA structure bias matrix to generate a structural feature representation; S5: Perform center anchor point mutual verification and context aggregation on the signal feature representation and the structural feature representation, and then perform vector concatenation to generate a center fusion feature representation; The specific steps of the central anchor point mutual verification are as follows: extract the central anchor point features from the structural feature representation and the signal feature representation respectively, and use the signal branch features to supplement the central anchor point features of the structural branch, and the structural branch features to supplement the central anchor point features of the signal branch. Then, by using a gating method, the fusion weights of the two branches are dynamically adjusted according to different DNA sequence samples to achieve bidirectional mutual verification and adaptive fusion of structural features and signal features, resulting in a central anchor point mutual verification fusion representation. S6: Perform feature transformation on the central fusion feature representation, and then normalize it using the Sigmoid function to output the methylation prediction probability value of the central site.
2. The methylation prediction method based on structural prior and multi-scale signal decomposition according to claim 1, characterized in that, The three types of embedding represent base embedding, distance embedding, and orientation embedding; The base intercalation is represented as follows: In the formula, i represents the i-th position in the DNA sequence. This represents the base vector at position i. The integer code representing the i-th base. Represents a learnable base embedding matrix; The distance from the i-th position to the center point c is calculated as follows: In the formula, Let i represent the distance from the i-th digit to the center c; Map the center distance to the distance embedding: In the formula, Let represent the distance vector at position i. Represents the learnable distance embedding matrix; The directional embedding is represented as: In the formula, This represents the direction vector of the i-th position. The matrix represents the learnable directional embedding. Indicates a direction label.
3. The methylation prediction method based on structural prior and multi-scale signal decomposition according to claim 2, characterized in that, The specific steps for weighted fusion of the three types of embedding representations to generate a base embedding representation, and for normalization of the base embedding representation to generate a multidimensional center-aware sequence representation are as follows: Let the embedding weights of the three types of embedding representations be: In the formula, w represents the normalized weight. Indicates the original weight parameters; The base insertion characterization at position i is then expressed as: In the formula, This represents the fusion vector of the i-th position; , , These represent the weighting coefficients for base insertion, distance insertion, and orientation insertion, respectively. The base insertion characterization is normalized and regularized to obtain the final input representation: In the formula, E represents the multidimensional center-sensing sequence representation.
4. The methylation prediction method based on structural prior and multi-scale signal decomposition according to claim 1, characterized in that, The DNA structure bias matrix includes helical phase bias, center distance attenuation bias, and relative distance binning bias.
5. The methylation prediction method based on structural prior and multi-scale signal decomposition according to claim 4, characterized in that, The calculation steps for the spiral phase offset are as follows: The multidimensional center-aware sequence representation is then subjected to one-dimensional convolution and GELU activation to generate local structural features: In the formula, C represents the local structural feature vector, and E represents the multidimensional center-sensing sequence representation; Linear mapping is performed on local structural features to generate location-related structural scores: In the formula, Let W represent the structural score of the i-th position, and let W represent the linear mapping weight matrix. This represents the local structural feature vector of the i-th position; Adjust the angular frequency of the i-th position based on the relevant structural fraction: In the formula, This represents the angular frequency adjustment factor. , All of these represent learnable parameters. This represents the dynamic angular frequency of the i-th position. Indicates the fundamental angular frequency; By accumulating the diagonal frequencies position by position, we obtain the phase: In the formula, Let represent the cumulative phase at position i, and k represent the traversal index for the summation. This represents the dynamic angular frequency of the k-th position; Calculate the phase difference between positions i and j: In the formula, This represents the phase difference between positions i and j. Indicates the phase at position i. Indicates the phase at position j; Periodic normalization of the phase difference: Calculate the spiral phase offset: In the formula, This represents the spiral phase offset value corresponding to positions i and j. , All of these represent learnable parameters.
6. The methylation prediction method based on structural prior and multi-scale signal decomposition according to claim 4, characterized in that, The calculation method for the center distance attenuation bias is as follows: Define the linear distance between positions i and j: In the formula, This represents the absolute distance between positions i and j; Define the normalized distance from position i to the center point c: In the formula, Let i represent the normalized distance from position i to the center, and L represent the total length of the sequence. For location (i, j), construct the center-related attenuation coefficient: In the formula, This represents the attenuation coefficients at positions i and j. Indicates the basic attenuation parameter. This represents the distance weighting parameter; Map the center-centric attenuation coefficient to the center-distance attenuation bias: In the formula, This represents the distance attenuation offset value corresponding to positions i and j.
7. The methylation prediction method based on structural prior and multi-scale signal decomposition according to claim 6, characterized in that, The calculation steps for the relative distance bin offset are as follows: Location distance Map to distance bucket: In the formula, This represents the bucket index corresponding to positions i and j; When the location distance is less than or equal to the threshold T, linear bucketing is used; when the location distance is greater than the threshold T, logarithmic bucketing is used. The offset value for each distance bucket is: In the formula, This represents the bucket offset value corresponding to positions i and j.
8. The methylation prediction method based on structural prior and multi-scale signal decomposition according to claim 3, characterized in that, The specific steps for extracting structural features from the multidimensional center-aware sequence representation and the DNA structure bias matrix based on the padding mask, and generating structural feature representations, are as follows: Construct a Transformer coding layer with N layers, where the input of the l-th layer is denoted as... Generate the corresponding query vector Key vector Sum value vector : In the formula, , , Represents the linear projection weights of the l-th layer; Calculate the attention scores for the first M layers: In the formula, This represents the attention score of the l-th layer. This represents the attention head dimension. This represents the DNA structure bias matrix. Indicates the padding mask; The attention scores for the remaining layers are: In the formula, N represents the total number of codes; Calculate attention weights: In the formula, Indicates the attention weights of the l-th layer; Obtain attention output: In the formula, This represents the attention output of the l-th layer; After residual connections, layer normalization, and a feedforward network, the output feature tensor is updated: In the formula, This represents the updated output feature tensor of the l-th layer. This represents the input feature tensor of the (l+1)th layer; After N layers of encoding, a structural feature representation is generated: In the formula, This represents the final structural feature.
9. The methylation prediction method based on structural prior and multi-scale signal decomposition according to claim 1, characterized in that, The specific steps for cross-verification of the signal feature representation and the structural feature representation using central anchor points are as follows: Extract the anchor point features corresponding to the center points of the signal feature representation and the structural feature representation respectively: In the formula, The central anchor point feature represents the structural branch. This indicates the central anchor point characteristic of the signal branch. Indicates structural branching characteristics, Indicates signal branching characteristics; Based on the central anchor point feature of the structural branches As a query vector, using signal branch features As keys and values, compute cross-branch attention from the structure to the signal direction: In the formula, Represents the structural branch query vector. The query weight matrix represents the structural branches. Indicates the signal branch key. The key weight matrix represents the signal branch. Indicates the signal branch value. The value weight matrix represents the signal branch; Calculate attention weights: In the formula, The cross-branch attention weights from structure to signal are represented, and d represents the feature dimension; The structural anchor point after signal branching and enhancement is represented as follows: Based on the central anchor point characteristics of the signal branch As a query vector, using signal branch features As keys and values, calculate cross-branch attention of the signal to the structural direction: In the formula, This represents the signal branch query vector. The query weight matrix represents the signal branch. Indicates the branch key of the structure. The key weight matrix represents the structural branches. Indicates the structure branch value, The value weight matrix represents the structural branches; Calculate attention weights: In the formula, This represents the cross-branch attention weights from signal to structure; The signal anchor point after signal branching and enhancement is represented as follows: The enhanced structural anchors and enhanced signal anchors are spliced together, and the anchor fusion gating coefficient is calculated. : In the formula, This indicates vector concatenation; , Indicates the gate layer weights; Obtain the central anchor point mutual verification fusion representation : In the formula, This indicates element-wise multiplication.
10. The methylation prediction method based on structural prior and multi-scale signal decomposition according to claim 9, characterized in that, The specific steps for performing context aggregation on the signal feature representation and the structural feature representation are as follows: Define a learnable Gaussian radius : In the formula, Indicates a learnable scalar; Gaussian weights are calculated based on the distance to the center point. : In the formula, This represents the distance from position i to the center c; Normalize the Gaussian weights for all positions: In the formula, L represents the sequence length; Weighted aggregation is performed on the structural feature representation and the signal feature representation respectively: In the formula, The central context representing the structural branch, Indicates the central context of the signal branch; Calculate context fusion gating coefficients : In the formula, , Indicates the context gating layer weights; Obtain the central context fusion representation : In the formula, This indicates normalization.
Citation Information
Patent Citations
Prediction method for identifying RNA methylation sites
CN120299525A
Quantum and region sensing fused protein methylation site prediction method
CN120727109A