Cell type and proportion prediction method based on image-based methylation base model and related equipment

By converting single-cell methylation data into two-dimensional images and constructing a basic methylation model, the problems of low computational efficiency and information loss in single-cell whole-genome methylation analysis are solved, and efficient cell type classification and proportion prediction are achieved.

CN121191162BActive Publication Date: 2026-04-10GUANGZHOU MEDICAL UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511497037.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-20
Publication Date
2026-04-10
Estimated Expiration
2045-10-20

AI Technical Summary

Technical Problem

Existing technologies suffer from low computational efficiency, high resource consumption, and information loss in single-cell whole-genome methylation analysis. Traditional binning strategies lead to the loss of base-level information, while deep learning-based methods are highly complex in long sequence processing and are difficult to scale up.

Method used

By converting single-cell methylation data into two-dimensional images, a methylation-based model based on an encoder-decoder architecture is constructed. A mask-reconstruction self-supervised learning strategy and a hybrid network structure are used to perform efficient convolutional learning, reducing information loss and improving computational efficiency.

Benefits of technology

It achieves good cell type classification results with less data, improves analysis efficiency and information integrity, and reduces computing costs and resource consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121191162B_ABST
    Figure CN121191162B_ABST
Patent Text Reader

Abstract

The application discloses a cell type and proportion prediction method based on an image-based methylation base model and related equipment, and the method comprises the following steps: acquiring initial single-cell methylation data; constructing a two-dimensional image according to the initial single-cell methylation data; constructing a methylation base model according to the two-dimensional image; predicting a target cell type according to the methylation base model and the two-dimensional image; and analyzing the initial single-cell methylation data according to the methylation base model to obtain a target cell type proportion. The application can improve the analysis efficiency and information integrity, and can be widely applied to the technical field of image processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and in particular to a method and related equipment for predicting cell types and proportions based on an image-based methylation model. Background Technology

[0002] DNA methylation is one of the most important epigenetic modifications, playing a crucial role in regulating gene expression, maintaining cell identity, and driving individual development. With the rapid development of sequencing technology, single-cell whole-genome methylation sequencing has provided researchers with the possibility of characterizing methylation at single-cell resolution. This technology can reveal methylation heterogeneity among cells within tissues, which is of great value for analyzing cell subpopulation characteristics, tracing developmental trajectories, and understanding disease mechanisms. However, due to the low coverage of single-cell sequencing, the observation of methylation sites is sparse and noisy, making it difficult to directly use the raw data for downstream modeling. Traditional analysis workflows often employ binning strategies, dividing the entire genome into fixed-size intervals and statistically analyzing methylation levels within each interval. This method is relatively efficient computationally, but the smoothness of interval averaging leads to the loss of base-level information, making it difficult to capture local methylation regulatory signals. To alleviate the information loss problem, some studies have turned to deep learning-based sequence modeling methods to directly model the sequence relationships of methylation sites. While these methods have advantages in preserving original information, they are complex for processing long sequences, consuming huge amounts of memory and computational resources, making large-scale deployment difficult. Summary of the Invention

[0003] In view of this, the main objective of the embodiments of the present invention is to provide a method and related equipment for predicting cell type and proportion based on an image-based methylation model, in order to solve at least one of the problems in the prior art. The present invention can improve analysis efficiency and information integrity.

[0004] To achieve the above objectives, one aspect of this invention provides a method for predicting cell type and proportion based on an image-based methylation model, the method comprising the following steps:

[0005] Obtain initial single-cell methylation data;

[0006] A two-dimensional image is constructed based on the initial single-cell methylation data;

[0007] Based on the two-dimensional image, a basic model of methylation is constructed;

[0008] Based on the methylation baseline model and the two-dimensional image, the target cell type is predicted;

[0009] According to the methylation base model, the initial single-cell methylation data is analyzed to obtain a proportion of a target cell type.

[0010] In some embodiments, the constructing a two-dimensional image according to the initial single-cell methylation data comprises the following steps:

[0011] The initial single-cell methylation data is binned to obtain a plurality of interval bin single-cell methylation data;

[0012] The methylation ratio mean of each interval bin single-cell methylation data is obtained to obtain a one-dimensional array;

[0013] The one-dimensional array is rearranged to obtain the two-dimensional image.

[0014] In some embodiments, the binning the initial single-cell methylation data to obtain a plurality of interval bin single-cell methylation data comprises the following steps:

[0015] According to the number of chromosomes, a first sorting operation is performed on the initial methylation sites to obtain intermediate methylation sites;

[0016] According to the position of the initial methylation site on the chromosome, a second sorting operation is performed on the intermediate methylation sites to obtain target methylation sites;

[0017] The target methylation sites are divided into a plurality of interval bins to obtain a plurality of interval bin single-cell methylation data;

[0018] The initial single-cell methylation data comprises the chromosome of a single initial methylation site and the position of the single initial methylation site on the chromosome.

[0019] In some embodiments, the constructing a methylation base model according to the two-dimensional image comprises the following steps:

[0020] An initial base model is constructed based on an encoder-decoder architecture;

[0021] The two-dimensional image is regionally divided to obtain a plurality of image regions;

[0022] The image regions of the two-dimensional image are randomly masked to obtain a masked image;

[0023] The masked image is input into an initial encoder module of the initial base model to output target encoder features;

[0024] The target encoder features are input into a decoder module of the initial base model to output mask region predicted pixel values;

[0025] obtaining a mean square error loss of the occlusion region predicted pixel value and the occlusion region real pixel value;

[0026] when the mean square error loss is greater than or equal to a preset threshold, returning the step of region division of the two-dimensional image to obtain a plurality of image regions until the mean square error loss is less than the preset threshold;

[0027] when the mean square error loss is less than the preset threshold, obtaining the methylation base model.

[0028] In some embodiments, the target cell type is predicted according to the methylation base model and the two-dimensional image, comprising the following steps:

[0029] obtaining a training image and a cell type label of the training image;

[0030] extracting a methylation encoder module of the methylation base model;

[0031] performing single cell annotation fine-tuning training on the methylation encoder module according to the training image and the cell type label to obtain a first encoder module;

[0032] inputting the two-dimensional image into the first encoder module and passing through a first fully connected layer to output the target cell type.

[0033] In some embodiments, the target cell type proportion is obtained by analyzing the initial single cell methylation data according to the methylation base model, comprising the following steps:

[0034] obtaining pseudo-batch data, randomly sampling the pseudo-batch data, and constructing first pseudo-single cell data;

[0035] extracting a methylation encoder module of the methylation base model;

[0036] performing deconvolution fine-tuning training on the methylation encoder module according to the first pseudo-single cell data to obtain a second encoder module;

[0037] obtaining real free DNA data, randomly sampling the real free DNA data, and constructing second pseudo-single cell data;

[0038] inputting the second pseudo-single cell data into the second encoder module to obtain pseudo-single cell features;

[0039] performing weighted fusion on the pseudo-single cell features to obtain fused features;

[0040] inputting the fused features into a second fully connected layer to output the target cell type proportion.

[0041] In some embodiments, the obtaining pseudo-batch data, randomly sampling the pseudo-batch data, and constructing first pseudo-single-cell data include the following steps:

[0042] According to the initial single-cell methylation data, the pseudo-batch data is constructed by randomly mixing single cells;

[0043] The number distribution of methylation sites of the initial single-cell methylation data is fitted;

[0044] The pseudo-batch data is randomly sampled multiple times by the number distribution of methylation sites to obtain multiple first pseudo-single-cell data.

[0045] In some embodiments, the obtaining real free DNA data, randomly sampling the real free DNA data, and constructing second pseudo-single-cell data include the following steps:

[0046] The real free DNA data is randomly sampled multiple times by the number distribution of methylation sites to obtain multiple second pseudo-single-cell data.

[0047] To achieve the above-mentioned purpose, another aspect of the embodiment of the present application provides a cell type and proportion prediction device based on an image-based methylation base model, which comprises:

[0048] A data acquisition module is configured to acquire initial single-cell methylation data;

[0049] An image construction module is configured to construct a two-dimensional image according to the initial single-cell methylation data;

[0050] A model construction module is configured to construct a methylation base model according to the two-dimensional image;

[0051] A cell type prediction module is configured to predict a target cell type according to the methylation base model and the two-dimensional image;

[0052] A cell type proportion prediction module is configured to analyze the initial single-cell methylation data according to the methylation base model to obtain a target cell type proportion.

[0053] To achieve the above-mentioned purpose, another aspect of the embodiment of the present application provides an electronic device, which comprises a memory and a processor, the memory stores a computer program, and the processor implements the above-mentioned method when executing the computer program.

[0054] To achieve the above object, another aspect of the embodiment of the present application provides a computer readable storage medium, which stores a computer program. The computer program is executed by a processor to implement the method described above.

[0055] To achieve the above object, another aspect of the embodiment of the present application provides a computer program product or computer program, which comprises computer instructions stored in a computer readable storage medium. A processor of a computer device can read the computer instructions from the computer readable storage medium, and the processor executes the computer instructions to make the computer device execute the method described above.

[0056] The embodiment of the present application at least has the following beneficial effects: the present application provides a cell type and proportion prediction method and related equipment based on an image-based methylation base model, which obtains initial single-cell methylation data; constructs a two-dimensional image according to the initial single-cell methylation data, to provide a data basis for subsequent model construction; constructs a methylation base model according to the two-dimensional image, which can directly learn by using the characteristics of efficient convolution to improve the calculation and analysis efficiency and reduce information loss; according to the methylation base model and the two-dimensional image, a good classification effect can be achieved with a small amount of data, and a target cell type is predicted; according to the strong transfer performance of the methylation base model, the methylation base model is applied to downstream tasks to analyze the initial single-cell methylation data, greatly improving the analysis efficiency and obtaining the proportion of the target cell type. The present application can improve the analysis efficiency and information integrity. BRIEF DESCRIPTION OF DRAWINGS

[0057] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0058] Figure 1 is a flowchart of the cell type and proportion prediction method based on the image-based methylation base model provided by the embodiment of the present application;

[0059] Figure 2 is a schematic diagram of the overall architecture of the cell type and proportion prediction based on the image-based methylation base model provided by the embodiment of the present application;

[0060] Figure 3 is a schematic diagram of the hardware structure of the electronic device provided by the embodiment of the present application. DETAILED DESCRIPTION

[0061] In order to make the objects, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and do not limit the present application. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the embodiments of the present application, but are only examples of devices and methods consistent with some aspects of the embodiments of the present application as described in the appended claims.

[0062] It should be noted that although the functional modules are divided in the system schematic diagram, the logical sequence is shown in the flowchart, but in some cases, the steps shown or described can be performed in a manner different from the module division in the system or the sequence in the flowchart. The terms "first / S100", "second / S200" in the specification and claims and the above drawings can be used herein to describe various concepts, but unless specifically stated, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another. For example, the first information can also be referred to as the second information, and similarly, the second information can also be referred to as the first information, without departing from the scope of the embodiments of the present application. Depending on the context, the word "if" as used herein can be interpreted as "when" or "upon" or "in response to determining".

[0063] The terms "at least one", "multiple", "each", "any" and the like used in the present application include one, two or more than two, multiple includes two or more than two, each refers to each of the corresponding multiple, and any refers to any one of the multiple.

[0064] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the present application belongs. The terms used herein are only for the purpose of describing the embodiments of the present application and are not intended to limit the present application.

[0065] Before the embodiments of the present application are described in detail, first, some nouns and terms involved in the embodiments of the present application are described, and the nouns and terms involved in the embodiments of the present application are applicable to the following explanations.

[0066] Binning is a process of grouping continuous data according to certain rules. By dividing data into multiple intervals (bins), the discretization of data can be achieved, noise can be reduced, and the effect of data analysis can be improved. The main purpose of binning is to denoise and simplify features, so that data is easier to process and analyze.

[0067] The existing analysis method for single-cell whole genome methylation has the limitations of low analysis efficiency and large resource consumption. The traditional method usually calculates the methylation ratio of the bin to deal with the problem of high data dimension, but it still needs to further screen the interval by finding the methylation high variable specific region, causing too much information loss, and the base-based sequence model is complete in information, but the computing power cost also increases accordingly. And the current deep learning-based method is trained by limited methylation supervision data, mainly facing a single downstream scene, and cannot realize the diversified analysis of methylation data.

[0068] Therefore, the embodiment of the present application provides a cell type and proportion prediction method based on an image-based methylation base model and related equipment, a bin-based methylation ratio is constructed into an image, and then a base model is established and trained based on the constructed image. The trained base model is applied to the single-cell annotation downstream application to predict the cell type. The trained base model is also applied to the deconvolution downstream task to infer the proportion of all cell types.

[0069] Figure 1 is an optional flowchart of a cell type and proportion prediction method based on an image-based methylation base model provided by the embodiment of the present application, Figure 1 The method in the embodiment can include but is not limited to steps S100 to S500:

[0070] Step S100, obtaining initial single-cell methylation data;

[0071] Step S200, constructing a two-dimensional image according to the initial single-cell methylation data;

[0072] Step S300, constructing a methylation base model according to the two-dimensional image;

[0073] Step S400, predicting a target cell type according to the methylation base model and the two-dimensional image;

[0074] Step S500, analyzing the initial single-cell methylation data according to the methylation base model to obtain the proportion of the target cell type.

[0075] In step S100 of some embodiments, the initial single-cell methylation data is obtained from a public database. Optionally, about 1 million single-cell whole genome methylation data can be collected from a public database such as NCBI (which contains all nucleic acid information sequenced by laboratories all over the world) as initial single-cell methylation data. In addition, the embodiment of the present application has low requirements for the required single-cell methylation data, and can well compatible with methylation data of different sources and formats.

[0076] In step S200 of some embodiments, for each initial single-cell methylation data, the average methylation ratio on each fixed interval bin is calculated, a one-dimensional array can be obtained, and the one-dimensional array is rearranged in row-major order to form a two-dimensional image. By converting the one-dimensional array into a two-dimensional image, efficient convolution can be used more easily, the amount of calculation is reduced, and as much information as possible is lost compared to traditional analysis.

[0077] In some embodiments, step S200 can include but is not limited to steps S210 to S230:

[0078] In step S210, the initial single-cell methylation data is binned to obtain a plurality of interval bin single-cell methylation data;

[0079] In step S220, the average methylation ratio of each interval bin single-cell methylation data is obtained to obtain a one-dimensional array;

[0080] In step S230, the one-dimensional array is rearranged to obtain a two-dimensional image.

[0081] In step S210 of some embodiments, the initial single-cell methylation data is binned to obtain single-cell methylation data of different interval bins. The initial single-cell methylation data requires information of a chromosome of a single initial methylation site, a position of the single initial methylation site on the chromosome, and an initial methylation ratio.

[0082] In some embodiments, step S210 can include but is not limited to steps S211 to S213:

[0083] In step S211, the initial methylation site is subjected to a first sorting operation according to the number of chromosomes to obtain an intermediate methylation site;

[0084] In step S212, the intermediate methylation site is subjected to a second sorting operation according to the position of the initial methylation site on the chromosome to obtain a target methylation site;

[0085] In step S213, the target methylation site is divided into a plurality of interval bins to obtain a plurality of interval bin single-cell methylation data;

[0086] In steps S211 to S212 of some embodiments, first, the sort function is used to perform a first sorting operation on the initial methylation site according to the number of chromosomes of the single initial methylation site to obtain an intermediate methylation site, and then a second sorting operation is performed on the intermediate methylation site from small to large according to the position of the initial methylation site on the chromosome to obtain a target methylation site.

[0087] In step S213 of some embodiments, the target methylation sites are divided into different interval bins according to a specified interval size (e.g., 5000 bp) by the bedtools tool, forming a plurality of interval bin single-cell methylation data.

[0088] In step S220 of some embodiments, for the interval bin single-cell methylation data in each bin, the average methylation ratio in the bin is calculated to obtain a one-dimensional array.

[0089] In step S230 of some embodiments, the one-dimensional array is rearranged into a two-dimensional image in row-major order according to a specified image size (e.g., 759x759), i.e., the elements of the one-dimensional array are arranged from left to right and from top to bottom into the shape of a two-dimensional grid.

[0090] In step S300 of some embodiments, based on the constructed two-dimensional image, an initial base model is established and trained to obtain a methylation base model. The initial base model is based on an encoder-decoder architecture and selects a self-supervised learning strategy based on mask-reconstruction. In this strategy, part of the area of the masked image is randomly masked, and the initial encoder module is input. The representation encoded by the initial encoder module is reconstructed by the decoder to output the missing pixels. The initial encoder module is based on a hybrid network structure of convolution, mamba, and transformer, and is composed of multiple convolution blocks, mamba blocks, and transformer blocks. The decoder adopts a hybrid form of multiple mamba blocks and transformer blocks. Through the mask-reconstruction method, the constructed methylation base model has good scalability and strong migration performance, which is conducive to application in various downstream tasks. In addition, the initial encoder module design can effectively handle large-size input images. The hybrid architecture of mamba blocks and transformer blocks reduces the use of computing resources while ensuring strong representation ability, greatly improving the computing efficiency. The traditional analysis speed is increased from 50 cells per second to 300 cells per second.

[0091] In some embodiments, step S300 can include but is not limited to steps S310 to S380:

[0092] Step S310, based on an encoder-decoder architecture, constructing an initial base model;

[0093] Step S320, dividing the two-dimensional image into a plurality of image regions;

[0094] Step S330, randomly masking the image regions of the two-dimensional image to obtain a masked image;

[0095] Step S340, inputting the masked image into the initial encoder module of the initial base model to output target encoder features;

[0096] Step S350, input the target encoder feature into the decoder module of the initial base model, and output the occluded region prediction pixel value;

[0097] Step S360, obtain the mean square error loss of the occluded region prediction pixel value and the occluded region real pixel value;

[0098] Step S370, when the mean square error loss is greater than or equal to the preset threshold, return to the step of dividing the two-dimensional image into regions to obtain a plurality of image regions until the mean square error loss is less than the preset threshold;

[0099] Step S380, when the mean square error loss is less than the preset threshold, obtain the methylation base model.

[0100] In step S310 of some embodiments, an initial base model based on an encoder-decoder architecture is constructed, and in subsequent steps, a two-dimensional image (optionally, with a size of 759x759) is constructed, a dataset with a data volume of nearly one million two-dimensional image data is trained and verified, and a masked self-supervised learning strategy is used for training.

[0101] In step S320 of some embodiments, the two-dimensional image is divided into regions according to a preset division size. For example, for a two-dimensional image with an image size of 759x759, the two-dimensional image is divided into regions according to a size of 32x32, and a plurality of image regions can be obtained.

[0102] In step S330 of some embodiments, according to the divided image regions, a part of the two-dimensional image is randomly masked, and a masked image can be obtained. For example, 75% of the two-dimensional image is randomly masked to obtain a masked image.

[0103] In step S340 of some embodiments, the masked image is input into the initial encoder module of the initial base model, and the target encoder feature is finally output after processing by the initial encoder module. For example, as shown in FIG. 3, the initial encoder module of the initial base model is used to process the masked image, and the target encoder feature is finally output. Figure 2As shown, the initial encoder module of the initial base model is sequentially connected by 2 convolution blocks, 1 convolution layer, 5 mamba blocks and 6 transformer blocks. Both of the 2 convolution blocks contain 4 convolution layers, wherein the kernel sizes of the 4 convolution layers of the convolution block 1 are 4, 1, 5 and 1 respectively, and the strides are 4, 1, 1 and 1 respectively; the kernel sizes of the 4 convolution layers of the convolution block 2 are 2, 1, 5 and 1 respectively, and the strides are 2, 1, 1 and 1 respectively; the kernel size of the convolution layer connected after the convolution block 2 is 2, and the stride is 2. The masked image is input into the initial encoder module, and sequentially processed by the convolution block 1, the convolution block 2, the convolution layer, the mamba block and the transformer block. In the processing process, the features output by the convolution block 1 are flattened to output the first intermediate processing feature; the features output by the convolution block 2 are flattened to output the second intermediate processing feature; the features output by the convolution layer are flattened and sequentially input into the conventional mamba block and the transformer block to output the third intermediate processing feature. The three intermediate processing features are added to obtain the final target encoder feature.

[0104] Compared with the convolution block using a large convolution kernel, the embodiment of the application gradually expands the receptive field by the stacking mode of the multi-stage small kernel convolution block, retains more local details, and reduces the parameter amount.

[0105] In step S350 of some embodiments, the target encoder feature is input into the decoder module of the initial base model to reconstruct the pixels in the masked area and output the predicted pixel value in the masked area. Exemplarily, as shown in Figure 2 The target encoder feature is input into the decoder module, the decoder is sequentially connected by 5 mamba blocks and 6 transformer blocks, and finally the pixel value in the masked area is reconstructed.

[0106] In steps S360 to S380 of some embodiments, the training target of the initial base model is to minimize the mean square error loss of the predicted pixel value in the masked area and the real pixel value in the masked area. By obtaining the mean square error loss of the predicted pixel value in the masked area and the real pixel value in the masked area, it is judged whether the mean square error loss is less than a preset threshold, so as to judge whether the initial base model converges. If the mean square error loss is greater than or equal to the preset threshold, the step of dividing the two-dimensional image into regions to obtain a plurality of image regions is returned, and the training of the initial base model is continued until the mean square error loss is less than the preset threshold. If the mean square error loss is less than the preset threshold, that is, the initial base model converges, the initial base model is taken as the methylation base model.

[0107] The pre-training of such a basic model on large-scale and diversified data can be used as a modular component to facilitate access to different downstream architectures, and through the transfer of the methylation basic model, a high-performance model can be obtained on downstream application tasks with smaller data sets and lower costs.

[0108] In step S400 of some embodiments, the trained methylation basic model is applied to the single cell annotation downstream task to predict the target cell type. In this task, only the encoder module of the pre-trained methylation basic model is used, the input image no longer needs to be masked, and is directly input into the encoder. After the obtained representation is input into the fully connected layer, the cell type probability is predicted, and the cell type corresponding to the maximum probability value is determined as the final type label.

[0109] In some embodiments, step S400 can include but is not limited to steps S410 to S440:

[0110] Step S410, obtaining training images and cell type labels of the training images;

[0111] Step S420, extracting a methylation encoder module of the methylation basic model;

[0112] Step S430, performing single cell annotation fine-tuning training on the methylation encoder module according to the training images and the cell type labels, to obtain a first encoder module;

[0113] Step S440, inputting a two-dimensional image into the first encoder module and passing it through a first fully connected layer to output a target cell type.

[0114] In step S410 of some embodiments, training images for model fine-tuning of cell annotation are obtained, and the true type labels of the training images are known. The training images are a training set constructed based on binned methylation ratios.

[0115] In step S420 of some embodiments, the single cell annotation module model part is as shown in Figure 2 By extracting the methylation encoder module of the methylation basic model as the network architecture, and connecting a first fully connected layer after it, the first fully connected layer is used to predict the type probability.

[0116] In step S430 of some embodiments, after loading the weights of the methylation base model, the methylation encoder module inputs the training image into the methylation encoder module, and obtains the predicted cell type probability after the first fully connected layer. The cross-entropy loss function between the predicted cell type probability and the real known cell type label is taken as the objective function, and optimization is performed based on the gradient direction propagation. By performing iterative optimization on the model parameters of the single cell annotation module, the objective function value gradually decreases until convergence, and then the pre-trained first encoder module is obtained in the single cell annotation module model.

[0117] In step S440 of some embodiments, the two-dimensional image is input into the first encoder module, and the target cell type can be obtained after the first fully connected layer.

[0118] The methylation base model trained on large-scale data has learned good image representation. By transferring its weights, only a small amount of data is needed for fine-tuning in the single cell annotation downstream task, which can achieve good classification effect.

[0119] In step S500 of some embodiments, the trained methylation base model is applied to the deconvolution downstream task to analyze the proportion of different cell types in the batch data. In order to apply the methylation base model to the deconvolution task, a method of randomly mixing single cells is used to construct pseudo-batch data, and the number of methylation sites of real single cell data is fitted. A fitted function is used to randomly sample methylation sites of pseudo-batch data multiple times to construct multiple pseudo-single cell data, thereby simulating the DNA methylation difference between single cell data of different cell types. The multiple pseudo-single cell data of a pseudo-batch data are input into the encoder at the same time in the form of a data packet, the encoded representation is weighted and superimposed to obtain a fused feature, and the class probability is output after the fully connected layer. For each real cfDNA data (real free DNA data), pseudo-single cell data is constructed by random sampling, and then input into the model trained by the pseudo-batch data to infer the proportion of all cell types.

[0120] In some embodiments, step S500 can include but is not limited to steps S510 to S570:

[0121] Step S510, obtaining pseudo-batch data, randomly sampling the pseudo-batch data to construct first pseudo-single cell data;

[0122] Step S520, extracting the methylation encoder module of the methylation base model;

[0123] Step S530, deconvolution fine-tuning training of the methylation encoder module according to the first pseudo-single cell data to obtain a second encoder module;

[0124] In step S540, real free DNA data is obtained, and random sampling is performed on the real free DNA data to construct second pseudo single-cell data.

[0125] In step S550, the second pseudo single-cell data is input into a second encoder module to obtain pseudo single-cell features.

[0126] In step S560, the pseudo single-cell features are weighted and fused to obtain fused features.

[0127] In step S570, the fused features are input into a second fully connected layer to output a proportion of a target cell type.

[0128] In some embodiments, step S510 can include but is not limited to steps S511 to S513.

[0129] In step S511, pseudo batch data is constructed by randomly mixing single cells according to initial single-cell methylation data.

[0130] In step S512, the number distribution of methylation sites of the initial single-cell methylation data is fitted.

[0131] In step S513, the pseudo batch data is randomly sampled for methylation site operation multiple times according to the number distribution of methylation sites to obtain multiple first pseudo single-cell data.

[0132] In step S511 of some embodiments, in order to apply the methylation base model to batch data for the initial single-cell methylation data, pseudo batch data needs to be constructed. Before the deconvolution fine-tuning training process, a set of pseudo batch data is constructed by randomly mixing single-cell data, and the proportion of each cell type of each batch data is known.

[0133] In step S512 of some embodiments, the number of methylation sites on each chromosome is counted for large-scale initial single-cell methylation data. The number distribution of methylation sites on each chromosome is fitted by a Gaussian fitting function.

[0134] In step S513 of some embodiments, for each pseudo batch data, the number of methylation sites is generated according to the fitted number distribution of methylation sites, and the methylation sites of the pseudo batch data are randomly sampled, and finally the pseudo single-cell data is obtained. Each pseudo batch data repeats the sampling process N times to obtain N first pseudo single-cell data.

[0135] In step S520 of some embodiments, the deconvolution module model is as shown in FIG. Figure 2 The methylation encoder module of the methylation base model is extracted as a network architecture.

[0136] In step S530 of some embodiments, in the deconvolution fine-tuning training process, N first pseudo single-cell data simulated from each pseudo batch data are packaged and input to the methylation encoder module at the same time, N features are obtained, the N features are input to the second fully connected layer to predict the importance weight, the N features are superimposed according to the importance weight to obtain the fusion feature, and the fusion feature is input to another fully connected layer to predict the cell type proportion probability. The deconvolution fine-tuning training target is to minimize the mean square error of the predicted cell type proportion probability and the real cell type proportion, and maximize the pearson correlation coefficient of the predicted cell type proportion probability and the real cell type proportion. After the deconvolution fine-tuning training target is reached, a pre-trained second encoder module can be obtained.

[0137] In some embodiments, step S540 can include but is not limited to step S541:

[0138] In step S541, the real free DNA data is subjected to a plurality of random sampling methylation site operations by the methylation site number distribution, and a plurality of second pseudo single-cell data are obtained.

[0139] In step S541 of some embodiments, in order to test the trained deconvolution module model on real cfDNA data, the methylation site number is generated according to the fitted methylation site number distribution function for each chromosome, the methylation site is randomly sampled, the sampling process is repeated N times, and N second pseudo single-cell data are constructed.

[0140] In steps S550 to S570 of some embodiments, a plurality of second pseudo single-cell data are packaged and input to the pre-trained second encoder module at the same time, a plurality of pseudo single-cell features are output, the plurality of pseudo single-cell features are input to a fully connected layer to predict the importance weight, the plurality of pseudo single-cell features are superimposed according to the importance weight to obtain a fusion feature, and then the fusion feature is input to a second fully connected layer to infer the proportion of different cell types and output the target cell type proportion.

[0141] The embodiment of the application also provides a cell type and proportion prediction device based on an image-based methylation base model, which can realize the cell type and proportion prediction method based on the image-based methylation base model. The device comprises:

[0142] A data acquisition module is configured to acquire initial single-cell methylation data.

[0143] An image construction module is configured to construct a two-dimensional image according to the initial single-cell methylation data.

[0144] A model construction module is configured to construct a methylation base model according to the two-dimensional image.

[0145] a cell type prediction module configured to predict a target cell type according to the methylation base model and the two-dimensional image;

[0146] a cell type proportion prediction module configured to analyze initial single-cell methylation data according to the methylation base model to obtain a proportion of the target cell type.

[0147] It can be understood that the content in the above method embodiments is applicable to the device embodiments, the device embodiments specifically implement the functions of the above method embodiments, and achieve the same beneficial effects as the above method embodiments.

[0148] The embodiment of the application further provides an electronic device, which comprises a processor and a memory, the memory stores a computer program, and the processor implements the above method when executing the computer program. The electronic device can be any intelligent terminal including a tablet computer, a vehicle-mounted computer, etc.

[0149] It can be understood that the content in the above method embodiments is applicable to the device embodiments, the device embodiments specifically implement the functions of the above method embodiments, and achieve the same beneficial effects as the above method embodiments.

[0150] Reference Figure 3 , Figure 3 The hardware structure of the electronic device of another embodiment is illustrated, and the electronic device comprises:

[0151] The processor 601 can be implemented in the form of a general-purpose CPU (Central Processing Unit), a microprocessor, an ASIC (Application Specific Integrated Circuit), or one or more integrated circuits, and is used to execute related programs to implement the technical solutions provided by the embodiments of the application;

[0152] The memory 602 can be implemented in the form of a ROM (Read Only Memory), a static storage device, a dynamic storage device, or a RAM (Random Access Memory). The memory 602 can store an operating system and other application programs, and when the technical solutions provided by the embodiments of the application are implemented by software or firmware, the related program codes are stored in the memory 602 and are called and executed by the processor 601 to implement the method of the embodiments of the application;

[0153] The input / output interface 603 is used to realize information input and output;

[0154] The communication interface 604 is configured to realize the communication interaction between the device and other devices, and the communication can be realized through a wired manner (for example, a USB, a network cable or the like) or a wireless manner (for example, a mobile network, WIFI, Bluetooth or the like).

[0155] The bus 605 is configured to transmit information between various components (for example, the processor 601, the memory 602, the input / output interface 603 and the communication interface 604) of the device.

[0156] The processor 601, the memory 602, the input / output interface 603 and the communication interface 604 are connected to each other through the bus 605.

[0157] The embodiment of the present application further provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to realize the method.

[0158] It can be understood that the contents in the above method embodiments are applicable to the present storage medium embodiment, the present storage medium embodiment specifically realizes the functions of the above method embodiments, and the beneficial effects achieved by the present storage medium embodiment are the same as the beneficial effects achieved by the above method embodiments.

[0159] The embodiment of the present application further provides a computer program product or a computer program, which comprises computer instructions stored in a computer readable storage medium. A processor of a computer device can read the computer instructions from the computer readable storage medium, and the processor executes the computer instructions, so that the computer device executes the above method.

[0160] To sum up, the cell type and proportion prediction method based on the methylation image-based model has the following advantages:

[0161] 1. The embodiment of the present application establishes a two-dimensional image from a one-dimensional signal of binned methylation ratio, and constructs an image-based model. Compared with the analysis method of further screening intervals to reduce the calculation amount of the one-dimensional signal, the two-dimensional image can directly learn by using the characteristics of efficient convolution to reduce the calculation cost, and reduce the information loss. Specifically, the one-dimensional single-cell whole-genome DNA methylation data is encoded into a two-dimensional image for analysis, fully utilizes the successful experience of convolution network in the image field, reduces the calculation amount and improves the calculation efficiency by 6 times while reducing data loss and capturing the relationship between adjacent CpGs.

[0162] 2、The embodiment of the present application uses a mixed architecture of convolution blocks and sequence-based modules (mamba blocks and transformer blocks), which effectively solves the problem of large input image size. The convolution block divides the image into different small blocks through local convolution and outputs a feature sequence, and the mamba block and the transformer block can learn long feature sequences. The combination of these modules well alleviates the problem of large size images (high resolution).

[0163] 3、The embodiment of the present application introduces a mixed structure of mamba blocks and transformer blocks in the model. This design not only takes advantage of the global dependence modeling of the transformer, but also fully utilizes the characteristics of the mamba in efficiently modeling sequence dependence through state space recursion, so that the model can maintain strong representation ability while significantly reducing computational overhead. The mamba and transformer framework can extend high-precision images, and cooperate with the strategy of randomly sampling sites, so that the resolution can reach a single base.

[0164] 4、The embodiment of the present application constructs pseudo-single-cell data by randomly sampling methylation sites multiple times. The differences between different pseudo-single-cell data reflect the changes of methylation sites, effectively alleviating the problem of base-level information loss caused by binning operation.

[0165] 5、The application of the mask language model pre-training general model to large-scale single-cell methylation data can effectively apply different typical single-cell methylation downstream scenarios and improve performance.

[0166] In some alternative embodiments, the functions / operations mentioned in the block diagram can not occur in the order mentioned in the operation diagram. For example, depending on the functions / operations involved, two blocks shown in succession can actually be executed substantially simultaneously or the blocks can sometimes be executed in reverse order. In addition, the embodiments presented and described in the flowcharts of the present application are provided by way of example, with the purpose of providing a more comprehensive understanding of the technology. The disclosed method is not limited to the operations and logical flows presented herein. Alternative embodiments are contemplated in which the order of various operations is changed and in which sub-operations described as part of larger operations are independently executed.

[0167] Furthermore, although the present application is described in the context of functional modules, it is to be understood that one or more of the described functions and / or features can be integrated in a single physical device and / or software module, or one or more functions and / or features can be implemented in separate physical devices or software modules. It will also be appreciated that detailed discussion of the actual implementation of each module is not necessary to an understanding of the application. Rather, the actual implementation of the modules, in combination with their attributes, functions, and internal relationships, are to be understood within the context of the devices disclosed herein. Thus, those skilled in the art with access to patents, scientific journals, and other public sources known by those skilled in the art will be able, using ordinary skill, to practice the application as set forth in the claims without undue experimentation. It is also to be understood that the specific concepts disclosed are merely illustrative and that the scope of the present application is to be determined by the entire scope of the claims, along with all equivalents of the claims and their equivalents.

[0168] If the functions are implemented in software, the functions can be stored in or implemented as one or more computer program products, which can be incorporated into a computer- readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor- containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. In the context of this document, a "computer-readable medium" can be any means that can store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device.

[0169] The logic and / or steps represented in the flowcharts and / or otherwise described herein, for example, can be embodied in non-transitory computer-readable media, which can be executed by an instruction execution system, apparatus, or device such as a computer-based system, processor- containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. In the context of this document, a "computer-readable medium" can be any means that can store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device.

[0170] More specific examples (a non-exhaustive list) of the computer-readable medium include the following: an electrical connection (electronic) having one or more wires, a portable computer diskette (magnetic), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium can also be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, for example, via optical scanning of the paper or other medium, then compiled, interpreted, or otherwise processed in a suitable manner, if necessary, and then stored in a computer memory.

[0171] It should be understood that aspects of the application can be implemented in hardware, software, firmware or combinations thereof. In the embodiments described above, various steps or methods can be implemented, for example, by software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, and in another embodiment, any of the following techniques can be used to implement the hardware used in the described embodiments: discrete logic circuitry having logic gates for implementing logic functions upon data signals, application specific integrated circuits having appropriate combinational logic gates, programmable gate arrays (PGA), field programmable gate arrays (FPGA), and so forth.

[0172] In the description of the specification, the description of the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" and the like means that the specific feature, structure, material or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the application. Illustrative expressions of the above terms in the specification do not necessarily refer to the same embodiment or example. Also, the specific feature, structure, material or characteristic described can be combined in any appropriate manner in one or more embodiments or examples.

[0173] Although embodiments of the application have been shown and described, it would be recognized by those of ordinary skill in the art that various changes, modifications, substitutions, and alterations can be made hereto without departing from the spirit and scope of the application. The scope of the application is limited only by the claims and the equivalents thereof.

[0174] The above is a specific description of the preferred embodiments of the present application, but the present application is not limited to the described embodiments, and those skilled in the art can make various equivalent modifications or replacements without departing from the spirit of the present application, and these equivalent modifications or replacements are all included in the scope defined by the claims of the present application.

Claims

1. A method for predicting cell types and proportions based on an image-based methylation-based model, characterized in that, The method comprises the following steps: obtaining initial single-cell methylation data; constructing a two-dimensional image according to the initial single-cell methylation data, comprising: binning the initial single-cell methylation data to obtain a plurality of interval bin single-cell methylation data; obtaining the methylation ratio mean of each interval bin single-cell methylation data to obtain a one-dimensional array; and rearranging the one-dimensional array to obtain the two-dimensional image; constructing a methylation base model according to the two-dimensional image, comprising: constructing an initial base model based on an encoder-decoder architecture; dividing the two-dimensional image into regions to obtain a plurality of image regions; randomly masking the image regions of the two-dimensional image to obtain a masked image; inputting the masked image into an initial encoder module of the initial base model to output target encoder features; inputting the target encoder features into a decoder module of the initial base model to output masked region predicted pixel values; obtaining the mean square error loss of the masked region predicted pixel values and the true pixel values of the masked region; when the mean square error loss is greater than or equal to a preset threshold, returning to the step of dividing the two-dimensional image into regions to obtain a plurality of image regions until the mean square error loss is less than the preset threshold; and when the mean square error loss is less than the preset threshold, obtaining the methylation base model; predicting a target cell type according to the methylation base model and the two-dimensional image; analyzing the initial single-cell methylation data according to the methylation base model to obtain a target cell type proportion.

2. The method of claim 1, wherein, The binning of the initial single-cell methylation data to obtain a plurality of interval bin single-cell methylation data comprises the following steps: performing a first sorting operation on the initial methylation sites according to the chromosome number to obtain intermediate methylation sites; performing a second sorting operation on the intermediate methylation sites according to the positions of the initial methylation sites on the chromosome to obtain target methylation sites; dividing the target methylation sites into a plurality of interval bins to obtain a plurality of interval bin single-cell methylation data; wherein the initial single-cell methylation data comprises the chromosome of a single initial methylation site and the position of the single initial methylation site on the chromosome.

3. The method of claim 1, wherein, The predicting of a target cell type according to the methylation base model and the two-dimensional image comprises the following steps: obtaining a training image and a cell type label of the training image; extracting a methylation encoder module of the methylation base model; performing single-cell annotation fine-tuning training on the methylation encoder module according to the training image and the cell type label to obtain a first encoder module; inputting the two-dimensional image into the first encoder module and passing it through a first fully connected layer to output the target cell type.

4. The method of claim 1, wherein, The analyzing of the initial single-cell methylation data according to the methylation base model to obtain a target cell type proportion comprises the following steps: obtaining pseudo-batch data, randomly sampling the pseudo-batch data, and constructing first pseudo-single-cell data; extract a methylation encoder module of the methylation base model; perform unrolling fine-tuning training on the methylation encoder module according to the first pseudo single-cell data to obtain a second encoder module; obtain real free DNA data, and perform random sampling on the real free DNA data to construct second pseudo single-cell data; input the second pseudo single-cell data into the second encoder module to obtain pseudo single-cell features; perform weighted fusion on the pseudo single-cell features to obtain fused features; input the fused features into a second fully connected layer to output a proportion of the target cell type.

5. The method of claim 4, wherein, The obtaining pseudo batch data, and the random sampling on the pseudo batch data to construct first pseudo single-cell data, includes the following steps: According to the initial single-cell methylation data, a pseudo batch data is constructed in a random mixed single-cell manner. fit the methylation site number distribution of the initial single-cell methylation data; Through the methylation site number distribution, the pseudo batch data is subjected to multiple random sampling methylation site operations to obtain multiple first pseudo single-cell data.

6. The method of claim 5, wherein, The obtaining real free DNA data, and the random sampling on the real free DNA data to construct second pseudo single-cell data, includes the following steps: Through the methylation site number distribution, the real free DNA data is subjected to multiple random sampling methylation site operations to obtain multiple second pseudo single-cell data.

7. An image-based methylation-based model cell type and proportion prediction device, characterized in that, It includes: a data acquisition module for acquiring initial single-cell methylation data; an image construction module for constructing a two-dimensional image according to the initial single-cell methylation data; the image construction module is specifically configured to: box the initial single-cell methylation data to obtain multiple interval box single-cell methylation data; obtain the methylation ratio mean of each interval box single-cell methylation data to obtain a one-dimensional array; and rearrange the one-dimensional array to obtain the two-dimensional image; a model construction module for constructing a methylation base model according to the two-dimensional image; the model construction module is specifically configured to: construct an initial base model based on an encoder-decoder architecture; divide the two-dimensional image into regions to obtain a plurality of image regions; randomly mask the image regions of the two-dimensional image to obtain a masked image; input the masked image into an initial encoder module of the initial base model to output target encoder features; input the target encoder features into a decoder module of the initial base model to output mask region predicted pixel values; obtain the mean square error loss of the mask region predicted pixel values and the mask region true pixel values; when the mean square error loss is greater than or equal to a preset threshold, return to the step of dividing the two-dimensional image into regions to obtain a plurality of image regions until the mean square error loss is less than the preset threshold; when the mean square error loss is less than the preset threshold, the methylation base model is obtained; a cell type prediction module for predicting a target cell type according to the methylation base model and the two-dimensional image; The cell type proportion prediction module is configured to analyze the initial single-cell methylation data according to the methylation base model to obtain a target cell type proportion.

8. A computer program product comprising a computer program, characterized in that, The computer program, when executed by a processor, implements the method of any one of claims 1 to 6.

Citation Information

Patent Citations

  • Methylation sample clustering method fused with single cell analysis method

    CN116312794A

  • Single cell annotation method of generative gene large model under long-tail data distribution

    CN119560033A