Cell region determination method and device, electronic equipment and storage medium

By obtaining gene expression information from spatial transcription data, dividing cell region sites and non-cellular region sites, and determining the clustering center as the cell region, the problem of inaccurate determination of cell region in the prior art is solved, and higher accuracy and applicability are achieved.

CN119560022APending Publication Date: 2025-03-04SHENZHEN HUADA SANJIAN QIFA TECHNOLOGY CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202311069902.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-08-23
Publication Date
2025-03-04

AI Technical Summary

Technical Problem

The prior art is difficult to accurately determine the cellular region, resulting in inaccurate cell segmentation, especially under conditions where RNA signal volume is low or sparse.

Method used

By obtaining gene expression information from the spatial transcription data of the target slice, the spatial sequencing site is divided into cell region sites and non-cell region sites based on the original gene expression amount, and the first seed site is determined as the clustering center, and the cell region of the target slice is determined.

Benefits of technology

It improves the accuracy of cell region determination, reduces the situation of low RNA semaphores, and reduces dependence on specific genes, and is suitable for different types of spatial transcriptome data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119560022A_ABST
    Figure CN119560022A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a cell region determination method and device, electronic equipment and a storage medium, and belongs to the technical field of cell segmentation. The cell region determination method comprises the following steps: acquiring gene expression information from spatial transcription data of a target section; wherein the gene expression information comprises position information of space sequencing sites and corresponding original gene expression quantity; dividing the spatial sequencing sites into cell region sites and non-cell region sites based on the original gene expression quantity; determining a first seed site in the spatial sequencing sites according to the original gene expression quantity and the position information; wherein the first seed site is a clustering center determined by clustering a plurality of spatial sequencing sites based on original gene expression quantity and position information; and determining a target seed site according to the first seed site, and determining a cell region of the target section according to the position information of the target seed site and the position information of the cell region site. According to the embodiment of the invention, the accuracy of determining the cell region can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of cell segmentation, and in particular to a method and device for determining a cell region, an electronic device, and a storage medium. Background Art

[0002] At present, determining the cell region is an important step in conducting spatial cell research. In the related art, methods for determining the cell region include methods based on staining images of labeled cell nuclei, cell components, cell bodies, etc., and methods for delineating cells through partial RNA signals. Among them, in the method based on staining images, there is a deviation between the image features and the amount of gene expression data, which leads to an overall low amount of RNA signals in the determined cell region, which is not conducive to downstream analysis and processing. In the method of delineating cells through partial RNA signals, a certain amount of RNA signal is required to be large, that is, the method depends on the capture amount of a specific gene, so this method is not suitable for sequencing-based spatial omics data with sparse RNA signals. Therefore, there is currently a lack of a method that can accurately determine the cell region, thereby achieving reasonable cell segmentation. Summary of the invention

[0003] The main purpose of the embodiments of the present application is to propose a method and device for determining a cell region, an electronic device and a storage medium, aiming to improve the accuracy of determining a cell region.

[0004] To achieve the above object, a first aspect of an embodiment of the present application provides a method for determining a cell region, the method comprising:

[0005] Obtaining gene expression information from the spatial transcription data of the target slice; wherein the gene expression information includes location information of multiple spatial sequencing sites and the original gene expression amount corresponding to each of the spatial sequencing sites;

[0006] Dividing the plurality of spatial sequencing sites into cell region sites and non-cell region sites based on the original gene expression amount;

[0007] Determine a plurality of first seed sites in the plurality of spatial sequencing sites according to the original gene expression amount and the position information; wherein the first seed site is a cluster center determined by clustering the plurality of spatial sequencing sites based on the original gene expression amount and the position information;

[0008] The cell region of the target slice is determined according to the first position information of the plurality of first seed sites and the second position information of the cell region site.

[0009] In some embodiments, determining a plurality of first seed sites in the plurality of spatial sequencing sites according to the original gene expression amount and the position information includes:

[0010] Performing weighted processing according to the original gene expression value to obtain the first gene expression value of the spatial sequencing site;

[0011] A plurality of first seed sites are determined based on the first gene expression level and the position information.

[0012] In some embodiments, determining a plurality of first seed sites based on the first gene expression level and the position information includes:

[0013] Determining a first sequencing site and a second sequencing site from the plurality of spatial sequencing sites; wherein the second sequencing site is determined based on preset position distance data and position information of the first sequencing site;

[0014] If the expression level of the first gene at the first sequencing site is greater than the expression level of the first gene at the second sequencing site, the first sequencing site is used as the first seed site.

[0015] In some embodiments, determining a plurality of first seed sites based on the first gene expression level and the position information includes:

[0016] Determine a third sequencing site and a fourth sequencing site from the plurality of spatial sequencing sites; wherein the fourth sequencing site is determined based on preset position distance data and position information of the third sequencing site;

[0017] If the expression level of the first gene at the third sequencing site is greater than the expression level of the first gene at the fourth sequencing site, taking the third sequencing site as a reference sequencing site;

[0018] Calculating the cluster distance of the reference sequencing sites based on the first gene expression level and the position information;

[0019] The product of the cluster distance and the first gene expression level is calculated to obtain product data. If the product data is greater than or equal to a first preset threshold, the reference sequencing site is used as the first seed site.

[0020] In some embodiments, the method further comprises:

[0021] Acquiring a staining image of the target slice;

[0022] Determine the probability that a pixel point of the stained image belongs to the centroid of the cell nucleus based on a preset cell segmentation algorithm, and if the probability is greater than or equal to a second preset threshold, select a second seed site from the plurality of spatial sequencing sites based on the pixel point;

[0023] A target seed site is determined according to the first seed site and the second seed site.

[0024] In some embodiments, dividing the plurality of spatial sequencing sites into cell region sites and non-cell region sites based on the original gene expression amount comprises:

[0025] Performing weighted average processing on the original gene expression values ​​of the multiple spatial sequencing sites to obtain a second gene expression value;

[0026] Calculating a target expression level threshold according to the expression levels of the plurality of second genes;

[0027] The second gene expression level is compared with the target expression level threshold, and the plurality of spatial sequencing sites are divided into the cell region sites and the non-cell region sites according to the comparison result.

[0028] In some embodiments, performing weighted average processing on the original gene expression value to obtain the second gene expression value includes:

[0029] Determining the adjacent sequencing sites of the spatial sequencing sites according to a preset distance range;

[0030] Performing weight calculation on the position data of the spatial sequencing site according to preset weight distribution data to obtain a first weight;

[0031] Performing weight calculation on the position data of the adjacent sequencing sites according to the preset weight distribution data to obtain a second weight;

[0032] The second gene expression value is obtained by performing weighted averaging processing according to the first weight, the original gene expression value corresponding to the spatial sequencing site, the second weight, and the original gene expression value corresponding to the adjacent sequencing site.

[0033] In some embodiments, calculating a target expression level threshold value based on a plurality of expression levels of the second gene includes:

[0034] Dividing the plurality of second gene expression levels into a plurality of first expression levels and a plurality of second expression levels according to a preset original expression level threshold;

[0035] Calculating an average of a plurality of the first expression levels to obtain a first average expression level, and calculating an average of a plurality of the second expression levels to obtain a second average expression level;

[0036] Determine the number of the spatial sequencing sites corresponding to the first expression level to obtain the first site number;

[0037] Determining the number of the spatial sequencing sites corresponding to the second expression value to obtain a second site number;

[0038] Calculate the expression variance according to the first number of sites, the second number of sites, the first average expression level, and the second average expression level;

[0039] Updating the original expression level threshold to obtain a plurality of expression level variances;

[0040] The original expression level threshold corresponding to the expression level variance with the largest value is used as the target expression level threshold.

[0041] In some embodiments, dividing the plurality of spatial sequencing sites into the cell region sites and the non-cell region sites according to the comparison results comprises:

[0042] If the comparison result indicates that the second gene expression level is greater than or equal to the target expression level threshold, dividing the spatial sequencing site corresponding to the second gene expression level into the cell region site;

[0043] If the comparison result indicates that the expression level of the second gene is less than the target expression level threshold, the spatial sequencing site corresponding to the expression level of the second gene is divided into the non-cellular region site.

[0044] In some embodiments, the dividing the plurality of spatial sequencing sites into cell region sites and non-cell region sites based on the original gene expression amount further includes denoising the non-cell region sites, specifically including:

[0045] Mapping a preset first value to the cell region site, and mapping a preset second value to the non-cell region site; wherein the second value is smaller than the first value;

[0046] Constructing a cell mask matrix according to the position information of the cell region site, the first value, the position information of the non-cell region site, and the second value;

[0047] Overlapping a preset first denoising matrix with the cell mask matrix to determine a first overlapping region in the cell mask matrix, and if the first overlapping region includes position data assigned to the first value, assigning the center position data of the first overlapping region to the first value to obtain a first mask matrix;

[0048] The first denoising matrix and the first mask matrix are overlapped to determine a second overlapping area in the first mask matrix. If the values ​​corresponding to all position data in the second overlapping area are the first value, the central position data of the second overlapping area is assigned the first value to obtain a second mask matrix.

[0049] In some embodiments, the dividing the plurality of spatial sequencing sites into cell region sites and non-cell region sites based on the original gene expression amount further includes performing denoising on the cell region sites, specifically including:

[0050] Overlapping the preset second denoising matrix with the second mask matrix to determine a third overlapping area in the second mask matrix, and if the values ​​corresponding to all position data in the third overlapping area are the first value, assigning the center position data of the third overlapping area to the first value to obtain a third mask matrix;

[0051] The second denoising matrix and the third mask matrix are overlapped to determine a fourth overlapping area in the third mask matrix. If the fourth overlapping area includes position data assigned to the first value, the center position data of the fourth overlapping area is assigned to the first value to obtain a fourth mask matrix.

[0052] In some embodiments, determining the cell region of the target slice according to the position information of the target seed site and the position information of the cell region site includes:

[0053] constructing a cell seed matrix according to the position data of the target seed site, and constructing a cell mask matrix according to the position data of the cell region site;

[0054] The area where multiple cell area sites in the cell mask matrix are connected is used as the original cell area; wherein each original cell area corresponds to one target seed site;

[0055] Based on the position data of the target seed site and a preset area threshold, the area of ​​the original cell region is reduced to obtain a preliminary cell region;

[0056] updating the cell mask matrix according to the preliminary cell region to obtain a target mask matrix;

[0057] The cell region of the target slice is determined according to the target mask matrix and the cell seed matrix.

[0058] In some embodiments, determining the cell region of the target slice according to the target mask matrix and the cell seed matrix comprises:

[0059] Constructing a regional convolution kernel according to a preset cell diameter, and performing convolution calculation according to the regional convolution kernel and the cell seed matrix to obtain a convolution matrix;

[0060] Performing dot product calculation on the convolution matrix and the target mask matrix to obtain a cell label matrix; wherein the row and column dimensions of the cell label matrix are the same as the gene expression information, the cell label matrix includes the position data of the spatial sequencing sites and the cell labels corresponding to the spatial sequencing sites, and the cell labels include cell region labels;

[0061] The cell region of the target slice is determined according to the position data corresponding to the cell region label.

[0062] To achieve the above-mentioned purpose, a second aspect of an embodiment of the present application provides a cell region determination device, the device comprising:

[0063] A gene expression information acquisition unit, used to acquire gene expression information from the spatial transcription data of the target slice; wherein the gene expression information includes the position information of multiple spatial sequencing sites and the original gene expression amount corresponding to each of the spatial sequencing sites;

[0064] A cell region division unit, used for dividing the plurality of spatial sequencing sites into cell region sites and non-cell region sites based on the original gene expression amount;

[0065] A seed site determination unit, used to determine a plurality of first seed sites among the plurality of spatial sequencing sites according to the original gene expression amount and the position information; wherein the first seed site is a cluster center determined by clustering the plurality of spatial sequencing sites based on the original gene expression amount and the position information;

[0066] A cell region determining unit is used to determine the cell region of the target slice according to the first position information of the plurality of first seed sites and the second position information of the cell region site.

[0067] To achieve the above-mentioned purpose, a third aspect of an embodiment of the present application proposes an electronic device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the method described in the first aspect is implemented.

[0068] To achieve the above-mentioned purpose, the fourth aspect of the embodiments of the present application proposes a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the method described in the first aspect is implemented.

[0069] To achieve the above-mentioned purpose, the fifth aspect of the embodiments of the present application proposes a computer program product, which includes a computer program. The computer program is read and executed by a processor of a computer device, so that the computer device executes the method described in the first aspect.

[0070] The cell region determination method and device, electronic device and storage medium proposed in the embodiment of the present application determine the cell region site and non-cell region site by the original gene expression in the gene expression information. The first seed site is determined by the original gene expression and position information, and the target seed site is determined according to the first seed site. The cell region of the target slice is determined by the position information of the target seed site and the position information of the cell region site. It can be seen from this that the example of the present application is to determine the cell region of the target slice completely based on the original gene expression. Compared with the method based on the staining image in the related art, the embodiment of the present application directly processes the gene expression information obtained by the spatial transcription data, reduces the situation that the RNA signal amount of the demarcated cell region is low, and improves the accuracy of the cell region determination. Compared with the method for determining the cell region according to partial RNA, the embodiment of the present application can reduce the dependence on specific genes and improve the universality of the cell region determination method. BRIEF DESCRIPTION OF THE DRAWINGS

[0071] The accompanying drawings are used to provide further understanding of the technical solution of the present disclosure and constitute a part of the specification. Together with the embodiments of the present disclosure, they are used to explain the technical solution of the present disclosure and do not constitute a limitation on the technical solution of the present disclosure.

[0072] Figure 1 is a flow chart of a method for determining a cell region provided in an embodiment of the present application;

[0073] Figure 2 yes Figure 1 Flow chart of step S102 in FIG.

[0074] Figure 3 yes Figure 2 Flow chart of step S201 in FIG.

[0075] Figure 4 is a schematic diagram of determining adjacent sequencing sites according to a convolution kernel in an embodiment of the present application;

[0076] Figure 5 yes Figure 2 Flow chart of step S202 in FIG.

[0077] Figure 6 yes Figure 2 A flowchart of another embodiment of step S203 in FIG.

[0078] Figure 7 It is a schematic diagram of the existence of "black hole" noise after imaging the cell mask matrix provided in an embodiment of the present application;

[0079] Figure 8 Yes Figure 7 Schematic diagram of the denoising effect of the "black hole" in the figure;

[0080] Fig. 9 is a schematic diagram of an expansion operation performed in an embodiment of the present application;

[0081] Fig.10 is a schematic diagram of the etching operation performed in the embodiment of the present application;

[0082] Fig.11 yes Figure 2 A flowchart of another embodiment of step S203 in FIG.

[0083] Fig.12 is a schematic diagram showing the presence of noise after imaging the second mask matrix provided by an embodiment of the present application;

[0084] Fig.13 Yes Fig.12 Schematic diagram of the effect of denoising the noise;

[0085] Fig.14 yes Figure 1 Flow chart of step S103 in FIG.

[0086] Fig.15 yes Fig.14 Flowchart of step S1402 in FIG.

[0087] Fig.16 yes Fig.14 A flowchart of another embodiment of step S1402 in FIG. 1 ;

[0088] Fig.17 is a flow chart of another embodiment of the method for determining a cell region provided in an embodiment of the present application;

[0089] Fig.18 yes Figure 1 Flow chart of step S104 in FIG.

[0090] Fig.19 yes Fig.18 Flowchart of step S1805 in FIG.

[0091] Fig. 20 It is a schematic diagram of the cell area determined by the method of artificial labeling based on RNA signals;

[0092] Fig.21 is a schematic diagram of a cell region determined using the method provided in the examples of the present application;

[0093] Fig. 22 It is a schematic diagram of the cell area determined using an image-based reference method (such as the Stardist method);

[0094] Fig.23 is a schematic diagram of a cell region determination device provided in an embodiment of the present application;

[0095] Fig.24 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION

[0096] In order to make the purpose, technical solution and advantages of the present disclosure more clear, the present disclosure is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present disclosure and are not used to limit the present disclosure.

[0097] Before further describing the embodiments of the present disclosure in detail, the nouns and terms involved in the embodiments of the present disclosure are described. The nouns and terms involved in the embodiments of the present disclosure are subject to the following interpretations:

[0098] Spatial Transcriptomics (ST) sequencing technology: a technology that analyzes RNA from a spatial level, used to analyze all RNA in a single tissue section. There are four capture areas on each slide used for library construction by 10x Genomics spatial transcriptomics, and the size of each capture area is 6.5x6.5mm. Each capture area contains 5,000 barcoded spots, each with a diameter of 55μm and a center-to-center distance of 100μm. Each spot includes multiple capture probes that can bind to RNA, and each probe carries unique spatial barcodes to mark the spatial position of the captured RNA. Through on-machine sequencing, the sequence of each RNA transcript can be mapped back to the original position in the tissue section, thereby providing data support for downstream tasks. It can be seen that ST sequencing technology is a technology that can simultaneously obtain RNA expression and RNA spatial location information in a single experiment.

[0099] At present, for spatial transcriptome sequencing technology with subcellular resolution, determining the cell region of tissue sections is an important step in conducting spatial cell research. In related technologies, methods for determining cell regions include the following two categories: the first category is based on staining images of labeled cell nuclei, cell components, cell bodies, etc.; the second category is based on partial RNA to delineate cell regions.

[0100] Among them, the methods based on staining images include the following two: the first method is to identify the staining images based on feature extraction of computer vision, random forest and other machine learning models (such as Ilastik algorithm) to determine the cell area. The second method is to identify the staining images based on deep learning models of convolutional neural networks (such as DeepCell, Stardist, Omnipose and other models) to determine the cell area.

[0101] Methods based on partial RNA to delineate cell regions (such as the Baysor algorithm and the ClusterMap algorithm) use image-based in situ transcriptional sequencing methods such as MERFISH to stain a small number of specific genes, and then delineate cells based on the staining images, that is, determine the cell regions.

[0102] Among the above methods, the method based on machine learning model can automatically detect cell regions in fluorescent staining images, but it requires a labeled data set for model training. In this case, the trained machine learning model may have poor generalization ability to other data sets, that is, the accuracy of cell region recognition is low when applied to other data sets.

[0103] The method based on deep learning model requires manual adjustment of the results to obtain better cell area determination results, and the determined cell area is different from the actual cell distribution. This is because the image needs to be collected through subsequent experiments processed by ST, which may cause the staining image and RNA signal to be inconsistent.

[0104] The method of delineating cell regions based on partial RNA requires a high capture amount of specific genes if accurate cell delineation results are expected. Therefore, this method is not suitable for processing sequencing-based spatial transcriptome data with sparse RNA signals. In addition, this method takes a long time to run and consumes a lot of memory.

[0105] Based on this, the embodiments of the present application propose a method and device for determining a cell region, an electronic device, and a storage medium, which can improve the accuracy of determining a cell region.

[0106] The cell region determination method proposed in the embodiment of the present application is described below.

[0107] Reference Figure 1 In some embodiments, the cell region determination method includes but is not limited to steps S101 to S104.

[0108] Step S101, obtaining gene expression information from the spatial transcription data of the target slice; wherein the gene expression information includes the position information of multiple spatial sequencing sites and the original gene expression amount corresponding to each spatial sequencing site;

[0109] Step S102, dividing the multiple spatial sequencing sites into cell region sites and non-cell region sites based on the original gene expression amount;

[0110] Step S103, determining a plurality of first seed sites in the plurality of spatial sequencing sites according to the original gene expression levels and the position information; wherein the first seed site is a cluster center determined by clustering the plurality of spatial sequencing sites based on the original gene expression levels and the position information;

[0111] Step S104: determining the cell region of the target slice according to the first position information of the plurality of first seed sites and the second position information of the cell region site.

[0112] Steps S101 to S104 shown in the embodiment of the present application determine the cell region site and the non-cell region site by the original gene expression amount in the gene expression information. The first seed site is determined by the original gene expression amount and the positional information, and the target seed site is determined according to the first seed site. The cell region of the target slice is determined by the positional information of the target seed site and the positional information of the cell region site. It can be seen from this that the present application example is to determine the cell region of the target slice completely based on the original gene expression amount. Compared with the method based on the staining image in the related art, the gene expression information obtained by the embodiment of the present application directly to the spatial transcription data is processed, and the situation that the RNA signal amount of the cell region demarcated is low is reduced, and the accuracy of the cell region determination is improved. Compared with the method for determining the cell region according to partial RNA, the embodiment of the present application can reduce the dependence on specific genes and improve the universality of the cell region determination method.

[0113] In step S101 of some embodiments, the target slice refers to a frozen embedded tissue slice to be subjected to ST processing to determine the cell area. The target slice is a biological slice obtained in compliance with relevant legal provisions, and the biological slice includes a plant slice and an animal slice. The target slice is subjected to ST processing to obtain spatial transcription data, and gene expression information is obtained based on the spatial transcriptome data. The gene expression information is used to describe the position data of the spatial sequencing site, and the original gene expression amount corresponding to the spatial sequencing site. Among them, the spatial sequencing site refers to the spot in the ST technology, the position information is used to indicate the position of the spot in the corresponding capture area, and the original gene expression amount refers to the RNA expression amount captured by the spot from the corresponding position of the target slice. It can be understood that the gene expression information can be represented in the form of a matrix, the corresponding position information can be represented in the form of (x, y) coordinates, and the original gene expression amount is the value of the (x, y) coordinate in the matrix.

[0114] In step S102 of some embodiments, based on the original gene expression corresponding to each spatial sequencing site, the spatial sequencing site is determined to be a cell region site or a non-cell region site. The original gene expression corresponding to the cell region site is within the target slice cell region RNA expression range. The original gene expression corresponding to the non-cell region site is within the target slice non-cell region RNA expression range.

[0115] Reference Figure 2 In some embodiments, step S102 includes but is not limited to steps S201 to S203.

[0116] Step S201, performing weighted average processing on the original gene expression values ​​of multiple spatial sequencing sites to obtain a second gene expression value;

[0117] Step S202, calculating a target expression level threshold value according to the expression levels of multiple second genes;

[0118] Step S203, comparing the second gene expression level with the target expression level threshold, and dividing the multiple spatial sequencing sites into cell region sites and non-cell region sites according to the comparison result.

[0119] In step S201 of some embodiments, the original gene expression value of each spatial sequencing site is subjected to weighted average processing to blur the original gene expression value and reduce the situation of abnormal or prominent values. After the weighted average processing, each spatial sequencing site will obtain a new gene expression value, that is, the second gene expression value.

[0120] Reference Figure 3 In some embodiments, step S201 includes but is not limited to steps S301 to S304.

[0121] Step S301, determining a neighboring sequencing site of a spatial sequencing site according to a preset distance range;

[0122] Step S302, performing weight calculation on the position data of the spatial sequencing site according to preset weight distribution data to obtain a first weight;

[0123] Step S303, performing weight calculation on the position data of the adjacent sequencing sites according to the preset weight distribution data to obtain a second weight;

[0124] Step S304, performing weighted averaging processing according to the first weight, the original gene expression level corresponding to the spatial sequencing site, the second weight, and the original gene expression level corresponding to the adjacent sequencing site, to obtain the second gene expression level.

[0125] It should be noted that when the gene expression data is represented in the form of a matrix, the matrix can be regarded as an image. The position data in the matrix is ​​used as the pixel points of the image, and the original gene expression amount in the matrix is ​​used as the brightness of the corresponding pixel points. Steps S301 to S304 are equivalent to the process of performing Gaussian blur processing on the image to blur the brightness of the image.

[0126] In step S301 of some embodiments, adjacent sequencing sites around each spatial sequencing site are determined, and the distance between the adjacent sequencing sites and the corresponding spatial sequencing sites is within a preset distance range. It is understandable that when the gene expression data is represented in the form of a matrix, the preset distance range can be in the form of a convolution kernel, such as a k×k convolution kernel, and the value of k can be 5 or any other value. Taking k=5 as an example, refer to Figure 4 , in gene expression data, spatial sequencing site A includes 24 adjacent sequencing sites B.

[0127] In steps S302 to S303 of some embodiments, the weight distribution data is used to describe the distribution of weights. It is understandable that the weight distribution data can be set according to the adaptability of the blur effect. The larger the weight distribution data, the smaller the weight calculated according to the weight distribution data, and the better the blur effect. The smaller the weight distribution data, the larger the weight calculated according to the weight distribution data, and the worse the blur effect. Specifically, the weight calculation can be performed according to the following formula (1).

[0128]

[0129] Among them, G(x,y) represents the first weight or the second weight, σ 2 Represents weight distribution data. μ x and μ y represents the mean, μ x and μ y The specific value of is determined by the center point of the convolution kernel. When the center point of the convolution kernel is taken as the origin (0,0), μ x and μ y The values ​​of are all zero. x represents the horizontal position offset between the position data of the sequencing site to be calculated (spatial sequencing site or adjacent sequencing site) and the origin (0,0), and y represents the vertical position offset between the position data of the sequencing site to be calculated and the origin (0,0).

[0130] In step S304 of some embodiments, weighted average processing refers to multiplying the first weight by the original gene expression corresponding to the spatial sequencing site, and multiplying the second weight by the original gene expression corresponding to the adjacent sequencing site, and calculating the average value of multiple multiplication results. After the above calculation, the second gene expression of a spatial sequencing site can be obtained, such as the second gene expression of spatial sequencing site A. The operations of steps S301 to S304 are performed on each spatial sequencing site in the gene expression data, and the original gene expression of the entire target slice can be blurred.

[0131] The benefit of step S301 to step S304 is that, in practical applications, the spatial sequencing sites captured by RNA are sparsely distributed. In order to determine a complete cell region based on these sparsely distributed spatial sequencing sites, the embodiment of the present application regards these sparsely distributed spatial sequencing sites as the outer contour of the cell region, and fills the spatial sequencing sites within the outer contour with data based on Gaussian blurring. Specifically, the spatial sequencing sites with low original gene expression levels within the outer contour can obtain new expression levels (i.e., second gene expression levels) that are as high as the surrounding spatial sequencing sites (i.e., adjacent sequencing sites, i.e., spatial sequencing sites corresponding to the outer contour) based on Gaussian blurring, thereby obtaining a complete connected region.

[0132] In step S202 of some embodiments, multiple second gene expression levels are processed to obtain target gene expression level threshold. According to the target expression level threshold, the target slice cell region RNA expression level range and non-cell region RNA expression level range can be determined. For example, if the target expression level threshold is a, then [a, ∞) is set as the cell region RNA expression level range, and [0, a) is set as the non-cell region RNA expression level range. It is understandable that the boundary value "∞" in the cell region RNA expression level range and the boundary value "0" in the non-cell region RNA expression level range are exemplary, and can also be adaptively set according to actual needs, and this embodiment of the present application is not specifically limited.

[0133] Reference Figure 5 In some embodiments, step S202 includes but is not limited to steps S501 to S507.

[0134] Step S501, dividing a plurality of second gene expression levels into a plurality of first expression levels and a plurality of second expression levels according to a preset original expression level threshold;

[0135] Step S502, calculating an average of a plurality of first expression amounts to obtain a first average expression amount, and calculating an average of a plurality of second expression amounts to obtain a second average expression amount;

[0136] Step S503, determining the number of spatial sequencing sites corresponding to the first expression level, and obtaining the number of first sites;

[0137] Step S504, determining the number of spatial sequencing sites corresponding to the second expression level to obtain the second site number;

[0138] Step S505, calculating the expression variance according to the number of first sites, the number of second sites, the first average expression level, and the second average expression level;

[0139] Step S506, updating the original expression level threshold to obtain multiple expression level variances;

[0140] Step S507 , taking the original expression level threshold corresponding to the expression level variance with the largest value as the target expression level threshold.

[0141] In step S501 of some embodiments, multiple second gene expression amounts are compared with preset original expression amount threshold values, and the second gene expression amount greater than or equal to the original expression amount threshold value is used as the first expression amount, and the second gene expression amount less than the original expression amount threshold value is used as the second expression amount. It is understandable that the specific value of the original expression amount threshold value can be adaptively set according to actual needs, and this embodiment of the present application is not specifically limited to this. However, in order to increase the speed of determining the target expression amount threshold value, the original gene expression amount threshold value can be set to the mean of multiple second gene expression amounts.

[0142] In step S502 of some embodiments, a plurality of first expression values ​​are averaged to obtain a first average expression value, and a plurality of second expression values ​​are averaged to obtain a second average expression value.

[0143] In some embodiments, in step S503 to step S504, the number of spatial sequencing sites corresponding to the first expression level is determined to obtain the first site number. The number of spatial sequencing sites corresponding to the second expression level is determined to obtain the second site number.

[0144] In step S505 of some embodiments, the expression variance g is calculated according to the first site number, the second site number, the first average expression level, the second average expression level and the following formula (2).

[0145] g=w0(u0-u t ) 2 +w1(u1-u t ) 2 ......Formula (2)

[0146] Wherein, w0 represents the ratio of the spatial sequencing sites corresponding to the first expression to all spatial sequencing sites, i.e., w0 = number of first sites / (number of first sites + number of second sites). w1 represents the ratio of the spatial sequencing sites corresponding to the second expression to all spatial sequencing sites, i.e., w1 = number of second sites / (number of first sites + number of second sites). u0 represents the first average expression, and u1 represents the second average expression. t represents the total average expression level of all second genes.

[0147] In steps S506 to S507 of some embodiments, the larger the expression variance g, the greater the difference between the first expression and the second expression. When the gene expression is used as the brightness of the grayscale image, the larger the g, the greater the difference between the image foreground (i.e., the area with higher brightness) and the background (i.e., the area with lower brightness). In an embodiment of the present application, the foreground area of ​​the image can be considered as the cell area, and the background area of ​​the image can be considered as the non-cell area. It can be seen that a larger expression variance g is conducive to determining the cell area. Therefore, the original expression threshold is updated to obtain a new original expression threshold. Steps S501 to S505 are performed again according to the new original expression threshold, so as to obtain multiple expression variances g. The expression variance g with the largest value is determined from multiple expression variances g, and the original expression threshold corresponding to the expression variance g with the largest value is used as the target expression threshold.

[0148] In step S203 of some embodiments, the second gene expression amount is compared with the target expression amount threshold to obtain a comparison result. The comparison result is used to indicate that the second gene expression amount is within the range of the cell region RNA expression amount, or the comparison result is used to indicate that the second gene expression amount is within the range of the non-cell region RNA expression amount. According to the comparison result, the corresponding spatial sequencing site is determined to be a cell region site or a non-cell region site, thereby achieving the division of multiple spatial sequencing sites.

[0149] In some embodiments, the step S203 of “dividing the plurality of spatial sequencing sites into cell region sites and non-cell region sites according to the comparison results” includes but is not limited to the following two steps:

[0150] If the comparison result indicates that the expression level of the second gene is greater than or equal to the target expression level threshold, the spatial sequencing site corresponding to the expression level of the second gene is divided into a cell region site;

[0151] If the comparison result indicates that the expression level of the second gene is less than the target expression level threshold, the spatial sequencing site corresponding to the expression level of the second gene is divided into a non-cellular region site.

[0152] Specifically, if the comparison result indicates that the second gene expression amount is greater than or equal to the target expression amount threshold, it indicates that the second gene expression amount is within the range of the cell region RNA expression amount, and the spatial sequencing site corresponding to the second gene expression amount is divided into a cell region site. If the comparison result indicates that the second gene expression amount is less than the target expression amount threshold, it indicates that the second gene expression amount is within the range of the non-cell region RNA expression amount, and the spatial sequencing site corresponding to the second gene expression amount is divided into a non-cell region site.

[0153] The benefit of step S201 to step S203 is that multiple spatial sequencing sites can be divided into multiple cell region sites and multiple non-cell region sites, so that a preliminary cell region can be determined based on the position data corresponding to the multiple cell region sites, and the non-cell region can be determined based on the position data corresponding to the multiple non-cell region sites.

[0154] Reference Figure 6 In some embodiments, step S203 further includes: performing denoising processing on non-cellular region sites, specifically including but not limited to steps S601 to S604.

[0155] Step S601, mapping a preset first value to a cell region site, and mapping a preset second value to a non-cell region site; wherein the second value is smaller than the first value;

[0156] Step S602, constructing a cell mask matrix according to the position information of the cell region site, the first value, the position information of the non-cell region site, and the second value;

[0157] Step S603, overlapping the preset first denoising matrix and the cell mask matrix to determine a first overlapping area in the cell mask matrix, and if the first overlapping area includes position data assigned a first value, assigning the center position data of the first overlapping area to the first value to obtain a first mask matrix;

[0158] Step S604, overlapping the first denoising matrix and the first mask matrix to determine the second overlapping area in the first mask matrix. If the values ​​corresponding to all position data in the second overlapping area are the first value, the center position data of the second overlapping area is assigned the first value to obtain the second mask matrix.

[0159] In step S601 to step S602 of some embodiments, in order to construct the cell mask matrix, a mapping operation is performed according to the preset first and second numerical values. Specifically, the first numerical value is mapped with the cell region site, so as to assign the first numerical value as the cell region site position information in the cell mask matrix. The second numerical value is mapped with the non-cell region site, so as to assign the second numerical value as the non-cell region site position information in the cell mask matrix. It is understandable that the specific values ​​of the first and second numerical values ​​can be adaptively set according to actual needs, and the embodiment of the present application is not specifically limited to this, but it should be ensured that the second numerical value is less than the first numerical value. For example, the first numerical value can be 1, and the second numerical value can be 0. It can be seen from this that in the cell mask matrix, the cell region can be determined according to the first numerical value, and the non-cell region can be determined according to the second numerical value.

[0160] In step S603 of some embodiments, a "black hole" may exist in the cell region preliminarily determined according to the above steps. Figure 7 , when imaging the cell mask matrix, Figure 7 The white area in the middle is the cell area preliminarily determined according to the above steps, the black area is the non-cell area, and the black area inside the white area is the "black hole". In the embodiment of the present application, these "black hole" noises (i.e., non-cell area site noises) are denoised based on the morphological closing operation. It can be understood that the closing operation is an operation method of performing an expansion operation first and then an erosion operation. The expansion operation is described below.

[0161] Specifically, the position information in the cell mask matrix is ​​overlapped with the center of the first denoising matrix, the first overlapping region of the first denoising matrix in the cell mask matrix is ​​determined according to the size of the first denoising matrix, and the assignment of the position information overlapping with the center of the first denoising matrix is ​​adjusted according to the assignment of each position information in the first overlapping region. It can be seen that when the position information overlapping with the first denoising center is the position information corresponding to the "black hole", the assignment of the position information corresponding to the "black hole" can be adjusted according to the assignment of the position information around the "black hole", thereby achieving denoising of the "black hole". Figure 8 As shown, Figure 8 For Figure 7 Schematic diagram of the effect of denoising by the "black hole" in the cell mask matrix. By traversing the center of the first denoising matrix through all the position information in the cell mask matrix, the assignment adjustment of all the position information can be achieved. It can be understood that in the expansion operation, the assignment adjustment is performed based on the maximum value of the first overlapping area, that is, the assignment of the position information overlapping with the center is adjusted to the maximum value of each position information in the first overlapping area. Since in the cell mask matrix, the first value is greater than the second value, therefore, in the expansion operation, when the first overlapping area includes position information assigned to the first value, the assignment of the position information overlapping with the center can be adjusted to the first value. For example, referring to Fig. 9 , taking the first denoising matrix as a 3*3 matrix as an example, the cell mask matrix can be transformed into the first mask matrix. It can be understood that Fig. 9 In the cell mask matrix, black indicates the position information corresponding to the value of 0, and white indicates the position information corresponding to the value of 1. The same is true for the first mask matrix.

[0162] In step S604 of some embodiments, by Figure 7 and Figure 8 From the comparison, we can see that the dilation operation not only filters out the "black hole" noise, but also expands the area of ​​the cell region. Therefore, in order to restore the area of ​​the cell region, the corrosion operation is also required. The corrosion operation is explained below.

[0163] Specifically, the position information in the first mask matrix is ​​overlapped with the center of the first denoising matrix, and the second overlapping area of ​​the first denoising matrix in the first mask matrix is ​​determined according to the size of the first denoising matrix, and the assignment of the position information overlapping with the center of the first denoising matrix is ​​adjusted according to the assignment of each position information in the second overlapping area. It can be seen that when the position information overlapping with the center of the first denoising is the position information of the edge of the cell area, the assignment of the position information of the edge of the cell area can be adjusted according to the assignment of the position information of the non-cell area, so as to achieve the reduction of the area of ​​the cell area. The center of the first denoising matrix is ​​traversed through all the position information in the first mask matrix, and the assignment of all the position information can be adjusted. It can be understood that in the corrosion operation, the assignment is adjusted according to the minimum value of the second overlapping area, that is, the assignment of the position information overlapping with the center is adjusted to the minimum value of each position information in the first overlapping area. Since in the cell mask matrix, the first value is greater than the second value, in the expansion operation, only when the assignments corresponding to all the position information in the first overlapping area are the first value, the assignment of the position information overlapping with the center will be adjusted to the first value, and in other cases, the assignment of the center overlapping position information is adjusted with the second value. For example, refer to Fig.10 , according to the 3*3 first denoising matrix, the first mask matrix can be transformed into the second mask matrix.

[0164] Reference Fig.11 In some embodiments, step S203 further includes: performing denoising processing on the cell region sites, specifically including but not limited to steps S1101 to S1102.

[0165] Step S1101, overlapping the preset second denoising matrix and the second mask matrix, determining a third overlapping area in the second mask matrix, and if the values ​​corresponding to all position data in the third overlapping area are the first value, assigning the center position data of the third overlapping area to the first value to obtain a third mask matrix;

[0166] Step S1102, overlapping the second denoising matrix and the third mask matrix to determine a fourth overlapping area in the third mask matrix, and if the fourth overlapping area includes position data assigned to the first value, assigning the center position data of the fourth overlapping area to the first value to obtain a fourth mask matrix.

[0167] It should be noted that, refer to Fig.12 , when the second mask matrix is ​​imaged, Fig.12The white area is the cell area, and the black area is the non-cell area. There are cell areas with smaller areas in the non-cell area. Since the real cell areas should have a certain size, these cell areas with smaller areas can be regarded as noise. In the embodiment of the present application, these noises are denoised based on morphological opening operations. It can be understood that the opening operation is an operation method that first performs an erosion operation and then performs an expansion operation.

[0168] Specifically, step S1101 is a process of performing an etching operation, and the specific operation method can refer to the description of step S604, which is not repeated in this embodiment of the present application. Step S1102 is a process of performing an expansion operation, and the specific operation method can refer to the description of step S603, which is not repeated in this embodiment of the present application.

[0169] It can be understood that according to the above closing operation and opening operation, the following can be obtained: Fig.13 That is, the fourth mask matrix is ​​the matrix corresponding to the "black hole" noise and the noise of the cell region with a smaller area after filtering out. Therefore, in the subsequent steps, the fourth mask matrix can be used as the cell mask matrix to improve the accuracy of determining the cell region of the target slice.

[0170] The benefit of steps S601 to S604 and steps S1101 to S1102 is that the "black hole" noise in the cell area and the cell area with a smaller area can be denoised, thereby reducing the influence of the above noise on the determination of the real cell area, that is, the accuracy of determining the cell area can be improved.

[0171] In step S103 of some embodiments, the first seed site is a spatial sequencing site corresponding to the target slice cell region and with high confidence. Confidence refers to the probability that the first seed site corresponds to the target slice cell region. It can be understood that the cluster center of multiple spatial sequencing sites can be considered to have the characteristics of corresponding cell regions and high confidence, that is, the spatial sequencing site corresponding to the cluster center can be identified as the first seed site. Among them, when the original gene expression of a certain spatial sequencing site is greater than the original gene expression of the adjacent spatial sequencing site, and the spatial sequencing site is far away from other spatial sequencing sites with higher original gene expression, the spatial sequencing site is considered to be a cluster center. Determine multiple first seed sites from multiple spatial sequencing sites according to the above method.

[0172] Reference Fig.14 In some embodiments, step S103 includes but is not limited to steps S1401 to S1402.

[0173] Step S1401, performing weighted processing according to the original gene expression value to obtain the first gene expression value corresponding to the spatial sequencing site;

[0174] Step S1402: determining a plurality of first seed sites based on the first gene expression level and position information.

[0175] In step S1401 of some embodiments, weighted processing is performed on each spatial sequencing site based on the original gene expression, that is, Gaussian blur processing is performed to obtain the first gene expression value of each spatial sequencing site. The Gaussian blur processing method refers to the description in steps S301 to S304, and this embodiment of the application will not be repeated.

[0176] In step S1402 of some embodiments, multiple spatial sequencing sites are screened according to the first gene expression level and position information to obtain multiple first seed sites.

[0177] Reference Fig.15 In some embodiments, step S1402 includes but is not limited to steps S1501 to S1502.

[0178] Step S1501, determining a first sequencing site and a second sequencing site from a plurality of spatial sequencing sites; wherein the second sequencing site is determined based on preset position distance data and position information of the first sequencing site;

[0179] Step S1502: If the expression level of the first gene at the first sequencing site is greater than the expression level of the first gene at the second sequencing site, the first sequencing site is used as a first seed site.

[0180] In step S1501 of some embodiments, one is randomly selected from a plurality of spatial sequencing sites as a first sequencing site. A plurality of second sequencing sites are determined from a plurality of target sequencing sites based on the position data of the first sequencing site and preset position distance data. Wherein, the target sequencing site refers to a spatial sequencing site other than the first sequencing site in a plurality of spatial sequencing sites. In other words, the position distance between the second sequencing site and the first sequencing site is less than or equal to the position distance data, that is, the second sequencing site is a neighbor site of the first sequencing site. It is understandable that the specific value of the position distance data can be adaptively set according to the actual situation, and this embodiment of the present application does not specifically limit this.

[0181] In step S1502 of some embodiments, the first gene expression level of the first sequencing site is compared with the first gene expression level of each second sequencing site, and if the first gene expression level of the first sequencing site is greater than the first gene expression levels of all second sequencing sites, the first sequencing site is used as the first seed site. The operations of step S1501 to step S1502 are performed on each spatial sequencing site, so that multiple first seed sites can be obtained.

[0182] It is understandable that step S1501 to step S1502 is to use the spatial sequencing site with a larger expression amount of the first gene as the first seed site. Among them, the "larger" comparison object is the neighboring site. According to actual needs, the first gene expression amount can also be directly compared with a preset threshold, and the spatial sequencing site corresponding to the first gene expression amount greater than the preset threshold is used as the first seed site. This embodiment of the application is not specifically limited to this.

[0183] Reference Fig.16 In some other embodiments, step S1402 may also include but is not limited to steps S1601 to S1604.

[0184] Step S1601, determining a third sequencing site and a fourth sequencing site from a plurality of spatial sequencing sites; wherein the fourth sequencing site is determined based on preset position distance data and position information of the third sequencing site;

[0185] Step S1602, if the first gene expression level at the third sequencing site is greater than the first gene expression level at the fourth sequencing site, the third sequencing site is used as a reference sequencing site;

[0186] Step S1603, calculating the cluster distance of the reference sequencing site based on the first gene expression level and position information;

[0187] Step S1604, calculating the product of the cluster distance and the first gene expression level to obtain product data, and if the product data is greater than or equal to a first preset threshold, taking the reference sequencing site as the first seed site.

[0188] In step S1601 of some embodiments, the method of determining the third sequencing site and the fourth sequencing site can refer to the description of step S1501, which will not be described in detail in the embodiments of the present application.

[0189] In step S1602 of some embodiments, the first gene expression level of the third sequencing site is compared with the first gene expression level of each fourth sequencing site respectively; if the first gene expression level of the third sequencing site is greater than the first gene expression levels of all fourth sequencing sites, the third sequencing site is used as a reference sequencing site.

[0190] In step S1603 of some embodiments, multiple sites to be compared are determined from multiple spatial sequencing sites, and the sites to be compared are spots where the expression of the first gene meets a preset condition, and the preset condition means that the expression of the first gene is greater than the expression of the first gene at the reference sequencing site. The cluster distance represents the minimum position distance between the reference sequencing site and the site to be compared, and the cluster distance can be calculated based on the position information of the reference sequencing site and the position information of the site to be compared. For example, the cluster distance δ can be determined according to the following formula (3): i .

[0191]

[0192] Among them, ρ i represents the first gene expression level at the reference sequencing site i, ρ j Indicates the expression level of the first gene at the site j to be compared. i,j represents the site distance between the reference sequencing site i and the site to be compared j, d i,j It can be calculated based on the Euclidean distance.

[0193] In step S1604 of some embodiments, the cluster distance δ is calculated. i and the first gene expression level ρ i The product of obtains the corresponding product data. The first preset threshold is a preset threshold, and the specific value of the first preset threshold can be adaptively set according to actual needs, and the embodiment of the present application does not specifically limit this. The product data is compared with the first preset threshold. If the product data is greater than or equal to the first preset threshold, the reference sequencing site i is used as the first seed site. The operations of steps S1601 to S1604 are performed on each spatial sequencing site, so that multiple first seed sites can be obtained.

[0194] Reference Fig.17 In some embodiments, the method provided in the embodiments of the present application also includes but is not limited to steps S1701 to S1703.

[0195] Step S1701, obtaining a staining image of a target slice;

[0196] Step S1702, determining the probability that the pixel point belongs to the centroid of the cell nucleus based on a preset cell segmentation algorithm, and if the probability is greater than or equal to a second preset threshold, selecting a second seed site from multiple spatial sequencing sites based on the pixel point;

[0197] Step S1703: determine a target seed site according to the first seed site and the second seed site.

[0198] In step S1701 of some embodiments, the staining image may be an image obtained by marking the cell nucleus, cell components, cell body, etc. of the target slice. The target slice may be stained before ST treatment, and then photographed to extract the staining image. The staining image obtained in this way is called an H&E image. Alternatively, it may be stained based on a single nucleotide fluorescent dye, and then photographed under the fluorescence of a microscope to obtain the staining image. The staining image obtained in this way is called an ssDNA image.

[0199] In step S1702 of some embodiments, the stained image is used as input data of a preset cell segmentation algorithm to determine the probability that each pixel in the stained image corresponds to the centroid of the cell nucleus through the cell segmentation algorithm. If the probability that a certain pixel corresponds to the centroid of the cell nucleus is greater than or equal to the second preset threshold, the pixel is confirmed to be the pixel of the centroid of the cell nucleus. The stained image can be aligned with the gene expression data. In this case, the corresponding second seed site can be screened out from multiple spatial sequencing sites based on the position of the pixel of the centroid of the cell nucleus in the stained image. Among them, the cell segmentation algorithm may include Stardist, DeepCell, etc., which is not specifically limited to this embodiment of the present application.

[0200] In step S1703 of some embodiments, the first seed site and the second seed site are combined to obtain a target seed site. In this case, step S104 can be changed to determine the cell region of the target slice according to the position information of the multiple target seed sites and the position information of the cell region site.

[0201] It is understood that in some embodiments, the cell region can also be determined based on the second seed site and the cell region site. That is, the cell region can be determined based on either or both of the first seed site and the second seed site. When the first seed site and the second seed site are combined to determine the target seed site, the second seed site can be used as a supplement to the first seed site to improve the completeness and accuracy of the seed site determination.

[0202] It is understandable that, usually, the RNA content of the cell nucleus is higher than that of the cytoplasm. In the staining image, the pixel value of the corresponding position of the cell nucleus is higher than that of other cell parts such as the cytoplasm. Based on the difference in pixel values, the centroid of the cell nucleus can be located. Therefore, it can be seen that the second seed site also meets the characteristics of the cluster center of "being a spatial sequencing site in the cell region with high confidence".

[0203] In step S104 of some embodiments, an enclosed area can be determined based on the second position information of multiple cell area sites, and the enclosed area is preliminarily identified as a cell area. However, due to the possibility of RNA diffusion during ST processing, that is, the RNA captured by the spot may be RNA drifting from the surrounding area, so in the real situation, a certain spatial sequencing site may correspond to the non-cellular area of ​​the target slice, but the original gene expression of the spatial sequencing site is within the range of RNA expression in the cell area of ​​the target slice. The spatial sequencing site identified as a cell area site in the above case is called edge noise. It can be seen that there may be an area corresponding to edge noise in the preliminarily identified cell area. In order to reduce the influence of the area corresponding to the above edge noise on the determination of the real cell area of ​​the target slice, the embodiment of the present application processes the preliminarily identified cell area according to the first position information of the first seed site, so as to obtain the real cell area corresponding to the target slice.

[0204] Reference Fig.18 In some embodiments, step S104 "determining the cell region of the target slice based on the position information of the target seed site and the position information of the cell region site" includes but is not limited to steps S1801 to S1805.

[0205] Step S1801, constructing a cell seed matrix according to the position data of the target seed site, and constructing a cell mask matrix according to the position data of the cell region site;

[0206] Step S1802, taking the region where multiple cell region sites in the cell mask matrix are connected as the original cell region; wherein each original cell region corresponds to a target seed site;

[0207] Step S1803, reducing the area of ​​the original cell region based on the position data of the target seed site and a preset area threshold to obtain a preliminary cell region;

[0208] Step S1804, updating the cell mask matrix according to the preliminary cell region to obtain a target mask matrix;

[0209] Step S1805, determining the cell region of the target slice according to the target mask matrix and the cell seed matrix.

[0210] In step S1801 of some embodiments, a cell seed matrix S is constructed according to the position data corresponding to the target seed site, in which the value assigned to the target seed site position data may be 1, and the value assigned to the position data of the remaining spatial sequencing sites may be 0. A cell mask matrix M is constructed according to the position data of the cell region sites, in which the value assigned to the cell region site position data may be 1, and the value assigned to the position data of the remaining spatial sequencing sites (i.e., non-cell region sites) may be 0.

[0211] In step S1802 of some embodiments, a connected region of multiple cell region site location data is determined in the cell mask matrix M, and the connected region is used as a preliminarily identified cell region (i.e., the original cell region), that is, the connected region assigned a value of "1" in the cell mask matrix M is used as the original cell region. It can be understood that each original cell region corresponds to a target seed site, and different original cell regions correspond to different target seed sites.

[0212] In step S1803 of some embodiments, for each original cell region, the location data of the target seed site corresponding to the original cell region is used as a reference to reduce the area around the location data of the target seed site until the area of ​​the reduced connected region is less than a preset area threshold, thereby obtaining a preliminary cell region. It is understandable that the specific value of the area threshold can be adaptively set according to actual needs. For example, when the cell mask matrix M is visualized, each location data in the cell mask matrix M corresponds to an image pixel point, and the area threshold can be set to 80 pixels.

[0213] In step S1804 of some embodiments, the cell mask matrix M is updated according to the preliminary cell region, that is, the original cell region in the cell mask matrix M is adjusted according to the preliminary cell region to obtain a new cell mask matrix M′ (ie, the target mask matrix).

[0214] It is understandable that, since the target mask matrix is ​​obtained by reducing each original cell region in the cell mask matrix M according to the target seed site and the area threshold, the noise (i.e., edge noise) at the edge of the original cell region can be filtered out during the process of reducing the original cell region. These noises cannot be filtered out in the open and closed operations because the corresponding original gene expression levels are high and located at the edge of the original cell region. It can be seen from this that the target mask matrix M′ can determine a more accurate cell region than the cell mask matrix M.

[0215] In step S1805 of some embodiments, cell segmentation is performed based on the target mask matrix and the cell seed matrix to ultimately determine multiple cell regions of the target slice.

[0216] Reference Fig.19 In some embodiments, step S1805 includes but is not limited to steps S1901 to S1903.

[0217] Step S1901, constructing a regional convolution kernel according to a preset cell diameter, and performing convolution calculation according to the regional convolution kernel and the cell seed matrix to obtain a convolution matrix;

[0218] Step S1902, performing dot product calculation on the convolution matrix and the target mask matrix to obtain a cell label matrix; wherein the row and column dimensions of the cell label matrix are the same as the gene expression information, the cell label matrix includes the location data of the spatial sequencing sites and the cell labels corresponding to the spatial sequencing sites, and the cell labels include cell region labels;

[0219] Step S1903, determining the target cell region according to the position data corresponding to the cell region label.

[0220] In step S1901 of some embodiments, a regional convolution kernel is constructed according to a preset cell diameter. The cell diameter can be determined according to prior knowledge, such as determining the cell diameter corresponding to each cell in the target slice according to prior knowledge, and then calculating the average of multiple cell diameters. The regional convolution kernel G is constructed according to the average of multiple cell diameters. The regional convolution kernel G can be an odd-numbered convolution kernel. For example, if the cell diameter s is 15, then the regional convolution kernel G = s*s. It can be understood that when the image is represented, the unit of the cell diameter is pixel. The regional convolution kernel G and the cell seed matrix S perform a convolution calculation as shown in the following formula (4) to obtain a convolution matrix V.

[0221] V=-Conv(S,G)......Formula (4)

[0222] In step S1902 of some embodiments, the convolution matrix V is dot-producted with the target mask matrix M′ to obtain a cell label matrix L. The row and column dimensions of the cell label matrix L are the same as those of the spot in the ST process, that is, when the gene expression information is in matrix form, the row and column dimensions of the cell label matrix L are the same as the gene expression information. The cell label matrix L is used to describe whether the position data corresponding to each spatial sequencing site is the position data of the target slice cell region. When it is the position data of the target slice cell region, the cell label corresponding to the spatial sequencing site is the cell region label. When it is not the position data of the target slice cell region, the cell label corresponding to the spatial sequencing site is a non-cell region label. It can be understood that the cell region label can be in the form of a number, a number of 0 represents a non-cell region label, and a number greater than 0 represents a cell region label. In the cell region label, different number values ​​represent corresponding different cell regions.

[0223] In step S1903 of some embodiments, the cell region of the target slice is obtained by segmentation according to the position data of the cell region labels in the cell label matrix L.

[0224] The advantage of steps S1901 to S1903 is that it can not only determine the cell area of ​​the target slice, but also distinguish each cell area according to the number corresponding to the cell area label. Steps S1901 to S1903 implement cell segmentation based on the watershed algorithm. Specifically, the preliminary cell area determined in the target mask matrix is ​​used as the basin of the watershed, and each target seed site in the cell seed matrix is ​​used as the starting point for basin filling, that is, water is filled from the target seed site corresponding to the basin until the water flows to the boundary of different regions to form a segmentation line, which becomes the watershed.

[0225] In a specific embodiment, referring to Figure 20 to Figure 22 Based on the cell region determination method provided in the embodiments of the present application, the cell region is determined for the 1cm×1cm mouse brain spatial transcriptome data produced by the Stereo-seq sequencing technology. Figure 20 to Figure 22 This is a diagram showing the effect of determining the cell area in a certain area captured in a real experiment. Fig. 20 It is a cell region determined by artificial labeling of RNA signals. Fig.21 is a cell region determined using the method provided in the embodiment of the present application, Fig. 22 The cell area is determined using image-based reference methods (such as the Stardist method). Figure 20 to Figure 22 By comparing, Fig. 22 The method shown has the disadvantage of segmenting one cell region into multiple cell regions, while the method shown in the embodiment of the present application can accurately segment all artificially marked cell regions, and adjacent cell regions can be accurately distinguished.

[0226] The cell region determination method provided by the embodiment of the present application directly processes the original gene expression amount to find the region where the RNA signal gathers in the space, so as to determine the cell region corresponding to the target slice in the spatial sequencing site. Compared with the image-based method, the method provided by the embodiment of the present application can be processed using more accurate RNA expression, thereby improving the accuracy determined by the cell region. Secondly, it is possible to reduce the dependence on specific genes in the method for determining the cell region based on partial RNA signals, thereby improving the applicability of the embodiment of the present application. In addition, the embodiment of the present application uses the method of matrix operation to process data, which can improve computational efficiency. The embodiment of the present application can also flexibly adjust the size of the regional convolution kernel to determine a more accurate cell region.

[0227] Reference Fig.23In some embodiments, the present application also provides a cell region determination device, the cell region determination device comprising:

[0228] The gene expression information acquisition unit 2301 is used to acquire gene expression information from the spatial transcription data of the target slice; wherein the gene expression information includes the position information of multiple spatial sequencing sites and the original gene expression amount corresponding to each spatial sequencing site;

[0229] A cell region division unit 2302 is used to divide the multiple spatial sequencing sites into cell region sites and non-cell region sites based on the original gene expression amount;

[0230] A seed site determination unit 2302 is used to determine a plurality of first seed sites in a plurality of spatial sequencing sites according to the original gene expression amount and the position information; wherein the first seed site is a cluster center determined by clustering the plurality of spatial sequencing sites based on the original gene expression amount and the position information;

[0231] The cell region determining unit 2304 is used to determine the cell region of the target slice according to the first position information of the plurality of first seed sites and the second position information of the cell region site.

[0232] It can be seen that the contents of the above-mentioned cell region determination method embodiment are all applicable to the embodiment of the present cell region determination device. The functions specifically implemented by the present cell region determination device embodiment are the same as those in the above-mentioned cell region determination method embodiment, and the beneficial effects achieved are also the same as those achieved by the above-mentioned cell region determination method embodiment.

[0233] Reference Fig.24 , Fig.24 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes:

[0234] The processor 2401 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;

[0235] The memory 2402 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 2402 can store an operating system and other application programs. When the technical solution provided in the embodiments of this specification is implemented by software or firmware, the relevant program code is stored in the memory 2402, and the processor 2401 calls and executes the cell region determination method of the embodiment of this application;

[0236] Input / output interface 2403, used to implement information input and output;

[0237] Communication interface 2404, used to realize communication interaction between the device and other devices, which can be realized through wired mode (such as USB, network cable, etc.) or wireless mode (such as mobile network, WIFI, Bluetooth, etc.);

[0238] A bus 2405 that transmits information between various components of the device (e.g., processor 2401, memory 2402, input / output interface 2403, and communication interface 2404);

[0239] The processor 2401 , the memory 2402 , the input / output interface 2403 and the communication interface 2404 are connected to each other in communication within the device via the bus 2405 .

[0240] The embodiment of the present application further provides a computer program product, which includes a computer program. A processor of a computer device reads and executes the computer program, so that the computer device executes and implements the above-mentioned cell region determination method.

[0241] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present disclosure described herein can, for example, be implemented in an order other than those illustrated or described herein. In addition, the terms "comprises" and "comprising" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0242] It should be understood that in the present disclosure, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0243] It should be understood that in the description of the embodiments of the present application, the meaning of multiple (or multiple items) is more than two, greater than, less than, exceed, etc. are understood to not include the number, and above, below, within, etc. are understood to include the number.

[0244] In the several embodiments provided in the present disclosure, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0245] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0246] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0247] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present disclosure is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the various embodiments of the present disclosure. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store program codes.

[0248] It should also be understood that the various implementations provided in the embodiments of the present application can be combined arbitrarily to achieve different technical effects.

[0249] The above is a specific description of the implementation methods of the present disclosure, but the present disclosure is not limited to the above implementation methods. Technical personnel familiar with the art can also make various equivalent modifications or substitutions without violating the spirit of the present disclosure. These equivalent modifications or substitutions are all included in the scope defined by the claims of the present disclosure.

Claims

1. A method for determining a cell region, characterized in that: The method comprises: Obtaining gene expression information from the spatial transcription data of the target slice; wherein the gene expression information includes location information of multiple spatial sequencing sites and the original gene expression amount corresponding to each of the spatial sequencing sites; Dividing the plurality of spatial sequencing sites into cell region sites and non-cell region sites based on the original gene expression amount; Determine a plurality of first seed sites in the plurality of spatial sequencing sites according to the original gene expression amount and the position information; wherein the first seed site is a cluster center determined by clustering the plurality of spatial sequencing sites based on the original gene expression amount and the position information; The cell region of the target slice is determined according to the first position information of the plurality of first seed sites and the second position information of the cell region site.

2. The method according to claim 1, characterized in that The step of determining a plurality of first seed sites in the plurality of spatial sequencing sites according to the original gene expression amount and the position information comprises: Performing weighted processing according to the original gene expression value to obtain the first gene expression value of the spatial sequencing site; A plurality of first seed sites are determined based on the first gene expression level and the position information.

3. The method according to claim 2, characterized in that The determining of a plurality of first seed sites based on the first gene expression level and the position information includes: Determining a first sequencing site and a second sequencing site from the plurality of spatial sequencing sites; wherein the second sequencing site is determined based on preset position distance data and position information of the first sequencing site; If the expression level of the first gene at the first sequencing site is greater than the expression level of the first gene at the second sequencing site, the first sequencing site is used as the first seed site.

4. The method according to claim 2, characterized in that: The determining of a plurality of first seed sites based on the first gene expression level and the position information includes: Determine a third sequencing site and a fourth sequencing site from the plurality of spatial sequencing sites; wherein the fourth sequencing site is determined based on preset position distance data and position information of the third sequencing site; If the expression level of the first gene at the third sequencing site is greater than the expression level of the first gene at the fourth sequencing site, taking the third sequencing site as a reference sequencing site; Calculating the cluster distance of the reference sequencing sites based on the first gene expression level and the position information; The product of the cluster distance and the first gene expression level is calculated to obtain product data. If the product data is greater than or equal to a first preset threshold, the reference sequencing site is used as the first seed site.

5. The method according to claim 1, characterized in that The method further comprises: Acquiring a staining image of the target slice; Determine the probability that a pixel point of the stained image belongs to the centroid of the cell nucleus based on a preset cell segmentation algorithm, and if the probability is greater than or equal to a second preset threshold, select a second seed site from the plurality of spatial sequencing sites based on the pixel point; A target seed site is determined according to the first seed site and the second seed site.

6. The method according to claim 1, characterized in that The dividing of the plurality of spatial sequencing sites into cell region sites and non-cell region sites based on the original gene expression amount comprises: Performing weighted average processing on the original gene expression values ​​of the multiple spatial sequencing sites to obtain a second gene expression value; Calculating a target expression level threshold according to the expression levels of the plurality of second genes; The second gene expression level is compared with the target expression level threshold, and the plurality of spatial sequencing sites are divided into the cell region sites and the non-cell region sites according to the comparison result.

7. The method according to claim 6, characterized in that The step of performing weighted average processing on the original gene expression value to obtain a second gene expression value includes: Determining the adjacent sequencing sites of the spatial sequencing sites according to a preset distance range; Performing weight calculation on the position data of the spatial sequencing site according to preset weight distribution data to obtain a first weight; Performing weight calculation on the position data of the adjacent sequencing sites according to the preset weight distribution data to obtain a second weight; The second gene expression value is obtained by performing weighted averaging processing according to the first weight, the original gene expression value corresponding to the spatial sequencing site, the second weight, and the original gene expression value corresponding to the adjacent sequencing site.

8. The method according to claim 6, characterized in that The step of calculating a target expression level threshold value according to the expression levels of the plurality of second genes comprises: Dividing the plurality of second gene expression levels into a plurality of first expression levels and a plurality of second expression levels according to a preset original expression level threshold; Calculating an average of a plurality of the first expression levels to obtain a first average expression level, and calculating an average of a plurality of the second expression levels to obtain a second average expression level; Determine the number of the spatial sequencing sites corresponding to the first expression level to obtain the first site number; Determining the number of the spatial sequencing sites corresponding to the second expression value to obtain a second site number; Calculate the expression variance according to the first number of sites, the second number of sites, the first average expression level, and the second average expression level; Updating the original expression level threshold to obtain a plurality of expression level variances; The original expression level threshold corresponding to the expression level variance with the largest value is used as the target expression level threshold.

9. The method according to claim 6, characterized in that The step of dividing the plurality of spatial sequencing sites into the cell region sites and the non-cell region sites according to the comparison results comprises: If the comparison result indicates that the second gene expression level is greater than or equal to the target expression level threshold, dividing the spatial sequencing site corresponding to the second gene expression level into the cell region site; If the comparison result indicates that the expression level of the second gene is less than the target expression level threshold, the spatial sequencing site corresponding to the expression level of the second gene is divided into the non-cellular region site.

10. The method according to claim 6, characterized in that The method of dividing the plurality of spatial sequencing sites into cell region sites and non-cell region sites based on the original gene expression amount further includes performing denoising processing on the non-cell region sites, specifically comprising: Mapping a preset first value to the cell region site, and mapping a preset second value to the non-cell region site; wherein the second value is smaller than the first value; Constructing a cell mask matrix according to the position information of the cell region site, the first value, the position information of the non-cell region site, and the second value; Overlapping a preset first denoising matrix with the cell mask matrix to determine a first overlapping region in the cell mask matrix, and if the first overlapping region includes position data assigned to the first value, assigning the center position data of the first overlapping region to the first value to obtain a first mask matrix; The first denoising matrix and the first mask matrix are overlapped to determine a second overlapping area in the first mask matrix. If the values ​​corresponding to all position data in the second overlapping area are the first value, the central position data of the second overlapping area is assigned the first value to obtain a second mask matrix.

11. The method according to claim 10, characterized in that The method further includes dividing the plurality of spatial sequencing sites into cell region sites and non-cell region sites based on the original gene expression amount, and performing denoising on the cell region sites, specifically comprising: Overlapping the preset second denoising matrix with the second mask matrix to determine a third overlapping area in the second mask matrix, and if the values ​​corresponding to all position data in the third overlapping area are the first value, assigning the center position data of the third overlapping area to the first value to obtain a third mask matrix; The second denoising matrix and the third mask matrix are overlapped to determine a fourth overlapping area in the third mask matrix. If the fourth overlapping area includes position data assigned to the first value, the center position data of the fourth overlapping area is assigned to the first value to obtain a fourth mask matrix.

12. The method according to any one of claims 1 to 11, characterized in that: The step of determining the cell region of the target slice according to the position information of the target seed site and the position information of the cell region site comprises: constructing a cell seed matrix according to the position data of the target seed site, and constructing a cell mask matrix according to the position data of the cell region site; The area where multiple cell area sites in the cell mask matrix are connected is used as the original cell area; wherein each original cell area corresponds to one target seed site; Based on the position data of the target seed site and a preset area threshold, the area of ​​the original cell region is reduced to obtain a preliminary cell region; updating the cell mask matrix according to the preliminary cell region to obtain a target mask matrix; The cell region of the target slice is determined according to the target mask matrix and the cell seed matrix.

13. The method according to claim 12, characterized in that The step of determining the cell region of the target slice according to the target mask matrix and the cell seed matrix comprises: Constructing a regional convolution kernel according to a preset cell diameter, and performing convolution calculation according to the regional convolution kernel and the cell seed matrix to obtain a convolution matrix; Performing dot product calculation on the convolution matrix and the target mask matrix to obtain a cell label matrix; wherein the row and column dimensions of the cell label matrix are the same as the gene expression information, the cell label matrix includes the position data of the spatial sequencing sites and the cell labels corresponding to the spatial sequencing sites, and the cell labels include cell region labels; The cell region of the target slice is determined according to the position data corresponding to the cell region label.

14. A cell region determination device, characterized in that: The device comprises: A gene expression information acquisition unit, used to acquire gene expression information from the spatial transcription data of the target slice; wherein the gene expression information includes the position information of multiple spatial sequencing sites and the original gene expression amount corresponding to each of the spatial sequencing sites; A cell region division unit, used for dividing the plurality of spatial sequencing sites into cell region sites and non-cell region sites based on the original gene expression amount; A seed site determination unit, used to determine a plurality of first seed sites among the plurality of spatial sequencing sites according to the original gene expression amount and the position information; wherein the first seed site is a cluster center determined by clustering the plurality of spatial sequencing sites based on the original gene expression amount and the position information; A cell region determining unit is used to determine the cell region of the target slice according to the first position information of the plurality of first seed sites and the second position information of the cell region site.

15. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the cell region determination method according to any one of claims 1 to 13 is implemented.

16. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the cell region determination method according to any one of claims 1 to 13 is implemented.

17. A computer program product, comprising a computer program, wherein the computer program is read and executed by a processor of a computer device, so that the computer device executes the cell region determination method according to any one of claims 1 to 13.

Citation Information

Cited By

  • Space transcriptome data analysis method and device based on PDX model and storage medium

    CN120808886A