Image-based DNA methylation site identification method
By converting Nanopore sequencing data into two-dimensional image data and combining it with a deep neural network model, the problem of low accuracy in DNA methylation site identification in existing methods has been solved, enabling higher-precision identification and medical testing applications.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ZHEJIANG SCI-TECH UNIV
- Filing Date
- 2023-07-28
- Publication Date
- 2026-05-01
AI Technical Summary
Existing methods for identifying DNA methylation sites ignore the graphical information in Nanopore sequencing data, resulting in low accuracy.
One-dimensional current data is transformed into two-dimensional image data. Combined with an image deep learning model, the Gram angle field method and deep neural network are used to identify DNA methylation sites. The identification accuracy is optimized by setting the identification window and adjusting the window size.
It improves the accuracy of DNA methylation site identification and provides theoretical guidance for the application of medical image recognition technology in disease detection.
Smart Images

Figure CN117037904B_ABST
Abstract
Description
An image-based method for DNA methylation site identification Technical Field
[0001] This invention relates to a method for identifying DNA methylation sites in the field of life sciences, specifically a method for identifying DNA methylation sites using image recognition. Background Technology
[0002] Nanopore sequencing technology enables rapid extraction of DNA current signals at the single-molecule level. Furthermore, because the current signals of methylated bases exhibit specific changes, analysis of these current signals can pinpoint the location of methylation in the DNA. Existing methods primarily utilize algorithms to extract current signals from Nanopore sequencing files, perform feature extraction, and then employ machine learning (such as support vector machines and random forests) or deep learning models (such as LSTM and RNNs) for identification. However, this approach only considers the sequence information within the current features, neglecting the underlying graphical information, leading to low identification accuracy. Summary of the Invention
[0003] To address the needs and problems in the background technology, this invention proposes an image recognition method for identifying DNA methylation sites. This invention transforms one-dimensional current data into two-dimensional image data, mining the potential graphical information within the data. Furthermore, by combining this with an image deep learning model, rapid identification of DNA methylation modification sites can be achieved. This solves the problem of low accuracy in existing methylation modification prediction models using Nanopore sequencing data, and also provides theoretical guidance for medical methods of using image recognition technology to detect diseases.
[0004] The technical solution of the present invention is as follows:
[0005] S1: Set the initial size of the recognition window;
[0006] S2: Based on the current recognition window, perform current signal preprocessing on the original Nanopore sequencing dataset to obtain the preprocessed Nanopore sequencing dataset;
[0007] S3: After transforming the current preprocessed Nanopore sequencing dataset using the Gram angle field method, the current two-dimensional image dataset is obtained;
[0008] S4: Based on the current two-dimensional image dataset, after training the deep neural network model, obtain the DNA methylation site recognition model and the corresponding recognition accuracy;
[0009] S5: Continuously change the size of the recognition window and repeat S2-S4 to obtain the DNA methylation site recognition model and recognition accuracy corresponding to different recognition windows. Record the recognition window and DNA methylation site recognition model corresponding to the best recognition accuracy as the best recognition window and DNA methylation site recognition model.
[0010] S6: The Nanopore sequencing data to be identified is processed using the optimal recognition window and then input into the DNA methylation site recognition model to obtain the recognition results of DNA methylation sites.
[0011] In step S2, each target base is set at the center of the recognition window, and the average value of the current signal of the bases within the recognition window is calculated and used as the current signal of the current target base.
[0012] In step S2, the segmented aggregation approximation method is used to perform feature fitting on the Nanopore sequencing dataset that has undergone current signal preprocessing to obtain the final preprocessed Nanopore sequencing dataset.
[0013] Specifically, S3 is:
[0014] S31: Scale the preprocessed Nanopore sequencing dataset to obtain a scaled Nanopore sequencing dataset.
[0015] S32: Perform coordinate transformation on the scaled Nanopore sequencing dataset to obtain the sequencing data point set in polar coordinates;
[0016] S33: Calculate the Gram angle field of the sequencing data point set in polar coordinates to obtain the quasi-Gram matrix set;
[0017] S34: Based on the quasi-Gram matrix set, after determining the density distribution of the Gram angular field values, a two-dimensional image is generated, thereby obtaining a two-dimensional image dataset.
[0018] In step S31, the range of the scaled data is [-1,1] or [0,1].
[0019] In step S32, if the scaled range of the data is [-1, 1], then the angle range of the sequencing data points in the polar coordinate system is [0, π]; if the scaled range of the data is [0, 1], then the angle range of the sequencing data points in the polar coordinate system is [0, π / 2].
[0020] In step S3, the pixel region relationship is used to resample the two-dimensional image dataset obtained after processing by the Gram angle field method to obtain the final two-dimensional image dataset.
[0021] In S4, the deep neural network model is the ViT network model.
[0022] The beneficial effects of this invention are as follows:
[0023] This invention converts one-dimensional current data into two-dimensional image data, and then uses the image recognition capabilities of computers to identify and process the image, thus accurately identifying whether methylation has occurred or the type of methylation that has occurred. Attached Figure Description
[0024] Figure 1 is a schematic diagram of matching Nanopore sequencing fragments to the reference genome.
[0025] Figure 2 shows the image after dimensional transformation of the feature information that has undergone 6mA modification.
[0026] Figure 3 shows the image after dimensional transformation of the feature information that has undergone 5mC modification.
[0027] Figure 4 shows the image after dimensional transformation of the feature information that has undergone 4mC modification.
[0028] Figure 5 shows the image after dimensionality transformation of the feature information that has not undergone methylation modification.
[0029] Figure 6 is a schematic diagram of the Vision Transformer network structure.
[0030] Figure 7 is a flowchart of the method of the present invention. Detailed Implementation
[0031] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are for illustration and explanation only and are not intended to limit the present invention.
[0032] As shown in Figure 7, the present invention includes the following steps:
[0033] S1: Set the initial size of the recognition window;
[0034] As shown in Figure 1, each site corresponds to multiple reads due to the fragment passing through the nanopore multiple times during sequencing. The current signal generated each time it passes through the nanopore differs. Since Nanopore sequencing data contains significant errors, the current signals of different reads are averaged to reduce the impact of these errors on the identification results. Because methylated bases have a methyl group attached, the current signal generated when passing through the nanopore differs from that of unmethylated bases. Furthermore, modified bases can interfere with the current signals of surrounding unmodified bases. Therefore, it is necessary to select several bases upstream and downstream of the methylation site as a window for identification.
[0035] S2: Based on the current recognition window, perform current signal preprocessing on the original Nanopore sequencing dataset to obtain the preprocessed Nanopore sequencing dataset;
[0036] In S2, each target base is set at the center of the recognition window. The target base is a base that has undergone methylation modification. The average value of the current signal of the bases in the recognition window is calculated and used as the current signal of the current target base.
[0037] In practice, considering that the original 660 columns of data are current time-series data, and that DNA methylation would affect the overall current value, causing a certain trend in the current, the Partial Aggregation Approximation (PAA) method was used to perform feature fitting on the Nanopore sequencing dataset after current signal preprocessing to obtain the final preprocessed Nanopore sequencing dataset. This minimizes information loss while maintaining the original data feature distribution, allowing the 660 columns of data to be converted into 220 columns before generating a 128*128 two-dimensional image, further improving accuracy.
[0038] S3: After transforming the current preprocessed Nanopore sequencing dataset using the Gram angle field (GAF) method, the current two-dimensional image dataset is obtained;
[0039] S3 specifically refers to:
[0040] S31: Scale the preprocessed Nanopore sequencing dataset to obtain a scaled Nanopore sequencing dataset. Use a min-max scaler limited to [-1,1] or [0,1] to scale the time series to [-1,1] or [0,1]. This is done to prevent the inner product from being biased towards the observation with the largest value. The formula is as follows:
[0041]
[0042] in, To extract the i-th value x from the original time series i The scaled value, X, represents the time series, i.e., X = {x1, x2, ... x} n The time series after scaling the original time series X is represented as follows:
[0043] In S31, the scaled range of the data is [-1,1] or [0,1].
[0044] S32: Perform coordinate transformation on the scaled Nanopore sequencing dataset, treating numerical values as the cosine of the included angle and timestamps as the radius to obtain the sequencing data point set in polar coordinates; the formula is as follows:
[0045]
[0046] In the formula, a i For the i-th data point polar angle; r i For the i-th data point The corresponding polar radius; t i For the i-th data point The timestamp; N is the length of the time series. This is the scaled time series.
[0047] If the scaled range of the data is [-1, 1], then the angle range of the sequencing data points in the polar coordinate system is [0, π]; if the scaled range of the data is [0, 1], then the angle range of the sequencing data points in the polar coordinate system is [0, π / 2].
[0048] S33: Calculate the Gram angle field of the sequencing data point set in polar coordinates to obtain the quasi-Gram matrix set; the calculation formula is as follows:
[0049]
[0050] In the formula, I is a unit row vector. Scaled time series The transpose of GASF is a quasi-Gram matrix.
[0051] S34: Based on the quasi-Gram matrix set, after determining the density distribution of the Gram angular field values, a two-dimensional image is generated, thereby obtaining a two-dimensional image dataset.
[0052] The transformed two-dimensional images are shown in Figures 2-5. Since the three methylation modifications of 4mC, 5mC and 6mA add methyl groups to the bases at different positions, there will be slight differences in the current signals generated when the bases with different types of modifications pass through the nanopores. Based on these differences, it can be determined which type of modification has occurred.
[0053] In practice, the two-dimensional image dataset is resampled using pixel region relationships, which compresses the images to obtain the final two-dimensional image dataset. Although this invention compresses the image resolution, the compressed image largely retains the original image shape, thus saving performance during training while ensuring recognition accuracy and reducing the model's hardware requirements.
[0054] S4: Based on the current two-dimensional image dataset, after training the deep neural network model, obtain the DNA methylation site recognition model and the corresponding recognition accuracy;
[0055] The ViT algorithm segments an image into fixed-size patches, arranges them linearly, adds positional embeddings and additional learnable recognition tokens, and then inputs the resulting vector sequence into a standard Transformer encoder. The ViT model is then trained in a self-supervised manner on image recognition. During algorithm development, it was considered that research has shown that when trained on small to medium-sized datasets, the ViT model performs slightly worse than ResNet because Transformers lack the inductive biases built into CNNs, such as translation invariance and local perceptualization. Therefore, it cannot generalize well on insufficient data, sometimes even falling a few percentage points in accuracy compared to ResNet models. However, on large-scale data, the ViT structure outperforms inductive biases, resulting in accuracy exceeding that of most CNN models. To address this, the present invention proposes a model of pre-training on a sufficiently large amount of data and then transferring it to a task with less data, enabling ViT to produce excellent results. Considering the local feature blurring and even loss of edge structure information caused by the expanded receptive field of the self-attention mechanism, a convolutional neural network is introduced before ViT. The inductive bias characteristics of the convolution kernel compensate for the weakness of the Transformer's local modeling ability, as shown in Figure 6.
[0056] Based on a thorough analysis of the model, the process of constructing the Vision Transformer in this invention is as follows:
[0057] First, define the image dataset. Save the Gram field images generated for each methylation category in the training and testing folders at a ratio of 4:1 between the training and testing sets. Use the ImageFolder method combined with image enhancement strategies to load the processed images for fine-grained image segmentation and Transformer Encoder-based model training.
[0058] Next, a convolutional neural network ResNet is constructed, and convolution and pooling operations are performed to extract image feature vectors and combine them with location information to generate location codes.
[0059] Then, a multi-head self-attention mechanism is constructed to capture image features. Multiple different key, query, and value transformations are used to compute attention sets to capture image features.
[0060] Finally, a feedforward neural network is constructed using a multilayer perceptron and multiple fully connected layers. The vector output from the attention module is fed into this network for further feature extraction and inference, ultimately completing the methylation prediction task.
[0061] S5: Continuously change the size of the recognition window and repeat S2-S4 to obtain the DNA methylation site recognition model and recognition accuracy corresponding to different recognition windows. Record the recognition window and DNA methylation site recognition model corresponding to the best recognition accuracy as the best recognition window and DNA methylation site recognition model.
[0062] S6: The Nanopore sequencing data to be identified is processed using the optimal recognition window and then input into the DNA methylation site recognition model to obtain the recognition results of DNA methylation sites.
[0063] Finally, it should be noted that the above embodiments and descriptions are only used to illustrate the technical solutions of the present invention and not to limit it. Those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the disclosure of the technical solutions of the present invention, and all such modifications and substitutions should be covered within the protection scope of the claims of the present invention.
Claims
1. A method for identifying DNA methylation sites based on images, characterized in that, Includes the following steps: S1: Set the initial size of the recognition window; S2: Based on the current recognition window, perform current signal preprocessing on the original Nanopore sequencing dataset to obtain the preprocessed Nanopore sequencing dataset; S3: After transforming the current preprocessed Nanopore sequencing dataset using the Gram angle field method, the current two-dimensional image dataset is obtained; S3 specifically includes: S31: Scaling the preprocessed Nanopore sequencing dataset to obtain a scaled Nanopore sequencing dataset; S32: Performing coordinate transformation on the scaled Nanopore sequencing dataset to obtain a set of sequencing data points in polar coordinates; S33: Calculating the Gram angle field of the sequencing data point set in polar coordinates to obtain a quasi-Gram matrix set; S34: Based on the quasi-Gram matrix set, determining the density distribution of the Gram angle field values and generating a two-dimensional image, thereby obtaining a two-dimensional image dataset; S4: According to the current A two-dimensional image dataset is used to train a deep neural network model to obtain a DNA methylation site recognition model and its corresponding recognition accuracy. The deep neural network model includes a convolutional neural network and a ViT model. S5: The size of the recognition window is continuously changed, and S2-S4 are repeated to obtain the DNA methylation site recognition model and recognition accuracy corresponding to different recognition windows. The recognition window and DNA methylation site recognition model corresponding to the best recognition accuracy are recorded as the best recognition window and DNA methylation site recognition model. S6: The Nanopore sequencing data to be identified is processed using the best recognition window and then input into the DNA methylation site recognition model to obtain the recognition result of the DNA methylation site.
2. The image-based DNA methylation site identification method according to claim 1, characterized in that, In step S2, each target base is set at the center of the recognition window, and the average value of the current signal of the bases within the recognition window is calculated and used as the current signal of the current target base.
3. The image-based DNA methylation site identification method according to claim 1, characterized in that, In step S2, the segmented aggregation approximation method is used to perform feature fitting on the Nanopore sequencing dataset that has undergone current signal preprocessing to obtain the final preprocessed Nanopore sequencing dataset.
4. The image-based DNA methylation site identification method according to claim 1, characterized in that, In step S31, the range of the scaled data is [-1,1] or [0,1].
5. The image-based DNA methylation site identification method according to claim 1, characterized in that, In step S32, if the scaled range of the data is [-1, 1], then the angle range of the sequencing data points in the polar coordinate system is [0, π]; if the scaled range of the data is [0, 1], then the angle range of the sequencing data points in the polar coordinate system is [0, π / 2].
6. The image-based DNA methylation site identification method according to claim 1, characterized in that, In step S3, the pixel region relationship is used to resample the two-dimensional image dataset obtained after processing by the Gram angle field method to obtain the final two-dimensional image dataset.
Citation Information
Patent Citations
Methylation feature screening method and device
CN116153417A
Signal data conversion and data amplification method based on deep learning classification
CN116257779A
Base modification analysis using electrical signals
US20220328135A1