RNA modification multi-classification prediction method based on cross-modal fusion

By employing a cross-modal fusion-based multi-classification prediction method for RNA modifications, this approach addresses the insufficient joint characterization of sequence context and electrical signal features in nanopore direct RNA sequencing technology. It enables parallel identification of multiple RNA modifications and detection of unknown modifications, thereby improving the accuracy and robustness of detection.

CN122474130APending Publication Date: 2026-07-28XIAMEN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
XIAMEN UNIV
Filing Date
2026-06-25
Publication Date
2026-07-28

AI Technical Summary

Technical Problem

Existing nanopore direct RNA sequencing technology suffers from several problems in detecting chemical modifications of RNA molecules, including insufficient joint characterization of sequence context and electrical signal features, classification models limited to the closed-world assumption, and a lack of a unified framework for parallel identification of multiple modifications.

Method used

A cross-modal fusion RNA modification multi-classification prediction method is adopted. The signal and sequence are accurately aligned by moving table coordinate mapping. The signal window and k-mer sequence context are jointly trained by a two-branch cross-modal deep learning model. At the output end, the dual thresholds of maximum softmax probability and energy score are used for joint verification to achieve parallel identification of multiple RNA modifications and detection of unknown modifications.

Benefits of technology

It achieves end-to-end parallel identification of multiple RNA modification types, improves the ability to distinguish similar modification types, provides early warning capability for unknown modifications, and enhances the robustness of the model in complex samples.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122474130A_ABST
    Figure CN122474130A_ABST
Patent Text Reader

Abstract

The application discloses a kind of RNA modification multi-classification prediction methods based on cross-modal fusion, comprising: obtaining POD5 electric signal, reference genome and modification annotation file, and generating BAM file containing movement table label by base calling;Signal is executed MAD normalization, parse movement table and construct base-to-signal center mapping array and intercept signal window;Extract k-mer coding as integer index, determine label in training stage by querying annotation file;Build double-branch deep learning model containing cross-attention fusion, pretrain and supervised fine-tuning two-stage training by contrast learning;Based on the calibration of MSP and energy threshold value of verification set, open set joint determination is carried out on test set, and known modification or unknown modification is output.The application realizes the cross-modal fusion of signal and sequence, has unknown modification early warning capability, and can complete the parallel identification of multiple RNA modifications simultaneously.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of bioinformatics and nanopore sequencing technology, specifically relating to a method for multi-classifying and identifying various chemical modifications on RNA molecules and providing early warnings for unknown modifications using raw electrical signals and reference sequence context information generated by direct RNA sequencing (DRS) through nanopores. The method is based on a cross-modal deep learning model, integrating a one-dimensional convolutional neural network (1D CNN), a Transformer encoder, a cross-attention mechanism, and multi-task learning to simultaneously discriminate known modification categories and detect unknown modifications in the open set. Background Technology

[0002] In gene expression regulation, chemical modifications on RNA molecules (such as N) 6 -Methyladenine m 6 A, 5-methylcytosine m 5 C, pseudouridine Ψ, inosine I, etc., play a crucial role. Nanopore direct RNA sequencing technology directly records the raw electrical signal containing modification information by measuring the changes in ionic current caused by RNA single strands passing through nanopores. This signal is usually stored in POD5 format. Compared with methods that first perform base calling and then indirectly infer based on alignment error features, directly resolving the raw electrical signal can retain physical characteristics such as current amplitude, wave morphology, and molecular residence time, and theoretically has a higher modification resolution potential.

[0003] However, existing methods for detecting modifications based on direct RNA sequencing signals from nanopores still face the following technical limitations in practical applications: (1) Insufficient deep joint characterization of sequence context and electrical signal features. The current response and aberration amplitude caused by RNA modification are highly dependent on the base sequence context (k-mer) around the modification site. Existing methods either only use signal fragments as input and ignore sequence information, or extract signal features and sequence features separately and then splice them at the end. They do not establish a deep interaction between signal mode and sequence mode during feature abstraction, making it difficult to capture modification-specific signal aberration patterns in a specific k-mer context, thus limiting the ability to distinguish different modification types with similar electrical responses.

[0004] (2) The classification model is limited by the closed-world assumption. Existing deep learning-based modification classification methods generally model modification detection as a closed-set classification task, and the output class space is fixed during the training phase. When the sample contains unrepresented modifications or abnormal waveforms, the model will still force it to be classified into a certain known category and may output a high confidence level, failing to provide early warning information. Existing frameworks lack the joint detection capability to unify multi-class prediction with adaptive detection of unknown modifications.

[0005] (3) Lack of a unified framework for parallel identification of multiple modification types. Most existing methods are designed for single modification types (such as m). 6 The binary classification problem design in A) has not yet formed an end-to-end multi-classification framework that can simultaneously distinguish multiple chemical modifications and unmodified bases within a deep learning model, which limits the shared learning of common features among different modification types and the collaborative utilization of complementary discriminative information. Summary of the Invention

[0006] This invention aims to at least partially solve one of the technical problems in the aforementioned technologies. To this end, one objective of this invention is to propose a multi-classification prediction method for RNA modifications based on cross-modal fusion. This method achieves precise alignment between the original electrical signal of the nanopore and the reference sequence through moving table coordinate mapping, and combines a two-branch cross-modal deep learning model to jointly train the signal window and the k-mer sequence context, thereby achieving end-to-end parallel identification of multiple RNA modification types.

[0007] The original electrical signal and the reference sequence are precisely aligned in the physical time coordinate domain by adaptive coordinate mapping through moving tables; the cross-attention fusion mechanism uses signal features as queries and sequence features as keys and values, so that the sequence context serves as conditional information to guide the model to focus on the modification-sensitive waveform regions in the electrical signal; and at the output end, the model achieves rejection and warning of out-of-distribution samples without the need for unknown class training samples through joint verification of the maximum softmax probability and energy score. Finally, the parallel identification of multiple RNA modifications and the detection of unknown modifications are completed simultaneously within a unified multi-task deep learning framework.

[0008] To achieve the above objectives, a first aspect of this invention proposes a multi-class prediction method for RNA modifications based on cross-modal fusion, comprising the following steps: acquiring a raw electrical signal file, a reference genome sequence file, and a known modification site annotation file; generating a binary alignment mapping format file based on the raw electrical signal file and the reference genome sequence file, wherein the binary alignment mapping format file includes read identifiers, query sequences, reference sequence names, alignment start positions, strand direction fields, and shift table labels; performing median absolute deviation normalization on the raw electrical signal file to obtain a normalized signal vector, and performing shift table coordinate mapping based on the shift table labels to obtain a mapping array from bases to signal center indices; for each target base on each read, according to the... The mapping array from bases to signal center indices is used to determine the truncation range in the normalized signal vector to obtain the signal window tensor corresponding to each target base. Base sequence context encoding is performed based on the query sequence to obtain a k-mer integer index. A known modification site annotation file is queried based on the reference sequence name, alignment start position, and strand direction field to obtain the classification label corresponding to each target base site. A two-branch cross-modal deep learning model is constructed, and the signal window tensor, k-mer integer index, and corresponding classification label are input into the two-branch cross-modal deep learning model for training to obtain a trained multi-class prediction model. RNA modification multi-class prediction is performed based on the trained multi-class prediction model to obtain the final prediction result for each base site.

[0009] The RNA modification multi-classification prediction method based on cross-modal fusion proposed in this application has the following advantages: it achieves precise alignment of the original electrical signal and the reference sequence in the physical time coordinate domain in nanopore sequencing by moving table coordinate mapping, effectively compensating for the nonlinear distortion of signal-base sequence due to non-uniform sequencing rate, and combines a two-branch cross-modal deep learning model to jointly train the signal window and k-mer sequence context, thereby achieving end-to-end parallel identification of multiple RNA modification types.

[0010] Optionally, the movement table coordinate mapping is performed based on the movement table label to obtain a mapping array from base to signal center index, including: parsing the movement table label to obtain the corresponding step size parameter and movement sequence; constructing a mapping array from base index to signal sampling point center index based on the step size parameter and movement sequence, wherein the length of the mapping array is the length of the corresponding query sequence.

[0011] Optionally, the moving table label is parsed to obtain the corresponding step size parameter and moving sequence, including: if the first element in the moving table label is greater than 0, then the first element is used as the corresponding step size parameter and the remaining elements are used as the moving sequence; if the first element in the moving table label is equal to 0, then the step size parameter is set to 1 and all elements are used as the moving sequence.

[0012] Optionally, a mapping array from base index to signal sampling point center index is constructed based on the step size parameter and the moving sequence, including: initializing position cursors and initializing an empty mapping list to store mapping values; traversing each element in the moving sequence, if element m is greater than 0, appending m current position cursors to the end of the mapping list, and then updating the current position cursor = previous position cursor + step size parameter; if element m is equal to 0, not appending to the end of the mapping list, and similarly updating the current position cursor = previous position cursor + step size parameter; after traversing all elements in the moving sequence, the mapping list is the mapping array from base index to signal sampling point center index.

[0013] Optionally, the truncation range is determined in the normalized signal vector according to the base-to-signal center index mapping array to obtain the signal window tensor corresponding to each target base, including: obtaining a preset window length; truncating the window from the center to both sides according to the base-to-signal center index corresponding to each target base in the base-to-signal center index mapping array to obtain a signal window tensor with a length of the preset window length, wherein if the window boundary exceeds the effective range of the normalized signal vector, the nearest edge sample value is used for copying and filling.

[0014] Optionally, base sequence context encoding is performed based on the query sequence to obtain a k-mer integer index, including: converting all thymine in the query sequence to uracil; extracting 5-mers by extending 2 bases to each side of the target base; if the target base is at the edge of the sequence, resulting in fewer than 2 bases on both sides, filling the missing positions with the character N; and weighting the 5-mers according to the base-to-integer mapping rule: A=0, C=1, G=2, U=3, with weights of 4 from left to right. 4 , 4³, 4², 4¹, 4 0 The 5-mer is encoded as a unique integer index between 0 and 1023; if the 5-mer includes the padding character N, the integer index is marked as an invalid value -1 to obtain the k-mer integer index.

[0015] Optionally, a two-branch cross-modal deep learning model is constructed, and the signal window tensor, k-mer integer index, and corresponding classification label are input into the two-branch cross-modal deep learning model for training to obtain a trained multi-class prediction model. This includes: constructing a two-branch cross-modal deep learning model, wherein the two-branch cross-modal deep learning model includes a signal encoder, a sequence encoder, a cross-attention fusion module, and a multi-task output module; inputting the signal window tensor into the signal encoder for signal encoding to obtain a signal feature vector; inputting the k-mer integer index into the sequence encoder for sequence encoding to obtain a sequence feature vector; inputting the signal feature vector and the sequence feature vector into the cross-attention fusion module for cross-attention fusion to obtain a joint feature vector; inputting the joint feature vector into the multi-task output module to simultaneously connect to a multi-classification head, a binary classification head, and a contrastive learning projection head to output corresponding results; constructing a contrastive learning dataset based on the signal window tensor for contrastive learning pre-training; and optimizing the two-branch cross-modal deep learning model overall. Based on the weights obtained from pre-training, the corresponding loss function is obtained according to the corresponding results and then subjected to supervised multi-task joint fine-tuning to obtain a trained multi-class prediction model.

[0016] Optionally, RNA modification multi-class prediction is performed based on the trained multi-class prediction model to obtain the final prediction result for each base site. This includes: obtaining a validation set, wherein the validation set includes a signal window tensor and a corresponding k-mer integer index; inputting the validation set into the trained multi-class prediction model to obtain a multi-class logical value for each sample; calculating the corresponding maximum softmax probability and energy score based on the multi-class logical value, and obtaining a lower bound threshold for the maximum softmax probability and an upper bound threshold for the energy score; obtaining a test set, wherein the test set includes a signal window tensor and a corresponding k-mer integer index; inputting the test set into the trained multi-class prediction model to obtain a multi-class logical value and a binary logical value for each sample; calculating the corresponding maximum softmax probability and energy score based on the multi-class logical value, and performing joint open set determination based on the maximum softmax probability, energy score, lower bound threshold for the maximum softmax probability, and upper bound threshold for the energy score to obtain the final prediction result for each base site in the test set.

[0017] Optionally, the maximum Softmax probability and energy score are calculated based on the multi-class logic value, and the lower bound threshold of the maximum Softmax probability and the upper bound threshold of the energy score are obtained, including: taking the 5th percentile of the maximum Softmax probability of all samples in the validation set as the lower bound threshold of the maximum Softmax probability, and taking the 95th percentile of the energy score value as the upper bound threshold of the energy score.

[0018] Optionally, an open set joint determination is performed based on the maximum Softmax probability, energy score, lower bound threshold of maximum Softmax probability, and upper bound threshold of energy score, including: if the maximum Softmax probability is less than the lower bound threshold of maximum Softmax probability or the energy score is greater than the upper bound threshold of energy score, then an unknown label is triggered, the corresponding site is labeled as an unknown modification, and the fused unknown confidence is calculated; otherwise, the predicted modification category is the known modification category corresponding to the maximum probability value after the multi-class logistic value is processed by the Softmax function, and the confidence is taken as the maximum Softmax probability value. Attached Figure Description

[0019] Figure 1 This is a flowchart illustrating the RNA modification multi-class prediction method based on cross-modal fusion according to an embodiment of the present invention. Figure 2 This is a schematic diagram of the framework of a multi-class prediction method for RNA modification based on cross-modal fusion according to an embodiment of the present invention; Figure 3 This is a multi-class confusion matrix for a test set according to an embodiment of the present invention; Figure 4 This is a summary graph of the ROC curves for each base according to an embodiment of the present invention. Detailed Implementation

[0020] Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain the present invention, and should not be construed as limiting the present invention.

[0021] To better understand the above technical solutions, exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided to enable a more thorough understanding of the present invention and to fully convey the scope of the invention to those skilled in the art.

[0022] To better understand the above technical solutions, the following will provide a detailed explanation of the technical solutions in conjunction with the accompanying drawings and specific implementation methods.

[0023] like Figure 1 As shown, this RNA modification multi-class prediction method based on cross-modal fusion includes the following steps: S101, obtain the raw electrical signal file, reference genome sequence file, and known modification site annotation file.

[0024] As an example, the raw electrical signal file is in POD5 format, which is the raw ion current signal generated by direct RNA sequencing through nanopores and stored in the form of sampling point sequences, including physical information such as current amplitude, wave morphology and molecular residence time; the reference genome sequence file is in FASTA format, which provides reference sequence information to be compared; the known modification site annotation file is in BED format, and the fields of the BED file include at least chromosome name, start position, end position, modification type and strand direction. During training, the known modification site annotation file is used as the ground truth label.

[0025] S102, Generate a binary alignment mapping format file based on the original electrical signal file and the reference genome sequence file. The binary alignment mapping format file includes read segment identifier, query sequence, reference sequence name, alignment start position, chain direction field, and move table label.

[0026] As an example, a POD5 file and a reference genome sequence are taken as input, and the `--emit-moves` option is configured during the call to generate a BAM format alignment file including a move table tag (mv tag). Each read in the BAM file includes at least a read identifier (read_id), a query sequence (query_sequence), a reference sequence name (reference_name), an alignment start position (reference_start), a chain direction field, and a move table tag (mv tag).

[0027] S103, perform median absolute deviation normalization on the original electrical signal file to obtain the normalized signal vector, and perform shift table coordinate mapping according to the shift table labels to obtain the mapping array from base to signal center index.

[0028] Specifically, the median absolute deviation (MAD) normalization is performed on the raw current signal of each read segment:

[0029] in, This represents the vector of all sampling points in the read segment. median The constant 1.4826 is the scaling factor of MAD and standard deviation under a Gaussian distribution, ensuring that the expected variance of the normalized signal is 1 when the noise follows a Gaussian distribution.

[0030] As an example, the process of mapping the coordinates of the moving table based on the moving table labels to obtain a mapping array from bases to signal center indices includes: parsing the moving table labels to obtain the corresponding step size parameters and moving sequences; and constructing a mapping array from base indices to signal sampling point center indices based on the step size parameters and moving sequences, wherein the length of the mapping array is the length of the corresponding query sequence.

[0031] As an example, the movement table label is parsed to obtain the corresponding step size parameter and movement sequence, including: if the first element in the movement table label is greater than 0, then the first element is used as the corresponding step size parameter and the remaining elements are used as the movement sequence; if the first element in the movement table label is equal to 0, then the step size parameter is set to 1 and all elements are used as the movement sequence.

[0032] As an example, constructing a mapping array from base index to signal sampling point center index based on step size parameter and moving sequence includes: initializing position cursors and initializing an empty mapping list to store mapping values; traversing each element in the moving sequence, if element m is greater than 0, appending m current position cursors to the end of the mapping list, and then updating the current position cursor = previous position cursor + step size parameter; if element m is equal to 0, not appending to the end of the mapping list, and similarly updating the current position cursor = previous position cursor + step size parameter; after traversing all elements in the moving sequence, the mapping list is the mapping array from base index to signal sampling point center index.

[0033] Specifically, for each read segment, its mv tag is extracted from the BAM file. The mv tag is an integer array, and if its first element... Then this value is the stride parameter, the remaining part of the array. For moves, move; otherwise `moves` refers to the entire array. A mapping array from bases to signal center indices is constructed based on `stride` and `moves`. The length is the length of the query sequence for this read segment. The specific construction process is as follows: Initialize the position cursor. Iterate through each element m in the move sequence moves. If m > 0, then in the mapping array... Add m elements with a value of pos to the array; update the array. After the traversal is complete, The approximate physical center index of the i-th base in the original POD5 signal sampling point sequence represents the reading segment.

[0034] As a specific example, assume that the parsed mv tag corresponding to the read segment yields: stride=5 (step size), moves= [3, 0, 0, 2, 1, 0, 2, ...] The traversal process is shown in Table 1 below: Table 1: Illustration of the traversal process

[0035] After traversal, the mapping array =[0, 0, 0, 15, 15, 20, 30, 30, ...], where the bases 0-7 correspond to 0, 0, 0, 15, 15, 20, 30, 30.

[0036] S104. For each target base on each read segment, the truncation range is determined in the normalized signal vector based on the mapping array from the base to the signal center index, so as to obtain the signal window tensor corresponding to each target base.

[0037] As one embodiment, the truncation range is determined in the normalized signal vector based on the base-to-signal center index mapping array to obtain the signal window tensor corresponding to each target base, including: obtaining a preset window length; truncation from the base-to-signal center index corresponding to each target base in the base-to-signal center index mapping array to both sides of the window center to obtain a signal window tensor with a length of the preset window length, wherein if the window boundary exceeds the effective range of the normalized signal vector, the nearest edge sample value is used for copying and filling.

[0038] Specifically, for each target base i in the read segment, using Centered on the signal, a window of length W is extracted from the normalized signal, with W containing 400 samples. If the window boundaries exceed the signal range, the nearest edge sample values ​​are used to fill the gap, ensuring that all windows have the same shape.

[0039] S105, perform base sequence context encoding based on the query sequence to obtain the k-mer integer index.

[0040] As an example, base sequence context encoding is performed based on the query sequence to obtain a k-mer integer index, including: converting all thymine in the query sequence to uracil; extracting 5-mers by extending 2 bases to each side of the target base; if the target base is at the edge of the sequence, resulting in fewer than 2 bases on both sides, the missing positions are filled with the character N; and weighting the 5-mers according to the base-to-integer mapping rule: A=0, C=1, G=2, U=3, with weights of 4 from left to right. 4, 4³, 4², 4¹, 4 0 The 5-mer is encoded as a unique integer index between 0 and 1023; if the 5-mer includes the padding character N, the integer index is marked as an invalid value -1 to obtain the k-mer integer index.

[0041] Specifically, for the query sequence of this read segment, after converting T to U, the nucleotide pentamer (5-mer) centered at base i is extracted. If there are insufficient bases at the sequence edges, they are padded with the character "N". Following the base-to-integer mapping rule A=0, C=1, G=2, U=3, the 5-mer is encoded from left to right as an integer index between 0 and 1023:

[0042] If the k-mer contains "N", then the integer index is marked as invalid -1, and can be replaced by the default index or filtered directly in the future.

[0043] S106. Based on the reference sequence name, alignment start position, and chain direction fields, query the known modification site annotation file to obtain the classification label corresponding to each target base site.

[0044] Specifically, the sample labels are determined as follows: First, the set of allowed modification types for the experiment is inferred based on the BAM filename being processed. For the current base i, the chromosome name, reference position, and strand orientation aligned to the reference genome are obtained, and the BED annotation file is queried using the triplet (chromosome, start position, strand orientation) as the key. If the site exists in the BED file and its modification type belongs to the set of allowed modification types, then the modification type is assigned to that site; otherwise, the modification type is set to the corresponding unmodified base type (A, U, C, G). Based on the modification type, multi-class labels are assigned to the samples: integers from 0 to 7, corresponding to m respectively. 6 A、m 5 C, Ψ, I, A, U, C, G. Binary classification labels are derived from multi-class classification labels: if the multi-class label is less than 4, it is a modified class; if the multi-class label is greater than or equal to 4, it is an unmodified class. The correspondence between multi-class and binary classification labels is shown in Table 2.

[0045] Table 2: Tag Mapping Table

[0046] Specifically, all base samples generated from all read segments are aggregated into a total sample set. To alleviate class imbalance, a sampling limit is set for each multi-class category. Samples exceeding the limit are randomly discarded, while insufficient samples are randomly sampled with replacement, ensuring that the final sample size for each category is close to the preset quota. The balanced sample set includes a signal window array, a k-mer index array, a multi-class label array, and a binary label array, and is stored as a binary file for subsequent training.

[0047] S107. Construct a two-branch cross-modal deep learning model, and input the signal window tensor, k-mer integer index and corresponding classification label into the two-branch cross-modal deep learning model for training to obtain a trained multi-class prediction model.

[0048] As an example, a two-branch cross-modal deep learning model is constructed, and the signal window tensor, k-mer integer index, and corresponding classification labels are input into the two-branch cross-modal deep learning model for training to obtain a trained multi-class prediction model. This includes: constructing a two-branch cross-modal deep learning model, wherein the two-branch cross-modal deep learning model includes a signal encoder, a sequence encoder, a cross-attention fusion module, and a multi-task output module; inputting the signal window tensor into the signal encoder for signal encoding to obtain a signal feature vector; inputting the k-mer integer index into the sequence encoder for sequence encoding to obtain a sequence feature vector; inputting the signal feature vector and the sequence feature vector into the cross-attention fusion module for cross-attention fusion to obtain a joint feature vector; inputting the joint feature vector into the multi-task output module to simultaneously connect to a multi-classification head, a binary classification head, and a contrastive learning projection head to output the corresponding results; constructing a contrastive learning dataset based on the signal window tensor for contrastive learning pre-training to optimize the two-branch cross-modal deep learning model as a whole; and performing supervised multi-task joint fine-tuning based on the weights obtained from the pre-training and the corresponding loss function obtained from the corresponding results to obtain a trained multi-class prediction model.

[0049] Specifically, a dual-branch cross-modal deep learning model is constructed, including a signal encoder, a sequence encoder, a cross-attention fusion module, and a multi-task output module.

[0050] Specifically, the signal encoder receives a signal window tensor of shape (B, 400), where B is the batch size. The signal encoder consists of three cascaded one-dimensional convolutional blocks and two Transformer encoder layers. The input and output channels of the three convolutional blocks are 1→32, 32→64, and 64→128 respectively, with a kernel size of 9 and padding of 4. Each convolutional block contains a one-dimensional convolutional layer, a batch normalization layer, a GELU activation function, and a max-pooling layer with a stride of 2. After three max-pooling operations, the sequence length is reduced to 1 / 8 of its original length, and the number of channels becomes 128. The transposed feature map is then input into an encoder composed of two stacked Transformer encoder layers. Each encoder layer employs a 4-head self-attention mechanism, with a feedforward network dimension of 512, a GELU activation function, and includes residual connections and layer normalization. The Transformer encoder output undergoes adaptive average pooling to compress the time dimension to 1, ultimately yielding a signal feature vector of shape (B, 128). .

[0051] Specifically, the sequence encoder receives k-mer integer indices of shape (B,). Each index is mapped to a 64-dimensional dense vector through an embedding layer (embedding, vocabulary size 1024, embedding dimension 64). This vector then passes through a fully connected layer (64→128), a GELU activation function, layer normalization (LayerNorm), and a dropout layer with a dropout rate of 0.1, ultimately outputting a sequence feature vector of shape (B, 64). .

[0052] Specifically, the cross-attention fusion module is used to achieve the interactive fusion of signal features and sequence features. Projected onto the dimension through the first linear layer , obtain the query matrix Q; Projecting the matrix to dimension 192 through the second and third linear layers respectively yields the key matrix K and value matrix V. Subsequently, the cross-attention output is calculated:

[0053] in Output attention With the original Residual connections are performed, and after layer normalization, fused features are obtained. :

[0054] Then The final joint feature vector is obtained by performing dimensionality transformation through the fourth linear layer. The shape is (B, 192). The multi-task output module will combine the feature vectors. It is simultaneously connected to three output heads: the multi-class head is a fully connected layer (192→8), outputting 8-dimensional logic values. , corresponding to m 6 A、m 5 The system classifies data into eight categories: C, Ψ, I, A, U, C, and G. The binary classification header is a fully connected layer (192→2), outputting 2D logical values. The contrastive learning projector consists of a fully connected layer (192→256), a GELU activation function, a fully connected layer (256→128), and a layer normalization function. It outputs a 128-dimensional normalized vector, which is only used to calculate the contrastive loss during the training phase and does not participate in the calculation during the inference phase.

[0055] During training, contrastive learning pre-training is performed first. A contrastive learning dataset is constructed using the signal window generated in step S104. Three random combinations of data augmentation are applied to each signal window: adding Gaussian noise with a mean of 0 and a standard deviation of 0.05; randomly shifting the window cyclically by up to 10 sampling points with a 50% probability; and multiplying the signal by an amplitude scaling factor uniformly distributed within the interval [0.9, 1.1]. Two different augmented versions of the same window are paired as positive samples. A first-in-first-out (FIFO) memory bank with a capacity of 4096 is maintained, storing the 4096 most recent projected feature vectors. For each training batch, 256 negative sample vectors are randomly sampled from the memory bank. Positive sample pairs are input into a two-branch cross-modal deep learning model. After passing through a signal encoder, sequence encoder, and cross-attention fusion, two normalized 128-dimensional projection vectors are obtained through a contrastive learning projector. and Optimization is performed using the InfoNCE loss function:

[0056] in For cosine similarity, temperature coefficient = 0.1, where B is the batch size. Pre-training is performed for 10 epochs, using AdamW as the optimizer, with a learning rate of 1e-4 and a weight decay coefficient of 0.01. After each batch, the projection vector of the current batch is... Update the memory bank using a first-in, first-out (FIFO) method.

[0057] During training, supervised multi-task joint fine-tuning is then performed. Based on the weights obtained during pre-training, the complete model is loaded, and the memory bank is reinitialized. The total loss function is a weighted sum of the multi-class cross-entropy loss, the binary cross-entropy loss, and the contrastive loss:

[0058] in, and Both methods use label-smoothed cross-entropy loss with a smoothing factor of 0.05. The calculation method is the same as in the pre-training phase. The AdamW optimizer is used with an initial learning rate of 1e-4, weight decay of 0.01, and a cosine annealing learning rate scheduling strategy with T_max of 40. The maximum norm of gradient clipping is 1.0. Supervised fine-tuning is performed for a maximum of 40 epochs. The total loss is monitored on the validation set. If the decrease in validation loss does not exceed 1e-4 for 8 consecutive epochs, an early stopping mechanism is triggered, and the model parameters with the minimum validation loss are selected as the final model and saved.

[0059] S108 performs multi-class prediction of RNA modification based on the trained multi-class prediction model to obtain the final prediction result for each base site.

[0060] As an example, RNA modification multi-class prediction is performed based on a trained multi-class prediction model to obtain the final prediction result for each base site. This includes: obtaining a validation set, which includes a signal window tensor and corresponding k-mer integer indices; inputting the validation set into the trained multi-class prediction model to obtain the multi-class logical value for each sample; calculating the corresponding maximum softmax probability and energy score based on the multi-class logical value, and obtaining the lower bound threshold of the maximum softmax probability and the upper bound threshold of the energy score; obtaining a test set, which includes a signal window tensor and corresponding k-mer integer indices; inputting the test set into the trained multi-class prediction model to obtain the multi-class logical value and binary logical value for each sample; calculating the corresponding maximum softmax probability and energy score based on the multi-class logical value, and performing joint open set determination based on the maximum softmax probability, energy score, lower bound threshold of the maximum softmax probability, and upper bound threshold of the energy score to obtain the final prediction result for each base site in the test set.

[0061] As an example, the maximum Softmax probability and energy score are calculated based on the multi-class logical values, and the lower bound threshold of the maximum Softmax probability and the upper bound threshold of the energy score are obtained, including: taking the 5th percentile of the maximum Softmax probability of all samples in the validation set as the lower bound threshold of the maximum Softmax probability, and taking the 95th percentile of the energy score as the upper bound threshold of the energy score.

[0062] Specifically, after training, samples of all known categories from the validation set are input into the trained model for forward propagation, and the multi-class logistic value vector of each sample is recorded. Calculate the maximum softmax probability and energy fraction:

[0063]

[0064] Take the 5th percentile of the MSP values ​​of all samples in the validation set as the lower bound threshold of MSP. The 95th percentile of the energy score is taken as the upper limit threshold of the energy. .

[0065] For each base position in the read segment to be detected, the signal window and k-mer index are obtained according to the methods in steps S104 and S105, forming an input pair, which is then input into the trained model to obtain the multi-class logical value. and binary classification logic values .in accordance with Calculate MSP and energy value based on The binary classification modification probability is calculated using the Softmax function.

[0066] Figure 3 The confusion matrix is ​​used to illustrate the model's performance on the test set across 8 categories (m). 6 A、m 5 The classification performance of C, Ψ, I, A, U, C, G can intuitively evaluate the model's ability to handle modification types with similar electrical responses (such as m). 6 Whether there are misjudgments between A and Ψ, and the model's ability to distinguish the boundary between modified and unmodified classes.

[0067] Figure 4 A one-vs-rest strategy was used to plot ROC curves for eight categories and the micro-average. The AUC values ​​for all categories were above 0.966, with class G having the highest AUC (0.998) and the micro-average AUC reaching 0.995, indicating that the model possesses excellent discriminative ability for all known modified and unmodified bases. Furthermore, the curves closely clustered in the upper left corner, and the true positive rate approached 1.0 when the false positive rate was approximately 0.2%, validating the significant improvement in the ability to distinguish similar modifications achieved through the cross-attention fusion mechanism.

[0068] As an example, the open set joint determination is performed based on the maximum Softmax probability, energy score, lower bound threshold of the maximum Softmax probability, and upper bound threshold of the energy score. This includes: if the maximum Softmax probability is less than the lower bound threshold of the maximum Softmax probability or the energy score is greater than the upper bound threshold of the energy score, then an unknown label is triggered, the corresponding site is labeled as an unknown modification, and the fused unknown confidence is calculated; otherwise, the predicted modification category is the known modification category corresponding to the maximum probability value of the multi-class logistic value after the Softmax function, and the confidence is taken as the maximum Softmax probability value.

[0069] Specifically, if the following conditions are met or If any of the conditions in the above conditions are met, the site is marked as "Unknown" and the confidence level is the fused unknown confidence level UnkConf.

[0070] in, The function is sigmoid. If neither of the above two conditions is met, the predicted modification category is... The known modified category corresponding to the maximum probability after the Softmax function is given a confidence level based on the MSP value.

[0071] like Figure 2 As shown in the framework diagram, the prediction results for individual base sites are summarized. Each record includes: read identifier (read_id), base index on the sequence (base_index), predicted modification type (predicted_mod_type), confidence level, binary modification probability (binary_modified_probability), unknown modification flag (unknown_flag, boolean value), and unknown confidence level (unknown_confidence). The summarized results can be saved as CSV or JSON files for downstream analysis and visualization.

[0072] In summary, the RNA modification multi-classification prediction method based on cross-modal fusion proposed in this application effectively compensates for signal-base alignment bias caused by non-uniform sequencing rates in nanopore sequencing by establishing a coordinate mapping system based on a moving table, thereby improving the feature fidelity of the system under complex modification extraction. By jointly optimizing the electrical signal encoder and sequence embedding features in space, the model can focus on electrical signal distortion based on context, enhancing the classification system's resistance to confusion with highly similar RNA modification categories. By calculating the energy score and maximum probability threshold distribution of the classification space in real time, early warning and interception of novel modifications or abnormal sequencing waveforms are achieved, thus improving the system's robustness in complex and incompletely characterized samples while ensuring the recognition of known modifications.

[0073] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0074] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0075] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0076] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0077] It should be noted that any reference signs placed between parentheses in the claims should not be construed as limiting the claims. The word "comprising" does not exclude the presence of components or steps not listed in the claims. The word "a" or "an" preceding a component does not exclude the presence of a plurality of such components. The invention can be implemented by means of hardware comprising several different components and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third, etc., does not indicate any order. These words can be interpreted as names.

[0078] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention.

[0079] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.

[0080] In the description of this invention, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.

[0081] In this invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," "linking," and "fixing," etc., should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.

[0082] In this invention, unless otherwise explicitly specified and limited, "above" or "below" the second feature can mean that the first feature is in direct contact with the second feature, or that the first feature is in indirect contact with the second feature through an intermediate medium. Furthermore, "above," "over," and "on top" of the second feature can mean that the first feature is directly above or diagonally above the second feature, or simply that the first feature is at a higher horizontal level than the second feature. "Below," "below," and "under" the second feature can mean that the first feature is directly below or diagonally below the second feature, or simply that the first feature is at a lower horizontal level than the second feature.

[0083] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms should not be construed as necessarily referring to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0084] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.

Claims

1. A multi-class prediction method for RNA modification based on cross-modal fusion, characterized in that, Includes the following steps: Obtain the raw electrical signal file, the reference genome sequence file, and the known modification site annotation file; A binary alignment mapping format file is generated based on the original electrical signal file and the reference genome sequence file, wherein the binary alignment mapping format file includes read segment identifier, query sequence, reference sequence name, alignment start position, chain direction field and move table label; The original electrical signal file is normalized by median absolute deviation to obtain a normalized signal vector, and the moving table coordinates are mapped according to the moving table labels to obtain a mapping array from bases to signal center indices. For each target base on each read segment, the truncation range is determined in the normalized signal vector according to the mapping array from the base to the signal center index, so as to obtain the signal window tensor corresponding to each target base; Based on the query sequence, perform base sequence context encoding to obtain a k-mer integer index; Based on the reference sequence name, alignment start position and chain direction fields, query the known modification site annotation file to obtain the classification label corresponding to each target base site; A two-branch cross-modal deep learning model is constructed, and the signal window tensor, k-mer integer index and corresponding classification label are input into the two-branch cross-modal deep learning model for training to obtain a trained multi-class prediction model; RNA modification multi-class prediction is performed based on the trained multi-class prediction model to obtain the final prediction result for each base site.

2. The RNA modification multi-class prediction method based on cross-modal fusion as described in claim 1, characterized in that, Based on the moving table labels, a moving table coordinate mapping is performed to obtain a mapping array from bases to signal center indices, including: The movement table labels are parsed to obtain the corresponding step size parameters and movement sequences; Based on the step size parameter and the moving sequence, a mapping array is constructed from the base index to the center index of the signal sampling point. The length of the mapping array is the length of the corresponding query sequence.

3. The RNA modification multi-class prediction method based on cross-modal fusion as described in claim 2, characterized in that, The movement table labels are parsed to obtain the corresponding step size parameters and movement sequences, including: If the first element in the moving table label is greater than 0, then the first element is used as the corresponding step size parameter, and the remaining elements are used as the moving sequence. If the first element in the move table label is equal to 0, then set the step size parameter to 1, and use all elements as the move sequence.

4. The RNA modification multi-class prediction method based on cross-modal fusion as described in claim 3, characterized in that, Based on the step size parameter and the moving sequence, a mapping array from base index to signal sampling point center index is constructed, including: Initialize the position cursor. Initialize an empty list of maps to store the map values; Iterate through each element in the movement sequence. If element m is greater than 0, append m current position cursors to the end of the mapping list, and then update the current position cursor = previous position cursor + step parameter. If element m equals 0, it is not appended to the end of the mapping list, and the current position cursor is updated to the previous position cursor plus the step parameter. After traversing all elements in the moving sequence, the mapping list is a mapping array from base index to the center index of the signal sampling point.

5. The RNA modification multi-class prediction method based on cross-modal fusion as described in claim 1, characterized in that, Based on the base-to-signal center index mapping array, a truncation range is determined in the normalized signal vector to obtain the signal window tensor corresponding to each target base, including: Get the preset window length; Based on the base-to-signal-center index corresponding to each target base in the base-to-signal-center index mapping array, the window center is truncated to both sides to obtain a signal window tensor with a preset window length. If the window boundary exceeds the effective range of the normalized signal vector, the nearest edge sample value is used for copying and filling.

6. The RNA modification multi-class prediction method based on cross-modal fusion as described in claim 1, characterized in that, Based on the query sequence, base sequence context encoding is performed to obtain a k-mer integer index, including: Convert all thymine in the query sequence to uracil; Extend two bases to each side of the target base and extract 5-mers. If the target base is at the edge of the sequence, resulting in fewer than two bases on each side, fill the missing positions with the character N. The 5-mer is weighted according to the base-to-integer mapping rule: A=0, C=1, G=2, U=3, with weights of 4 from left to right. 4 , 4³, 4², 4¹, 4 0 Encode 5-mer as a unique integer index between 0 and 1023; If the 5-mer contains the padding character N, then the integer index is marked as invalid -1 to obtain the k-mer integer index.

7. The RNA modification multi-class prediction method based on cross-modal fusion as described in claim 1, characterized in that, A two-branch cross-modal deep learning model is constructed, and the signal window tensor, k-mer integer index, and corresponding classification label are input into the two-branch cross-modal deep learning model for training to obtain a trained multi-class prediction model, including: A dual-branch cross-modal deep learning model is constructed, wherein the dual-branch cross-modal deep learning model includes a signal encoder, a sequence encoder, a cross-attention fusion module, and a multi-task output module; The signal window tensor is input into the signal encoder for signal encoding to obtain the signal feature vector; The k-mer integer index is input into the sequence encoder for sequence encoding to obtain the sequence feature vector; The signal feature vector and the sequence feature vector are input into the cross-attention fusion module for cross-attention fusion to obtain a joint feature vector; The joint feature vector is input into the multi-task output module to simultaneously connect to the multi-classification head, the binary classification head, and the contrastive learning projection head to output the corresponding results. Contrastive learning datasets are constructed based on the signal window tensor for contrastive learning pre-training, and the bi-branch cross-modal deep learning model is optimized as a whole. Based on the weights obtained from pre-training, the corresponding loss function is obtained according to the corresponding results and then subjected to supervised multi-task joint fine-tuning to obtain a trained multi-class prediction model.

8. The RNA modification multi-class prediction method based on cross-modal fusion as described in claim 1, characterized in that, Based on the trained multi-class prediction model, RNA modification multi-class prediction is performed to obtain the final prediction result for each base site, including: Obtain a validation set, wherein the validation set includes a signal window tensor and the corresponding k-mer integer index; The validation set is input into the trained multi-class prediction model to obtain the multi-class logical value corresponding to each sample; The maximum Softmax probability and energy score are calculated based on the multi-class logic value, and the lower bound threshold of the maximum Softmax probability and the upper bound threshold of the energy score are obtained. Obtain a test set, wherein the test set includes a signal window tensor and the corresponding k-mer integer index; The test set is input into the trained multi-class prediction model to obtain the multi-class logical value and binary logical value corresponding to each sample; The maximum softmax probability and energy score are calculated based on the multi-class logic value. The open set is then jointly determined based on the maximum softmax probability, energy score, lower bound threshold of the maximum softmax probability, and upper bound threshold of the energy score to obtain the final prediction result for each base site in the test set.

9. The RNA modification multi-class prediction method based on cross-modal fusion as described in claim 8, characterized in that, Calculate the corresponding maximum Softmax probability and energy score based on the multi-class logic value, and obtain the lower bound threshold of the maximum Softmax probability and the upper bound threshold of the energy score, including: The 5th percentile of the maximum Softmax probability of all samples in the validation set is taken as the lower bound threshold of the maximum Softmax probability, and the 95th percentile of the energy score is taken as the upper bound threshold of the energy score.

10. The RNA modification multi-class prediction method based on cross-modal fusion as described in claim 9, characterized in that, The open set is jointly determined based on the maximum Softmax probability, energy score, lower bound threshold of the maximum Softmax probability, and upper bound threshold of the energy score, including: If the maximum Softmax probability is less than the lower bound threshold of the maximum Softmax probability or the energy score is greater than the upper bound threshold of the energy score, then an unknown labeling is triggered, the corresponding site is labeled as an unknown modification, and the fusion unknown confidence is calculated. Otherwise, the predicted modification category is the known modification category corresponding to the maximum probability value of the multi-class logistic value after passing through the Softmax function, and the confidence level is taken as the maximum Softmax probability value.