Data processing method and device, equipment and storage medium
By converting spatial transcriptome data into images and extracting feature information from non-zero pixels, the high computational resource consumption and low efficiency of existing technologies are solved, achieving efficient data processing and accurate spatial location information encoding.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TENCENT TECHNOLOGY (SHENZHEN) CO LTD
- Filing Date
- 2022-07-22
- Publication Date
- 2026-07-10
AI Technical Summary
Existing spatial transcriptome data clustering techniques consume significant computational resources and are inefficient, failing to effectively encode spatial location information.
The target data is converted into a first image, and spatial location information and feature information are fused for feature extraction. Only the feature information of non-zero pixels is extracted to avoid processing zero pixels.
It improves the accuracy and efficiency of data processing, reduces the consumption of computing resources, and simplifies the data processing process.
Smart Images

Figure CN115223662B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a data processing method, apparatus, device, and storage medium. Background Technology
[0002] For some data, spatial location information needs to be considered during data processing. For example, spatial transcriptome data includes both cellular genetic information and spatial location information. In clustering scenarios using spatial transcriptome data, to achieve accurate clustering, it is necessary to combine both cellular genetic information and spatial location information.
[0003] However, current data processing techniques, such as clustering techniques for spatial transcriptome data, consume a lot of computing resources and are inefficient when clustering spatial transcriptome data. Summary of the Invention
[0004] This application provides a data processing method, apparatus, device, and storage medium that can reduce the consumption of computing resources and improve the efficiency of data processing.
[0005] Firstly, this application provides a data processing method, including:
[0006] Obtain the target data to be processed, and parse the spatial location information and first feature information of each of the N objects from the target data, where N is a positive integer;
[0007] Based on the spatial location information and first feature information of each of the N objects, the target data is converted into a first image;
[0008] Feature extraction is performed on the first image to obtain the second feature information of each of the N objects;
[0009] The second feature information of each of the N objects is subjected to preset processing to obtain the processing result of the target data.
[0010] Secondly, this application provides a data processing apparatus, comprising:
[0011] An acquisition unit is used to acquire target data to be processed, and to parse the spatial location information and first feature information of each of the N objects from the target data, where N is a positive integer;
[0012] A conversion unit is used to convert the target data into a first image based on the spatial location information and first feature information of each of the N objects;
[0013] An extraction unit is used to extract features from the first image to obtain second feature information for each of the N objects;
[0014] The processing unit is used to perform preset processing on the second feature information of each of the N objects to obtain the processing result of the target data.
[0015] Thirdly, this application provides an electronic device including a processor and a memory. The memory is used to store a computer program, and the processor is used to call and run the computer program stored in the memory to perform the method described in the first aspect.
[0016] Fourthly, a chip is provided for implementing the methods of any one of the first or second aspects or their implementations described above. Specifically, the chip includes a processor for calling and running a computer program from a memory, causing a device on which the chip is installed to perform the methods of the first aspect described above.
[0017] Fifthly, a computer-readable storage medium is provided for storing a computer program that causes a computer to perform the method described in the first aspect.
[0018] In a sixth aspect, a computer program product is provided, including computer program instructions that cause a computer to perform the method described in the first aspect.
[0019] In a seventh aspect, a computer program is provided that, when run on a computer, causes the computer to perform the method described in the first aspect.
[0020] In summary, this application acquires target data to be processed and parses the spatial location information and first feature information of each of the N objects from the target data. Based on the spatial location information and first feature information of each of the N objects, the target data is converted into a first image. Feature extraction is performed on the first image to obtain the second feature information of each of the N objects. This second feature information combines the spatial location information and the first feature information. Thus, when using the second feature information of the N objects for preset processing, accurate processing results can be obtained. That is, this application converts target data into a first image, which includes the spatial location information and first feature information of each of the N objects. Then, feature extraction is performed on the first image to obtain the second feature information of each of the N objects, thereby encoding the spatial location information into features. The entire data processing process is simple, consumes few computational resources, and has high data processing efficiency. In addition, when performing feature extraction on the first image, this application only extracts the second feature information of each of the N objects. If the first image includes zero pixels, feature extraction is not performed on the zero pixels in the first image, further saving computational resources and improving data processing efficiency. Attached Figure Description
[0021] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0022] Figure 1 This is a schematic diagram illustrating an application scenario according to an embodiment of this application;
[0023] Figure 2 A schematic diagram of clustering spatial transcriptome data;
[0024] Figure 3 This is a schematic diagram illustrating the principle of SEDR;
[0025] Figure 4 A schematic flowchart illustrating a data processing method provided in an embodiment of this application;
[0026] Figure 5 This is a schematic diagram of the first image and the first feature map involved in an embodiment of this application;
[0027] Figures 6A to 6D This is a schematic diagram showing the results of input graph, ordinary convolution, ordinary sparse convolution, and submanifold sparse convolution.
[0028] Figure 7 This is a schematic diagram of a data processing procedure according to an embodiment of this application;
[0029] Figure 8 This is a schematic diagram of another data processing procedure involved in an embodiment of this application;
[0030] Figure 9 This is a training diagram of an autoencoder based on submanifold sparse convolution, according to an embodiment of this application.
[0031] Figure 10 This is a schematic diagram of the spatial transcription data processing flow provided in the embodiments of this application;
[0032] Figure 11 This illustration shows the annotation results of this application on one sample of the MERFISH mouse brain primary motor cortex data;
[0033] Figure 12 This is a schematic block diagram of a data processing apparatus provided in an embodiment of this application;
[0034] Figure 13 This is a schematic block diagram of the electronic device provided in the embodiments of this application. Detailed Implementation
[0035] The technical solutions in the embodiments of this application will now be described with reference to the accompanying drawings.
[0036] It should be understood that, in the embodiments of the present invention, "B corresponding to A" means that B is associated with A. In one implementation, B can be determined based on A. However, it should also be understood that determining B based on A does not mean determining B solely based on A; B can also be determined based on A and / or other information.
[0037] In the description of this application, unless otherwise stated, "a plurality of" means two or more.
[0038] Furthermore, to facilitate a clear description of the technical solutions in the embodiments of this application, the terms "first" and "second" are used in the embodiments of this application to distinguish identical or similar items with substantially the same function and effect. Those skilled in the art will understand that the terms "first" and "second" do not limit the quantity or execution order, and the terms "first" and "second" are not necessarily different.
[0039] To facilitate understanding of the embodiments of this application, the relevant concepts involved in the embodiments of this application will be briefly introduced as follows:
[0040] Artificial intelligence (AI) is the theory, methods, technology, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a comprehensive technology within computer science that attempts to understand the essence of intelligence and produce a new kind of intelligent machine that can react in a way similar to human intelligence. AI studies the design principles and implementation methods of various intelligent machines, enabling them to possess the functions of perception, reasoning, and decision-making.
[0041] Artificial intelligence (AI) is a comprehensive discipline encompassing a wide range of fields, including both hardware and software technologies. Fundamental AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies primarily include computer vision, speech processing, natural language processing, and machine learning / deep learning.
[0042] Machine learning (ML) is a multidisciplinary field involving probability theory, statistics, approximation theory, convex analysis, and algorithm complexity theory. It specifically studies how computers can simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to endow computers with intelligence; its applications span all areas of artificial intelligence. Machine learning and deep learning typically include techniques such as artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and instructional learning.
[0043] With the research and advancement of artificial intelligence (AI) technology, it is being studied and applied in various fields, such as smart homes, wearable devices, virtual assistants, smart speakers, smart marketing, autonomous driving, drones, robots, smart healthcare, and smart customer service. It is believed that with further technological development, AI will be applied in even more areas and play an increasingly important role.
[0044] In this embodiment of the application, artificial intelligence technology is used to achieve data processing, such as clustering, type annotation, and downstream analysis of target data.
[0045] First, the application scenarios of the embodiments of this application will be introduced.
[0046] Figure 1 This is a schematic diagram of an application scenario involved in an embodiment of this application, including a terminal device 101 and a server 102.
[0047] Terminal device 101 may include, but is not limited to: PC (Personal Computer), PDA (Tablet PC), mobile phone, wearable smart device, medical device, etc. The device is often equipped with a display device, which may be a monitor, display screen, touch screen, etc. The touch screen may also be a touchscreen, touch panel, etc. The display device can be used to display processing results, etc.
[0048] Server 102 can be one or more. When there are multiple servers 102, at least two servers are used to provide different services, and / or at least two servers are used to provide the same service, such as providing the same service in a load-balanced manner. This application embodiment does not limit this. Server 102 can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. Server 102 can also be a node in a blockchain.
[0049] The terminal device 101 and the server 102 can be directly or indirectly connected through wired or wireless communication, and this application does not impose any restrictions on this.
[0050] In some embodiments, the server 102 of this application embodiment can train the feature extraction model (e.g., an autoencoder based on submanifold sparse convolution) involved in this application embodiment and store the trained feature extraction model.
[0051] In some embodiments, the data processing method of this application embodiment can be performed by a terminal device 101. For example, the terminal device 101 acquires target data to be processed and obtains the processing result of the target data according to the method provided in this application embodiment. In one example, the terminal device 101 loads a feature extraction model trained in the server 102, and performs feature extraction on the first image through the feature extraction model to obtain the second feature information of each of the N objects, and then performs preset processing on the second feature information of each of the N objects to obtain the processing result of the target data.
[0052] In some embodiments, the data processing method of this application embodiment can be performed by server 102. For example, terminal device 101 sends target data to be processed to server 102, and server 102 processes the target data according to the method provided in this application embodiment to obtain the processing result of the target data. In one example, server 102 uses its own stored trained feature extraction model to extract features from the first image corresponding to the target data, obtains the second feature information of each of the N objects, and then performs preset processing on the second feature information of each of the N objects to obtain the processing result of the target data. Optionally, server 102 can also send the processing result to terminal device 101 for display.
[0053] In some embodiments, the data processing method of this application can be jointly performed by terminal device 101 and server 102. For example, server 102 performs network model-related operations, and terminal device 101 performs other operations besides network model operations. For instance, terminal device 101 acquires target data, converts the target data into a first image, and sends the first image to server 102. Server 102 performs feature extraction on the first image, for example, using a trained feature extraction model to extract features from the first image, obtaining second feature information for each of the N objects. Then, the second feature information of each of the N objects undergoes preset processing to obtain the processing result of the target data. Finally, the processing result is sent to terminal device 101 for display.
[0054] It should be noted that the application scenarios of this application embodiment include, but are not limited to, those of other applications. Figure 1 As shown.
[0055] The data processing method provided in this application can be applied to any feature processing application that requires the combination of spatial location information.
[0056] In some embodiments, the present application can be applied to clustering scenarios of spatial transcriptome data.
[0057] Spatial transcriptome sequencing is a new technology in recent years. Its key feature is that, in addition to obtaining gene expression information in cells, it can also obtain spatial location information of cells that is not available in single-cell transcriptome data.
[0058] The primary goal of cluster analysis of spatial transcriptome data is to divide a group of cells into multiple populations based on gene expression in each cell. Currently, the common cluster analysis workflow mainly consists of two steps: first, feature extraction, and then applying clustering algorithms to the extracted features for clustering. Clustering algorithms can include general-purpose algorithms such as K-means or K-Nearest Neighbor (KNN), or more suitable for cell clustering based on community discovery such as Louvain or Leiden. For example, Figure 2 This is a schematic diagram of a clustering method for spatial transcriptome data.
[0059] The core of clustering spatial transcriptome data lies in the feature extraction process. A set of cell data typically contains tens of thousands of different genes. Directly using the expression of each gene as input to the clustering algorithm would consume an enormous amount of computational resources and contain much useless information (not all genes are meaningful for cell clustering; for example, gene expression exists in all cells, but housekeeping is meaningless for clustering). Furthermore, for spatial transcriptome data, spatial location information is key to distinguishing it from single-cell data. This is because single-cell transcriptome data only contains gene expression of cells without knowing their absolute or relative locations, while spatial transcriptome data contains both gene expression and location information. Therefore, in clustering analysis of spatial transcriptome data, effectively encoding spatial location information into features is an important aspect of the feature extraction process.
[0060] Currently, the Scan Equalization Digital Radiography (SEDR) method is used to encode spatial location information into feature information. Specifically, for example... Figure 3 As shown, firstly, the neighborhood matrix and gene expression matrix are parsed from the spatial transcriptome data. Then, the neighborhood matrix is encoded using an autoencoder (VGAE) to obtain a feature Zg that represents spatial information. The gene expression matrix is then encoded using an encoder to obtain a feature Zf that represents gene information. The spatial feature Zg is merged into the gene-information feature Zf to obtain the intermediate expression Z. The intermediate expression Z includes both spatial and gene information, and it can be used for subsequent tasks such as clustering.
[0061] Depend on Figure 3 It is known that SEDR mainly utilizes the neighborhood relationships of cells when encoding spatial information. If too few neighborhoods are considered when encoding each cell, spatial location information cannot be effectively utilized. Therefore, to ensure effectiveness, more neighborhoods are considered. However, considering more neighborhoods will exponentially increase the consumption of computing resources, and the entire data processing process will be more complex and inefficient.
[0062] To address the aforementioned technical problems, this application first acquires the target data to be processed and parses the spatial location information and first feature information of each of the N objects from the target data. Based on the spatial location information and first feature information of each of the N objects, the target data is converted into a first image. Then, feature extraction is performed on the first image to obtain the second feature information of each of the N objects. This second feature information combines the spatial location information and the first feature information. Therefore, when using the second feature information of each of the N objects for preset processing, accurate processing results can be obtained. In other words, this application converts the target data into a first image, which includes the spatial location information and first feature information of each of the N objects. Then, feature extraction is performed on the first image to obtain the second feature information of each of the N objects, thus encoding the spatial location information into features. Furthermore, the entire data processing process is simple, consumes few computational resources, and has high data processing efficiency. In addition, when performing feature extraction on the first image in this embodiment, only the second feature information of each of the N objects is extracted. If the first image includes zero pixels, then no feature extraction is performed on the zero pixels in the first image, which further saves computing resources and improves data processing efficiency.
[0063] The technical solutions of the embodiments of this application will be described in detail below through some examples. The following embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.
[0064] Figure 4 This is a schematic flowchart of a data processing method provided in an embodiment of this application.
[0065] The executing entity in the embodiments of this application can be a device with data processing capabilities, such as a data processing device. In some embodiments, the data processing device can be a server. In some embodiments, the data processing device can be a terminal device. In some embodiments, the data processing device can be a system composed of a server and a terminal device. Both the server and the terminal device can be understood as electronic devices; therefore, for ease of description, the following description uses an electronic device as the executing entity.
[0066] like Figure 4 As shown, the model training method in this application embodiment includes:
[0067] S401. Obtain the target data to be processed, and parse the spatial location information and first feature information of each of the N objects from the target data.
[0068] Where N is a positive integer.
[0069] In some embodiments, N is a positive integer greater than 1, that is, the objects studied in the embodiments of this application are multiple objects.
[0070] The embodiments of this application do not limit the specific type of the above-mentioned object. For example, it can be any object with spatial location information, such as a cell, subcellular, or cell cluster.
[0071] The aforementioned target data can be understood as data corresponding to N objects. This target data includes or implicitly includes the spatial location information and first feature information of each of the N objects.
[0072] In some embodiments, the target data described above may be generated by the electronic device itself.
[0073] In some embodiments, the target data described above may be sent by other devices.
[0074] In some embodiments, the target data may also be read by the electronic device from the storage device. For example, when the electronic device receives a processing request for the target data, it reads the target data from the storage device in response to the request.
[0075] This application does not limit the specific method for obtaining the target data in its embodiments.
[0076] In order to achieve accurate analysis and processing of target data, in this embodiment of the application, after obtaining the target data, the target data is parsed to obtain the spatial location information and first feature information of each of the N objects.
[0077] In other words, in this embodiment of the application, each of the N objects includes spatial location information and first feature information.
[0078] In this context, the spatial location information of each of the N objects is different.
[0079] Spatial location information can be understood as any information that can represent the spatial location of an object, such as the coordinates of the center point of the object.
[0080] Among the N objects, the first feature information of each object can be the same, different, or partially the same and partially different. This application embodiment does not impose any restrictions on this.
[0081] The embodiments of this application do not limit the specific type of the first feature information.
[0082] In some embodiments, the first characteristic information of an object can be understood as the original characteristic information of the object included in the target data, and the original characteristic information can be understood as the inherent characteristic (or attribute) data of the object. For example, when the object is a cell, the first characteristic information can be the gene expression information of the cell.
[0083] The process of obtaining spatial location information and primary feature information is described below.
[0084] The specific implementation method for parsing the spatial location information and first feature information of each of the N objects from the target data in S401 above is not limited.
[0085] In some embodiments, if the target data includes spatial location information and first feature information for each of the N objects, then the spatial location information and first feature information for each of the N objects can be directly read from the target data.
[0086] In some embodiments, at least one sub-object of this application can correspond to an object, such as a cell. At least one sequencing point can be set on the cell, so that a sequencing point can be recorded as a sub-object corresponding to the cell.
[0087] In this embodiment, it is assumed that the target data includes first sub-feature information of multiple sub-objects. Each of these sub-objects can correspond to one of N objects, and the first sub-feature information can constitute all or part of the first feature information. Based on this, the multiple sub-objects in the target data can be mapped to N objects. For example, sub-objects 11 and 13 of the target data correspond to object 1 among the N objects, and sub-objects 21 and 22 of the target data correspond to object 2 among the N objects. In this way, the first sub-feature information of sub-objects 11 and 13 can be used as the first feature information of object 1, and the first sub-feature information of sub-objects 21 and 22 can be used as the first feature information of object 2. Referring to the above method, the first feature information of each of the N objects can be determined.
[0088] In one implementation of this embodiment, the target data includes a correspondence between multiple sub-objects and N objects. In this way, the electronic device can map the multiple sub-objects included in the target data to N objects according to the correspondence between the multiple sub-objects and N objects in the target data, and then use the first sub-feature information corresponding to each of the N objects as the first feature information of the object.
[0089] In this embodiment, the method for determining the location information of each of the N objects includes at least the following examples:
[0090] Example 1: The target data includes the spatial location information of each of the N objects, so that the electronic device can directly determine the spatial location information of each of the N objects from the target data.
[0091] Example 2: The target data includes the spatial location information of sub-objects. This allows us to determine the spatial location information of all N objects based on the spatial location information of their corresponding sub-objects. For example, for the i-th object among the N objects, if its corresponding sub-objects are sub-objects i1 and i2, then the spatial location information of the i-th object can be determined based on the spatial location information of sub-objects i1 and i2. Alternatively, the average of the spatial location information of sub-objects i1 and i2 can be used to determine the spatial location information of the i-th object.
[0092] This application does not limit the specific form of spatial location information. In some embodiments, spatial location information is represented in the form of a matrix.
[0093] For example, the spatial location information of N objects is represented by the following matrix A:
[0094] A={(x1,y1),(x2,y2),…(x i y i ), ... (x) N y N )}
[0095] Among them, (x) i y i ) represents the spatial location information of the i-th object among N objects.
[0096] The embodiments of this application do not limit the specific form of the first feature information. In some embodiments, the first feature information is represented in the form of a matrix.
[0097] For example, the first feature information of N objects is the following matrix B:
[0098] B = {a 11 a 12 , ..., a 1G (a 21 a 22 , ..., a 2G ), ... (a i1 a i2 , ..., a iG ), ... (a N1 a N2 , ..., a NG )}
[0099] Among them, (a) 21 a 22 , ..., a 2GLet G represent the G first feature information of the i-th object among N objects. It should be noted that at least one of the G first feature information of the i-th object may be empty. That is to say, G can be understood as the total type of the first feature information included in the N objects. The types of the first feature information included in each of the N objects may be the same or different. In other words, some of the N objects include different types of first feature information from the G first feature information.
[0100] According to the above method, after obtaining the target data and parsing out the spatial location information and first feature information of each of the N objects from the target data, the following S402 is executed.
[0101] S402. Based on the spatial location information and first feature information of each of the N objects, the target data is converted into a first image.
[0102] In this embodiment, target data is converted into a first image, which includes spatial location information and first feature information for each of N objects. Feature extraction is then performed on the first image to obtain second feature information for the N objects. This second feature information integrates the spatial location information and the first feature information. Subsequent processing based on this second feature information can improve the processing efficiency.
[0103] Furthermore, in this embodiment, the first feature information and spatial location information are integrated into the first image. Feature extraction is directly performed on the first image containing the fused spatial location information and first feature information to encode the spatial location information into the features. Compared to SEDR, which extracts the neighborhood matrix, encodes the neighborhood matrix to obtain spatial encoded information, and then integrates the spatial encoded information into the features, the entire data processing in this embodiment is simpler and consumes fewer computational resources. Moreover, this embodiment directly uses the spatial location information of N objects as spatial information. Compared to the neighborhood relationship of objects, this can more accurately represent the spatial information of objects, thereby improving the accuracy of data processing. Furthermore, the amount of spatial information in this application is relatively small, which can further reduce the consumption of computational resources.
[0104] In other words, the first image generated in this application embodiment integrates the spatial location information and first feature information of each of the N objects. For example, each of the N objects is used as a non-zero pixel of the first image, and the first feature information of the object is used as a channel of the first image to form the first image.
[0105] This application embodiment does not limit the specific process of converting target data into a first image based on the spatial location information and first feature information of each of the N objects in S402.
[0106] In some embodiments, based on the spatial location information of each of the N objects, each of the N objects is treated as a pixel in a first image, and the first feature information is used as a channel of the first image to obtain a first image including N pixels. In this embodiment, the first image does not include zero pixels.
[0107] For example, if N is 1000, then the first image includes 1000 pixels, each pixel representing one of the 1000 objects. The order of these 1000 objects in the first image is determined based on their spatial position information. Assuming that the spatial position information of each object is a two-dimensional coordinate, such as (x, y), the 1000 objects are arranged on a two-dimensional plane based on their spatial position information, with no gaps between them. Each of the sorted 1000 objects is then used as a pixel in the first image, resulting in a first image containing 1000 pixels. In this embodiment, the method for sorting the 1000 objects based on their spatial position information is not limited. For example, the 1000 objects are first sorted according to their x-coordinates. If the x-coordinates are the same, then the objects with the same x-coordinates are sorted according to their y-coordinates, thus arranging the 1000 objects on a two-dimensional plane.
[0108] In this embodiment, the first image obtained may or may not be rectangular, and this application embodiment does not impose any restrictions on this.
[0109] In this embodiment, since the first image does not include invalid zero pixels, when performing feature extraction on the first image, only valid information is extracted, thereby improving the reliability of feature extraction. Since invalid zero pixels are not processed, computational resources are saved.
[0110] In some embodiments, the target data can also be converted into a first image through the following steps S402-A and S402-B:
[0111] S402-A, Create a blank second image;
[0112] S402-B: Based on the spatial position information of each of the N objects, fill the N objects into the corresponding positions of the second image, and use the first feature information as the channel of the first image to obtain the first image.
[0113] In this embodiment, a blank second image is first created, meaning all pixels in this second image are zero pixels. Then, based on the spatial location information of each of the N objects, these N objects are filled into their corresponding positions in the blank second image. For example, for the i-th object among the N objects, the i-th object is filled into the second image at the position corresponding to its spatial location information. This process is repeated until all N objects are filled into the blank second image. Finally, the first feature information is used as a channel of the first image to obtain the first image.
[0114] The embodiments of this application do not limit the specific size of the second image, but only require that the second image includes N pixels.
[0115] In some embodiments, if the number of pixels included in the second image is greater than N, then the first image generated based on the second image includes N non-zero pixels and at least one zero pixel, and the N non-zero pixels correspond one-to-one with the N objects.
[0116] The embodiments of this application do not limit the specific shape of the second image.
[0117] In some embodiments, the second image may be rectangular.
[0118] In some embodiments, the second image can be a regular shape other than a rectangle, such as a circle, ellipse, polygon, etc., or it can be an irregular shape.
[0119] The process of creating a blank second image in S402-A above is described below.
[0120] This application does not limit the specific method of creating a blank second image in the embodiments.
[0121] In some embodiments, the size and shape of the second image are preset.
[0122] In some embodiments, the second image is a rectangular or square image comprising at least N pixels.
[0123] In some embodiments, S402-A includes the following steps:
[0124] S402-A1. Construct a blank second image based on the spatial location information of each of the N objects.
[0125] In this embodiment, a blank second image is constructed based on the spatial location information of each of the N objects, so that each of the N objects can correspond to a pixel in the second image.
[0126] In this embodiment, since the N objects may be relatively sparse, that is, the distance between the objects in the N objects is large, for example, at least a units, if the spatial location information is not processed, the minimum distance between non-zero pixels in the first image is a pixels.
[0127] In one possible implementation of S402-A1, to reduce the size of the first image, when creating a blank second image, the spatial position information of N objects can be reduced by a factor of a, and the second image is constructed based on the reduced spatial position information. For example, the maximum difference in x and y values of the spatial position information of the N objects after being reduced by a factor of a are obtained. The maximum difference in x is used as the length H of the second image, and the maximum difference in y is used as the width W of the second image. A second image with length H and width W is constructed, and the number of channels of the second image is the total type G of the first feature information of the N objects. In this implementation, the size of the constructed blank second image is smaller than the minimum bounding rectangle of the N objects. Thus, when the N objects are filled into the second image to form the first image, the number of zero pixels included in the formed first image is reduced.
[0128] It should be noted that the distance of a units between the N objects mentioned above is just an example, and the actual distance should be based on the actual situation.
[0129] In one possible implementation of S402-A1, S402-A1 includes the following steps:
[0130] S402-A11. Based on the spatial location information of each of the N objects, determine the minimum bounding rectangle of the N objects;
[0131] S402-A12. Construct a blank second image with the minimum bounding rectangle as the size of the second image.
[0132] In this implementation, a blank second image is constructed directly based on the spatial position information of each of the N objects, without scaling the spatial position information. This simplifies the construction process of the second image and ensures that the N objects can be filled into the blank second image without overlapping.
[0133] Specifically, the minimum and maximum coordinates of N objects along the x-axis are determined, and the difference between these values is used as the length H of the minimum bounding rectangle. Similarly, the minimum and maximum coordinates of the N objects along the y-axis are determined, and the difference between these values is used as the width W of the minimum bounding rectangle. Thus, the minimum bounding rectangle for the N objects is determined to be a rectangle with length H and width W. Next, using the minimum bounding rectangle of the N objects as the size of the second image, a blank second image with length H and width W is constructed.
[0134] In this implementation, the size of the constructed second image is consistent with the size of the minimum bounding rectangle of the N objects. This ensures that each of the N objects corresponds to a pixel in the second image. Next, based on the spatial position information of each of the N objects, the N objects are filled into the blank second image one by one. For example, for the i-th object among the N objects, based on its spatial position information, it can be determined that the i-th object corresponds to the j-th pixel in the second image. Thus, the i-th object is filled into the j-th pixel of the second image. Similarly, based on the spatial position information of each of the N objects, the N objects are filled into the blank second image to generate the first image.
[0135] For example, suppose the spatial location information of N objects is represented by an N×2 matrix A, denoted as the center coordinates of each of the N objects. Suppose the first feature information of the N objects is represented by an N×G matrix B, denoted as the first feature information of class G for each of the N objects. For instance, the i-th row and j-th column of matrix B represents the value of the first feature information j of the i-th object. Referring to the above embodiment, firstly, based on the spatial location information of each of the N objects, i.e., the spatial location matrix B, a blank second image is created. This second image can be understood as an H×W×G matrix, where G represents the number of channels. Next, based on the spatial location information of each of the N objects, the N objects are filled into the second image to obtain the first image. For example, the value of the g-channel in the h-th row and w-th column of the first image, i.e., the pixel value at (h, w, g), represents the value of the first feature information g of the object with center coordinates (h, w).
[0136] In the first image generated by the above method, each of the N objects occupies one pixel. The pixels occupied by objects are designated as non-zero pixels, and all channels of these non-zero pixels constitute all the first feature information of that object. Zero pixels in the first image indicate that there is no object at that location, and all channel values of a zero pixel are 0. Therefore, in the generated H×W first image, only the N non-zero pixels contain information; the other zero pixels do not.
[0137] For example, suppose the generated first image is represented by matrix C as follows:
[0138]
[0139] in, This indicates that the pixel is a zero pixel. This indicates that the pixel is a non-zero pixel, that is, the pixel where the object is located.
[0140] In this embodiment of the application, after converting the target data into a first image according to the above steps, the following step S403 is executed.
[0141] S403. Perform feature extraction on the first image to obtain the second feature information of each of the N objects.
[0142] As described above, this embodiment converts target data into a first image based on the spatial location information and first feature information of N objects. The first image includes the spatial location information and first feature information of each of the N objects. Next, feature extraction is performed on the first image to obtain second feature information for each of the N objects. This results in the generated second feature information incorporating the spatial location information and first feature information of the N objects. Therefore, using this second feature information for subsequent processing can improve the accuracy of data processing.
[0143] In other words, the second feature information in this application embodiment can be understood as a feature vector obtained by extracting features from the first image, and the feature vector is fused with the spatial location information of the object and the first feature information.
[0144] This application embodiment does not limit the specific implementation of the above-described S403 process of extracting features from the first image to obtain the second feature information of each of the N objects.
[0145] In some embodiments, as described above, if the first image includes N non-zero pixels but does not include zero pixels, any feature extraction method can be used to extract features from the first image to obtain the second feature information of each of the N objects. Since the first image does not include zero pixels, there is no waste of computational resources caused by processing invalid zero pixels, thus saving computational resources.
[0146] In some embodiments, as described above, the first image includes at least one zero pixel in addition to N non-zero pixels, as shown in matrix C above. In this embodiment, to save computing resources, the electronic device only extracts features from the non-zero pixels in the first image and does not extract features from the zero pixels in the first image, thereby obtaining the second feature information of each of the N objects.
[0147] This application embodiment performs feature extraction on non-zero pixels in the first image, but does not limit the specific implementation method of not performing feature extraction on zero pixels in the first image.
[0148] In one possible implementation of this embodiment, S403 includes the following steps S403-A and S403-B:
[0149] S403-A: Extract features from the first image to obtain the first feature map.
[0150] The first feature map includes N non-zero elements that correspond one-to-one with the N objects.
[0151] In this implementation, feature extraction is performed on the first image to obtain a first feature map. The first feature map includes N non-zero elements, which correspond one-to-one with N objects. That is, the N non-zero elements of the first feature map correspond one-to-one with the N non-zero pixels in the first image.
[0152] In this step, the size of the first feature map can be the same as or different from the size of the first image; this application embodiment does not impose any restrictions on this.
[0153] In some embodiments, the size of the first feature map obtained in this step is the same as the size of the first image, and the position of the zero element in the first feature map is consistent with the position of the zero pixel in the first image, and the position of the non-zero element in the first feature map is consistent with the position of the non-zero pixel in the first image.
[0154] For example Figure 5 As shown, Figure 5 The left side of the image is the first image, in which a black square represents an object or a non-zero pixel, and there are a total of 7 objects. Figure 5 The right side is the first feature map, which is the same size as the first image. A black square in the first feature map represents a non-zero element. There are a total of seven non-zero elements, and their positions correspond to the positions of the seven objects in the first image. Furthermore, the number and position of zero elements in the first feature map are also consistent with the number of zero pixels in the first image. Figure 5 As can be seen, in this embodiment of the application, when performing feature extraction on the first image and generating the first feature map, feature extraction is only performed on the non-zero pixels (i.e., objects) in the first image, and no feature extraction is performed on the zero pixels in the first image. This avoids processing invalid information, thereby saving computing resources and improving data processing efficiency.
[0155] This application embodiment does not limit the specific method of extracting features from the first image in S403-A to obtain the first feature map.
[0156] In some embodiments, an autoencoder based on submanifold sparse convolution is used to extract features from the first image to obtain a first feature map.
[0157] Among them, Submanifold Sparse Convolution (SubMConv), also known as Valid Sparse Convolution, can skip feature extraction of zero-pixel points in the first image.
[0158] The following section compares submanifold sparse convolution with ordinary average convolution and ordinary sparse convolution.
[0159] Figures 6A to 6D This demonstrates the differences between ordinary convolution, ordinary sparse convolution, and submanifold sparse convolution. Figure 6A For the input sparse image, such as Figure 6A As shown, the sparse image includes two non-zero pixels, A1 and A2, and all others are zero pixels. Figures 6B to 6D The processing of ordinary convolution, ordinary sparse convolution, and submanifold sparse convolution with a kernel size of 3 are respectively performed. Figure 6A The output is shown after the input image. Figures 6B to 6D In the diagram, blank light gray cells indicate no information, cells with text indicate information, and white cells indicate that the location does not need to be stored.
[0160] When performing a convolution operation with a kernel of size 3, it's equivalent to processing information from that cell and a maximum of nine surrounding cells when performing a convolution on each cell. Figure 6A For example, when performing a convolution on the bottom-left cell, there is no useful information to process, so the return value is 0. In a regular convolution, this zero value needs to be saved because the information at that position is needed as input for the next convolution round. In a regular sparse convolution, the zero value no longer participates in the calculation, so there is no need to save that position when the return value is 0. However, in a submanifold sparse convolution, not only does the zero value not participate in the calculation, but only the content corresponding to the non-zero values in the original input is saved. Therefore, after performing a submanifold sparse convolution, the output and input sizes, non-zero value positions, and zero value positions will all be completely consistent. Thus, the use of submanifold sparse convolution greatly reduces the amount of content involved in computation and that needs to be stored, thereby significantly reducing computational performance requirements and computational resource consumption.
[0161] The embodiments of this application do not limit the number of submanifold sparse convolutional layers included in the autoencoder based on submanifold sparse convolution, for example, including at least one submanifold sparse convolutional layer.
[0162] In some embodiments, the autoencoder based on submanifold sparse convolution includes two submanifold sparse convolution layers. In this case, the data processing procedure provided in the embodiments of this application can be represented as follows: Figure 7 As shown.
[0163] Specifically, such as Figure 7As shown, target data is acquired, and the spatial location information and first feature information of each of the N objects are parsed from the target data. The spatial location information of the N objects is an N×2 dimensional matrix, and the first feature information of the N objects is an N×G dimensional matrix. Next, based on the spatial location information and first feature information of each of the N objects, the target data is converted into a first image, for example, as shown... Figure 7 As shown, the first image has a size of H×W and the number of channels is G. The first image is input into an autoencoder based on submanifold sparse convolution. After passing through the first submanifold sparse convolution layer, compression is performed in the channel direction to obtain an H×W×R feature map. This H×W×R feature map is then compressed again through the first submanifold sparse convolution layer to generate a first feature map of size H×W×L. In other words, in this embodiment, the encoding layer of the autoencoder based on submanifold sparse convolution uses two submanifold sparse convolution layers to compress the first image in the channel direction. After two submanifold sparse convolutions, the input X of size H×W×G is encoded into a first feature map of size H×W×L.
[0164] In some embodiments, the autoencoder based on submanifold sparse convolution of this application may include a decoding layer, which includes at least one submanifold sparse deconvolution layer.
[0165] In one example, such as Figure 8 and Figure 9 As shown, the submanifold sparse convolution-based autoencoder includes an encoding layer and a decoding layer. The encoding layer consists of two submanifold sparse convolution (SubMConv) layers, and the decoding layer consists of two submanifold sparse deconvolution (SubDeMConv) layers. During training, the encoding layer uses two submanifold sparse deconvolution layers to compress the training image along the channel direction, encoding an H×W×G input X into an H×W×L feature map. Then, the decoding layer uses two submanifold sparse deconvolution layers to re-decode the H×W×L feature map, restoring it to a H×W×G reconstruction matrix X'. Finally, the reconstruction loss between X and X' is optimized to train the submanifold sparse convolution-based autoencoder.
[0166] In some embodiments, the autoencoder based on submanifold sparse convolution can use a larger convolution kernel to ensure that a certain amount of information about the surrounding objects is taken into account in each sparse convolution.
[0167] In some embodiments, the autoencoder based on submanifold sparse convolution may include only the encoding layer and not the decoding layer. In this case, labels or other instructions may be introduced to train the encoding layer.
[0168] In practical use, the coding layer in the autoencoder based on submanifold sparse convolution is used to extract features from the first image to obtain the first feature map.
[0169] According to the above method, after extracting features from the first image to obtain the first feature map, the following steps S403-B are performed.
[0170] S403-B: Based on the feature information of N non-zero elements in the first feature map, obtain the second feature information of each of the N objects.
[0171] As can be seen from the above, the generated first feature map includes feature information of N non-zero elements that correspond one-to-one with the N objects. In this way, the second feature information of each of the N objects can be obtained based on the feature information of the N non-zero elements in the first feature map.
[0172] For example, the first feature map is determined as the second feature information of N objects.
[0173] For example, from the first feature map, the feature information of non-zero elements is extracted. This feature information of non-zero elements is the second feature information of N objects. For example, the i-th object among the N objects corresponds to the j-th non-zero element in the first feature map. Therefore, the feature information of the j-th non-zero element is determined as the second feature information of the i-th object. For example, Figure 7 As shown, only N non-zero elements are valid in the generated first feature map of size H×W×L. After removing all zero elements, an N×L dimensional feature map is finally obtained, which forms the input representation Embedding for subsequent tasks and is used for subsequent analysis.
[0174] Based on the above method, feature extraction is performed on the first image to obtain the second feature information of each of the N objects, and then the following step S404 is executed.
[0175] S404. Perform preset processing on the second feature information of each of the N objects to obtain the processing result of the target data.
[0176] The aforementioned preset processing can be understood as a downstream task pre-set based on the second feature information.
[0177] The embodiments of this application do not limit the specific method of preset processing.
[0178] In some embodiments, the preset processing includes at least one of clustering N objects, annotating N objects, and downstream analysis.
[0179] In one example, if the above-mentioned preset processing is to cluster N objects, then S404 includes the following steps:
[0180] S404-A: Based on the second feature information of each of the N objects, cluster the N objects to obtain M cluster sets of the N objects.
[0181] Each of the M cluster sets contains at least one object, where M is a positive integer less than or equal to N.
[0182] As can be seen from the above, the second feature information in this application embodiment integrates spatial location information and first feature information. When clustering is performed based on the second feature information, the accuracy of clustering can be improved.
[0183] The embodiments of this application do not limit the specific clustering method used. For example, it can be a general clustering algorithm such as K-means or KNN, or a clustering algorithm based on community discovery such as Louvain or Leiden.
[0184] In some embodiments, the present application further includes: selecting P cluster sets from M cluster sets, where P is a positive integer less than or equal to M; and re-clustering the objects in the P cluster sets. For example, merging the objects in the P cluster sets, or dividing the objects in the P cluster sets into more detailed categories, thereby achieving multi-level and multi-step clustering.
[0185] In one example, if the above-mentioned preset processing involves annotating N objects, then this application embodiment can provide a type annotation model. This type annotation model includes the aforementioned autoencoder based on submanifold sparse convolution and a classifier, enabling end-to-end type annotation of objects. For example, the probability value of an object belonging to a certain type obtained from other labeled data or manually can be used as a pseudo-label. After being fed into the extracted second feature information through a classifier, the loss of the classifier is optimized while simultaneously optimizing the reconstruction loss. Ultimately, an end-to-end type annotation model can be obtained, whose performance will be significantly better than directly using pseudo-labels as annotation results.
[0186] In some embodiments, downstream analysis of the target data can also be performed based on the results of the above clustering or type annotation, and this application does not limit this.
[0187] The data processing method provided in this application involves acquiring target data to be processed, parsing the spatial location information and first feature information of each of the N objects from the target data, converting the target data into a first image based on the spatial location information and first feature information of each of the N objects, and then performing feature extraction on the first image to obtain second feature information of each of the N objects. This second feature information combines the spatial location information and the first feature information. Therefore, when using the second feature information of each of the N objects for preset processing, accurate processing results can be obtained. In other words, this application converts target data into a first image, which includes the spatial location information and first feature information of each of the N objects. Then, feature extraction is performed on the first image to obtain the second feature information of each of the N objects, thus encoding the spatial location information into features. The entire data processing process is simple, consumes few computational resources, and has high data processing efficiency. In addition, when performing feature extraction on the first image in this embodiment, only the second feature information of each of the N objects is extracted. If the first image includes zero pixels, then no feature extraction is performed on the zero pixels in the first image, which further saves computing resources and improves data processing efficiency.
[0188] The following section uses cells as the object, spatial transcription data as the target data, and gene information as the first feature information as an example to further describe the data processing process provided in the embodiments of this application.
[0189] Figure 10 This is a schematic diagram of the spatial transcription data processing flow provided in the embodiments of this application, as shown below. Figure 10 As shown, the embodiments of this application include:
[0190] S501. Obtain the spatial transcription data to be processed, and parse the spatial location information and gene information of each cell in N cells from the spatial transcription data.
[0191] In some embodiments, the spatial transcription data includes the spatial location information and first characteristic information of each cell in N cells. In this case, the spatial location information and first characteristic information of each cell in N cells can be directly read from the spatial transcription data.
[0192] In some embodiments, spatial transcription data includes gene expression captured at sequencing sites, in which case S501 above includes:
[0193] S501-A: Map each sequencing point in the spatial transcription data to N cells to obtain the gene information of each of the N cells. The gene information of the cells includes the gene expression captured by the sequencing point corresponding to the cell.
[0194] In actual testing, at least one sequencing point can be set on a cell to capture gene expression at the test point, thereby forming spatial transcription data, which includes gene expression captured by the sequencing point. In this embodiment, after obtaining the spatial transcription data, the spatial location information and gene information of each of the N cells are parsed from the spatial transcription data. Specifically, based on the mapping relationship between cells and sequencing points, each sequencing point in the spatial transcription data is mapped to one of the N cells, and the gene expression captured by the sequencing point corresponding to that cell constitutes the gene information of that cell, thus encapsulating the raw sequencing data in the form of sequencing points into gene expression data in the form of cells.
[0195] In one example, the spatial transcription data includes the spatial location information of each cell in N cells, so the spatial location information of each cell in N cells can be read directly from the spatial transcription data.
[0196] In another example, spatial transcription data includes the spatial location information of each sequencing point. Based on the correspondence between sequencing points and cells, the spatial location information of cells can be determined according to the spatial location information of the sequencing points corresponding to the cells.
[0197] In some embodiments, before mapping each sequencing point in the spatial transcription data to N cells to obtain the gene information of each of the N cells, the method further includes: removing erroneous sequencing points from the spatial transcription data; then...
[0198] After removing erroneous sequencing points from the spatial transcription data, each sequencing point is mapped to N cells to obtain the gene information of each of the N cells.
[0199] In some embodiments, the gene information of N cells generated according to the above method is an N×G dimensional matrix, where N is the number of cells, G is the number of gene types, and the i-th row and j-th column of the matrix represents the amount of gene j expressed by cell i.
[0200] In some embodiments, the spatial location information of the N cells generated by the above method is an N×2 dimensional matrix, recording the coordinates of the center of each cell.
[0201] S502. Based on the spatial location information and gene information of each cell in N cells, the spatial transcription data is converted into a first image.
[0202] In some embodiments, a blank second image is created; based on the spatial position information of each of the N cells, the N cells are filled into the corresponding positions of the second image, and the first feature information is used as a channel of the first image to obtain the first image.
[0203] One method for creating a blank second image is to construct a blank second image based on the spatial location information of each cell in N cells.
[0204] For example, based on the spatial location information of each cell in N cells, determine the minimum bounding rectangle of the N cells; use the minimum bounding rectangle as the size of the second image to construct a blank second image.
[0205] In some embodiments, the first image includes N non-zero pixels that correspond one-to-one with N cells, and the number of channels in the first image is equal to the number of gene types in the N cells.
[0206] Suppose the first image is an H×W×G image, where H×W is the size of the first image, G is the number of channels of the first image, and the value of the g channel (i.e. the (h, w, g) pixel) in the h-th row and w-th column of the first image represents the amount of gene g expressed by the cell at the center coordinate (h, w).
[0207] When the first image generated above includes non-zero pixels and zero pixels, each cell will occupy a non-zero pixel, and all channels of the non-zero pixel constitute the gene expression of the cell. A non-zero pixel indicates that there is no cell at that location, and all channel values of the zero pixel are 0.
[0208] Of all the H×W pixels in the first image generated above, only N pixels will contain information.
[0209] In some embodiments of this application, only the non-zero pixel information in the first image is extracted. Therefore, when generating the first image, it is not necessary to reduce the number of zero pixels in the first image by the required size of the first image, thereby compressing resource usage. Instead, the first image can be directly obtained by converting the spatial position information of N cells.
[0210] S503. Perform feature extraction on the first image to obtain the second feature information of each cell in N cells.
[0211] In some embodiments, feature extraction is performed on the first image to obtain a first feature map, and second feature information of each cell in the N cells is obtained based on the feature information of N non-zero elements in the first feature map.
[0212] In one example, the size of the first feature map is the same as the size of the first image, and the positions of the zero elements in the first feature map are the same as the positions of the zero pixels in the first image, and the positions of the non-zero elements in the first feature map are the same as the positions of the non-zero pixels in the first image.
[0213] Optionally, an autoencoder based on submanifold sparse convolution is used to extract features from the first image to obtain a first feature map.
[0214] Optionally, the autoencoder based on submanifold sparse convolution includes at least one submanifold sparse convolution layer.
[0215] The specific implementation method of 503 above is described in S403 above, and will not be repeated here.
[0216] S504. Perform preset processing on the second feature information of each of the N cells to obtain the processing result.
[0217] For example, based on the second feature information of each of the N cells, the N cells can be clustered, annotated, or subjected to downstream analysis.
[0218] In some embodiments, the N cells are clustered based on the second feature information of each cell in the N cells to obtain M cluster sets of the N cells. Each of the M cluster sets includes at least one cell, and M is a positive integer less than or equal to N.
[0219] In some embodiments, after obtaining the above N cluster sets, P cluster sets can be selected from the M cluster sets, where P is a positive integer less than or equal to M; and the cells in the P cluster sets can be re-clustered.
[0220] In some embodiments, the embodiments of this application can be applied to a single-cell analysis platform as part of the spatial transcriptome data analysis process. The user inputs spatial transcriptome data (i.e., gene expression and corresponding spatial locations of a series of cells). First, the spatial transcriptome data is converted into a first image. Then, an autoencoder based on submanifold sparse convolution is used to extract the second feature information of each cell, and a clustering algorithm is applied to divide all cells into multiple different clusters. Clustering can be applied directly to all data, or it can be applied to a portion of the data at multiple levels according to user selection (e.g., first selecting 1 / 3 of the data to be divided into 8 classes, and then selecting the 8th class to further subdivide it into 10 subclasses). Low-level and low-cluster clustering can assist in the analysis of anatomical structures, while high-level and high-cluster clustering can assist in the analysis of cell or subcellular structural types. Based on the clustering results, downstream analyses such as gene spatial differential expression, marker genes, and HVG (highly variable genes) can also be performed.
[0221] As can be seen from the above, the data processing method provided in this application embodiment can effectively reduce the consumption of computing resources and improve data processing efficiency. Therefore, the data processing method provided in this application embodiment can be applied to ultra-high resolution, large field-of-view spatial transcriptome data. Here, resolution refers to the density of sequencing points. Low-resolution data means that the density of sequencing points is greater than the cell density, in which case one sequencing point represents the sum of gene expression of multiple cells. High-resolution or ultra-high-resolution data means that the density of sequencing points is equal to or higher than the cell density, in which case a single sequencing point represents a cell or subcellular structure, and one or more sequencing points combined constitute the gene expression of a single cell. Field of view refers to the total space occupied by all cells in a batch of data. Spatial transcriptome data is usually obtained from sequencing tissue sections; a large field of view means that the section is relatively large, usually indicating a large number of cells.
[0222] To further illustrate the effectiveness of the data processing method provided in the embodiments of this application, experiments are conducted to demonstrate the beneficial effects of the embodiments of this application.
[0223] Table 1 shows the GPU memory usage of this application and SEDR technology under different data volumes:
[0224] Table 1. Memory Usage of this Application and SEDR Technology
[0225]
[0226] As shown in Table 1 above, this application has a significantly lower memory footprint, making it highly efficient for use on ultra-high resolution, large field-of-view spatial transcriptome data.
[0227] Furthermore, by incorporating cell type guidance, this application can directly achieve end-to-end annotation of cell types. Clustering results typically lack reliable validation metrics, making effective quantitative comparison difficult. Therefore, comparing the results with those of direct annotation more readily demonstrates the superiority of this application. Figure 11 The annotation results of this application on one sample of the MERFISH mouse brain primary motor cortex data are shown (using its corresponding single cell as type guidance). Table 2 shows the accuracy of the cell type annotation results generated by this application and six other automatic annotation methods (Seurat, SingleR, scmap, Cell-ID, scNym, SciBet) on the mouse1_sample1 dataset, using the corresponding single cell data as type guidance.
[0228] Table 2. Accuracy of this application and the comparison method
[0229]
[0230] As shown in Table 2, the annotation accuracy of this application is higher than that of other annotation methods.
[0231] Furthermore, because this application effectively combines gene expression and spatial information as self-supervised training, it also performs exceptionally well on noisy data. Table 3 shows the accuracy of this application compared with six other methods on the MERFISH data mouse1_sample1 sample after manually removing 30% of the genes.
[0232] Table 3. Accuracy (with noise) of this application and the comparative method
[0233]
[0234] As shown in Table 3, the method provided in this application embodiment has significantly higher annotation accuracy than other methods after adding noise to the data.
[0235] The data processing method provided in this application involves acquiring spatial transcription data to be processed and parsing the spatial location information and gene information of each of the N cells from the spatial transcription data. Based on the spatial location information and gene information of each of the N cells, the spatial transcription data is converted into a first image. Then, feature extraction is performed on the first image to obtain the second feature information of each of the N cells. This second feature information combines the spatial location information and gene information. Thus, when using the second feature information of each of the N cells for preset processing, accurate processing results can be obtained. In other words, this application converts spatial transcription data into a first image, which includes the spatial location information and gene information of each of the N cells. Then, feature extraction is performed on the first image to obtain the second feature information of each of the N cells, thus encoding the spatial location information into features. The entire data processing process is simple, consumes few computational resources, and has high data processing efficiency. Furthermore, when performing feature extraction on the first image, this application only extracts the second feature information of the N cells. If the first image includes zero pixels, feature extraction is not performed on the zero pixels in the first image, further saving computational resources and improving data processing efficiency.
[0236] The above text combined Figures 4 to 11 The method embodiments of this application are described in detail below, in conjunction with... Figures 12 to 13 The following describes in detail the device embodiments of this application.
[0237] Figure 12 This is a schematic block diagram of a data processing apparatus provided in an embodiment of this application. The apparatus 10 may be an electronic device or a part of an electronic device.
[0238] like Figure 12 As shown, the data processing device 10 includes:
[0239] The acquisition unit 11 is used to acquire the target data to be processed, and to parse the spatial location information and first feature information of each of the N objects from the target data, where N is a positive integer;
[0240] The conversion unit 12 is used to convert the target data into a first image based on the spatial location information and first feature information of each of the N objects;
[0241] Extraction unit 13 is used to extract features from the first image to obtain the second feature information of each of the N objects;
[0242] The processing unit 14 is used to perform preset processing on the second feature information of each of the N objects to obtain the processing result of the target data.
[0243] In some embodiments, the conversion unit 12 is specifically used to create a blank second image; according to the spatial position information of each of the N objects, the N objects are filled into the corresponding positions of the second image, and the first feature information is used as a channel of the first image to obtain the first image.
[0244] In some embodiments, the conversion unit 12 is specifically used to construct a blank second image based on the spatial location information of each of the N objects.
[0245] In some embodiments, the conversion unit 12 is specifically used to determine the minimum bounding rectangle of the N objects based on the spatial location information of each of the N objects; and to construct a blank second image using the minimum bounding rectangle as the size of the second image.
[0246] In some embodiments, the first image includes N non-zero pixels and at least one zero pixel, wherein the N non-zero pixels correspond one-to-one with the N objects.
[0247] In some embodiments, the extraction unit 13 is specifically used to extract features from the first image to obtain a first feature map, the first feature map including N non-zero elements corresponding one-to-one with the N objects; and to obtain second feature information of each of the N objects based on the feature information of the N non-zero elements in the first feature map.
[0248] In some embodiments, the size of the first feature map is the same as the size of the first image, and the position of the zero element in the first feature map is consistent with the position of the zero pixel in the first image, and the position of the non-zero element in the first feature map is consistent with the position of the non-zero pixel in the first image.
[0249] In some embodiments, the extraction unit 13 is specifically used to extract features from the first image using an autoencoder based on submanifold sparse convolution to obtain the first feature map.
[0250] In some embodiments, the autoencoder based on submanifold sparse convolution includes at least one submanifold sparse convolution layer.
[0251] In some embodiments, the preset processing includes at least one of clustering the N objects, annotating the N objects, and downstream analysis.
[0252] In some embodiments, if the preset processing is to cluster the N objects, then the processing unit 14 is specifically used to cluster the N objects according to the second feature information of each of the N objects to obtain M cluster sets of the N objects, each of the M cluster sets including at least one object, and M is a positive integer less than or equal to N.
[0253] In some embodiments, the processing unit 14 is further configured to select P cluster sets from the M cluster sets, where P is a positive integer less than or equal to M; and to re-cluster the objects in the P cluster sets.
[0254] In some embodiments, the object is a cell, the target data is spatial transcription data, and the first feature information is gene information.
[0255] The acquisition unit 11 is specifically used to parse the spatial location information and gene information of each cell in N cells from the spatial transcription data;
[0256] The conversion unit 12 is specifically used to convert the spatial transcription data into a first image based on the spatial location information and gene information of each cell in the N cells;
[0257] Extraction unit 13 is specifically used to extract features from the first image to obtain the second feature information of each cell in the N cells.
[0258] The processing unit 14 is specifically used to perform preset processing on the second feature information of each of the N cells to obtain the processing result.
[0259] In some embodiments, the first image includes N non-zero pixels that correspond one-to-one with the N cells, and the number of channels in the first image is equal to the number of gene types in the N cells.
[0260] In some embodiments, the spatial transcription data includes gene expression captured by sequencing points. The acquisition unit 11 specifically maps each sequencing point in the spatial transcription data to N cells to obtain the gene information of each of the N cells. The gene information of the cells includes the gene expression captured by the sequencing point corresponding to the cell.
[0261] In some embodiments, the acquisition unit 11 is further configured to remove erroneous sequencing points from the spatial transcription data; and to map each sequencing point after removing erroneous sequencing points from the spatial transcription data to N cells to obtain the gene information of each of the N cells.
[0262] It should be understood that the device embodiments and method embodiments can correspond to each other, and similar descriptions can be referred to the method embodiments. To avoid repetition, further details will not be provided here. Specifically, Figure 12 The apparatus shown can perform the embodiments of the above data processing method, and the foregoing and other operations and / or functions of each module in the apparatus are for implementing the above method embodiments, which will not be described in detail here for the sake of brevity.
[0263] The apparatus of this application embodiment has been described above from the perspective of functional modules in conjunction with the accompanying drawings. It should be understood that this functional module can be implemented in hardware, in software instructions, or in a combination of hardware and software modules. Specifically, the steps of the method embodiments in this application can be completed by integrated logic circuits in the processor's hardware and / or by software instructions. The steps of the method disclosed in this application embodiment can be directly embodied as being executed by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. Optionally, the software module can reside in a mature storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps in the above method embodiments.
[0264] Figure 13 This is a schematic block diagram of an electronic device provided in an embodiment of this application, which is used to perform the above-described data processing method embodiment.
[0265] like Figure 13 As shown, the electronic device 30 may include:
[0266] The system includes a memory 31 and a processor 32. The memory 31 stores a computer program 33 and transfers the program code 33 to the processor 32. In other words, the processor 32 can retrieve and run the computer program 33 from the memory 31 to implement the methods described in the embodiments of this application.
[0267] For example, the processor 32 can be used to execute the above method steps according to the instructions in the computer program 33.
[0268] In some embodiments of this application, the processor 32 may include, but is not limited to:
[0269] General-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0270] In some embodiments of this application, the memory 31 includes, but is not limited to:
[0271] Volatile memory and / or non-volatile memory. Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), and Direct Rambus RAM (DR RAM).
[0272] In some embodiments of this application, the computer program 33 may be divided into one or more modules, which are stored in the memory 31 and executed by the processor 32 to complete the page recording method provided in this application. The one or more modules may be a series of computer program instruction segments capable of performing specific functions, which describe the execution process of the computer program 33 in the electronic device.
[0273] like Figure 13 As shown, the electronic device 30 may further include:
[0274] Transceiver 34, which can be connected to processor 32 or memory 31.
[0275] The processor 32 can control the transceiver 34 to communicate with other devices; specifically, it can send information or data to other devices or receive information or data sent by other devices. The transceiver 34 may include a transmitter and a receiver. The transceiver 34 may further include antennas, and the number of antennas may be one or more.
[0276] It should be understood that the various components in the electronic device 30 are connected through a bus system, which includes a data bus, a power bus, a control bus, and a status signal bus.
[0277] According to one aspect of this application, a computer storage medium is provided that stores a computer program thereon, which, when executed by a computer, enables the computer to perform the methods of the above-described method embodiments.
[0278] This application also provides a computer program product containing instructions that, when executed by a computer, cause the computer to perform the method described in the above method embodiments.
[0279] According to another aspect of this application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the electronic device to perform the method described in the above-described method embodiments.
[0280] In other words, when implemented using software, it can be implemented wholly or partially in the form of a computer program product. This computer program product includes one or more computer instructions. When these computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., digital video disc (DVD)), or a semiconductor medium (e.g., solid-state disk (SSD)).
[0281] Those skilled in the art will recognize that the modules and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0282] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or modules may be electrical, mechanical, or other forms.
[0283] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. For example, the functional modules in the various embodiments of this application may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.
[0284] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A data processing method, characterized in that, include: Obtain the target data to be processed, and parse the spatial location information and first feature information of each of the N objects from the target data, where N is a positive integer; Create a blank second image; Based on the spatial location information of each of the N objects, the N objects are filled into the corresponding positions of the second image, and the first feature information is used as the channel of the first image to obtain the first image. The first image includes N non-zero pixels and at least one zero pixel, and the N non-zero pixels correspond one-to-one with the N objects. Feature extraction is performed on the first image to obtain the second feature information of each of the N objects, wherein zero pixels in the first image are not extracted during feature extraction. The second feature information of each of the N objects is subjected to preset processing to obtain the processing result of the target data.
2. The method according to claim 1, characterized in that, The creation of the blank second image includes: Based on the spatial location information of each of the N objects, a blank second image is constructed.
3. The method according to claim 2, characterized in that, The step of constructing a blank second image based on the spatial location information of each of the N objects includes: Based on the spatial location information of each of the N objects, determine the minimum bounding rectangle of the N objects; A blank second image is constructed using the minimum bounding rectangle as the size of the second image.
4. The method according to claim 1, characterized in that, The step of extracting features from the first image to obtain the second feature information of each of the N objects includes: Feature extraction is performed on the first image to obtain a first feature map, which includes N non-zero elements that correspond one-to-one with the N objects; Based on the feature information of the N non-zero elements in the first feature map, the second feature information of each of the N objects is obtained.
5. The method according to claim 4, characterized in that, The size of the first feature map is the same as the size of the first image, and the position of the zero element in the first feature map is the same as the position of the zero pixel in the first image, and the position of the non-zero element in the first feature map is the same as the position of the non-zero pixel in the first image.
6. The method according to claim 4 or 5, characterized in that, The step of extracting features from the first image to obtain a first feature map includes: An autoencoder based on submanifold sparse convolution extracts features from the first image to obtain the first feature map.
7. The method according to claim 6, characterized in that, The autoencoder based on submanifold sparse convolution includes at least one submanifold sparse convolution layer.
8. The method according to any one of claims 1-3, characterized in that, The preset processing includes at least one of clustering the N objects, annotating the N objects, and downstream analysis.
9. The method according to claim 8, characterized in that, If the preset processing involves clustering the N objects, then the preset processing of the second feature information of each of the N objects to obtain the processing result of the target data includes: Based on the second feature information of each of the N objects, the N objects are clustered to obtain M cluster sets of the N objects. Each of the M cluster sets includes at least one object, and M is a positive integer less than or equal to N.
10. The method according to claim 9, characterized in that, The method further includes: Select P cluster sets from the M cluster sets, where P is a positive integer less than or equal to M; Re-cluster the objects in the P cluster sets.
11. The method according to any one of claims 1-3, characterized in that, The object is a cell, the target data is spatial transcription data, and the first feature information is gene information. The step of parsing the spatial location information and first feature information of each of the N objects from the target data includes: From the spatial transcription data, the spatial location information and gene information of each cell in N cells were extracted; The step of filling the N objects into the corresponding positions of the second image based on the spatial position information of each of the N objects, and using the first feature information as a channel of the first image to obtain the first image, includes: Based on the spatial location information of each cell in the N cells, the N cells are filled into the corresponding positions in the second image, and the gene information is used as a channel in the first image to obtain the first image; The step of extracting features from the first image to obtain the second feature information of each of the N objects includes: Feature extraction is performed on the first image to obtain the second feature information of each cell in the N cells; The step of performing preset processing on the second feature information of each of the N objects to obtain the processing result of the target data includes: The second feature information of each of the N cells is subjected to preset processing to obtain the processing result.
12. The method according to claim 11, characterized in that, The first image includes N non-zero pixels that correspond one-to-one with the N cells, and the number of channels in the first image is equal to the number of gene types in the N cells.
13. The method according to claim 11, characterized in that, The spatial transcription data includes gene expression captured by sequencing points. The step of resolving gene information for each of N cells from the spatial transcription data includes: Each sequencing point in the spatial transcription data is mapped to N cells to obtain the gene information of each of the N cells. The gene information of the cells includes the gene expression captured by the sequencing point corresponding to the cell.
14. The method according to claim 13, characterized in that, Before mapping each sequencing point in the spatial transcription data to N cells to obtain the gene information of each of the N cells, the method further includes: Remove erroneous sequencing points from the spatial transcription data; The step of mapping each sequencing point in the spatial transcription data to N cells to obtain the gene information of each of the N cells includes: Each sequencing point in the spatial transcription data, after removing erroneous sequencing points, is mapped to N cells to obtain the gene information of each of the N cells.
15. A data processing apparatus, characterized in that, include: An acquisition unit is used to acquire target data to be processed, and to parse the spatial location information and first feature information of each of the N objects from the target data, where N is a positive integer; A conversion unit is used to create a blank second image, and fill the N objects into the corresponding positions of the second image according to the spatial position information of each of the N objects, and use the first feature information as a channel of the first image to obtain the first image. The first image includes N non-zero pixels and at least one zero pixel, and the N non-zero pixels correspond one-to-one with the N objects. An extraction unit is used to extract features from the first image to obtain second feature information for each of the N objects, wherein when extracting features from the first image, zero pixels in the first image are not extracted. The processing unit is used to perform preset processing on the second feature information of each of the N objects to obtain the processing result of the target data.
16. An electronic device, characterized in that, Including processor and memory; The memory is used to store computer programs; The processor is configured to execute the computer program to implement the method as described in any one of claims 1 to 14.
17. A computer-readable storage medium, characterized in that, Used to store computer programs that cause a computer to perform the method as described in any one of claims 1 to 14.
18. A computer program product, characterized in that, It includes computer program instructions that cause a computer to perform the method described in any one of claims 1 to 14.