Abstract
RNA N7-methylguanosine (m7G) is an important post-transcriptional epigenetic modification that participates in key biological processes, including RNA processing, stability maintenance, and translational regulation. Medical research has shown that m7G modification and its related regulatory factors are closely related to many neurological diseases and tumors. The accurate prediction of m7G sites is thus critical for understanding their biological functions in diseases. In this work, we propose BF-m7GPred, a dual-branch deep learning framework that integrates single-nucleotide-level embeddings and motif-level embeddings for m7G modification site prediction. Our proposed context-aware module tokenizes RNA sequences using byte-pair encoding and encodes sequences with the pretrained foundation biological model DNABERT2. In parallel, the proposed feature fusion module transforms sequences into multiple feature matrices using multiple traditional encoders. We introduce a feature selection strategy tailored to the encoding characteristics of the two branches. On a benchmark dataset collected from m7G-Hub v2.0, BF-m7GPred achieves superior performance on the independent test set against existing methods. Furthermore, its generalization capability is validated through comparative experiments on 10 diverse RNA modification datasets.
1. Introduction
RNA modifications can regulate interactions between RNA and other biomacromolecules (e.g., proteins or other RNAs), thereby affecting RNA conformation, stability, and biological functions [1,2]. To date, more than 170 different kinds of natural RNA modifications have been identified [3]. Among them, N7-methylguanosine (m7G) is best known as the methylated guanosine forming the 5′ cap structure of eukaryotic mRNAs [4]. The m7G modification is involved in regulating diverse metabolic processes of various RNA species and plays important roles in gene expression regulation and physiological functions [5]. It affects almost the entire RNA metabolic lifecycle, including pre-mRNA splicing, maturation, polyadenylation, RNA structure and stability, transcription, translation, and nuclear export [6]. Recent research has shown that the dysregulation of m7G is related to the occurrence and development of various diseases such as developmental abnormalities, multiple cancers, and neurological disorders [7,8,9]. Therefore, the accurate identification of m7G sites is critical for elucidating the molecular mechanisms by which m7G contributes to RNA regulation and diseases.
With advances in next-generation sequencing technology, a range of experimental techniques have been developed for the transcriptome-wide identification of m7G RNA modifications, including AlkAniline-Seq [10], m7G-MeRIP-seq [11], m7G-seq [12], m7G-MaP-seq [13], and m7G-miCLIP-seq [14]. Among them, m7G-MeRIP-seq enables m7G detection at an approximate 100 bp resolution, whereas m7G-miCLIP-seq improves the resolution to around 30 bp. The remaining three approaches allow single-nucleotide resolution mapping of m7G sites. While these techniques have accelerated m7G detection, traditional experimental identification is still often costly and time-consuming. Collectively, these limitations have underscored the need for more efficient and scalable m7G identification methods.
In recent years, computational bioinformatics has experienced continuous development. Machine learning methods and deep learning techniques have been extensively applied to biological sequences. Numerous computational methods have recently been developed to identify RNA m7G modification sites. The feature extraction strategies and architectural designs of 11 m7G modification site prediction models are listed in Table S1. The first four are all machine learning-based models. The first m7G site machine learning predictor, iRNA-m7G [15], employs a multi-feature integration strategy that combines three kinds of features and uses a support vector machine (SVM) to predict m7G sites. Another SVM-based method, m7GPredictor [16], combines six encoding schemes and uses the Random Forest algorithm to find the optimized feature subset for SVM prediction. XG-m7G [17] integrates six feature-encoding methods and employs the eXtreme Gradient Boost (XGBoost) algorithm to improve m7G prediction performance. M7G-IFL [18] utilizes three feature extraction methods and introduces an iterative feature representation strategy, with XGBoost as the classifier for the identification of the m7G sites. These machine learning methods establish a solid foundation for m7G site prediction. The remaining seven models in Table S1 are all deep learning-based models. M7G-DLSTM [19] combines binary coding and nucleotide chemical properties (NCPs) [20] with a directional long short-term memory (LSTM) network to capture sequential context. Sia-m7G [21] leverages a lightweight attention mechanism and Convolutional Neural Network (CNN) architecture, using One-hot encoding [22], enhanced nucleic acid composition (ENAC) [23], and NCP to identify m7G sites. Recently, the Transformer architecture has been widely used in biological sequence modeling tasks. TMSC-m7G [24] uses multi-sense-scaled embedding methods combined with position embedding to extract the context information and sequential information, and then introduces Transformer [25] architecture for sequence encoding. Another predictor, im7G-DCT [26], introduces a two-branch design that combines an improved DenseNet for local feature extraction and a Transformer encoder for global information modeling, followed by a feature fusion method to further improve the accuracy of m7G site prediction. Deep-m7G [27] integrates DNABERT-2 [28] contextual embeddings with parallel multi-scale CNN blocks and a contrastive learning module to capture both local motifs and global independences. Moss-m7G employs the One-hot encoding method followed by multiple convolutional kernels to generate motif-embedding, and then applies a Transformer encoder to capture contextual information [29]. MCAMEF-BERT [30] further advances multi-view fusion by coupling a DNABERT-2 branch with a multi-encoding feature branch and introducing a representation alignment module under multi-channel attention to reconcile heterogeneous feature spaces.
Despite the endless emergence of m7G site predictors, there are still some limitations in current studies. Firstly, traditional machine learning-based predictors for m7G site identification are often trained on relatively small benchmark datasets, leaving substantial room for improvement in predictive accuracy and robustness. Secondly, many deep learning approaches rely on a single RNA sequence encoding scheme, which may be insufficient to capture complex sequence relationships and long-range dependencies, especially when the dataset scale increases or input sequences become longer. Furthermore, although numerous studies focus on architectural refinements and metric improvements, interpretability is frequently under-discussed, which may hinder further biological investigation and mechanistic understanding.
To address these challenges, we propose BF-m7GPred, a dual-branch deep architecture for efficient m7G site prediction that integrates base sequence order context with physicochemical characteristics. The main innovations of this study are as follows:
(1) BF-m7GPred adopts a dual-branch representation learning framework that combines complementary feature views and modeling dependencies from local sequence patterns to longer contextual signals, aiming to achieve the accurate identification of m7G sites.
(2) BF-m7GPred is developed on top of DNABERT2 with its native BPE tokenization, which enables compact token sequences and efficient contextual encoding. To better adapt BPE-derived representations to m7G prediction, we further introduce a feature selection strategy to enhance representation efficiency.
(3) To improve the interpretability of the proposed model, systematic experiments were conducted. We systematically examined the effect of input window length on predictive performance, and we conducted a comprehensive set of ablation experiments to examinate the contribution of each component of the model.
(4) To assess generalization and transferability, we additionally evaluated the performance of BF-m7GPred on ten other RNA modification datasets, demonstrating consistent performance across heterogeneous data distributions and RNA modification types.
2. Materials and Methods
2.1. Benchmark Datasets
High-quality datasets help deep learning models to learn more informative representation, thereby improving prediction reliability. In our study, the 7mG datasets for model training and testing were collected from the m7G-Hub v2.0 database [31]. To construct benchmark datasets, we first collected 8402 m7G modification sites in Homo sapiens covering HeLa and HepG2 cell lines. These sites were experimentally validated using the m7G-seq and m7G-MaP next-generation sequencing techniques, and were kept in base-resolution site format. To generate positive samples, we aligned the m7G sites to the reference genome and extracted 501-nt sequences centered on each site, including 250 nucleotides upstream and 250 nucleotides downstream. In order to reduce homology bias, the CD-HIT program [32] with a threshold of 0.8 was applied to remove similar sequences, yielding a high-quality positive sample of 5486 sequences. The generation of negative samples follows these rules: (1) non-m7G sites were randomly selected from unmodified G sites located on the same genes as m7G sites; (2) to avoid data overlap, the distance between each non-m7G site and any m7G site was kept to at least 400nt; (3) non-m7G sites and their upstream and downstream adjacent sequence regions were extracted from the human genome to construct negative samples. In this study, we split the entire dataset into training, testing, and validation sets in a ratio of 3:1:1. Detailed information about the dataset is shown in Table 1.
Table 1.
Details of our benchmark 7mG datasets.
2.2. Encoding Methods
2.2.1. Byte-Pair Encoding
Byte-Pair Encoding (BPE) is a subword-based tokenization algorithm widely used in Natural Language Processing (NLP) to efficiently represent text data. As for biological sequences, BPE can reduce memory requirements without truncating the input [33]. To establish a biological vocabulary, BPE starts with a vocabulary of individual nucleotides . Then, it iteratively merges the most frequent pair into new tokens. This process continues until a predefined vocabulary size or stop step is reached. BPE reduces the size of the vocabulary while maintaining meaningful representations. Note that in our work, the U base in RNA sequences is regarded as T for modeling.
2.2.2. One-Hot Encoding
One-hot encoding provides a simple way to represent biological sequences at single-base resolution. Each nucleotide is mapped to a binary vector of 4 dimensions, and thus converts an input sequence of length L centered on the modification site into a binary matrix in shape (4, L). Specifically, A, C, G and T are encoded as [1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0] and [0, 0, 0, 1], respectively. Note that for RNA sequences, U is used in place of T. One-hot encoding preserves the identity and position of each base, serving as a base-level input for the model to capture sequence patterns.
2.2.3. NCP
NCP is a classical and efficient encoding method that uses prior chemical knowledge of nucleobases. Differing from One-hot encoding, which treats bases as symbolic letters, NCP maps these four types of nucleotides to a 3-dimensional numeric vector according to the chemical properties, including ring structure, hydrogen bond strength, and functional group type. Specifically, A is mapped to [1, 1, 1], C is mapped to [0, 1, 0], G is mapped to [1, 0, 0], and T or U is mapped to [0, 0, 1]. As a result, a DNA or RNA sequence of length L is transformed to an L × 3 matrix, providing chemistry information for model training.
2.2.4. Electron–Ion Interaction Potential
Electron–Ion Interaction Potential (EIIP) [34] converts an RNA sequence into numerical features by assigning each nucleotide an electron–ion interaction pseudopotential value. EIIP values, derived from the energy of delocalized electrons in amino acids and nucleotides, have been used in classical machine learning algorithms (e.g., SVM) to predict DNA or RNA properties and sequences patterns. Specifically, A, G, C and U (T) are encoded as 0.1260, 0.0806, 0.1340 and 0.1335, respectively. Therefore, a sequence of length L is transformed into a numerical matrix of dimension L × 1.
2.2.5. ENAC
ENAC represents the local nucleotide composition of a sequence, calculated with a sliding-window approach. Given an input sequence of L, a fixed window size W, a stride of 1, and a padding of W/2, the window moves from the 5′ end to 3′ end and generates L overlapping subsequences. For each window, we counted the occurrences of the four nucleotides, denoted as , , and . The ENAC vector of the window could then be calculated as follows:
Finally, we stacked the vectors from all windows, yielding an ENAC feature matrix of size L × 4.
3. Model Architecture
In this study, we propose BF-m7GPred, a novel deep learning model with a dual-branch architecture that integrates a context-aware module (CAM) and a feature fusion module (FFM), leveraging five complementary encoding schemes to jointly capture sequence semantics, structural patterns, and physicochemical properties. The detailed architecture of BF-m7GPred is illustrated in Figure 1. In the CAM branch, the input sequence is first segmented into pieces, tokenized into tokens, and then mapped to input embeddings and fed into DNABERT2, which consists of 12 Transformer encoder layers. The resulting last hidden states are sent to a BiLSTM to capture bidirectional sequential dependencies, and a representation selection strategy is used to choose a contextual representation. In parallel, the FFM transforms the same sequence using a multi-encoder, including One-hot, EIIP, NCP, and ENAC. These feature matrices are processed by the CNN extractor to learn local patterns, and the extracted features are then fused and passed through another BiLSTM to model long-range representations. Finally, the representations from both branches are concatenated and fed into a two-layer linear classifier, yielding logits for binary classification (7mG vs. non-7mG).
Figure 1.
Overview of BF-m7GPred. The architecture contains three parts: (i) a context-aware module analyzing sequence patterns through DNABERT2 and BiLSTM, (ii) a feature fusion module that integrates multiple feature encoding methods and extracts features through CNNs and BiLSTM, and (iii) a classification module. The bottom-right panel illustrates the internal structure of the BiLSTM.
3.1. CNN Extractor
CNN has the structural characteristics of local connection and weight sharing, which can efficiently extract local patterns while controlling the size of parameters, so it is widely used in various pattern recognition tasks [35]. For sequence data, the 1D-CNN models local context relationships in the limited receptive field by sliding convolution kernels along the length dimension, thus effectively capturing short-range dependencies and local feature combinations in different representation spaces.
In the FFM branch of this model, we first use a variety of encoders to encode the input sequence and generate four feature matrices. Then, we use four parallel CNN extractors to process these four matrices respectively to fully mine the local pattern in their respective representation space. Each CNN extractor consists of two stacked 1D convolutional layers. We compare the sizes of different convolutional kernels, and ultimately set both kernels to a size of 5. As for channel configuration, we set the output channel size in the first Conv1D layer to 128 for all CNN extractors, except for the EIIP branch, where it is set to 64. This is because EIIP yields a single-channel scalar feature vector. To enhance robustness and alleviate overfitting, we add a dropout layer at the end of each extractor. As a result, four CNN outputs are fused in the channel dimension to form a higher-dimension representation matrix. The process of the CNN extractor and feature concatenation can be represented as follows:
3.2. DNABERT2
DNABERT2 is a transformer-based genome foundation model trained on a large-scale, multi-species genomic sequences, thus acquiring a global and transferrable understanding of genomic sequences. Compared to the former DNABERT [36], DNABERT2 replaces overlapping k-mer tokenization with BPE and positional embedding with Attention with Linear Bias (AliBi) [28], and incorporates other strategies to improve its efficiency and effectiveness. In addition, it can effectively process long genome sequences arbitrarily, which makes it more suitable as the length of the input sequence increases.
In our study, we leverage the pretrained DNABERT2 model to capture long-range positional dependencies within RNA sequences and generate high-dimensional-feature contextually enriched representations. While training, the tokenization of our input sequences is fed into the 12 layers of transformer block, each composed of a multi-head attention mechanism, a feed-forward network, and two normalization layers. For the -th encoder, the multi-head attention mechanism satisfies the following:
where denotes the input hidden state to the -th encoder, represents the multi-head attention output transformation matrix, represents the number of heads, and for the -th head,
with
where , , and represent the learnable query, key, and value transformation matrices of the -th head, and represents the AliBi matrix for head . After obtaining the multi-head self-attention output , the -th Transformer encoder applies a residual connection followed by layer normalization to produce an intermediate representation:
Then, a position-wise feed-forward network (FFN) is applied to . The FFN output is again combined with a residual connection and normalized to yield the encoder output:
We take the last hidden output states as our contextual features.
3.3. BiLSTM
BiLSTM is a special type of recurrent neural network. Its ability to retain long-term memory and capture bidirectional contextual relationships makes it particularly well suited for handling long sequence data [37]. As shown in the bottom-right panel of Figure 1, the BiLSTM consists of two LSTM networks running in opposite temporal directions. Given an input feature sequence , the forward LSTM processes the sequence from 1 to , while the backward LSTM processes it from to 1. At each position , the two hidden states are concatenated to form a bidirectional context representation, allowing the model to integrate both upstream and downstream information at the same position. Formally, for ,
and the bidirectional representation is obtained by concatenation:
As shown in Figure 1, we introduce a BiLSTM module at the end of both the CAM and the FFM. In the CAM, the BiLSTM is used to further contextualize the token-level representations generated by the fine-tuned DNABERT2 backbone network. In the FFM, it is applied after multi-encoder feature extraction and CNN-based local pattern modeling, allowing the fused feature sequence to be refined through sequence context before classification.
3.4. Feature Selection Strategy
In our task, we select position-specific representations from each branch and fuse them for the final binary classification. For the FFM branch, features are encoded at the single-nucleotide level; thus, the BiLSTM outputs are naturally aligned with the original sequence. Therefore, we directly take the BiLSTM hidden state at the center position as the representative feature. In contrast, the CAM branch applies a BPE tokenizer that iteratively merges frequent cooccurring nucleotide pairs into variable-length tokens. As a result, the token sequence length is not fixed and each token may span a variable number of nucleotides. To quantify this misalignment, we computed, over the entire training dataset, the distribution of the token position that covers the central nucleotide after BPE tokenization. As shown in Figure 2, there is a clear unimodal pattern, with nonzero indices ranging from 26 to 61 and a pronounced peak at index 49 (0-based), with most samples concentrated around its neighborhood. Previous research also showed that BPE tokenization can compress the sequence length by nearly five times on average [28]. Based on these results, we selected the hidden vector of the token from the CAM branch as the representative feature for the central region, where denotes the RNA sequence length. Finally, the two selected branch features are fused by concatenation and fed into the classifier to produce predictions.
Figure 2.
Distribution of the token position covering the central nucleotide after BPE for the 501nt RNA sequence. Dashed vertical lines denote the boundaries of the non-zero index range.
3.5. Classification Module
We added a classification head to the end of BF-7mGPred to perform 7mG site prediction. The classification module consists of a linear layer that projects the hidden vector to a lower dimension vector, followed by a ReLU activation and a dropout layer for regularization, and a final linear layer that outputs class logits. The predicted probability of the m7G class is obtained by applying a Softmax function to the logits, which can be represented as follows:
The objective for model parameters updates is optimized using the cross-entropy loss between the predicted probabilities and the ground-truth labels:
3.6. Metrics
We evaluated the performance of our proposed model and comparable methods using Accuracy (ACC), Sensitivity (SN), Specificity (SP), and Matthew’s correlation coefficient (MCC). These metrics are defined as
where TP, TN, FP, and FN represent true positives, true negatives, false positives, and false negatives, respectively. The ACC measures the overall proportion of correctly classified samples. However, ACC can be misleading under class imbalance. Therefore, we additionally introduce SN and SP. SN measures the percentage of modified sites that are correctly identified, whereas SP measures the percentage of non-modified sites that are correctly rejected. To further account for potential imbalance and to capture the quality of predictions across all four outcomes in a single statistic, we use MCC. MCC is a balanced metric for binary classification that measures the model’s performance even when class proportions are uneven. In addition, we introduce the area under the receiver operating characteristic curve (AUC), which evaluates the ranking/separability of positives and negatives across all decision thresholds to further compare the performance of our model. Our model aims to achieve higher results in all of these metrics.
3.7. Model Training Details
Our model was trained on eight NVIDIA RTX 3090 GPUs, and the DNABERT2 component was wrapped with Low-Rank Adaptation (LoRA) for efficient parameter fine-tuning to accelerate training. We utilized the AdamW [38] optimizer for parameter optimization with a learning rate of 1 × 10−4 and a weight decay of 1 × 10−2. To mitigate overfitting, we applied different dropout rates to different modules: the dropout of the BiLSTM was set to 0.5, while the rest of the model used dropout rates set at 0.1. The model was trained for 20 epochs with a warmup ratio of 0.05. Distributed training was performed using torchrun. The per GPU batch size was set to 8 for training as well as for validation and testing. During training, we used the Matthews correlation coefficient (MCC) as the primary criterion for selecting the best checkpoint, and the selected best model was then evaluated on an independent test set for final performance assessment.
4. Results and Discussion
4.1. Performance Comparison with Existing Models
We first employed five-fold cross-validation to assess model performance. Specifically, the predefined training and validation subsets of the benchmark dataset were first merged, and 20% of the merged dataset was further held out as a validation set for performance evaluation and hyperparameter tuning. We then conducted five independent rounds of five-fold cross-validation. Model robustness was evaluated by examining the variability of performance metrics across all rounds. As shown in Figure 3, all metrics remained stable across different rounds, exhibiting only negligible fluctuations.
Figure 3.
Performance of 5-round cycle of cross-validation.
We further evaluated the performance with several state-of-the-art predictors on the independent test datasets, aiming to verify the superiority of our model in m7G site prediction. We recovered the original codes of iRNA-m7G, m7GPredictor, Moss-m7G, im7G-DCT, MCAMEF-BERT and DEEP-m7G and applied them to the benchmark datasets of this study. To ensure a fair benchmarking process, we used their default parameters and environment settings to conduct comparative experiments, and the datasets were formed in a consistent way. The result is shown in Table 2, which shows that BF-m7GPred consistently outperforms classical machine learning-based predictors and recent deep models in all five evaluation metrics, indicating our model’s strong capability in identifying RNA m7G sites. Specifically, our model achieves scores of 93.93% in ACC, 93.52% in SN, 94.55% in SP, 87.87 in MCC, and 98.24% in AUC.
Table 2.
Performance between our model and other predictors on independent tests.
From a modeling perspective, our proposed BF-m7GPred is based on the Transformer-based backbone in the pretrained DNABERT2. Through multi-head self-attention, Transformers can integrate information across arbitrary distances in a sequence, enabling the model to capture long-range contextual dependencies. This property is particularly valuable for RNA modification identification tasks. Furthermore, compared with MCAMEF-BERT, which also adopts a DNABERT2-based backbone but represents input sequences using fixed-length k-mer tokenization rather than DNABERT2’s native BPE, our model benefits from both efficiency and effectiveness. Specifically, BPE typically produces a shorter token sequence, thereby reducing the computational and memory cost of self-attention. In addition, by avoiding the heavy token overlap and redundancy inherent to k-mer schemes, BPE can yield a more compact and less repetitive representation, which is expected to facilitate more effective transfer from pretraining and may partly explain the improved predictive performance.
4.2. Impact of Different Sequence Length on Our Model
To achieve optimal performance of the basic classifiers, we explored the influence of input RNA sequence length on the final model predictions. Specifically, we evaluated the performance of our model with sequence lengths of 51 bp, 101 bp, 201 bp, 301 bp, 401 bp and 501 bp. As shown in Figure 4, a sequence length of 501 bp yields the best overall performance, with the model performance improving as the sequence length increases. We also observe monotonically improved performance as the sequence length increases from 51 bp to 501 bp. This indicates that m7G-associated signals are not strictly confined to an immediate neighborhood around the modified G. Extended windows may include additional contextual information that helps the model achieve better performance.
Figure 4.
Influence of sequence length on performance. This figure shows the performance of BF-m7GPred under different input window lengths. (A) Effect of Sequence Length on ACC. (B) Effect of Sequence Length on MCC.
To more deeply understand the relationship between sequence length and m7G site predictions, we then used the MEME [39] tool to discover motifs enriched in the input sequences. Enrichment is measured relative to a (higher-order) random model based on the frequencies of the letters in the sequences. Figure S1A shows the five motifs found by MEME. To determine the distribution of motifs on RNA sequences, we used MAST [39] to conduct motif matching. MAST searches sequences for matches to a set of motifs, and sorts the sequence by best combined match to all motifs [39]. Figure S1B shows the best ten combined matches to all MEME-found motifs, from which we can see that motifs land not only around the center of the sequences, which is the 7mG site, but are also distributed across other regions of the sequence. This indicate that the model may benefit from integrating distal context rather than focusing exclusively on a narrow fragment around the center base. Considering the best performance of metrics, we selected 501bp RNA sequences as the m7G datasets for the subsequent experiments.
4.3. Interpretability Analysis of Our Model
To enhance the transparency and interpretability of our learned model, SHapley Additive exPlantions (SHAP) [40] and gradient-based methods [41] were applied to identify the features that most strongly influenced model predictions. The SHAP values quantify each feature’s contribution to the model’s prediction. Feature importance is reflected by the magnitude of the SHAP value, which can be visualized by bar length in the summary plot. SHAP values greater than 0 suggest that a feature pushes the prediction toward the positive class, whereas negative SHAP values push it toward the negative class. We computed the SHAP values for the concatenated vector formed from the outputs of the two BILSTM branches. Figure 5 shows the top 30 features with the largest absolute SHAP values. Among the top 30 features, 27 were derived from the CAM branch, whereas only three originated from the FFM branch. In addition, the top five features were all CAM-derived, suggesting that DNABERT2 representations dominate the final decision, while single-nucleotide-level features from FFM branch contribute more modestly. However, several features from the FFM branch exhibited higher SHAP values than those of DNABERT2 features. The SHAP on the fused representation indicates that the CAM-derived features dominate the top-ranked contributors, while a smaller subset of FFM features still provides complementary information for m7G prediction.
Figure 5.
Top 30 features sorted by SHAP.
We employed a gradient-based importance analysis to investigate where the model attends in the CAM branch. Specifically, we computed the gradients of the logits with respect to the hidden-layer outputs of DNABERT2, and summed the gradients across the 768 dimensions for each feature to obtain a feature-level gradient importance score. Larger gradient magnitudes indicate that the model’s prediction relies more heavily on the corresponding features at those positions. Figure 6 illustrates the important scores for ten randomly selected positive samples. Notably, across all ten samples, the feature at position 49 (0-based) consistently exhibits a peak importance score, and the positions surrounding 49 (0-based) also show substantially higher values than other regions, suggesting that the model’s decision is primarily driven by this local neighborhood.
Figure 6.
Gradient-based position importance analysis for CAM branch.
4.4. Generalization Evaluation of BF-m7GPred
To validate our model’s generalization capability, we conducted comparative evaluations and independent tests with two competing methods—MultiRM [42] and Moss-m7G—on ten additional RNA methylation datasets, including Am, Cm, Gm, Um, m1A, m5C, m5U, m6A, m6Am and . All of the datasets were obtained from Song et al. [42]. For a fair comparison, we followed the same dataset organization as MultiRM and adopted identical training, validation and test splits. As shown in Figure 7, our predictor achieves the best overall performance, delivering higher AUC on almost all methylation types and higher MCC on most datasets than other methods. BF-m7GPred achieved its highest performance on m5U, with the best AUC of 0.978 and best MCC of 0.923. In addition, it showed particularly large MCC advantages on Um and m6A, exceeding the best-competing method by 17.5% and 15.6%. Notably, the model was relatively weaker on Am, Gm (where its AUC was slightly lower than the best baseline), and m6Am. This may be because different modifications may have distinct sequence preferences, label noise levels, and dataset sizes; thus, a single architecture and hyperparameter setting may not be optimal in different RNA modification site prediction tasks. In summary, our model is not only an efficient and interpretable predictor for m7G site prediction tasks, but also exhibits broad applicability and potential research value in other types of RNA modification site identification.
Figure 7.
Comparison of performance on 10 RNA modification types. This figure summarizes the generalization performance across ten RNA modification datasets.
4.5. Ablation Research
To assess the contribution of each component in BF-m7GPred, we conducted an ablation study. We constructed three ablated variants: (1) w/o FFM: removing the feature fusion module and the four CNN modules and one BiLSTM module, while retaining the CAM branch and the final classifier; (2) w/o BiLSTM: removing the BiLSTM model, using representations from DNABERT2’s last hidden layer and the CNN extractor, following the classification module; (3) finetuned DNABERT2: in finetuning pretrained DNABERT2, instead of utilizing our feature selection strategy, this version feeds the [CLS] output of DNABERT2 into the final classification module.
Ablation experiments were conducted on the m7G benchmark using 501nt sequence segments, and the ratio of training, evaluation and testing was set at 3:1:1. As shown in Figure 8, compared with w/o FFM, BF-m7GPred improves ACC by 1.68%, SN by 0.54%, SP by 5.46%, MCC by 3.22%, and AUC by 0.05%, indicating that the feature fusion mechanism effectively leverages multi-encoding features for more accurate m7G identification. When compared to w/o BiLSTM, BF-m7GPred achieved 0.91% increases for ACC, 3.82% for SP, 1.77% for MCC, 0.32% for AUC, and 0.05% for SN, suggesting that the BiLSTM mainly enhances specificity and overall performance by aggregating contextual information across features. We further compared the performance of BF-m7GPred and finetuned DNABERT2, finding that BF-m7GPred exhibited a more significantly improved ACC of 4.67% and SN of 3.45%, SP of 6.82%, MCC of 7.88%, and AUC of 4.97% compared to finetuned DNABERT2, respectively. This indicates that relying on the [CLS] representation might be less effective than our specific feature selection strategy. Notably, even w/o FFM still outperforms finetuned DNABERT2 across all metrics, further supporting the necessity of the feature selection strategy and BiLSTM module. These results further validate the superiority of BF-m7GPred in terms of feature representation and discriminative power.
Figure 8.
The predictive performance for different model variants across independent datasets. This figure presents the ablation results of key components in BF-m7GPred.
To evaluate the contributions of different features in the FFM branch, we conducted systematic ablation studies of the influence of the four key features: EIIP, NCP, ENAC and One-hot encoding. The result suggests that all of these features are important in predicting m7G modification sites. As shown in Table S4, removing any one of the EIIP, ENAC, and NCP components results in a 0.13–0.27% decrease in ACC and 0.62–0.91% decrease in MCC. Removing the One-hot encoding part leads to an almost 0.5 decrease in ACC and 0.94% decrease in MCC. Notably, when these four features are fused, the model exhibited the highest performance, which highlights the joint benefits of our fusing feature branch.
5. Conclusions
RNA m7G modification is essential for RNA stability, transport, and translation, and its dysregulation is closely associated with the occurrence and progression of various diseases. Accurately identifying m7G sites is thus critical for understanding how m7G shapes RNA regulation and influences disease development. In this study, we developed a novel m7G predictive model for identifying m7G sites. The core innovation of this work lies in the design of a dual-branch network architecture that integrates features at the single-nucleotide resolution and fragment level, enabling the fusion of critical information such as sequence context, biochemical properties and spatial structure. Meanwhile, we also devised a feature selection strategy tailored to the encoding characteristics of the two branches. The results of comparative experiments with existing predictors indicates that the proposed model, BF-m7GPred, outperforms recent machine learning-based models and deep models in m7G prediction tasks. Moreover, systematic experiments in terms of input sequence length selection, feature contribution, and model design were conducted to help build a stable and accurate m7G predictor and enhance the interpretability of our model. Furthermore, the comparative evaluation across ten additional RNA modification datasets further suggests that our model exhibits superior generalization performance and transferability compared with the existing model. Overall, our model demonstrates strong performance for RNA modification site prediction and provides research value for computational epitranscriptomics and bioinformatics studies.
However, there are still some limitations. First, the m7G benchmark datasets utilized in this study are relatively small and are restricted to HeLa and HepG2 cell lines in Homo sapiens, mainly because the number of biological experimentally validated m7G sites at single-nucleotide resolution remains limited. In future work, we plan to expand the dataset size and improve data quality through deeper investigation and collaborative efforts, thereby enabling the construction of a higher-quality dataset that can further improve the model’s accuracy and generalization in RNA modification site prediction tasks. In addition, we have not yet provided a user-friendly, packaged implementation for convenient use of the model. To facilitate follow-up research and development, we have publicly released all related materials, including the datasets and source code. These materials are openly available in GitHub at (https://github.com/yjccm/BF-m7GPred, accessed on 23 February 2026).
Supplementary Materials
The following supporting information can be downloaded at https://www.mdpi.com/article/10.3390/app16052577/s1: Table S1: Overview for existing m7G predictors; Table S2: Ten additional RNA modification datasets; Table S3: Performance on additional RNA modification datasets; Table S4: Performance of different encoding schemes on m7G site prediction; Figure S1: Visualization of motifs in m7G sequences and the top 10 scoring sequences identified by MAST.
Author Contributions
Conceptualization, J.C., Q.J., X.F. and S.X.; Methodology, J.C., Q.J., X.F. and S.X.; Software, J.C.; Validation, J.C.; Formal analysis, J.C. and S.X.; Investigation, J.C. and S.X.; Resources, J.C. and S.X.; Data curation, J.C., Q.J. and X.F.; Writing—original draft, J.C.; Writing—review and editing, J.C. and S.X.; Visualization, J.C.; Supervision, S.X.; Project administration, S.X.; Funding acquisition, S.X. All authors have read and agreed to the published version of the manuscript.
Funding
National Key R&D Program of China (Youth Scientist Project, Grant No. 2024YFD2402300).
Data Availability Statement
The data presented in this study are openly available in GitHub at https://github.com/yjccm/BF-m7GPred (accessed on 23 February 2026).
Conflicts of Interest
The authors declare no conflicts of interest.
References
- Boccaletto, P.; Machnicka, M.A.; Purta, E.; Piatkowski, P.; Baginski, B.; Wirecki, T.K.; de Crécy-Lagard, V.; Ross, R.; Limbach, P.A.; Kotter, A.; et al. MODOMICS: A database of RNA modification pathways. 2017 update. Nucleic Acids Res. 2018, 46, D303–D307. [Google Scholar] [CrossRef] [Scilit]
- Liu, W.W.; Zheng, S.Q.; Li, T.; Fei, Y.F.; Wang, C.; Zhang, S.; Wang, F.; Jiang, G.M.; Wang, H. RNA modifications in cellular metabolism: Implications for metabolism-targeted therapy and immunotherapy. Signal Transduct. Target. Ther. 2024, 9, 70. [Google Scholar] [CrossRef] [Scilit]
- Yang, B.; Wang, J.Q.; Tan, Y.; Yuan, R.; Chen, Z.S.; Zou, C. RNA methylation and cancer treatment. Pharmacol. Res. 2021, 174, 105937. [Google Scholar] [CrossRef] [Scilit]
- Furuichi, Y. Discovery of m7G-cap in eukaryotic mRNAs. Proc. Jpn. Acad. Ser. B Phys. Biol. Sci. 2015, 91, 394–409. [Google Scholar] [CrossRef] [Scilit]
- Shimotohno, K.; Kodama, Y.; Hashimoto, J.; Miura, K.I. Importance of 5′-terminal blocking structure to stabilize mRNA in eukaryotic protein synthesis. Proc. Natl. Acad. Sci. USA 1977, 74, 2734–2738. [Google Scholar] [CrossRef] [Scilit]
- Li, J.Z.; Wang, L.F.; Hahn, Q.; Nowak, R.P.; Viennet, T.; Orellana, E.A.; Burman, S.R.S.; Yue, H.; Hunkeler, M.; Fontana, P.; et al. Structural basis of regulated m7G tRNA modification by METTL1-WDR4. Nature 2023, 613, 391–397. [Google Scholar] [CrossRef] [Scilit]
- Ma, J.Y.; Han, H.; Huang, Y.; Yang, C.L.; Zheng, S.Y.; Cai, T.C.; Bi, J.; Huang, X.H.; Liu, R.M.; Huang, L.B.; et al. METTL1/WDR4-mediated m7G tRNA modifications and m7G codon usage promote mRNA translation and lung cancer progression. Mol. Ther. 2021, 29, 3422–3435. [Google Scholar] [CrossRef] [Scilit]
- Li, Q.F.; Liu, H.; Li, L.S.; Guo, H.M.; Xie, Z.H.; Kong, X.J.; Xu, J.M.; Zhang, J.L.; Chen, Y.X.; Zhang, Z.S.; et al. Mettl1-mediated internal m7G methylation of Sptbn2 mRNA elicits neurogenesis and anti-alzheimer’s disease. Cell Biosci. 2023, 13, 183. [Google Scholar] [CrossRef] [Scilit]
- Xia, X.H.; Wang, Y.; Zheng, J.C. Internal m7G methylation: A novel epitranscriptomic contributor in brain development and diseases. Mol. Ther. Nucl. Acids 2023, 31, 295–308. [Google Scholar] [CrossRef] [Scilit]
- Marchand, V.; Bourguignon-Igel, V.; Helm, M.; Motorin, Y. Mapping of 7-methylguanosine (m7G), 3-methylcytidine (m3C), dihydrouridine (D) and 5-hydroxycytidine (ho5C) RNA modifications by AlkAniline-Seq. Methods Enzymol. 2021, 658, 25–47. [Google Scholar] [CrossRef] [Scilit]
- Zhang, L.S.; Liu, C.; Ma, H.; Dai, Q.; Sun, H.L.; Luo, G.; Zhang, Z.; Zhang, L.; Hu, L.; Dong, X.; et al. Transcriptome-wide Mapping of Internal N7-Methylguanosine Methylome in Mammalian mRNA. Mol Cell 2019, 74, 1304–1316.e8. [Google Scholar] [CrossRef] [Scilit]
- D’Ambrosi, S.; García-Vílchez, R.; Kedra, D.; Vitali, P.; Macias-Cámara, N.; Bárcena, L.; Gonzalez-Lopez, M.; Aransay, A.M.; Dietmann, S.; Hurtado, A.; et al. Global and single-nucleotide resolution detection of 7-methylguanosine in RNA. RNA Biol. 2024, 21, 476–493. [Google Scholar] [CrossRef] [Scilit]
- Enroth, C.; Poulsen, L.D.; Iversen, S.; Kirpekar, F.; Albrechtsen, A.; Vinther, J. Detection of internal N7-methylguanosine (m7G) RNA modifications by mutational profiling sequencing. Nucleic Acids Res. 2019, 47, e126. [Google Scholar] [CrossRef] [Scilit]
- Malbec, L.; Zhang, T.; Chen, Y.S.; Zhang, Y.; Sun, B.F.; Shi, B.Y.; Zhao, Y.L.; Yang, Y.; Yang, Y.G. Dynamic methylome of internal mRNA N7-methylguanosine and its regulatory role in translation. Cell Res. 2019, 29, 927–941. [Google Scholar] [CrossRef] [Scilit]
- Chen, W.; Feng, P.M.; Song, X.M.; Lv, H.; Lin, H. iRNA-m7G: Identifying N7-methylguanosine Sites by Fusing Multiple Features. Mol. Ther.-Nucl. Acids 2019, 18, 269–274. [Google Scholar] [CrossRef] [Scilit]
- Liu, X.D.; Liu, Z.; Mao, X.L.; Li, Q.W. m7GPredictor: An improved machine learning-based model for predicting internal m7G modifications using sequence properties. Anal. Biochem. 2020, 609, 113905. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Bi, Y.; Xiang, D.X.; Ge, Z.Y.; Li, F.Y.; Jia, C.Z.; Song, J.N. An Interpretable Prediction Model for Identifying N7-Methylguanosine Sites Based on XGBoost and SHAP. Mol. Ther. Nucl. Acids 2020, 22, 362–372. [Google Scholar] [CrossRef] [Scilit]
- Dai, C.C.; Feng, P.M.; Cui, L.Z.; Su, R.; Chen, W.; Wei, L.Y. Iterative feature representation algorithm to improve the predictive performance of N7-methylguanosine sites. Brief. Bioinform. 2021, 22, bbaa278. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Ning, Q.; Sheng, M.Y. m7G-DLSTM: Intergrating directional Double-LSTM and fully connected network for RNA N7-methlguanosine sites prediction in human. Chemom. Intell. Lab. Syst. 2021, 217, 104398. [Google Scholar] [CrossRef] [Scilit]
- Wang, T.; Liu, Z.D. m6A-SPP: Identification of RNA N6-methyladenosine modification sites through multi-source biological features and a hybrid deep learning architecture. Int. J. Biol. Macromol. 2025, 316, 144789. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Zheng, J.; Zhou, Y.T. Sia-m7G: Predicting m7G Sites through the Siamese Neural Network with an Attention Mechanism. Curr. Bioinform. 2024, 19, 953–962. [Google Scholar] [CrossRef] [Scilit]
- Huang, G.H.; Huang, X.H.; Jiang, J.Y. Deepm6A-MT: A deep learning-based method for identifying RNA N6-methyladenosine sites in multiple tissues. Methods 2024, 226, 1–8. [Google Scholar] [CrossRef] [Scilit]
- Chen, Z.; Zhao, P.; Li, F.Y.; Marquez-Lago, T.T.; Leier, A.; Revote, J.; Zhu, Y.; Powell, D.R.; Akutsu, T.; Webb, G.; et al. An integrated platform and meta-learner for feature engineering, machine-learning analysis and modeling of DNA, RNA and protein sequence data. Brief. Bioinform. 2020, 21, 1047–1057. [Google Scholar] [CrossRef] [Scilit]
- Zhang, S.L.; Xu, Y.J.; Liang, Y.Y. TMSC-m7G: A transformer architecture based on multi-sense-scaled embedding features and convolutional neural network to identify RNA N7-methylguanosine sites. Comput. Struct. Biotechnol. 2024, 23, 129–139. [Google Scholar] [CrossRef] [Scilit]
- Zeng, W.H.; Gautam, A.; Huson, D.H. MuLan-Methyl-multiple transformer-based language models for accurate DNA methylation prediction. Gigascience 2023, 12, giad054. [Google Scholar] [CrossRef] [Scilit]
- Lei, R.F.; Jia, J.; Qin, L.L. im7G-DCT: A two-branch strategy model based on improved DenseNet and transformer for m7G site prediction. Comput. Biol. Chem. 2025, 118, 108473. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Zhang, M.; Wu, J.; Wang, Y.L.; Cao, Y.; Liu, J.J.; Wang, Q.; Song, X.F.; Zhao, J.; Wang, Y.X. Deep-m7G: A contrastive learning-based deep biological language model for identifying RNA N7-methylguanosine sites. Int. J. Biol. Macromol. 2025, 318, 145341. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Zhou, Z.; Ji, Y.; Li, W.; Dutta, P.; Davuluri, R.; Liu, H. DNABERT-2: Efficient foundation model and benchmark for multi-species genome. arXiv 2023, arXiv:2306.15006. [Google Scholar]
- Zhao, Y.; Jin, J.; Gao, W.; Qiao, J.; Wei, L. Moss-m7G: A Motif-Based Interpretable Deep Learning Method for RNA N7-Methlguanosine Site Prediction. J. Chem. Inf. Model. 2024, 64, 6230–6240. [Google Scholar] [CrossRef] [Scilit]
- Yu, J.; Gao, W.; Chen, S.; Lu, R.; Qiao, J.; Jin, J.; Wei, L.; Shi, H.; Zhang, Z.; Cui, F.; et al. MCAMEF-BERT: An efficient deep learning method for RNA N7-methylguanosine site prediction via multi-branch feature integration. Brief. Bioinform. 2025, 26, bbaf447. [Google Scholar] [CrossRef] [Scilit]
- Wang, X.; Zhang, Y.X.; Chen, K.Q.; Liang, Z.M.; Ma, J.M.; Xia, R.; de Magalhaes, J.P.; Rigden, D.J.; Meng, J.; Song, B.W. m7GHub V2.0: An updated database for decoding the N7-methylguanosine (m7G) epitranscriptome. Nucleic Acids Res. 2024, 52, D203–D212. [Google Scholar] [CrossRef] [Scilit]
- Fu, L.; Niu, B.; Zhu, Z.; Wu, S.; Li, W. CD-HIT: Accelerated for clustering the next-generation sequencing data. Bioinformatics 2012, 28, 3150–3152. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Tahmid, M.T.; Shahgir, H.S.; Mahbub, S.; Dong, Y.; Bayzid, M.S. BiRNA-BERT allows efficient RNA language modeling with adaptive tokenization. Commun. Biol. 2025, 8, 1621. [Google Scholar] [CrossRef] [Scilit]
- Huang, G.; Tang, X.; Zheng, P. DeepHLAPred: A deep learning-based method for non-classical HLA binder prediction. BMC Genom. 2023, 24, 706. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Gunasekaran, H.; Ramalakshmi, K.; Rex Macedo Arokiaraj, A.; Deepa Kanmani, S.; Venkatesan, C.; Suresh Gnana Dhas, C. Analysis of DNA Sequence Classification Using CNN and Hybrid Models. Comput Math Methods Med 2021, 2021, 1835056. [Google Scholar] [CrossRef] [Scilit]
- Ji, Y.R.; Zhou, Z.H.; Liu, H.; Davuluri, R. DNABERT: Pre-trained Bidirectional Encoder Representations from Transformers model for DNA-language in genome. Bioinformatics 2021, 37, 2112–2120. [Google Scholar] [CrossRef] [Scilit]
- Yuan, Y.Q.; Tang, X.Z.; Li, H.Y.; Lang, X.F.; Song, Y.H.; Yang, Y.; Zhou, Z.J. BiLSTM- and CNN-Based m6A Modification Prediction Model for circRNAs. Molecules 2024, 29, 2429. [Google Scholar] [CrossRef] [Scilit]
- Zhou, P.; Xie, X.Y.; Lin, Z.C.; Yan, S.C. Towards Understanding Convergence and Generalization of AdamW. IEEE Trans. Pattern Anal. 2024, 46, 6486–6493. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Nystrom, S.L.; McKay, D.J. Memes: A motif analysis environment in R using tools from the MEME Suite. PLoS Comput. Biol. 2021, 17, e1008991. [Google Scholar] [CrossRef] [Scilit]
- Zhou, S.; Chen, J.; Wei, S.S.; Zhou, C.X.; Wang, D.; Yan, X.F.; He, X.; Yan, P.C. Exploring the correlation between DNA methylation and biological age using an interpretable machine learning framework. Sci. Rep. 2024, 14, 24208. [Google Scholar] [CrossRef] [Scilit]
- Wang, H.L.; Zhang, X.S.; Sun, Y.J.; Liu, Z.Y.; Zhang, L. MCLCBA: Multi-view contrastive learning network for RNA methylation site prediction. BMC Bioinform. 2025, 26, 281. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Song, Z.T.; Huang, D.Y.; Song, B.W.; Chen, K.Q.; Song, Y.Y.; Liu, G.; Su, J.L.; de Magalhaes, J.P.; Rigden, D.J.; Meng, J. Attention-based multi-label neural networks for integrated prediction and interpretation of twelve widely occurring RNA modifications. Nat. Commun. 2021, 12, 4011. [Google Scholar] [CrossRef] [Scilit] [PubMed]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.







