Somatic cell variation detection method, device, equipment, medium and program product
By extracting and classifying the multi-sequence alignment data characteristics of somatic cells, combined with the self-attention mechanism, the problem of poor somatic cell variant detection performance in the prior art is solved, and higher detection accuracy and data processing efficiency are achieved.
Patent Information
- Application Number
- CN202411488784.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-23
- Publication Date
- 2025-02-07
- Estimated Expiration
- 2044-10-23
AI Technical Summary
The prior art cannot fully utilize the gene sequencing multi-sequence alignment data of somatic cells, resulting in poor somatic cell variant detection performance.
By obtaining reference gene sequences and multi-sequence alignment data of different somatic cells, encoding and extracting features, and combining self-attention mechanisms to extract and classify somatic variation detection is achieved.
It improves the accuracy of somatic cell variant detection, makes full use of multi-sequence alignment data of different somatic cells in individuals, reduces the amount of redundant information and invalid areas, and improves data processing efficiency.
Smart Images

Figure CN119400242A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence, and in particular to a somatic variation detection method, device, equipment, medium and program product. Background Art
[0002] Somatic cells are cells other than reproductive cells, and somatic cell mutations occur randomly. Gene sequencing refers to the use of sequencing equipment to determine the order of bases in deoxyribonucleic acid (DNA) or ribonucleic acid (RNA) extracted from individual samples. The bases include five types: adenine (A), guanine (G), cytosine (C), thymine (T), and uracil (U).
[0003] In related technologies, gene sequencing is performed on somatic cells of tissues to obtain multiple sequence alignment (MSA) data, and the MSA data is input into a prediction model, such as a convolutional neural network (CNN) or a sequence model (Bi-GRU), to predict whether somatic cells have mutated.
[0004] However, this type of prediction model cannot fully utilize the MSA data of somatic gene sequencing, resulting in poor performance in somatic variation detection. Summary of the invention
[0005] The present application provides a somatic cell variation detection method, device, equipment, medium and program product. The technical solution is as follows:
[0006] In one aspect, a method for detecting somatic variation is provided, the method comprising:
[0007] Obtaining a reference gene sequence, and first MSA data of a first somatic cell of an individual, and second MSA data of a second somatic cell of the individual;
[0008] combining the reference gene sequence, the first MSA data, and the second MSA data to obtain MSA data of the individual;
[0009] Encoding a coding feature of the MSA data; and extracting an MSA feature corresponding to the coding feature;
[0010] The MSA features are classified to obtain somatic variation detection results of the first somatic cell and the second somatic cell relative to the reference gene sequence.
[0011] In some embodiments, extracting the sample MSA feature corresponding to the sample coding feature based on the base model layer includes:
[0012] Based on the basic model layer, self-attention calculation is performed on the sample encoding feature to obtain the sample MSA feature.
[0013] In some embodiments, performing self-attention calculation on the sample encoding feature based on the base model layer to obtain the sample MSA feature includes:
[0014] Based on the basic model layer, performing column attention calculation on the sample encoding feature to obtain a sample column attention feature;
[0015] Performing pooling on the sample column attention features in the column direction to obtain sample column pooling features;
[0016] The sample column pooling features are subjected to row attention calculation to obtain the sample MSA features.
[0017] In some embodiments, adjusting the model parameters of the somatic variation detection model with the training goal of reducing the difference between the predicted mutation type and the sample mutation type includes:
[0018] Determining a training loss based on the predicted mutation type and the sample mutation type;
[0019] Taking reducing the training loss as a training goal, the model parameters of the somatic variation detection model are adjusted.
[0020] In some embodiments, determining the training loss based on the predicted mutation type and the sample mutation type includes:
[0021] Determining a cross entropy loss based on the predicted mutation type and the sample mutation type;
[0022] The cross entropy loss is determined as the training loss.
[0023] In some embodiments, obtaining the first sample MSA data of normal cells of a first sample individual includes:
[0024] Acquire first sample sequencing data of normal cells of the sample;
[0025] Aligning the first sample sequencing data with the reference gene sequence to obtain first sample alignment data;
[0026] Determining sample candidate sites that meet screening conditions in the first sample alignment data;
[0027] Based on the first sample alignment data and the sample candidate sites, the first sample MSA data is determined.
[0028] In some embodiments, determining the sample candidate sites satisfying the screening conditions in the first sample alignment data includes:
[0029] In the first sample alignment data, when there is a base change in the column data corresponding to the sample gene site and the minor allele frequency of the sample gene site is greater than a threshold, the sample gene site is determined as the sample candidate site.
[0030] In some embodiments, the first sample MSA data includes first sample sequence MSA data and first sample insertion MSA data of the sample candidate site, the first sample sequence MSA data is used to characterize the base change of the sample candidate site, and the first sample insertion MSA data is used to characterize the base insertion of the sample candidate site;
[0031] The determining the first sample MSA data based on the first sample alignment data and the sample candidate sites includes:
[0032] Taking each sample candidate site of the sample candidate sites as the center of a window, extracting a sample gene sequence in the window in the first sample alignment data, wherein each sample sequencing fragment in the sample gene sequence corresponds to at least one of base insertion information, base deletion information and base change information;
[0033] Determine the first sample sequence MSA data of each sample candidate site based on the base deletion information and the base change information corresponding to each sample sequencing fragment in the sample gene sequence, and determine the first sample insertion MSA data of each sample candidate site based on the base insertion information corresponding to each sample sequencing fragment in the sample gene sequence;
[0034] The first sample sequence MSA data corresponding to each sample candidate site of the sample candidate site and the first sample insertion MSA data are combined to obtain the first sample MSA data.
[0035] In some embodiments, obtaining the second sample MSA data of sample variant cells of the first sample individual includes:
[0036] Obtaining second sample sequencing data of the sample mutant cells;
[0037] Aligning the second sample sequencing data with the reference gene sequence to obtain second sample alignment data;
[0038] Based on the second sample alignment data and the sample candidate sites, the second sample MSA data is determined.
[0039] In some embodiments, the second sample MSA data includes second sample sequence MSA data and second sample insertion MSA data of the sample candidate site, the second sample sequence MSA data is used to characterize the base change of the sample candidate site, and the second sample insertion MSA data is used to characterize the base insertion of the sample candidate site;
[0040] The determining the second sample MSA data based on the second sample alignment data and the sample candidate site comprises:
[0041] Taking each sample candidate site of the sample candidate sites as the center of a window, extracting a sample gene sequence in the window in the second sample alignment data, wherein each sample sequencing fragment in the sample gene sequence corresponds to at least one of base insertion information, base deletion information and base change information;
[0042] Determine the second sample sequence MSA data of each sample candidate site based on the base deletion information and the base change information corresponding to each sample sequencing fragment in the sample gene sequence, and determine the second sample insertion MSA data of each sample candidate site based on the base insertion information corresponding to each sample sequencing fragment in the sample gene sequence;
[0043] The second sample sequence MSA data and the second sample insertion MSA data corresponding to each sample candidate site of the sample candidate site are combined to obtain the second sample MSA data.
[0044] In some embodiments, the performing self-attention calculation on the sample coding feature based on the feature extraction unit to obtain the sample MSA feature corresponding to the sample coding feature includes:
[0045] Based on the feature extraction unit, performing column attention calculation on the sample encoding feature to obtain a sample column attention feature;
[0046] Performing pooling on the sample column attention features in the column direction to obtain sample column pooling features;
[0047] The column pooling features are subjected to row attention calculation to obtain the sample MSA features.
[0048] In some embodiments, the step of obtaining the third sample MSA data of normal cells of the second sample individual includes:
[0049] Acquire sequencing data of a third sample of normal cells of the sample;
[0050] Aligning the third sample sequencing data with the reference gene sequence to obtain third sample alignment data;
[0051] Determining sample candidate sites that meet screening conditions in the third sample alignment data;
[0052] Based on the third sample alignment data and the sample candidate sites, the third sample MSA data is determined.
[0053] In some embodiments, determining the sample candidate sites satisfying the screening conditions in the third sample alignment data includes:
[0054] In the third sample alignment data, when there is a base change in the column data corresponding to the sample gene site, and the minor allele frequency of the sample gene site is greater than a threshold, the sample gene site is determined as the sample candidate site.
[0055] In some embodiments, the third sample MSA data includes third sample sequence MSA data and third sample insertion MSA data of the sample candidate site, the third sample sequence MSA data is used to characterize the base change of the sample candidate site, and the third sample insertion MSA data is used to characterize the base insertion of the sample candidate site;
[0056] The determining the third sample MSA data based on the third sample alignment data and the sample candidate sites includes:
[0057] Taking each sample candidate site of the sample candidate sites as the center of the window, extracting the sample gene sequence in the window in the third sample alignment data, wherein each sample sequencing fragment in the sample gene sequence corresponds to at least one of base insertion information, base deletion information and base change information;
[0058] Determine the third sample sequence MSA data of each sample candidate site based on the base deletion information and the base change information corresponding to each sample sequencing fragment in the sample gene sequence, and determine the third sample insertion MSA data of each sample candidate site based on the base insertion information corresponding to each sample sequencing fragment in the sample gene sequence;
[0059] The third sample sequence MSA data and the third sample insertion MSA data corresponding to each sample candidate site of the sample candidate site are combined to obtain the third sample MSA data.
[0060] In some embodiments, the obtaining of the fourth sample MSA data of the sample variant cells of the second sample individual includes:
[0061] Acquire fourth sample sequencing data of the sample mutant cells;
[0062] Aligning the fourth sample sequencing data with the reference gene sequence to obtain fourth sample alignment data;
[0063] Based on the fourth sample alignment data and the sample candidate sites, the fourth sample MSA data is determined.
[0064] In some embodiments, the fourth sample MSA data includes fourth sample sequence MSA data and fourth sample insertion MSA data of the sample candidate site, the fourth sample sequence MSA data is used to characterize the base change of the sample candidate site, and the fourth sample insertion MSA data is used to characterize the base insertion of the sample candidate site;
[0065] The determining the fourth sample MSA data based on the fourth sample alignment data and the sample candidate sites includes:
[0066] Taking each sample candidate site of the sample candidate sites as the center of the window, extracting the sample gene sequence in the window in the fourth sample alignment data, wherein each sample sequencing fragment in the sample gene sequence corresponds to at least one of base insertion information, base deletion information and base change information;
[0067] Determine the fourth sample sequence MSA data of each sample candidate site based on the base deletion information and the base change information corresponding to each sample sequencing fragment in the sample gene sequence, and determine the fourth sample insertion MSA data of each sample candidate site based on the base insertion information corresponding to each sample sequencing fragment in the sample gene sequence;
[0068] The fourth sample sequence MSA data and the fourth sample insertion MSA data corresponding to each sample candidate site of the sample candidate sites are combined to obtain the fourth sample MSA data.
[0069] In another aspect, a somatic variation detection device is provided, the device comprising:
[0070] An acquisition module, configured to acquire a reference gene sequence, a first MSA data of a first somatic cell of an individual, and a second MSA data of a second somatic cell of the individual;
[0071] A combination module, used for combining the reference gene sequence, the first MSA data and the second MSA data to obtain the MSA data of the individual;
[0072] An encoding module, used for encoding the encoding features of the MSA data; and extracting the MSA features corresponding to the encoding features;
[0073] A classification module is used to classify the MSA features to obtain somatic variation detection results of the first somatic cell and the second somatic cell relative to the reference gene sequence.
[0074] On the other hand, a computer device is provided, comprising: a processor and a memory, wherein the memory stores a computer program, and the computer program is loaded and executed by the processor to implement the somatic variation detection method as described above.
[0075] On the other hand, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and the computer program is loaded and executed by a processor to implement the somatic variation detection method as described above.
[0076] On the other hand, a computer program product is provided, which includes computer instructions, the computer instructions are stored in a computer-readable storage medium, and a processor obtains the computer instructions from the computer-readable storage medium, so that the processor loads and executes to implement the somatic cell variation detection method as described above.
[0077] The beneficial effects brought by the technical solution provided by the embodiment of the present application include at least:
[0078] The reference gene sequence and the MSA data of different somatic cells from the same individual are combined to obtain the individual's MSA data, which fully represents the individual's MSA data. The MSA features of the MSA data are obtained through two feature extractions, which can integrate the base information and sequencing information of the reference gene sequence and the MSA data of different somatic cells. By classifying the MSA features, the MSA data of different somatic cells of the individual can be fully utilized to improve the accuracy of the somatic cell variation detection results. In addition, the individual's MSA data contains relevant information about candidate sites in the gene loci, which can reduce redundant information, reduce the amount of calculation of invalid areas, and improve data processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0079] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0080] Figure 1 is a schematic diagram of sequencing MSA data provided by an exemplary embodiment of the present application;
[0081] Figure 2 is a schematic diagram of the structure of a computer system provided by an exemplary embodiment of the present application;
[0082] Figure 3 is a schematic diagram of a somatic variation detection method provided by an exemplary embodiment of the present application;
[0083] Figure 4 is a schematic diagram of the structure of a somatic cell variation detection model provided by an exemplary embodiment of the present application;
[0084] Figure 5 is a structural schematic diagram of a basic model provided by an exemplary embodiment of the present application;
[0085] Figure 6 is a flow chart of a somatic variation detection method provided by an exemplary embodiment of the present application;
[0086] Figure 7 is a schematic diagram of sequence MSA data of normal cells provided by an exemplary embodiment of the present application;
[0087] Figure 8 is a schematic diagram of MSA data of normal cells inserted provided by an exemplary embodiment of the present application;
[0088] Fig. 9 is a schematic diagram of sequence MSA data of cancer cells provided by an exemplary embodiment of the present application;
[0089] Fig.10 is a schematic diagram of inserted MSA data of cancer cells provided by an exemplary embodiment of the present application;
[0090] Fig.11 is an application schematic diagram of a somatic cell variation detection model provided by an exemplary embodiment of the present application;
[0091] Fig.12 is a flow chart of somatic variation detection provided by an exemplary embodiment of the present application;
[0092] Fig.13 is a block diagram of a somatic variation detection device provided by an exemplary embodiment of the present application;
[0093] Fig.14 It is a structural block diagram of a computer device provided by an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0094] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below in conjunction with the accompanying drawings.
[0095] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0096] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. The singular forms of "a", "said" and "the" used in this application and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0097] It should be understood that, although the terms first, second, etc. may be used in the present application to describe various information, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present application, the first parameter may also be referred to as the second parameter, and similarly, the second parameter may also be referred to as the first parameter. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0098] It should be noted that before collecting relevant user data (for example, data related to individual somatic cells and genes) and during the process of collecting relevant user data, this application can display a prompt interface, pop-up window or output voice prompt information, and the prompt interface, pop-up window or voice prompt information is used to prompt the user that its relevant data is currently being collected, so that this application only starts to execute the relevant steps of obtaining user-related data after obtaining the user's confirmation operation on the prompt interface or pop-up window, otherwise (that is, when the user's confirmation operation on the prompt interface or pop-up window is not obtained), the relevant steps of obtaining user-related data are terminated, that is, the user's relevant data is not obtained. In other words, all user data collected by this application are collected with the user's consent and authorization, and the collection, use and processing of relevant user data need to comply with relevant laws, regulations and standards of relevant countries and regions.
[0099] First, the terms involved in the embodiments of the present application are briefly introduced.
[0100] Cell: It is the basic structural and functional unit of an organism. Cells are composed of somatic cells and germ cells. Somatic cells are cells that make up the tissues and organs of an organism, except for germ cells. Somatic cell mutations occur randomly. For example, an organism is a human individual.
[0101] In this embodiment, the first somatic cell and the second somatic cell are somatic cells from different tissues of the same individual. For example, the first somatic cell is from a first tissue of an individual, and the second somatic cell is from a reference tissue of the individual, the first tissue is a normal tissue, and the reference tissue is a variant tissue, such as a cancerous tissue or a tumor tissue. Alternatively, the first somatic cell is from a normal tissue of an individual, and the second somatic cell is from a variant tissue of the individual, then the first somatic cell is a normal cell, and the second somatic cell is a variant cell, such as a cancer cell or a tumor cell.
[0102] Gene: A fragment of deoxyribonucleic acid (DNA) or ribonucleic acid (RNA) that carries genetic information. It is the basic unit of inheritance of organisms and the basis of their growth, development, reproduction and other life activities. The functions of genes include storing and transmitting genetic information and replicating cells. Genes are located on the chromosomes of cells and are arranged in a linear pattern.
[0103] Base: It is the basic unit for synthesizing nucleosides, nucleotides and nucleic acids. There are 5 types of bases: Adenine (A), Guanine (G), Cytosine (C), Thymine (T) and Uracil (U). Bases are composed of carbon, oxygen, hydrogen, nitrogen and other elements. A gene locus usually involves two bases. A gene locus is a specific position occupied by a gene on a chromosome. The mutation / variation of a gene locus usually involves the change of two bases.
[0104] Gene sequence: It is the order of the bases that make up the gene, which can also be called a base sequence. A gene sequence is represented by a string of characters, which include letters and symbols. The letters are A, G, C, T, and U corresponding to different types of bases, and the symbols include "-" and / or ".".
[0105] Reference gene sequence: It is a standard version of an individual's gene sequence, which is integrated based on gene sequencing and analysis of multiple individuals. Optionally, by comparing the gene sequence of an individual with the reference gene sequence, it is possible to identify whether there are genetic mutations in the gene sequence of the individual, thereby identifying somatic mutations. Generally, an individual refers to a human individual. The reference gene sequence is obtained from a public data set, and the human genome HG38 reference sequence can be used, and it is truncated to a preset length, which can be 1024BP. BP stands for base pair, which is a commonly used unit of length in biology and is used to indicate the length of a gene sequence.
[0106] Gene sequencing: also referred to as sequencing, is a new type of gene detection technology that can determine the gene sequence of an individual from an individual's sample (tissue), that is, determine the order of the bases of deoxyribonucleic acid (DNA) or ribonucleic acid (RNA) on the chromosome extracted from the individual's sample. Chromosomes include 23 pairs, 22 pairs of autosomes and 1 pair of sex chromosomes. Gene sequencing is achieved using sequencing equipment, which can be: sequencer. Sequencing methods can be: chain termination sequencing, high-throughput sequencing.
[0107] Multiple Sequence Alignment (MSA) data: MSA data for short, also known as sequencing MSA data, is obtained by aligning the original sequencing data of an individual with the reference gene sequence. MSA data is obtained based on alignment software. It can make the sequencing data involved in the alignment have as many columns with the reference gene sequence as possible with the same characters, so as to find the similar parts between different gene sequences, and thus infer the similarity between the two.
[0108] In some embodiments, sequencing MSA data is represented by a two-dimensional array. Rows represent gene sequences, each row corresponds to a gene sequence, columns represent gene loci, and each column contains nucleotide information of all gene sequences at the same gene locus. Sequencing MSA data can also capture small insertions, deletions, and point mutations, and deletions are generally represented by the symbol "-".
[0109] For example, refer to Figure 1, each row of sequencing MSA data corresponds to a gene sequence. Taking the first row as an example, the corresponding gene sequence is "CCNTAACCCT...". During gene sequencing, due to the limitation of sequencing level, the genome needs to be broken into small fragments for sequencing. Sequencing fragments (reads) are shorter gene sequence fragments read by a sequencing device in a single sequencing. A gene sequence includes multiple sequencing fragments. Each column represents the nucleotide information of all gene sequences at the same gene locus. Taking the last column as an example, the base corresponding to all gene sequences at this gene locus is "C". The symbol "-" in the sequencing MSA data indicates that the base of the gene locus is missing, or is understood to be deleted. The symbol "." indicates an interval, or is understood to mean that a long gene sequence is interrupted, or the base of the gene locus is not copied.
[0110] In some embodiments, the steps for generating individual MSA data include: base calling, sequence quality control, sequence alignment, and post-processing. Base calling is used to convert the sequencing signal generated by the sequencing device into an analyzable gene sequence, that is, to obtain sequencing data. Among them, the accuracy of base calling is affected by many factors, such as signal noise, similarity of base chemical structure, sequencing depth, etc. Sequence quality control is used to filter, prune and evaluate the original sequencing data generated by sequencing. For example, remove low-quality sequences, discard sequences that do not meet the requirements, etc., to ensure the quality of sequencing data. The sequencing data obtained by base calling and sequence quality control can be a Fastq file. Sequence alignment is used to align the sequencing data obtained by sequencing with the reference gene sequence, or to understand it as aligning the sequencing data with the reference gene sequence. Optionally, alignment software is used to align the sequencing data with the reference gene sequence to obtain an alignment result, that is, to obtain alignment data, and the alignment data can be a BAM file. Post-processing is an optional step for de-duplication, phasing, mining and visual display of alignment data. After obtaining the alignment data, MSA data can be further obtained based on the candidate sites screened from each gene site.
[0111] Minor Allele Frequency (MAF): It is the frequency of the second highest allele at a gene locus. For example, there are three types of bases at a gene locus of an individual: A, C, and G. Among them, the frequency of base A is 0.6, the frequency of base C is 0.3, and the frequency of base G is 0.1. Then the minor allele frequency refers to the frequency of base C, which is 0.3.
[0112] Coverage: refers to the proportion of gene sequences obtained by sequencing to the entire genome, which is determined based on the number of sequencing fragments (reads) obtained by sequencing the current gene loci. Due to the complex structure of the genome, the gene sequences obtained by the final assembly of sequencing often cannot cover all areas. This part of the uncovered (unmeasured) area is called a GAP. For example, if the coverage of an individual's gene sequencing is 98%, there are still 2% of the areas that have not been obtained through sequencing.
[0113] Mapping Quality: It is used to indicate the reliability of each base obtained by sequencing. The larger the mapping quality value, the better the sequencing quality. The mapping quality value is provided by the mapping software.
[0114] Base Quality: It is used to indicate the quality score of base calling and characterizes the sequencing error rate of bases. The base quality is provided by the sequencing equipment, which can be a sequencer.
[0115] Sense Strand, Antisense Strand: used to characterize the directionality of genes on chromosomes, that is, the positive or negative arrangement of gene sequences on DNA chains. Taking DNA as an example, the positive and negative strands of genes are two complementary strands of DNA. The base sequence of the positive strand is the template directly involved in protein synthesis, and the base sequence of the negative strand is complementary to the positive strand and serves as an antisense template in the process of protein synthesis. The positive and negative strand information is provided by the alignment software.
[0116] Candidate sites: some gene sites in the various gene sites of the somatic cells of an individual that meet the screening conditions. They can also be understood as suspicious sites, which are gene sites that may have mutations in somatic cells. When detecting somatic cell mutations, the first MSA data of the first somatic cell of the individual input into the somatic cell mutation detection model, and the second MSA data of the second somatic cell of the individual, respectively contain only the base information and sequencing information of the candidate sites in the gene sites, which can reduce the amount of calculation of invalid areas. It should also be noted that the candidate sites corresponding to the first somatic cell and the second somatic cell are the same, which can ensure the alignment of the reference gene sequence, the first MSA data, and the second MSA data.
[0117] Taking the first somatic cell of an individual as an example, after aligning the original sequencing data of the first somatic cell of the individual with the reference gene sequence, the first alignment data is obtained, and the first alignment data contains the base information and sequencing information corresponding to each gene locus. These first alignment data can be simply divided into: unmutated region, noise region, and mutated region. For the unmutated region, this part of the gene sequence is exactly the same as the reference gene sequence, and its base information and sequencing information are redundant. For the noise region, this part of the gene sequence has a small amount of base changes, which is caused by the sequencing system error and the comparison error, and its comparison quality value is usually relatively low. In the embodiment of the present application, the candidate site is determined as follows: in the first alignment data, when there is a base change in the column data corresponding to the gene locus, and the minor allele frequency of the gene locus is greater than the threshold, the gene locus is determined as a candidate site. The threshold can be set according to actual technical needs.
[0118] Somatic Variant Caller: Also known as a somatic mutation detection model, it is a model provided in the embodiments of the present application for executing a somatic variant detection method. In the process of somatic variant identification, the gene sequences of somatic cells of different tissues of an individual are compared with reference gene sequences, which is called somatic variant calling.
[0119] In some embodiments, in the application stage of the somatic cell variation detection model, the input data of the somatic cell variation detection model is the reference gene sequence, the first somatic cell and the second somatic cell of the individual after sequencing, comparison, and combination. The MSA data obtained, and the output result is the mutation type of the first somatic cell and the second somatic cell relative to the reference gene sequence and the probability corresponding to the mutation type. Optionally, the mutation types include: noise mutation (artifact), system mutation (somatic), normal cell mutation (normal-only), germline mutation (germline). Noise mutation (artifact) also includes the situation where no mutation occurs, which means that neither the first somatic cell nor the second somatic cell has mutated. System mutation (somatic) means that the first somatic cell has not mutated and the second somatic cell has mutated. Normal cell mutation (normal-only) means that the first somatic cell has mutated and the second somatic cell has not mutated. Germline mutation (germline) means that both the first somatic cell and the second somatic cell have mutated. Taking the first somatic cell as a normal cell and the second somatic cell as a cancer cell as an example, the noise mutation (artifact) means that neither the normal cell nor the cancer cell has mutated. Somatic mutation means that normal cells do not mutate, but cancer cells do. Normal-only mutation means that normal cells mutate, but cancer cells do not. Germline mutation means that both normal cells and cancer cells mutate.
[0120] Basic model: also known as the MSA basic model, is a pre-trained model provided in an embodiment of the present application, which is used to extract MSA features. Part of the model structure and model parameters of the pre-trained basic model can also be used as part of the model structure in the somatic variation detection model, and its model parameters are retained. In some embodiments, the basic model is determined based on a unified sequence model (USM). The USM model is a language model that is both a conventional single sequence model and an MSA model. In other embodiments, the basic model can also be an MSA Transformer model implemented based on a Transformer structure, or other models for extracting MSA features, or other large language models, general language models.
[0121] Figure 2 1 is a schematic diagram of a computer system provided by an exemplary embodiment of the present application. The computer system 100 can be implemented as a system architecture of a somatic cell variation detection method. The computer system 100 includes: a terminal 120 and a server 140.
[0122] The terminal 120 can be an electronic device such as a mobile phone, a tablet computer, a vehicle-mounted terminal (car computer), a wearable device, a PC (Personal Computer), an unmanned reservation terminal, etc. A client that runs the target application can be installed in the terminal 120. Optionally, the target application is a program dedicated to gene sequencing and / or gene analysis, or a program that provides gene sequencing and / or gene analysis functions, or a program that provides somatic variation detection functions, or a program that provides training functions in the training phase of the somatic variation detection model, or a program that provides application functions in the application phase of the somatic variation detection model. This application is not limited to this. The embodiment of the present application does not limit the form of the target application, including but not limited to App (Application, application), applets, etc. installed in the terminal 120, and can also be in the form of a web page. Optionally, the terminal 120 stores a somatic variation detection model for identifying somatic variation.
[0123] Server 140 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud computing services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and cloud servers for basic cloud computing services such as big data and artificial intelligence platforms. Server 140 can be the background server of the above-mentioned target application, used to provide background services for the client of the target application. In some optional embodiments, server 140 can also be implemented as a node in a blockchain system. Optionally, server 140 stores a somatic variation detection model for identifying somatic variation.
[0124] The terminal 120 and the server 140 may communicate with each other via a network, such as a wired or wireless network.
[0125] The somatic cell variation detection method provided in the embodiment of the present application can be performed by a computer device in each step. A computer device refers to an electronic device with data calculation, processing and storage capabilities. Figure 1Taking the implementation environment of the scheme shown as an example, the somatic variation detection method can be executed by the terminal 120, for example, the client of the target application installed and running in the terminal 120 executes the somatic variation detection method, or the somatic variation detection method can be executed by the server 140, or the terminal 120 and the server 140 can interact and cooperate to execute, for example, the client of the target application installed and running in the terminal 120 executes the application stage of the somatic variation detection model in the somatic variation detection method, and the server 140 executes the training stage of the somatic variation detection model in the somatic variation detection method, and the present application is not limited to this.
[0126] Those skilled in the art will appreciate that the number of the above-mentioned terminals 120 may be more or less. For example, the above-mentioned terminal 120 may be only one, or may be dozens or hundreds, or more. The embodiment of the present application does not limit the number and device type of the terminal 120.
[0127] In the process of individual gene sequencing, multiple gene sequences obtained by sequencing are compared with reference gene sequences to obtain multiple sequence alignment (MSA) data, such as Figure 1 As shown. MSA data reveals the differences between an individual's gene sequence and the reference gene sequence. By comparing the gene sequences of two different tissues from the same individual with the reference gene sequence, we can obtain mutations in somatic cells of different tissues compared to the reference gene sequence. This process is called somatic variant calling. Somatic variant calling is an important step in early cancer diagnosis and precision medicine, and its recognition accuracy plays an important role in early disease detection. With the popularization of sequencing technology, identifying somatic variants at the gene sequence level and exploring their correlation with diseases will greatly improve the level of precision medicine.
[0128] The somatic mutation detection method in the related art is divided into two parts: 1. Machine learning methods, such as the mutation detection method in the software (Genome Analysis Toolkit, GATK) for processing high-throughput sequencing data, and the identification of mutations using hidden Markov chains, etc. 2. Deep learning methods, including: 2-1. Deep learning methods based on sequence models, such as the VarNet method and mutation detection model (ClairS) based on deep learning. Specifically, the base information at each reference gene sequence position in the statistical alignment sequence, such as the number of A, G, C, T, and U bases, the average sequencing quality, and other information. The statistical sequence is input into the prediction model to predict whether a somatic mutation occurs. For example, the VarNet method uses a convolutional neural network (CNN) to predict whether a mutation occurs. The ClairS Pileup model calculates the statistical information of normal cell genes and cancer cell genes, and predicts the mutation type through a sequence model (Bi-GRU). 2-2. Deep learning methods based on image models. For example, the ClairS Full-alignment model combines the base information, insertion and deletion information, sequencing quality information, etc. of normal cells and cancer cells, and predicts the mutation type through the residual network (ResNet).
[0129] The characteristics of MSA data are: large data volume and high redundancy, which leads to the following shortcomings in related technologies: 1. The machine learning method has low operating efficiency and is difficult to configure. The performance of this method varies greatly for different sequencing platforms and different sequencing technologies. 2. The deep learning method cannot fully utilize the massive MSA data and has poor performance. If the MSA data is converted into an image or a one-dimensional counting sequence, the original sequencing information is lost. This method is also unable to perform unsupervised pre-training of the model on massive MSA data. As a result, the performance of somatic variation detection is poor.
[0130] The present embodiment provides a somatic cell variation detection model, which can be applied to somatic cell variation detection, not limited to somatic cell variation detection of DNA and RNA sequencing, and has the following technical key points: 1. Sequencing data is converted into MSA data, and MSA data includes insertion MSA data and sequence MSA data. Based on pre-training of the basic model and fine-tuning training of the somatic cell variation detection model, the somatic cell variation detection performance is improved; 2. For two somatic cells from different tissues of the same individual, their MSA data are extracted respectively, and the MSA data of the two somatic cells are merged to improve the somatic cell variation detection performance; 3. The somatic cell variation detection model is a multi-task model that can identify the mutation type and detect the mutated base position and the inserted base sequence, and has powerful functions.
[0131] Figure 3is a schematic diagram of a somatic cell variation detection method provided by an exemplary embodiment of the present application. The method is executed by a computer device, which may be Figure 2 The terminal 120 and / or server 140 shown. Exemplarily, the computer device stores a somatic cell variation detection model, which is used to execute to implement the somatic cell variation detection method. In the application stage, the steps of the method are briefly described as follows:
[0132] refer to Figure 3 The computer device obtains a reference gene sequence 11, a first MSA data 12 of a first somatic cell of an individual, and a second MSA data 13 of a second somatic cell of the individual, wherein the first somatic cell is from a first tissue of the individual, and the second somatic cell is from a reference tissue of the individual; combines the reference gene sequence 11, the first MSA data 12, and the second MSA data 13 to obtain the MSA data 10 of the individual; encodes the coding feature 20 of the MSA data 10; and extracts the MSA feature 30 corresponding to the coding feature 20; classifies the MSA feature 30, and obtains the somatic variation detection result 40 of the first somatic cell and the second somatic cell relative to the reference gene sequence. See below for a detailed example.
[0133] Part 1: Model Structure
[0134] (1) Model structure of somatic variation detection model
[0135] Figure 4 1 is a schematic diagram of the structure of a somatic cell variation detection model provided by an exemplary embodiment of the present application. The somatic cell variation detection model is used to perform the encoding, extraction and classification steps in the somatic cell variation detection method.
[0136] In some embodiments, a somatic variation detection model for performing a somatic variation detection method includes: a first encoding layer (Embedding), a base model layer (USM Core), and a classifier (Classifier); the first encoding layer is cascaded with the base model layer, and the base model layer is cascaded with the classifier;
[0137] Among them, the first encoding layer is used to encode the encoding features of MSA data; the basic model layer is used to extract the MSA features corresponding to the encoding features; the classifier is used to classify the MSA features to obtain the somatic variation detection results of the first somatic cell and the second somatic cell relative to the reference gene sequence.
[0138] In some embodiments, the base model layer in the somatic variation detection model includes: a feature extraction unit (USM Block) stacked in the pre-trained base model. The base model is a unified sequence model (USM) for extracting MSA features.
[0139] In one possible implementation, in the somatic variation detection model, the first coding layer (Embedding) is implemented based on at least one standard coding layer (Embedding) and / or at least one linear transformation (Linear) layer. In a specific example, it is one Embedding layer and / or one Linear layer. Among them, the continuous value MSA is encoded using the Linear layer, and the categorical MSA is encoded using the Embedding layer. The basic model layer (USM Core) is implemented based on N stacked feature extraction units (USM Block), N is greater than or equal to 1, and the structure and calculation method of each feature extraction unit remain consistent, which will be explained below. The classifier (Classifier) is implemented based on at least one multilayer perceptron (Multilayer Perceptron, MLP) layer. In a specific example, it is one MLP layer, and the one MLP layer consists of two linear transformation (Linear) layers and an activation function ReLU.
[0140] In this embodiment, the somatic variation detection model can simultaneously utilize the MSA data of different somatic cells of the same individual to obtain the encoding features of the MSA data, and further encode to obtain the MSA features. In this way, the information of the MSA data in different information dimensions can be learned during the training phase, and the somatic variation detection performance can be improved during the application phase, thereby improving the accuracy of the somatic variation detection results.
[0141] (2) Model structure of the basic model
[0142] Figure 5 1 is a schematic diagram of a basic model provided by an exemplary embodiment of the present application. The basic model is a unified sequence model (USM) for extracting MSA features.
[0143] In some embodiments, the basic model includes: a second coding layer (MSA Embedding), a stacked feature extraction unit (USM Block), and a conversion layer (LM Head), the second coding layer is cascaded with the feature extraction unit, and the feature extraction unit is cascaded with the conversion layer. The number of stacked feature extraction units is N, N is greater than or equal to 1, and the structure and calculation operation of each feature extraction unit in the N feature extraction units are consistent.
[0144] The somatic variant detection model is adjusted based on the basic model. The somatic variant detection model removes the conversion layer of the basic model and adds a classifier. The model parameters of the first encoding layer (Embedding) of the somatic variant detection model are the same as the model parameters of the second encoding layer (MSA embedding) of the pre-trained basic model. The second encoding layer is used for sample encoding features of sample MSA data.
[0145] In some embodiments, the calculation operations in each feature extraction unit (USM Block) include: root mean square error normalization (RMSNorm), column attention, addition, column pooling, multi-head self-attention, and activation operations performed using an activation function (SwiGLU). The calculation operations in column attention include: transposition operations performed using a transposition function (Transpose), multi-head self-attention (Multi-Head Attention). The calculation operations in multi-head self-attention (Multi-Head Attention) include: linear transformation (Linear), query (Query, Q) matrix, key (Key, K) matrix, value (Value, V) matrix, rotation position encoding (RoPE), multiplication, and normalized exponential operations performed using an activation function (Softmax). The calculation operations in the activation operation performed using an activation function (SwiGLU) include: linear transformation (Linear), activation operations performed using an activation function (SiLU), and dot products.
[0146] For example, in a feature extraction unit (USM Block), for a coding feature, root mean square error normalization and column attention calculation are performed in sequence, and the coding feature and the result after the column attention calculation are added to obtain a first processing feature; the first processing feature is sequentially subjected to column pooling, root mean square error normalization and multi-head self-attention calculation, and the first processing feature and the result after the multi-head self-attention calculation are added to obtain a second processing feature; the second processing feature is sequentially subjected to root mean square error normalization and activation operation, and the second processing feature and the result after the activation operation are added to obtain the MSA feature corresponding to the coding feature.
[0147] For example, in a column attention calculation, the normalized root mean square error result is used to perform the first transposition operation using the transpose function, the result after the first transposition operation is used to perform multi-head self-attention calculation, and the result after the multi-head self-attention calculation is used to perform the second transposition operation using the transpose function to obtain the result after the column attention calculation.
[0148] For example, in a multi-head self-attention calculation, the normalized root mean square error result is linearly transformed and mapped to the Q / K / V matrix, the Q / K / V matrix is divided into multiple heads, and self-attention calculation is performed for each head. Rotational position encoding is performed on the Q matrix, rotational position encoding is performed on the K matrix, the encoding results of the two are multiplied, the result of the multiplication is normalized exponentially, the V matrix is multiplied with the result of the normalized exponential operation, the result of the multiplication is linearly transformed, and the result of the multiplication is obtained after the multi-head self-attention calculation.
[0149] For example, in an activation operation performed using the activation function (SwiGLU), the result of the normalized root mean square error is linearly transformed using two parallel Linear layers respectively, the result of the linear transformation of one Linear layer is activated using the activation function (SiLU), the result of the activation operation (SiLU) is dot-producted with the result of the linear transformation of another Linear layer, the result of the dot product is linearly transformed using a Linear layer to obtain the result after the activation operation (SiGLU).
[0150] In one possible implementation, in the base model, the first coding layer (MSA Embedding) is implemented based on at least one standard coding layer (Embedding), and in a specific example, it is one Embedding layer. Each feature extraction unit (USM Block) is implemented based on at least two Linear layers. The conversion layer (LM Head) is implemented based on at least one Linear layer, and in a specific example, it is one Linear layer.
[0151] In this embodiment, the basic model adopts the attention mechanism, so the training phase can capture and learn the important parts of the MSA data, thereby improving the accuracy of the MSA features.
[0152] Part II: Application Phase
[0153] Figure 6 is a flow chart of a somatic cell variation detection method provided by an exemplary embodiment of the present application. The method is executed by a computer device, which may be Figure 2 The terminal 120 and / or server 140 shown. The method includes at least some of steps 220, 240, 260, and 280:
[0154] Step 220 , obtaining a reference gene sequence, a first MSA data of a first somatic cell of an individual, and a second MSA data of a second somatic cell of the individual.
[0155] An individual is an organism. Generally, an individual refers to a human individual. A first somatic cell comes from a first tissue of an individual, and a second somatic cell comes from a reference tissue of the individual. Multiple sequence alignment (MSA) data is obtained by aligning the sequencing data obtained by sequencing the gene of an individual with a reference gene sequence. For example, the first MSA data of a first somatic cell is obtained by aligning the first sequencing data of a first somatic cell of an individual with a reference gene sequence. The second MSA data of a second somatic cell is obtained by aligning the second sequencing data of a second somatic cell of an individual with a reference gene sequence. The reference gene sequence is a standard version of an individual's gene sequence, which is integrated based on gene sequencing and analysis performed on multiple individuals.
[0156] In some embodiments, the first MSA data of the first somatic cell includes the base information and sequencing information of the candidate site in the gene locus. The second MSA data of the second somatic cell includes the base information and sequencing information of the candidate site in the gene locus. Here, the candidate sites corresponding to the first somatic cell and the second somatic cell are the same. Candidate sites are some gene sites in each gene locus of an individual that meet the screening conditions, and can also be understood as suspicious sites, which are gene sites where mutations may exist. When detecting somatic cell mutations, the first MSA data of the first somatic cell of an individual and the second MSA data of the second somatic cell only include the base information and sequencing information of the candidate sites in the gene locus, which can reduce the amount of calculation of invalid areas.
[0157] In some embodiments, a sequencing device is used to perform gene sequencing on a first somatic cell of an individual to obtain a sequencing signal. The sequencing signal is an electrical signal or an optical signal, and the sequencing signal needs to be converted into an analyzable gene sequence, i.e., first sequencing data, and then the first MSA data of the first somatic cell of the individual is generated based on the first sequencing data. Similarly, a sequencing device is used to perform gene sequencing on a second somatic cell of the same individual to obtain a sequencing signal. The sequencing signal is an electrical signal or an optical signal, and the sequencing signal needs to be converted into an analyzable gene sequence, i.e., second sequencing data, and then the second MSA data of the second somatic cell of the individual is generated based on the second sequencing data.
[0158] The first MSA data of the first somatic cell of an individual can be generated in the following manner: performing base calling on the original sequencing signal, the base calling is used to convert the sequencing signal generated by the sequencing device into the original first sequencing data, so as to obtain the original first sequencing data; performing sequence quality control on the original first sequencing data, the sequence quality control is used to filter, prune and evaluate the original first sequencing data, so as to obtain the processed first sequencing data, wherein the sequence quality control can also be used as an optional step; next, performing sequence alignment on the processed first sequencing data, the sequence alignment is used to align the processed first sequencing data with the reference gene sequence, so as to obtain the first alignment data; based on the candidate sites screened out from each gene site and the first alignment data, the first MSA data of the first somatic cell of the individual is obtained.
[0159] In some embodiments, after aligning the original sequencing data of the first somatic cell of the individual with the reference gene sequence, the first alignment data is obtained, and the first alignment data contains the base information and sequencing information corresponding to each gene locus. These first alignment data can be simply divided into: unmutated region, noise region, and mutated region. For the unmutated region, this part of the gene sequence is exactly the same as the reference gene sequence, and its base information and sequencing information are redundant. For the noise region, this part of the gene sequence has a small amount of base changes, which is caused by the sequencing system error and the comparison error, and its comparison quality value is usually relatively low. Then in the embodiment of the present application, the candidate site is determined as follows: in the first alignment data, when there is a base change in the column data corresponding to the gene locus, and the minor allele frequency of the gene locus is greater than the threshold, the gene locus is determined as a candidate site. The threshold can be set according to actual technical needs.
[0160] In some embodiments, the first MSA data of the first somatic cell of the individual includes: the first sequence MSA data (Base MSA) and the first insertion MSA data (Insertion MSA) of the candidate site. The first sequence MSA data is used to characterize the base change of the candidate site, that is, the first sequence MSA data indicates the specific base type, whether there is a deletion, and whether it is not detected at the candidate site. For example, the first somatic cell is a normal cell, and the first insertion MSA data is used to characterize the base change of the candidate site. Figure 7 For the first somatic cell, the first sequence MSA data includes: letters A, G, C, T, U, and the symbol "." or "-". The letters A, G, C, T, and U represent the specific base types of the candidate sites, the symbol "-" indicates that the candidate site has a deletion, and the symbol "." indicates that the candidate site has not been detected and is a GAP. The first insertion MSA data is used to characterize the base insertion situation at the candidate site, that is, when there is no insertion at the candidate site, or, when there is an insertion variation at the candidate site, the insertion base type of the base inserted at the candidate site. Reference Figure 8For the first somatic cell, the first insertion MSA data includes: letters A, G, C, T, U or the symbol ".". The letters A, G, C, T, U represent the insertion base types of the candidate site, and the symbol "." represents that there is no insertion in the candidate site.
[0161] The second MSA data of the second somatic cell of the individual may be generated by: performing base calling on the original sequencing signal, the base calling is used to convert the sequencing signal generated by the sequencing device into the original second sequencing data, and obtain the original second sequencing data; performing sequence quality control on the original second sequencing data, the sequence quality control is used to filter, prune and evaluate the original second sequencing data, and obtain the processed second sequencing data, wherein the sequence quality control can also be used as an optional step; next, performing sequence alignment on the processed second sequencing data, the sequence alignment is used to align the processed second sequencing data with the reference gene sequence, and obtain the second alignment data; based on the candidate site and the second alignment data, the second MSA data of the second somatic cell of the individual is obtained. The candidate sites corresponding to the first somatic cell and the second somatic cell are the same.
[0162] In some embodiments, the second MSA data of the second somatic cell of the individual includes: the second sequence MSA data (Base MSA) of the candidate site and the second insertion MSA data (Insertion MSA). The second sequence MSA data is used to characterize the base change of the candidate site, that is, the second sequence MSA data indicates the specific base type, whether there is a deletion, and whether it is not detected at the candidate site. Fig. 9 For the second somatic cell, the second sequence MSA data includes: letters A, G, C, T, U, and the symbol "." or "-". The letters A, G, C, T, and U represent the specific base types of the candidate sites, the symbol "-" indicates that the candidate site has a deletion, and the symbol "." indicates that the candidate site has not been detected and is a GAP. The second insertion MSA data is used to characterize the base insertion situation at the candidate site, that is, when there is no insertion at the candidate site, or, when there is an insertion variation at the candidate site, the insertion base type of the base inserted at the candidate site. Reference Fig.10 For the second somatic cell, the second insertion MSA data includes: letters A, G, C, T, U or the symbol ".". The letters A, G, C, T, U represent the insertion base type of the candidate site, and the symbol "." represents that there is no insertion at the candidate site.
[0163] Step 240, combining the reference gene sequence, the first MSA data and the second MSA data to obtain the MSA data of the individual.
[0164] Exemplarily, the computer device sequentially combines the reference gene sequence, the first MSA data, and the second MSA data to obtain the MSA data of the individual. The MSA data of the individual are, from top to bottom, the reference gene sequence, the first MSA data, and the second MSA data. The MSA data of the individual in this embodiment also includes the reference gene sequence, which is located in the first line of the MSA data as the first line gene sequence of the MSA data. The reference gene sequence can use HG38 and be truncated to a preset length, which can be 1024BP.
[0165] Step 260, encoding the encoding features of the MSA data; and extracting the MSA features corresponding to the encoding features.
[0166] Exemplarily, the computer device encodes the coding features of the MSA data, and extracts the MSA features corresponding to the coding features. The coding features are used to characterize the base information and sequencing information of the MSA data of the individual. The MSA features integrate the base information and sequencing information of the MSA data of the individual, and can characterize the MSA data of the individual from different information dimensions.
[0167] In some embodiments, the first MSA data includes base information and sequencing information of the candidate sites of the first somatic cell. The base information includes: at least one of the base changes in the first sequence MSA data (Base MSA), the base insertions in the first insertion MSA data (Insertion MSA), and the mapping quality value (MappingQuality) of each base in the first MSA data; the sequencing information includes: at least one of the base quality value (BaseQuality) at the time of base calling in the first MSA data, and the positive and negative strand information (Strand Info) of each sequencing fragment (reads) of the gene sequence at the time of gene sequencing. The positive and negative strand information includes: the sequencing fragment is located in the positive strand (Sense Strand) or the negative strand (Antisense Strand). In one implementation, the first sequence MSA data, the first insertion MSA data, the mapping quality value of each base, and the positive and negative strand information can be obtained by the comparison software after comparing the reference gene sequence with the first sequencing data of the individual, and provided by the comparison software, and the base quality value at the time of base calling is provided by the sequencing device.
[0168] In some embodiments, the second MSA data includes base information and sequencing information of the candidate sites of the second somatic cell, the base information includes: at least one of the base changes in the second sequence MSA data (Base MSA), the base insertions in the second insertion MSA data (Insertion MSA), and the mapping quality value (MappingQuality) of each base in the second MSA data; the sequencing information includes: at least one of the base quality value (BaseQuality) when the base is called in the second MSA data, and the positive and negative strand information (Strand Info) of each sequencing fragment (reads) of the gene sequence when the gene is sequenced. The positive and negative strand information includes: the sequencing fragment is located in the positive strand (Sense Strand) or the negative strand (Antisense Strand). In one implementation, the second sequence MSA data, the second insertion MSA data, the mapping quality value of each base, and the positive and negative strand information can be obtained by the alignment software after the reference gene sequence is aligned with the second sequencing data of the individual, and provided by the alignment software, and the base quality value when the base is called is provided by the sequencing device.
[0169] In some optional implementations, the encoding method includes one-hot encoding. The reference gene sequence, the first MSA data, and the second MSA data in the individual's MSA data are encoded and concatenated by one-hot encoding to obtain encoding features. The encoding features can also be further subjected to feature extraction to obtain MSA features.
[0170] In some embodiments, the computer device stores a somatic variation detection model, and the steps of encoding and extracting are implemented based on the somatic variation detection model. After the individual MSA data is obtained by combination, the individual MSA data is input into the somatic variation detection model, and based on the first encoding layer, the encoding features of the MSA data are encoded, and, based on the base model layer, the MSA features corresponding to the encoding features are extracted.
[0171] Step 280 , classify the MSA features to obtain somatic variation detection results of the first somatic cell and the second somatic cell relative to the reference gene sequence.
[0172] In this embodiment, since the reference gene sequence is a standard version of the gene sequence of an individual, it is based on the integration of gene sequencing and analysis performed on multiple individuals. By comparing the gene sequences of the first somatic cell and the second somatic cell of the individual with the reference gene sequence, the somatic variation of the first somatic cell and the second somatic cell can be identified. The computer device classifies the MSA features and obtains the somatic variation detection results of the first somatic cell and the second somatic cell relative to the reference gene sequence.
[0173] In some embodiments, the computer device stores a somatic variation detection model, and the classification step is implemented based on the somatic variation detection model. Based on the classifier, the MSA features are classified to obtain the somatic variation detection results of the first somatic cell and the second somatic cell relative to the reference gene sequence.
[0174] In summary, the somatic cell variation detection method provided in the embodiment of the present application is that the computer device obtains the reference gene sequence, the first MSA data of the first somatic cell of the individual, and the second MSA data of the second somatic cell of the individual; combines the reference gene sequence, the first MSA data and the second MSA data to obtain the MSA data of the individual; encodes the coding features of the MSA data; and extracts the MSA features corresponding to the coding features; classifies the MSA features to obtain the somatic cell variation detection results of the first somatic cell and the second somatic cell relative to the reference gene sequence. Accordingly, the reference gene sequence and the MSA data of different somatic cells from the same individual are combined to obtain the MSA data of the individual, so as to achieve the full characterization of the MSA data of the individual. The MSA features of the MSA data are obtained by extracting the features twice, and the base information and sequencing information of the reference gene sequence and the MSA data of different somatic cells can be integrated. By classifying the MSA features, the MSA data of different somatic cells of the individual can be fully utilized to improve the accuracy of the somatic cell variation detection results. In addition, the MSA data of the individual contains the relevant information of the candidate sites in the gene loci, which can reduce redundant information, reduce the amount of calculation of invalid areas, and improve data processing efficiency.
[0175] In some embodiments, step 260 extracts the MSA feature corresponding to the coding feature, which is implemented as step 262:
[0176] Step 262, perform self-attention calculation on the encoded feature to obtain the MSA feature.
[0177] The self-attention calculation is used to capture and learn the key parts of the rows and columns of the reference gene sequence, the first somatic cell, and the second somatic cell in the MSA data of the individual. Exemplarily, the computer device performs self-attention calculation on the encoding feature to obtain the MSA feature.
[0178] The method of this embodiment obtains MSA features based on the attention mechanism, which can improve the accuracy of MSA features and is beneficial to improving the accuracy of somatic variation detection results.
[0179] Specifically, step 262 is implemented as step 2621, step 2622, and step 2623:
[0180] Step 2621, perform column attention calculation on the encoded features to obtain column attention features;
[0181] Step 2622, performing pooling on the column attention features in the column direction to obtain column pooling features;
[0182] Step 2623, perform row attention calculation on the column pooling features to obtain MSA features.
[0183] Self-attention calculation includes: column attention calculation and row attention calculation. Since the rows of MSA data represent gene sequences, a gene sequence includes one or more sequencing fragments (reads), and the columns represent gene loci, the gene loci in the same column have the same corresponding position on the chromosome. Column attention calculation is used to learn the relevant information of bases aligned at the same position, and row attention calculation is used to learn the relevant information of the relationship between one or more sequencing fragments of each gene sequence. The amount of information in the column direction of MSA data is low, and the amount of information in the row direction is high.
[0184] Exemplarily, the computer device performs column attention calculation on the encoded features to obtain column attention features; performs pooling on the column attention features in the column direction, and the pooling method includes at least one of average pooling, maximum pooling, and random pooling. This embodiment adopts average pooling, also known as column pooling, to obtain column pooling features; performs row attention calculation on the column pooling features to obtain MSA features. In this way, the MSA feature can fully characterize the individual MSA data from two dimensions, row and column.
[0185] The method of this embodiment fully extracts the information in the encoded features from the dimensions of rows and columns, and fully represents the MSA data based on the attention mechanism, which can improve the accuracy of the MSA features and is conducive to improving the accuracy of the somatic variation detection results.
[0186] In some embodiments, step 280 is implemented as step 282:
[0187] Step 282, performing classification based on the MSA feature to obtain somatic variation detection results of the first somatic cell and the second somatic cell relative to the reference gene sequence; wherein the somatic variation detection results include mutation types and probabilities corresponding to the mutation types, and the mutation types include at least one of noise mutations, system mutations, normal cell mutations only, and germline mutations.
[0188] Exemplarily, the computer device performs classification based on the MSA feature to obtain somatic variation detection results of the first somatic cell and the second somatic cell relative to the reference gene sequence. The somatic variation detection results include mutation types and probabilities corresponding to mutation types, and mutation types include: artifact, somatic, normal-only, and germline.
[0189] Noise mutation (artifact) also includes the situation where no mutation occurs, which means that neither the first somatic cell nor the second somatic cell mutates. Systemic mutation (somatic) means that the first somatic cell does not mutate, but the second somatic cell mutates. Normal-only mutation (normal-only) means that the first somatic cell mutates, but the second somatic cell does not mutate. Germline mutation (germline) means that both the first somatic cell and the second somatic cell mutate. Taking the example that the first somatic cell is a normal cell and the second somatic cell is a cancer cell, noise mutation (artifact) means that neither the normal cell nor the cancer cell mutates. Systemic mutation (somatic) means that the normal cell does not mutate, but the cancer cell mutates. Normal-only mutation (normal-only) means that the normal cell mutates, but the cancer cell does not mutate. Germline mutation (germline) means that both normal cells and cancer cells mutate.
[0190] In the method of this embodiment, the somatic cell variation detection result may include the mutation type and the probability corresponding to the mutation type, which can fully represent the mutation status of the first somatic cell and the second somatic cell. The somatic cell variation detection result is more accurate and is also beneficial for subsequent disease detection, cancer screening, etc.
[0191] Specifically, step 282 is implemented as step 2821 and step 2822:
[0192] Step 2821, extracting the first row of MSA features in the MSA features, where the first row of MSA features is used to characterize the global features corresponding to the candidate loci in the gene loci of the MSA data;
[0193] Step 2822, classify the first row of MSA features to obtain somatic variation detection results of the first somatic cell and the second somatic cell relative to the reference gene sequence.
[0194] In some embodiments, the first line of gene sequences in the MSA data of the individual includes a reference gene sequence. The computer device extracts the first line of MSA features in the MSA features, and the first line of MSA features is used to characterize the global features corresponding to the candidate sites in the gene sites of the MSA data; the first line of MSA features is classified to obtain the somatic variation detection results of the first somatic cell and the second somatic cell relative to the reference gene sequence.
[0195] In this embodiment, the feature corresponding to the first gene sequence in the MSA data is selected to perform classification. This feature can represent global information, which is beneficial to improving the accuracy of somatic variation detection results.
[0196] In some embodiments, step 220 of obtaining first MSA data of a first somatic cell of an individual is implemented as steps 221, 222, 223, and 224:
[0197] Step 221, obtaining first sequencing data of a first somatic cell;
[0198] Step 222, aligning the first sequencing data with the reference gene sequence to obtain first aligned data;
[0199] Step 223, determining candidate sites in the first alignment data that meet the screening conditions;
[0200] Step 224, obtaining first MSA data based on the first alignment data and the candidate sites.
[0201] Exemplarily, a computer device obtains an original sequencing signal of a first somatic cell of an individual, the sequencing signal is obtained by a sequencing device performing gene sequencing on the first somatic cell of the individual, performs base calling on the original sequencing signal, and obtains first sequencing data of the individual. A reference gene sequence is obtained; the first sequencing data is aligned with the reference gene sequence to obtain first alignment data; candidate sites that meet a screening condition in the first alignment data are determined; based on the first alignment data and the candidate sites, the first alignment data is converted into first MSA data to obtain first MSA data.
[0202] Candidate sites that meet the screening conditions can also be understood as suspicious sites, which are gene sites that may have mutations in the first somatic cell. During somatic cell variation detection, the first MSA data of the first somatic cell of the individual input into the somatic cell variation detection model, and the second MSA data of the second somatic cell of the individual, respectively contain only the base information and sequencing information of the candidate sites in the gene site, which can reduce the amount of calculation of invalid areas. It should also be noted that the candidate sites corresponding to the first somatic cell and the second somatic cell are the same, which can ensure the alignment of the reference gene sequence, the first MSA data and the second MSA data.
[0203] In some embodiments, the candidate site is determined as follows: in the first alignment data, when there is a base change in the column data corresponding to the gene site and the minor allele frequency of the gene site is greater than a threshold, the gene site is determined as a candidate site. The threshold can be set according to actual technical needs.
[0204] In the method of this embodiment, the first sequencing data of the first somatic cell of the individual is converted into the first MSA data. The first MSA data can only retain the base information and sequencing information of the candidate site, which can reduce the amount of calculation of invalid areas, and is conducive to subsequently improving the processing efficiency of the individual's MSA data and increasing the speed of somatic cell variation detection.
[0205] In some embodiments, the first MSA data of the first somatic cell includes: the first sequence MSA data (Base MSA) and the first insertion MSA data (Insertion MSA) of the candidate site. The first sequence MSA data is used to characterize the base variation of the candidate site, that is, the first sequence MSA data indicates the specific base type, whether there is a deletion, and whether it is not detected at the candidate site. The first insertion MSA data is used to characterize the base insertion at the candidate site, that is, the candidate site does not have an insertion, or, in the case of an insertion variation at the candidate site, the insertion base type of the base inserted at the candidate site.
[0206] Specifically, step 224 is implemented as step 2241, step 2242, and step 2243:
[0207] Step 2241, taking each candidate site of the candidate sites as the center of the window, extracting the gene sequence in the window in the first alignment data, each sequencing fragment in the gene sequence corresponds to at least one of base insertion information, base deletion information and base change information;
[0208] Step 2242, based on the base deletion information and base change information corresponding to each sequencing fragment in the gene sequence, determine the first sequence MSA data of each candidate site, based on the base insertion information corresponding to each sequencing fragment in the gene sequence, determine the first insertion MSA data of each candidate site;
[0209] Step 2243, combining the first sequence MSA data and the first insertion MSA data corresponding to each candidate site of the candidate site to obtain the first MSA data.
[0210] The window size is preset, and the window size is the same for different candidate sites. The window depth is preset, and the window depth is the same for different candidate sites. The window is expressed as [start, end], and the window size is expressed as window = end-start. The candidate site is the center of the window, and the candidate site is expressed as center = (start + end) / 2. The first alignment data can be a BAM file, and the first alignment data includes a gene sequence, each gene sequence includes one or more sequencing fragments (reads), and each sequencing fragment is stored in the BAM file in Cigar String format. Cigar String includes a series of operation codes, and each operation code is used to describe the detailed information of base insertion, base deletion, and base change when the sequencing fragment is aligned to the reference feature sequence.
[0211] As an example, for the first somatic cell, the first sequence MSA data of a candidate site can be a matrix, represented as: M base ∈N k×l , k represents the number of sequencing fragments (reads) located in the window, l represents the window size, M base The MSA data of a candidate site can be a matrix, represented by M. ins ∈N k×l , k represents the number of sequencing fragments (reads) located in the window, l represents the window size, M ins The letters A, G, C, T, U or the symbol "." are included. The letters A, G, C, T, and U represent the insertion base type of the candidate site, and the symbol "." indicates that there is no insertion at the candidate site. In the specific example, the window size is 129 and the maximum depth is 64.
[0212] In some embodiments, after obtaining the first sequence MSA data and the first insertion MSA data corresponding to each candidate site, the sequencing fragments (reads) in the first sequence MSA data and the first insertion MSA data are converted row by row into corresponding base encoding values (IDs) according to the sorting in the first alignment data. The IDs may be in digital form. Next, the first sequence MSA data and the first insertion MSA data corresponding to each candidate site of the candidate site are combined to obtain the first MSA data.
[0213] This embodiment provides a method for determining the first MSA data of the first somatic cell. The first MSA data includes the first sequence MSA data and the first insertion MSA data, so that the insertion, deletion, and change of bases at each candidate site can be retained to improve the accuracy of the somatic cell variation detection result, and the individual MSA data can be simplified to avoid excessive memory usage during data processing and improve data processing efficiency.
[0214] In some embodiments, step 220 of obtaining second MSA data of a second somatic cell of an individual is implemented as steps 225, 226, and 227:
[0215] Step 225, obtaining second sequencing data of a second somatic cell;
[0216] Step 226, aligning the second sequencing data with the reference gene sequence to obtain second aligned data;
[0217] Step 227, obtaining second MSA data based on the second alignment data and the candidate sites.
[0218] Exemplarily, a computer device obtains an original sequencing signal of a second somatic cell of an individual, the sequencing signal is obtained by a sequencing device performing gene sequencing on the second somatic cell of the individual, performs base calling on the original sequencing signal, and obtains second sequencing data of the individual. Obtain a reference gene sequence; align the second sequencing data with the reference gene sequence to obtain second alignment data; based on the second alignment data and the candidate site, convert the second alignment data into second MSA data to obtain second MSA data. The candidate sites corresponding to the first somatic cell and the second somatic cell are the same.
[0219] In the method of this embodiment, the second sequencing data of the second somatic cell of the individual is converted into the second MSA data, and only the base information and sequencing information of the candidate site can be retained in the second MSA data, which can reduce the amount of calculation of invalid regions, and is conducive to improving the processing efficiency of the individual's MSA data in the future, and improving the speed of somatic cell variation detection. Since the candidate sites corresponding to the first somatic cell and the second somatic cell are the same, the alignment of the reference gene sequence, the first MSA data, and the second MSA data in the individual's MSA data can also be ensured.
[0220] In some embodiments, the second MSA data of the second somatic cell includes: second sequence MSA data (Base MSA) and second insertion MSA data (Insertion MSA) of the candidate site. The second sequence MSA data is used to characterize the base variation of the candidate site, that is, the second sequence MSA data indicates the specific base type, whether there is a deletion, and whether it is not detected at the candidate site. The second insertion MSA data is used to characterize the base insertion at the candidate site, that is, the candidate site does not have an insertion, or, in the case of an insertion variation at the candidate site, the insertion base type of the base inserted at the candidate site.
[0221] Specifically, step 227 is implemented as step 2271, step 2272, and step 2273:
[0222] Step 2271, taking each candidate site of the candidate sites as the center of the window, extracting the gene sequence in the window in the second alignment data, wherein each sequencing fragment in the gene sequence corresponds to at least one of base insertion information, base deletion information and base change information;
[0223] Step 2272, based on the base deletion information and base change information corresponding to each sequencing fragment in the gene sequence, determine the second sequence MSA data of each candidate site, based on the base insertion information corresponding to each sequencing fragment in the gene sequence, determine the second insertion MSA data of each candidate site;
[0224] Step 2273, combining the second sequence MSA data and the second insertion MSA data corresponding to each candidate site of the candidate site to obtain the second MSA data.
[0225] The window size is preset, and the window size is the same for different candidate sites. The window depth is preset, and the window depth is the same for different candidate sites. The window is expressed as [start, end], and the window size is expressed as window = end-start. The candidate site is the center of the window, and the candidate site is expressed as center = (start + end) / 2. The second alignment data can be a BAM file, and the second alignment data includes gene sequences, each gene sequence includes one or more sequencing fragments (reads), and each sequencing fragment is stored in the BAM file in Cigar String format. Cigar String includes a series of operation codes, and each operation code is used to describe the detailed information of base insertion, base deletion, and base change when the sequencing fragment is aligned to the reference feature sequence.
[0226] As an example, for the second somatic cell, the second sequence MSA data of a candidate site can be a matrix, represented as: M base ∈N k×l, k represents the number of sequencing fragments (reads) located in the window, l represents the window size, M base The MSA data of a candidate site can be a matrix, represented by M. ins ∈N k×l , k represents the number of sequencing fragments (reads) located in the window, l represents the window size, M ins The letters A, G, C, T, U or the symbol "." are included. The letters A, G, C, T, and U represent the insertion base type of the candidate site, and the symbol "." indicates that there is no insertion at the candidate site. In the specific example, the window size is 129 and the maximum depth is 64.
[0227] In some embodiments, after obtaining the second sequence MSA data and the second insertion MSA data corresponding to each candidate site, the sequencing fragments (reads) in the second sequence MSA data and the second insertion MSA data are converted row by row into corresponding base encoding values (IDs) according to the sorting in the second alignment data. The IDs may be in digital form. Next, the second sequence MSA data and the second insertion MSA data corresponding to each candidate site of the candidate site are combined to obtain the second MSA data.
[0228] This embodiment provides a method for determining the second MSA data of the second somatic cell. The second MSA data includes the second sequence MSA data and the second insertion MSA data, so that the insertion, deletion, and change of bases at each candidate site can be retained to improve the accuracy of the somatic cell variation detection results, and the individual MSA data can be simplified to avoid excessive memory usage during data processing and improve data processing efficiency.
[0229] Part III: Training Phase
[0230] (1) Training phase of somatic variant detection model
[0231] In some embodiments, a somatic variation detection model for performing a somatic variation detection method includes: a first encoding layer (Embedding), a base model layer (USM Core), and a classifier (Classifier); the first encoding layer is cascaded with the base model layer, and the base model layer is cascaded with the classifier;
[0232] Among them, the first encoding layer is used to encode the encoding features of MSA data; the basic model layer is used to extract the MSA features corresponding to the encoding features; the classifier is used to classify the MSA features to obtain the somatic variation detection results of the first somatic cell and the second somatic cell relative to the reference gene sequence.
[0233] In some embodiments, the base model layer in the somatic variation detection model includes: a feature extraction unit (USM Block) stacked in the pre-trained base model. The base model is a unified sequence model (USM) for extracting MSA features.
[0234] It should also be noted that, since the basic model is a pre-trained model, the basic model has been trained before the somatic variation detection model is trained, and the N feature extraction units stacked in the pre-trained basic model can be directly applied to the somatic variation detection model, where N is greater than or equal to 1. Optionally, the training stage of the somatic variation detection model can also be called fine-tuning training, and the training stage of the basic model can also be called pre-training.
[0235] In some embodiments, the training phase of the somatic variant detection model is performed by a computer device, which may be Figure 2 The terminal 120 and / or the server 140 shown, before step 220, further includes at least some of steps 310, 320, 330, 340, 350, and 360:
[0236] Step 310 , obtaining a reference gene sequence, a first sample MSA data of a sample normal cell of a first sample individual, and a second sample MSA data of a sample mutant cell of the first sample individual.
[0237] The first sample individual in the training phase of the somatic cell variation detection model is consistent with the type of the individual in the application phase. Generally, the first sample individual is also a human individual. The first sample MSA data of the sample normal cells of the first sample individual and the second sample MSA data of the sample variant cells of the first sample individual are real paired data and / or synthetic paired data, which can be selected according to the required data volume.
[0238] In some embodiments, the first sample MSA data of the sample normal cell and the second sample MSA data of the sample variant cell are real paired data. For example, the sample normal cell is a somatic cell of a normal tissue in the first sample individual, and the sample variant cell is a somatic cell of a variant tissue of the first sample individual, for example, a cancer cell or a tumor cell. The first sample MSA data is the sample sequencing data obtained by sequencing the gene of the sample normal cell, and is obtained by comparing it with the reference gene sequence. The second sample MSA data is the sample sequencing data obtained by sequencing the gene of the sample variant cell, and is obtained by comparing it with the reference gene sequence.
[0239] In other embodiments, the first sample MSA data of the sample normal cell and the second sample MSA data of the sample variant cell are synthetic paired data. For example, the sample normal cell is a somatic cell of a normal tissue in the first sample individual, and the first sample MSA data is sample sequencing data obtained by sequencing the gene of the sample normal cell, and is obtained after alignment with the reference gene sequence. The second sample MSA data of the sample variant cell is obtained by performing random changes on the bases of a part of the sample gene sites in the first sample MSA data of the sample normal cell, for example, performing at least one of base deletion, change to another type of base, and insertion of any type of base on a part of the sample gene sites.
[0240] In some embodiments, the first sample MSA data of the sample normal cells include the sample base information and sample sequencing information of the sample candidate sites in the sample gene loci. The second sample MSA data of the sample variant cells include the sample base information and sample sequencing information of the sample candidate sites in the sample gene loci. Here, the sample candidate sites corresponding to the sample normal cells and the sample variant cells are the same. The sample candidate sites are some sample gene sites that meet the screening conditions in the various sample gene loci of the first sample individual, which can also be understood as sample suspicious sites, which are sample gene sites that may have mutations. In the training stage of the somatic cell variation detection model, the first sample MSA data of the sample normal cells of the first sample individual and the second sample MSA data of the sample variant cells only include the sample base information and sample sequencing information of the sample candidate sites in the sample gene loci, which can reduce the amount of calculation of invalid areas and improve the training speed of the somatic cell variation detection model.
[0241] In some embodiments, a sequencing device is used to perform gene sequencing on a sample normal cell of a first sample individual to obtain a sample sequencing signal. The sample sequencing signal is an electrical signal or an optical signal, and the sample sequencing signal needs to be converted into an analyzable gene sequence, i.e., first sample sequencing data, and then the first sample MSA data of the sample normal cell of the first sample individual is generated based on the first sample sequencing data. Similarly, a sequencing device is used to perform gene sequencing on a sample variant cell of the same first sample individual to obtain a sample sequencing signal. The sample sequencing signal is an electrical signal or an optical signal, and the sample sequencing signal needs to be converted into an analyzable gene sequence, i.e., second sample sequencing data, and then the second sample MSA data of the sample variant cell of the first sample individual is generated based on the second sample sequencing data.
[0242] The first sample MSA data of the sample normal cells of the first sample individual can be generated in a manner as follows: performing base calling on the original sample sequencing signal, the base calling is used to convert the sample sequencing signal generated by the sequencing device into the original first sample sequencing data, so as to obtain the original first sample sequencing data; performing sequence quality control on the original first sample sequencing data, the sequence quality control is used to filter, prune and evaluate the original first sample sequencing data, so as to obtain the processed first sample sequencing data, wherein the sequence quality control can also be used as an optional step; next, performing sequence alignment on the processed first sample sequencing data, the sequence alignment is used to align the processed first sample sequencing data with the reference gene sequence, so as to obtain the first sample alignment data; based on the sample candidate sites screened out from each sample gene site and the first sample alignment data, the first sample MSA data of the sample normal cells of the first sample individual is obtained.
[0243] The second sample MSA data of the sample variant cell of the first sample individual may be generated by: performing base calling on the original sample sequencing signal, the base calling is used to convert the sample sequencing signal generated by the sequencing device into the original second sample sequencing data, and obtain the original second sample sequencing data; performing sequence quality control on the original second sample sequencing data, the sequence quality control is used to filter, prune and evaluate the original second sample sequencing data, and obtain the processed second sample sequencing data, wherein the sequence quality control can also be used as an optional step; next, performing sequence alignment on the processed second sample sequencing data, the sequence alignment is used to align the processed second sample sequencing data with the reference gene sequence, and obtain the second sample alignment data; based on the sample candidate site and the second sample alignment data, the second sample MSA data of the sample variant cell of the first sample individual is obtained. Wherein, the sample candidate sites corresponding to the sample normal cells and the sample variant cells are the same.
[0244] Step 320, combining the reference gene sequence, the first sample MSA data and the second sample MSA data to obtain the sample MSA data of the first sample individual, wherein the sample MSA data includes the sample mutation type.
[0245] Exemplarily, the computer device sequentially combines the reference gene sequence, the first sample MSA data, and the second sample MSA data to obtain the sample MSA data of the first sample individual. The sample MSA data of the first sample individual are, from top to bottom, the reference gene sequence, the first sample MSA data, and the second sample MSA data. Then, the sample MSA data of the first sample individual in this embodiment also includes the reference gene sequence, which is located in the first row of the sample MSA data as the first row gene sequence of the sample MSA data. The reference gene sequence can use HG38 and be truncated to a preset length, which can be 1024BP.
[0246] Step 330 , based on the first coding layer, encode the sample coding features of the sample MSA data.
[0247] Step 340: extracting sample MSA features corresponding to sample coding features based on the basic model layer.
[0248] Exemplarily, the computer device encodes the sample coding features of the sample MSA data based on the first coding layer (Embedding), and extracts the sample MSA features corresponding to the sample coding features based on the basic model layer (USM Core). The sample coding features are used to characterize the sample base information and sample sequencing information of the sample MSA data of the first sample individual. The sample MSA features integrate the sample base information and sample sequencing information of the sample MSA data of the first sample individual, and can characterize the sample MSA data of the first sample individual from different information dimensions.
[0249] In some embodiments, the first sample MSA data includes sample base information and sample sequencing information of sample candidate sites of sample normal cells. The sample base information includes: at least one of the base changes in the first sample sequence MSA data (Base MSA), the base insertions in the first sample insertion MSA data (Insertion MSA), and the mapping quality value (Mapping Quality) of each base in the first sample MSA data; the sample sequencing information includes: at least one of the base quality value (Base Quality) when the base is called in the first sample MSA data, and the positive and negative strand information (Strand Info) of each sample sequencing fragment (reads) of the sample gene sequence during gene sequencing. The positive and negative strand information includes: the sample sequencing fragment is located in the positive strand (Sense Strand) or the negative strand (Antisense Strand). In one implementation, the first sample sequence MSA data, the first sample insertion MSA data, the alignment quality value of each base, and the positive and negative chain information can be obtained by the alignment software after aligning the reference gene sequence with the first sample sequencing data of the first sample individual, and provided by the alignment software. The base quality value during base calling is provided by the sequencing device.
[0250] In some embodiments, the second sample MSA data includes sample base information and sample sequencing information of sample candidate sites of sample variant cells, the sample base information includes: base changes in the second sample sequence MSA data (Base MSA), base insertions in the second sample insertion MSA data (Insertion MSA), and at least one of the mapping quality values (Mapping Quality) of each base in the second sample MSA data; the sample sequencing information includes: base quality values (Base Quality) when bases are called in the second sample MSA data, and at least one of the positive and negative strand information (Strand Info) of each sample sequencing fragment (reads) of the sample gene sequence during gene sequencing. The positive and negative strand information includes: the sample sequencing fragment is located in the positive strand (Sense Strand) or the negative strand (Antisense Strand). In one implementation, the second sample sequence MSA data, the second sample insertion MSA data, the alignment quality value of each base, and the positive and negative chain information can be obtained by the alignment software after aligning the reference gene sequence with the second sample sequencing data of the first sample individual, and provided by the alignment software. The base quality value during base calling is provided by the sequencing device.
[0251] Step 350: Based on the classifier, classify the sample MSA features to obtain the predicted mutation type.
[0252] The predicted mutation type is prediction information, which refers to the predicted mutation type of the normal cells and the mutant cells of the sample relative to the reference gene sequence. Exemplarily, the computer device classifies the MSA features of the sample based on the classifier to obtain the predicted mutation type.
[0253] The sample mutation type is label information. Optionally, the sample mutation type includes: noise mutation (artifact), system mutation (somatic), normal cell mutation (normal-only), germline mutation (germline). Specifically, noise mutation (artifact) means that neither the sample normal cells nor the sample variant cells have mutated. System mutation (somatic) means that the sample normal cells have not mutated, and the sample variant cells have mutated. Only normal cell mutation (normal-only) means that the sample normal cells have mutated, and the sample variant cells have not mutated. Germline mutation (germline) means that both the sample normal cells and the sample variant cells have mutated.
[0254] Step 360 , adjusting the model parameters of the somatic variation detection model with the training goal of reducing the difference between the predicted mutation type and the sample mutation type.
[0255] Exemplarily, the computer device adjusts the model parameters of the somatic cell variation detection model with the training goal of reducing the difference between the predicted mutation type and the sample mutation type. In one implementation, it is not necessary to adjust the model parameters of the base model layer in the somatic cell variation detection model, and fine-tune the model parameters of the first encoding layer and the classifier.
[0256] This embodiment provides a training step for a somatic variation detection model to provide support for the training of the somatic variation detection model. The somatic variation detection model uses the stacked feature extraction layer of the pre-trained basic model as the basic model layer to extract the sample MSA features of the first sample individual. In this way, the somatic variation detection model only needs to be fine-tuned for training, which can improve both the training speed and the model accuracy.
[0257] In some embodiments, step 340 is implemented as step 342:
[0258] Step 342: Based on the basic model layer, perform self-attention calculation on the sample encoding features to obtain the sample MSA features.
[0259] The self-attention calculation is used to capture and learn the key parts in the rows and columns of the reference gene sequence, the sample normal cell, and the sample mutant cell in the sample MSA data of the first sample individual. Exemplarily, the computer device performs self-attention calculation on the sample encoding feature based on the basic model layer to obtain the sample MSA feature.
[0260] In one possible implementation, since the basic model layer is N feature extraction units stacked in the basic model, the structure and calculation operations of each of the N feature extraction units are consistent. It can be based on each of the N feature extraction units, continue to perform self-attention calculation on the output result of the previous feature extraction unit, and use the output result of the Nth feature extraction unit as the sample MSA feature.
[0261] Specifically, for the first feature extraction unit among the N feature extraction units, based on the first feature extraction unit, perform self-attention calculation on the sample coding feature to obtain the first output result, for the i-th feature extraction unit among the N feature extraction units, based on the i-th feature extraction unit, perform self-attention calculation on the i-1-th output result to obtain the i-th output result, update i to i+1 and repeat the above steps until i equals N, and use the N-th output result as the sample MSA feature corresponding to the sample coding feature. Wherein, N is greater than or equal to 1, i is greater than or equal to 1, and i is less than or equal to N.
[0262] The method of this embodiment obtains the sample MSA features of the first sample individual based on the attention mechanism, which can improve the accuracy of the sample MSA features, so that the somatic variation detection model can fully learn the sample MSA data of the first sample individual, which is conducive to improving the model accuracy.
[0263] Specifically, step 342 is implemented as step 3421, step 3422, and step 3423:
[0264] Step 3421, based on the basic model layer, perform column attention calculation on the sample encoding feature to obtain the sample column attention feature;
[0265] Step 3422, performing pooling on the sample column attention features in the column direction to obtain sample column pooling features;
[0266] Step 3423, perform row attention calculation on the sample column pooling features to obtain the sample MSA features.
[0267] Self-attention calculation includes: column attention calculation and row attention calculation. Since the row of the sample MSA data of the first sample individual represents the sample gene sequence, a sample gene sequence includes one or more sample sequencing fragments (reads), and the column represents the sample gene loci, the sample gene loci in the same column have the same corresponding position on the chromosome. Column attention calculation is used to learn the relevant information of the bases aligned at the same position, and row attention calculation is used to learn the relevant information of the relationship between one or more sample sequencing fragments of each sample gene sequence. The sample MSA data of the first sample individual has a lower amount of information in the column direction and a higher amount of information in the row direction.
[0268] Exemplarily, based on the basic model layer, the computer device performs column attention calculation on the sample coding features to obtain sample column attention features; performs pooling on the sample column attention features in the column direction, and the pooling method includes at least one of average pooling, maximum pooling, and random pooling. This embodiment adopts average pooling, also known as column pooling, to obtain sample column pooling features; performs row attention calculation on the sample column pooling features to obtain sample MSA features. In this way, the sample MSA features can fully characterize the sample MSA data of the first sample individual from the two dimensions of row and column.
[0269] The method of this embodiment fully extracts the information in the sample encoding features from the row and column dimensions, and fully characterizes the sample MSA data of the first sample individual based on the attention mechanism, which can improve the accuracy of the sample MSA features corresponding to the first sample individual.
[0270] In some embodiments, step 360 is implemented as step 362 and step 364:
[0271] Step 362, determining the training loss based on the predicted mutation type and the sample mutation type;
[0272] Step 364 , adjusting the model parameters of the somatic variation detection model with the goal of reducing the training loss.
[0273] The training loss refers to the loss between the predicted mutation type corresponding to the sample MSA data of the first sample individual and the sample mutation type corresponding to the sample MSA data. Exemplarily, the computer device determines the training loss based on the predicted mutation type and the sample mutation type; and adjusts the model parameters of the somatic cell variation detection model with the goal of reducing the training loss.
[0274] This embodiment provides a method for determining the training loss of a somatic variation detection model. When the training loss is reduced as a goal, the model accuracy of the somatic variation detection model can be improved.
[0275] In some embodiments, the type of training loss of the somatic variation detection model can be at least one of: mean squared error (MSE), mean absolute error (MAE), and cross-entropy loss. In this embodiment, cross-entropy loss is used for classification problems. Specifically, step 362 is implemented as step 3621 and step 3622:
[0276] Step 3621, determining a cross entropy loss based on the predicted mutation type and the sample mutation type;
[0277] Step 3622, determine the cross entropy loss as the training loss.
[0278] Exemplarily, the computer device determines a cross entropy loss based on the predicted mutation type and the sample mutation type, and determines the cross entropy loss as the training loss. Thus, with the reduction of the training loss as the training goal, the model parameters of the somatic cell variation detection model are adjusted so that the predicted mutation type is close to the sample mutation type.
[0279] In this embodiment, the training loss is a cross entropy loss, so that the predicted mutation type predicted by the somatic variation detection model can be close to the sample mutation type, making the somatic variation detection result more accurate.
[0280] In some embodiments, step 310 of obtaining first sample MSA data of normal cells of a first sample individual is implemented as steps 311, 312, 313, and 314:
[0281] Step 311, obtaining first sample sequencing data of normal cells of the sample;
[0282] Step 312, aligning the first sample sequencing data with the reference gene sequence to obtain first sample alignment data;
[0283] Step 313, determining the sample candidate sites in the first sample alignment data that meet the screening conditions;
[0284] Step 314: Determine the first sample MSA data based on the first sample alignment data and the sample candidate sites.
[0285] The first sample sequencing data of the sample normal cells of the first sample individual may be obtained from a plurality of public sequencing platforms, for example, ONT, Illumina, PacBio sequencing platforms; or, may be obtained from a public nucleic acid sequence database, for example, GenBank, EMBL, RefSeq database; or, may be obtained by performing gene sequencing on the sample normal cells of the first sample individual.
[0286] Exemplarily, a computer device obtains an original sample sequencing signal of a sample normal cell of a first sample individual, the sample sequencing signal is obtained by a sequencing device performing gene sequencing on the sample normal cell of the first sample individual, performs base calling on the original sample sequencing signal, and obtains first sample sequencing data of the sample normal cell of the first sample individual. Obtain a reference gene sequence; align the first sample sequencing data with the reference gene sequence to obtain first sample alignment data; determine a sample candidate site that meets a screening condition in the first sample alignment data; based on the first sample alignment data and the sample candidate site, convert the first sample alignment data into first sample MSA data to obtain first sample MSA data.
[0287] The sample candidate sites that meet the screening conditions can also be understood as sample suspicious sites, which are sample gene sites that may have mutations in the sample normal cells. During the training stage of the somatic cell variation detection model, the first sample MSA data of the sample normal cells of the first sample individual input into the somatic cell variation detection model, and the second sample MSA data of the sample variant cells of the first sample individual, respectively contain only the sample base information and sample sequencing information of the sample candidate sites in the sample gene sites, which can reduce the amount of calculation of invalid areas. It should also be noted that the sample candidate sites corresponding to the sample normal cells and the sample variant cells are the same, which can ensure the alignment of the reference gene sequence, the first sample MSA data and the second sample MSA data.
[0288] In some embodiments, the sample candidate site is determined as follows: in the first sample alignment data, when there is a base change in the column data corresponding to the sample gene site and the minor allele frequency of the sample gene site is greater than a threshold, the sample gene site is determined as a sample candidate site. The threshold can be set according to actual technical needs.
[0289] In the method of this embodiment, the first sample sequencing data is converted into the first sample MSA data, in which only the sample base information and sample sequencing information of the sample candidate site can be retained, which can reduce the amount of calculation of invalid areas, is beneficial to improve the processing efficiency of the sample MSA data of the first sample individual, and improve the fine-tuning training speed.
[0290] In some embodiments, the first sample MSA data of the sample normal cells of the first sample individual includes: the first sample sequence MSA data (Base MSA) and the first sample insertion MSA data (Insertion MSA) of the sample candidate site. The first sample sequence MSA data is used to characterize the base changes of the sample candidate site, that is, the first sample sequence MSA data indicates the specific base type, whether there is a deletion, and whether it is not detected at the sample candidate site. The first sample insertion MSA data is used to characterize the base insertion of the sample candidate site, that is, the absence of an insertion at the sample candidate site, or, in the case of an insertion variation at the sample candidate site, the insertion base type of the base inserted at the sample candidate site.
[0291] Specifically, step 314 is implemented as step 3141, step 3142 and step 3143:
[0292] Step 3141, taking each sample candidate site of the sample candidate sites as the center of the window, extracting the sample gene sequence in the window in the first sample alignment data, each sample sequencing fragment in the sample gene sequence corresponds to at least one of base insertion information, base deletion information and base change information;
[0293] Step 3142, based on the base deletion information and base change information corresponding to each sample sequencing fragment in the sample gene sequence, determine the first sample sequence MSA data of each sample candidate site, based on the base insertion information corresponding to each sample sequencing fragment in the sample gene sequence, determine the first sample insertion MSA data of each sample candidate site;
[0294] Step 3413, combining the first sample sequence MSA data and the first sample insertion MSA data corresponding to each sample candidate site of the sample candidate site to obtain the first sample MSA data.
[0295] The window size is preset, and the window size is the same for different sample candidate sites. The window depth is preset, and the window depth is the same for different sample candidate sites. The window is expressed as [start, end], and the window size is expressed as window = end-start. The sample candidate site is the center of the window, and the sample candidate site is expressed as center = (start + end) / 2. The first sample alignment data can be a BAM file, and the first sample alignment data includes a sample gene sequence, each sample gene sequence includes one or more sample sequencing fragments (reads), and each sample sequencing fragment is stored in the BAM file in Cigar String format. Cigar String includes a series of operation codes, and each operation code is used to describe the detailed information of base insertion, base deletion, and base change when the sample sequencing fragment is aligned to the reference feature sequence.
[0296] Specifically, the computer device takes each sample candidate site of the sample candidate site as the center of the window, extracts the sample gene sequence in the window in the first sample alignment data, and each sample sequencing fragment in the sample gene sequence corresponds to at least one of base insertion information, base deletion information, and base change information. Based on the base deletion information and base change information corresponding to each sample sequencing fragment in the sample gene sequence, the first sample sequence MSA data of each sample candidate site is determined, and based on the base insertion information corresponding to each sample sequencing fragment in the sample gene sequence, the first sample insertion MSA data of each sample candidate site is determined. The first sample sequence MSA data and the first sample insertion MSA data corresponding to each sample candidate site of the sample candidate site are combined to obtain the first sample MSA data.
[0297] As an example, for a sample normal cell, the first sample sequence MSA data of a sample candidate site can be a matrix, represented as: M base ∈N k×l , k represents the number of sample sequencing fragments (reads) located in the window, l represents the window size, M base The MSA data includes: letters A, G, C, T, U, and symbols "." or "-". Letters A, G, C, T, and U represent specific base types of sample candidate sites, the symbol "-" indicates that the sample candidate site is deleted, and the symbol "." indicates that the sample candidate site is not detected and belongs to a GAP. The first sample insertion MSA data of a sample candidate site can be a matrix, represented as M ins ∈N k×l , k represents the number of sample sequencing fragments (reads) located in the window, l represents the window size, M ins The '.' includes: letters A, G, C, T, U or the symbol ".". Letters A, G, C, T, U represent the type of inserted bases at the sample candidate site, and the symbol "." indicates that there is no insertion at the sample candidate site. In the specific example, the window size is 129 and the maximum depth is 64.
[0298] In some embodiments, after obtaining the first sample sequence MSA data and the first sample insertion MSA data corresponding to each sample candidate site, the sample sequencing fragments (reads) in the first sample sequence MSA data and the first sample insertion MSA data are also converted row by row into corresponding base encoding values (IDs) according to the sorting in the first sample alignment data. The IDs may be in digital form. Next, the first sample sequence MSA data and the first sample insertion MSA data corresponding to each sample candidate site of the sample candidate site are combined to obtain the first sample MSA data.
[0299] This embodiment provides a method for determining the first sample MSA data. The first sample MSA data includes the first sample sequence MSA data and the first sample insertion MSA data, so that the base insertion, deletion, and change of each sample candidate site can be retained to improve the model accuracy, and the first sample MSA data can be simplified to avoid excessive memory usage during training and improve the training speed.
[0300] In some embodiments, step 310 of obtaining the second sample MSA data of the sample variant cells of the first sample individual is implemented as steps 315, 316 and 317:
[0301] Step 315, obtaining second sample sequencing data of sample mutant cells;
[0302] Step 316, aligning the second sample sequencing data with the reference gene sequence to obtain second sample alignment data;
[0303] Step 317: Determine the second sample MSA data based on the second sample alignment data and the sample candidate sites.
[0304] The second sample sequencing data of the sample variant cells of the first sample individual can be obtained from multiple public sequencing platforms, for example, ONT, Illumina, PacBio sequencing platforms; or, obtained from a public nucleic acid sequence database, for example, GenBank, EMBL, RefSeq database; or, obtained by performing gene sequencing on the sample variant cells of the first sample individual.
[0305] Exemplarily, a computer device obtains an original sample sequencing signal of a sample variant cell of a first sample individual, the sample sequencing signal is obtained by a sequencing device performing gene sequencing on the sample variant cell of the first sample individual, performs base calling on the original sample sequencing signal, and obtains second sample sequencing data of the first sample individual. Obtain a reference gene sequence; align the second sample sequencing data with the reference gene sequence to obtain second sample alignment data; based on the second sample alignment data and the sample candidate sites, convert the second sample alignment data into second sample MSA data to obtain second sample MSA data. The sample candidate sites corresponding to the sample normal cells and the sample variant cells are the same.
[0306] In the method of this embodiment, the second sample sequencing data is converted into second sample MSA data, in which only the sample base information and sample sequencing information of the sample candidate site can be retained, which can reduce the amount of calculation of invalid areas, is beneficial to improve the processing efficiency of the sample MSA data of the first sample individual, and improve the fine-tuning training speed.
[0307] In some embodiments, the second sample MSA data of the sample variant cells of the first sample individual includes: the second sample sequence MSA data (Base MSA) and the second sample insertion MSA data (Insertion MSA) of the sample candidate site. The second sample sequence MSA data is used to characterize the base changes of the sample candidate site, that is, the second sample sequence MSA data indicates the specific base type, whether there is a deletion, and whether it is not detected at the sample candidate site. The second sample insertion MSA data is used to characterize the base insertion of the sample candidate site, that is, the sample candidate site does not have an insertion, or, in the case of an insertion variation at the sample candidate site, the insertion base type of the base inserted at the sample candidate site.
[0308] Specifically, step 317 is implemented as step 3171, step 3172 and step 3173:
[0309] Step 3171, taking each sample candidate site of the sample candidate sites as the center of the window, extracting the sample gene sequence in the window in the second sample alignment data, each sample sequencing fragment in the sample gene sequence corresponds to at least one of base insertion information, base deletion information and base change information;
[0310] Step 3172, based on the base deletion information and base change information corresponding to each sample sequencing fragment in the sample gene sequence, determine the second sample sequence MSA data of each sample candidate site, based on the base insertion information corresponding to each sample sequencing fragment in the sample gene sequence, determine the second sample insertion MSA data of each sample candidate site;
[0311] Step 3173, combining the second sample sequence MSA data corresponding to each sample candidate site of the sample candidate site and the second sample insertion MSA data to obtain the second sample MSA data.
[0312] The window size is preset, and the window size is the same for different sample candidate sites. The window depth is preset, and the window depth is the same for different sample candidate sites. The window is expressed as [start, end], and the window size is expressed as window = end-start. The sample candidate site is the center of the window, and the sample candidate site is expressed as center = (start + end) / 2. The second sample alignment data can be a BAM file, and the second sample alignment data includes a sample gene sequence, each sample gene sequence includes one or more sample sequencing fragments (reads), and each sample sequencing fragment is stored in the BAM file in Cigar String format. Cigar String includes a series of operation codes, and each operation code is used to describe the detailed information of base insertion, base deletion, and base change when the sample sequencing fragment is aligned to the reference feature sequence.
[0313] Specifically, the computer device takes each sample candidate site of the sample candidate site as the center of the window, extracts the sample gene sequence in the window in the second sample alignment data, and each sample sequencing fragment in the sample gene sequence corresponds to at least one of base insertion information, base deletion information, and base change information. Based on the base deletion information and base change information corresponding to each sample sequencing fragment in the sample gene sequence, the second sample sequence MSA data of each sample candidate site is determined, and based on the base insertion information corresponding to each sample sequencing fragment in the sample gene sequence, the second sample insertion MSA data of each sample candidate site is determined. The second sample sequence MSA data and the second sample insertion MSA data corresponding to each sample candidate site of the sample candidate site are combined to obtain the second sample MSA data.
[0314] As an example, for a sample variant cell, the second sample sequence MSA data of a sample candidate site can be a matrix, represented as: M base ∈N k×l , k represents the number of sample sequencing fragments (reads) located in the window, l represents the window size, M base The MSA data includes: letters A, G, C, T, U, and symbols "." or "-". Letters A, G, C, T, and U represent specific base types of sample candidate sites, the symbol "-" indicates that the sample candidate site is deleted, and the symbol "." indicates that the sample candidate site is not detected and belongs to a GAP. The second sample insertion MSA data of a sample candidate site can be a matrix, represented as M ins ∈N k×l , k represents the number of sample sequencing fragments (reads) located in the window, l represents the window size, M ins The '.' includes: letters A, G, C, T, U or the symbol ".". Letters A, G, C, T, U represent the type of inserted bases at the sample candidate site, and the symbol "." indicates that there is no insertion at the sample candidate site. In the specific example, the window size is 129 and the maximum depth is 64.
[0315] In some embodiments, after obtaining the second sample sequence MSA data and the second sample insertion MSA data corresponding to each sample candidate site, the second sample sequence MSA data and the sample sequencing fragments (reads) in the second sample insertion MSA data are also converted row by row into corresponding base encoding values (IDs) according to the sorting in the second sample alignment data. The IDs may be in digital form. Next, the second sample sequence MSA data and the second sample insertion MSA data corresponding to each sample candidate site of the sample candidate site are combined to obtain the second sample MSA data.
[0316] This embodiment provides a method for determining the second sample MSA data. The second sample MSA data includes the second sample sequence MSA data and the second sample insertion MSA data. In this way, the base insertion, deletion, and change of each sample candidate site can be retained to improve the model accuracy, and the second sample MSA data can be streamlined to avoid excessive memory usage during training and improve the training speed. Since the sample normal cells and sample mutant cells correspond to the same sample candidate sites, the alignment of the reference gene sequence, the first sample MSA data, and the second sample MSA data in the sample MSA data of the first sample individual can also be ensured.
[0317] (2) Basic model training phase
[0318] In some embodiments, the base model layer in the somatic variation detection model includes: a feature extraction unit (USM Block) stacked in the pre-trained base model. The base model is a unified sequence model (USM) for extracting MSA features.
[0319] In some embodiments, the basic model includes: a second coding layer (MSA Embedding), a stacked feature extraction unit (USM Block), and a conversion layer (LM Head), the second coding layer is cascaded with the feature extraction unit, and the feature extraction unit is cascaded with the conversion layer. The number of stacked feature extraction units is N, N is greater than or equal to 1, and the structure and calculation operation of each feature extraction unit in the N feature extraction units are consistent.
[0320] The somatic variant detection model is adjusted based on the basic model. The somatic variant detection model removes the conversion layer of the basic model and adds a classifier. The model parameters of the first encoding layer (Embedding) of the somatic variant detection model are the same as the model parameters of the second encoding layer (MSA Embedding) of the pre-trained basic model. The second encoding layer is used for sample encoding features of sample MSA data.
[0321] In some embodiments, the training phase of the base model is performed by a computer device, which may be Figure 2 The terminal 120 and / or the server 140 shown, before step 220 and / or step 310, further includes at least some of steps 410, 420, 430, 440, 450, and 460:
[0322] Step 410, obtaining a reference gene sequence, a third sample MSA data of a sample normal cell of a second sample individual, and a fourth sample MSA data of a sample mutant cell of the second sample individual.
[0323] The second sample individual in the training phase of the basic model is consistent with the first sample individual in the training phase of the somatic cell variation detection model and the type of the individual in the application phase. Generally, the second sample individual is also a human individual. The third sample MSA data of the sample normal cells of the second sample individual and the fourth sample MSA data of the sample variant cells of the second sample individual are real paired data and / or synthetic paired data, which can be selected according to the required data volume.
[0324] In some embodiments, the third sample MSA data of the sample normal cell and the fourth sample MSA data of the sample variant cell are real paired data. For example, the sample normal cell is a somatic cell of a normal tissue in the second sample individual, and the sample variant cell is a somatic cell of a variant tissue of the second sample individual, for example, a cancer cell or a tumor cell. The third sample MSA data is the sample sequencing data obtained by sequencing the gene of the sample normal cell, and is obtained by comparing it with the reference gene sequence. The fourth sample MSA data is the sample sequencing data obtained by sequencing the gene of the sample variant cell, and is obtained by comparing it with the reference gene sequence.
[0325] In other embodiments, the third sample MSA data of the sample normal cell and the fourth sample MSA data of the sample variant cell are synthetic paired data. For example, the sample normal cell is a somatic cell of a normal tissue in the second sample individual, and the third sample MSA data is sample sequencing data obtained by sequencing the gene of the sample normal cell, and is obtained after alignment with the reference gene sequence. The fourth sample MSA data of the sample variant cell is obtained by performing random changes on the bases of a part of the sample gene sites in the third sample MSA data of the sample normal cell, for example, performing at least one of base deletion, change to another type of base, and insertion of any type of base on a part of the sample gene sites.
[0326] In some embodiments, the third sample MSA data of the sample normal cells include the sample base information and sample sequencing information of the sample candidate sites in the sample gene loci. The fourth sample MSA data of the sample variant cells include the sample base information and sample sequencing information of the sample candidate sites in the sample gene loci. Here, the sample candidate sites corresponding to the sample normal cells and the sample variant cells are the same. The sample candidate sites are some sample gene sites that meet the screening conditions in the sample gene loci of the second sample individual, which can also be understood as sample suspicious sites, which are sample gene sites that may have mutations. In the training stage of the basic model, the third sample MSA data of the sample normal cells of the second sample individual and the fourth sample MSA data of the sample variant cells only include the sample base information and sample sequencing information of the sample candidate sites in the sample gene loci, which can reduce the amount of calculation of invalid areas and improve the training speed of the basic model.
[0327] In some embodiments, a sequencing device is used to perform gene sequencing on the sample normal cells of the second sample individual to obtain a sample sequencing signal. The sample sequencing signal is an electrical signal and an optical signal, and the sample sequencing signal needs to be converted into an analyzable gene sequence, that is, the third sample sequencing data, and then the third sample MSA data of the sample normal cells of the second sample individual is generated based on the third sample sequencing data. Similarly, a sequencing device is used to perform gene sequencing on the sample variant cells of the same second sample individual to obtain a sample sequencing signal. The sample sequencing signal is an electrical signal and an optical signal, and the sample sequencing signal needs to be converted into an analyzable gene sequence, that is, the fourth sample sequencing data, and then the fourth sample MSA data of the sample variant cells of the second sample individual is generated based on the fourth sample sequencing data.
[0328] The third sample MSA data of the sample normal cells of the second sample individual may be generated by: performing base calling on the original sample sequencing signal, the base calling is used to convert the sample sequencing signal generated by the sequencing device into the original third sample sequencing data, so as to obtain the original third sample sequencing data; performing sequence quality control on the original third sample sequencing data, the sequence quality control is used to filter, prune and evaluate the original third sample sequencing data, so as to obtain the processed third sample sequencing data, wherein the sequence quality control may also be used as an optional step; next, performing sequence alignment on the processed third sample sequencing data, the sequence alignment is used to align the processed third sample sequencing data with the reference gene sequence, so as to obtain the third sample alignment data; based on the sample candidate sites screened out from each sample gene site and the third sample alignment data, the third sample MSA data of the sample normal cells of the second sample individual is obtained.
[0329] The fourth sample MSA data of the sample variant cell of the second sample individual may be generated by: performing base calling on the original sample sequencing signal, the base calling is used to convert the sample sequencing signal generated by the sequencing device into the original fourth sample sequencing data, and obtain the original fourth sample sequencing data; performing sequence quality control on the original fourth sample sequencing data, the sequence quality control is used to filter, prune and evaluate the original fourth sample sequencing data, and obtain the processed fourth sample sequencing data, wherein the sequence quality control can also be used as an optional step; next, performing sequence alignment on the processed fourth sample sequencing data, the sequence alignment is used to align the processed fourth sample sequencing data with the reference gene sequence, and obtain the fourth sample alignment data; based on the sample candidate site and the fourth sample alignment data, the fourth sample MSA data of the sample variant cell of the second sample individual is obtained. Wherein, the sample candidate sites corresponding to the sample normal cell and the sample variant cell are the same.
[0330] Step 420, combining the reference gene sequence, the third sample MSA data and the fourth sample MSA data to obtain the sample MSA data of the second sample individual, wherein the sample MSA data includes the sample mutation type.
[0331] Exemplarily, the computer device sequentially combines the reference gene sequence, the third sample MSA data, and the fourth sample MSA data to obtain the sample MSA data of the second sample individual. The sample MSA data of the second sample individual are, from top to bottom, the reference gene sequence, the third sample MSA data, and the fourth sample MSA data. Then, the sample MSA data of the second sample individual in this embodiment also includes the reference gene sequence, which is located in the first row of the sample MSA data as the first row gene sequence of the sample MSA data. The reference gene sequence can use HG38 and be truncated to a preset length, which can be 1024BP.
[0332] Step 430 , based on the second coding layer, encode the sample coding features of the sample MSA data.
[0333] Step 440: Based on the feature extraction unit, a self-attention calculation is performed on the sample coding feature to obtain a sample MSA feature corresponding to the sample coding feature.
[0334] Exemplarily, the computer device encodes the sample coding features of the sample MSA data based on the second coding layer (MSA Embedding), and, based on the feature extraction unit (USM Block), performs self-attention calculation on the sample coding features to obtain the sample MSA features corresponding to the sample coding features. The sample coding features are used to characterize the sample base information and sample sequencing information of the sample MSA data of the second sample individual. The sample MSA features integrate the sample base information and sample sequencing information of the sample MSA data of the second sample individual, and can characterize the sample MSA data of the second sample individual from different information dimensions.
[0335] In one possible implementation, the basic model includes N stacked feature extraction units, and the structure and calculation operations of each of the N feature extraction units are consistent. It can be based on each of the N feature extraction units, continuing to perform self-attention calculation on the output result of the previous feature extraction unit, and using the output result of the Nth feature extraction unit as the sample MSA feature.
[0336] Specifically, for the first feature extraction unit among the N feature extraction units, based on the first feature extraction unit, perform self-attention calculation on the sample coding feature to obtain the first output result, for the i-th feature extraction unit among the N feature extraction units, based on the i-th feature extraction unit, perform self-attention calculation on the i-1-th output result to obtain the i-th output result, update i to i+1 and repeat the above steps until i equals N, and use the N-th output result as the sample MSA feature corresponding to the sample coding feature. Wherein, N is greater than or equal to 1, i is greater than or equal to 1, and i is less than or equal to N.
[0337] Step 450: Based on the conversion layer, convert the sample MSA features to obtain the predicted mutation type.
[0338] Exemplarily, the computer device converts the sample MSA features based on the conversion layer (LM Head) to obtain the predicted mutation type, which is the predicted mutation type of the sample normal cells and sample mutant cells relative to the reference gene sequence. The conversion layer (LM Head) in the basic model is used for mask learning. Among them, mask learning refers to randomly replacing a part of the region in the input sequence with a mask (Mask), so that the basic model predicts the base type in the masked mask region to help the basic model learn a better contextual representation of the sample gene sequence.
[0339] In one implementation, the mask learning method is dynamic masking (Mask Token), which specifically includes: one or a combination of column masking and global random masking. Column masking refers to randomly masking the entire column. Since column masking is difficult to learn, a smaller ratio is used in the training phase. In one example, the column mask ratio is set to 0.05. Global random masking means randomly masking a single character (Token). As the training progresses, the ratio of the global random mask is set from high to low. In one example, the ratio of the global random mask is set from 0.3 to 0.15.
[0340] Step 460 , adjusting the model parameters of the basic model with the training goal of reducing the difference between the predicted mutation type and the sample mutation type.
[0341] Exemplarily, the computer device adjusts the model parameters of the basic model with the training goal of reducing the difference between the predicted mutation type and the sample mutation type. In one implementation, the model parameters of the second encoding layer, the feature extraction unit, and the conversion layer are adjusted.
[0342] This embodiment provides a training step for a basic model, provides support for pre-training of the basic model, and provides support for training of a somatic variation detection model. The basic model can improve the accuracy of the extracted MSA features through pre-training.
[0343] In some embodiments, step 440 is implemented as step 442, step 444, and step 446:
[0344] Step 442, based on the feature extraction unit, performing column attention calculation on the sample encoding feature to obtain a sample column attention feature;
[0345] Step 444, performing pooling on the sample column attention features in the column direction to obtain sample column pooling features;
[0346] Step 446, perform row attention calculation on the column pooling features to obtain sample MSA features.
[0347] Self-attention calculation includes: column attention calculation and row attention calculation. Since the row of the sample MSA data of the second sample individual represents the sample gene sequence, a sample gene sequence includes one or more sample sequencing fragments (reads), and the column represents the sample gene loci, the sample gene loci in the same column have the same corresponding position on the chromosome. Column attention calculation is used to learn the relevant information of the bases aligned at the same position, and row attention calculation is used to learn the relevant information of the relationship between one or more sample sequencing fragments of each sample gene sequence. The sample MSA data of the second sample individual has a lower amount of information in the column direction and a higher amount of information in the row direction.
[0348] Exemplarily, taking a feature extraction unit as an example, the computer device performs column attention calculation on the sample coding feature based on the feature extraction unit to obtain the sample column attention feature; performs pooling on the sample column attention feature in the column direction, and the pooling method includes at least one of average pooling, maximum pooling, and random pooling. This embodiment adopts average pooling, also known as column pooling, to obtain the sample column pooling feature; performs row attention calculation on the sample column pooling feature to obtain the sample MSA feature. In this way, the sample MSA feature can fully characterize the sample MSA data of the second sample individual from the two dimensions of row and column.
[0349] The method of this embodiment fully learns the information in the sample encoding features from the dimensions of rows and columns, and fully characterizes the sample MSA data of the second sample individual based on the attention mechanism, which can improve the accuracy of the sample MSA features corresponding to the second sample individual.
[0350] In some embodiments, step 450 is implemented as step 452 and step 454:
[0351] Step 452, performing random masking on at least a portion of the mask area in the sample MSA feature to obtain the sample MSA mask feature, wherein the at least a portion of the mask area includes at least a portion of the columns and at least a portion of the single characters in the sample MSA feature;
[0352] Step 454 : Based on the conversion layer, predict the predicted base type in at least a portion of the mask region of the sample MSA mask feature to obtain the predicted mutation type.
[0353] During the training phase of the basic model, the conversion layer (LM Head) in the basic model is used for mask learning. The mask learning method is dynamic mask (Mask Token), which specifically includes: one of column mask and global random mask or a combination of the two. This embodiment takes the combination of the two as an example. Column mask refers to randomly masking the entire column. Since the learning difficulty of column mask is relatively large, a smaller ratio is used in the training phase. In one example, the column mask ratio is set to 0.05. Global random masking means randomly masking a single character (Token). As the training progresses, the ratio of the global random mask is set from high to low. In one example, the ratio of the global random mask is set from 0.3 to 0.15.
[0354] Exemplarily, a computer device performs random masking on at least a portion of a mask region in a sample MSA feature to obtain a sample MSA mask feature, wherein at least a portion of the mask region includes at least a portion of columns and at least a portion of single characters (Tokens) in the sample MSA feature; based on a conversion layer, a predicted base type in at least a portion of the mask region of the sample MSA mask feature is predicted to obtain a predicted mutation type.
[0355] This embodiment provides a pre-training method for the basic model. This dynamic masking method has the characteristics of self-supervised learning. By randomly masking some mask areas and predicting the base types in these mask areas, it can fully learn the semantic relationship and context dependency between bases, and can improve the model accuracy and generalization performance of the basic model.
[0356] In some embodiments, step 410 of obtaining the third sample MSA data of the normal cells of the sample of the second sample individual is implemented as steps 411, 412, 413 and 414:
[0357] Step 411, obtaining sequencing data of a third sample of normal cells;
[0358] Step 412, aligning the third sample sequencing data with the reference gene sequence to obtain third sample alignment data;
[0359] Step 413, determining the sample candidate sites that meet the screening conditions in the third sample alignment data;
[0360] Step 414: Determine the third sample MSA data based on the third sample alignment data and the sample candidate sites.
[0361] The third sample sequencing data of the sample normal cells of the second sample individual can be obtained from multiple public sequencing platforms, for example, ONT, Illumina, PacBio sequencing platforms; or, obtained from a public nucleic acid sequence database, for example, GenBank, EMBL, RefSeq database; or, obtained by performing gene sequencing on the sample normal cells of the second sample individual.
[0362] Exemplarily, the computer device obtains the original sample sequencing signal of the sample normal cell of the second sample individual, the sample sequencing signal is obtained by the sequencing device performing gene sequencing on the sample normal cell of the second sample individual, performs base calling on the original sample sequencing signal, and obtains the third sample sequencing data of the sample normal cell of the second sample individual. Obtain the reference gene sequence; align the third sample sequencing data with the reference gene sequence to obtain the third sample alignment data; determine the sample candidate sites that meet the screening conditions in the third sample alignment data; based on the third sample alignment data and the sample candidate sites, convert the third sample alignment data into the third sample MSA data to obtain the third sample MSA data.
[0363] The sample candidate sites that meet the screening conditions can also be understood as sample suspicious sites, which are sample gene sites that may have mutations in the sample normal cells. In the training stage of the basic model, the third sample MSA data of the sample normal cells of the second sample individual input into the basic model, and the fourth sample MSA data of the sample variant cells of the second sample individual, respectively contain only the sample base information and sample sequencing information of the sample candidate sites in the sample gene sites, which can reduce the amount of calculation of invalid areas. It should also be noted that the sample candidate sites corresponding to the sample normal cells and the sample variant cells are the same, which can ensure the alignment of the reference gene sequence, the third sample MSA data and the fourth sample MSA data.
[0364] In some embodiments, the sample candidate site is determined as follows: in the third sample alignment data, when there is a base change in the column data corresponding to the sample gene site and the minor allele frequency of the sample gene site is greater than a threshold, the sample gene site is determined as a sample candidate site. The threshold can be set according to actual technical needs.
[0365] In the method of this embodiment, the third sample sequencing data is converted into third sample MSA data, in which only the sample base information and sample sequencing information of the sample candidate sites can be retained, which can reduce the amount of calculation in invalid areas, is beneficial to improve the processing efficiency of the sample MSA data of the second sample individual, and improve the training speed of the basic model.
[0366] In some embodiments, the third sample MSA data of the sample normal cells of the second sample individual includes: the third sample sequence MSA data (Base MSA) and the third sample insertion MSA data (Insertion MSA) of the sample candidate site. The third sample sequence MSA data is used to characterize the base changes of the sample candidate site, that is, the third sample sequence MSA data indicates the specific base type, whether there is a deletion, and whether it is not detected at the sample candidate site. The third sample insertion MSA data is used to characterize the base insertion of the sample candidate site, that is, the sample candidate site does not have an insertion, or, in the case of an insertion variation at the sample candidate site, the insertion base type of the base inserted at the sample candidate site.
[0367] Specifically, step 414 is implemented as step 4141, step 4142, and step 4143:
[0368] Step 4141, taking each sample candidate site of the sample candidate sites as the center of the window, extracting the sample gene sequence in the window in the third sample alignment data, each sample sequencing fragment in the sample gene sequence corresponds to at least one of base insertion information, base deletion information and base change information;
[0369] Step 4142, based on the base deletion information and base change information corresponding to each sample sequencing fragment in the sample gene sequence, determine the third sample sequence MSA data of each sample candidate site, based on the base insertion information corresponding to each sample sequencing fragment in the sample gene sequence, determine the third sample insertion MSA data of each sample candidate site;
[0370] Step 4143, combining the third sample sequence MSA data and the third sample insertion MSA data corresponding to each sample candidate site of the sample candidate site to obtain the third sample MSA data.
[0371] The window size is preset, and the window size is the same for different sample candidate sites. The window depth is preset, and the window depth is the same for different sample candidate sites. The window is expressed as [start, end], and the window size is expressed as window = end-start. The sample candidate site is the center of the window, and the sample candidate site is expressed as center = (start + end) / 2. The third sample alignment data can be a BAM file, and the third sample alignment data includes sample gene sequences, each sample gene sequence includes one or more sample sequencing fragments (reads), and each sample sequencing fragment is stored in the BAM file in Cigar String format. Cigar String includes a series of operation codes, and each operation code is used to describe the detailed information of base insertion, base deletion, and base change when the sample sequencing fragment is aligned to the reference feature sequence.
[0372] Specifically, the computer device takes each sample candidate site of the sample candidate site as the center of the window, extracts the sample gene sequence in the window in the third sample alignment data, and each sample sequencing fragment in the sample gene sequence corresponds to at least one of base insertion information, base deletion information, and base change information. Based on the base deletion information and base change information corresponding to each sample sequencing fragment in the sample gene sequence, the third sample sequence MSA data of each sample candidate site is determined, and based on the base insertion information corresponding to each sample sequencing fragment in the sample gene sequence, the third sample insertion MSA data of each sample candidate site is determined. The third sample sequence MSA data and the third sample insertion MSA data corresponding to each sample candidate site of the sample candidate site are combined to obtain the third sample MSA data.
[0373] As an example, for a sample normal cell, the third sample sequence MSA data of a sample candidate site can be a matrix, represented as: M base ∈N k×l , k represents the number of sample sequencing fragments (reads) located in the window, l represents the window size, M base The MSA data includes: letters A, G, C, T, U, and symbols "." or "-". Letters A, G, C, T, and U represent specific base types of sample candidate sites, the symbol "-" indicates that the sample candidate site is deleted, and the symbol "." indicates that the sample candidate site is not detected and belongs to a GAP. The third sample insertion MSA data of a sample candidate site can be a matrix, represented as M ins ∈N k×l , k represents the number of sample sequencing fragments (reads) located in the window, l represents the window size, M insThe '.' includes: letters A, G, C, T, U or the symbol ".". Letters A, G, C, T, U represent the type of inserted bases at the sample candidate site, and the symbol "." indicates that there is no insertion at the sample candidate site. In the specific example, the window size is 129 and the maximum depth is 64.
[0374] In some embodiments, after obtaining the third sample sequence MSA data and the third sample insertion MSA data corresponding to each sample candidate site, the third sample sequence MSA data and the sample sequencing fragments (reads) in the third sample insertion MSA data are also converted row by row into corresponding base encoding values (IDs) according to the sorting in the third sample alignment data. The IDs may be in digital form. Next, the third sample sequence MSA data and the third sample insertion MSA data corresponding to each sample candidate site of the sample candidate site are combined to obtain the third sample MSA data.
[0375] This embodiment provides a method for determining the third sample MSA data. The third sample MSA data includes the third sample sequence MSA data and the third sample insertion MSA data, so that the insertion, deletion, and change of bases at each sample candidate site can be retained to improve the model accuracy, and the third sample MSA data can be streamlined to avoid excessive memory usage during training and improve the training speed.
[0376] In some embodiments, step 410 of obtaining the fourth sample MSA data of the sample variant cells of the second sample individual is implemented as steps 415, 416, and 417:
[0377] Step 415, obtaining fourth sample sequencing data of sample mutant cells;
[0378] Step 416, aligning the fourth sample sequencing data with the reference gene sequence to obtain fourth sample alignment data;
[0379] Step 417, determining fourth sample MSA data based on the fourth sample alignment data and the sample candidate sites.
[0380] The fourth sample sequencing data of the sample variant cells of the second sample individual may be obtained from a plurality of public sequencing platforms, for example, ONT, Illumina, or PacBio sequencing platforms; or, may be obtained from a public nucleic acid sequence database, for example, GenBank, EMBL, or RefSeq database; or, may be obtained by performing gene sequencing on the sample variant cells of the second sample individual.
[0381] Exemplarily, the computer device obtains the original sample sequencing signal of the sample variant cell of the second sample individual, the sample sequencing signal is obtained by the sequencing device performing gene sequencing on the sample variant cell of the second sample individual, performs base calling on the original sample sequencing signal, and obtains the fourth sample sequencing data of the second sample individual. Obtain the reference gene sequence; align the fourth sample sequencing data with the reference gene sequence to obtain the fourth sample alignment data; based on the fourth sample alignment data and the sample candidate site, convert the fourth sample alignment data into the fourth sample MSA data to obtain the fourth sample MSA data. Among them, the sample normal cells and the sample variant cells respectively correspond to the same sample candidate sites.
[0382] In the method of this embodiment, the fourth sample sequencing data is converted into fourth sample MSA data. The fourth sample MSA data can only retain the sample base information and sample sequencing information of the sample candidate site, which can reduce the amount of calculation in the invalid area, which is beneficial to improve the processing efficiency of the sample MSA data of the second sample individual and improve the training speed of the basic model.
[0383] In some embodiments, the fourth sample MSA data of the sample variant cells of the second sample individual includes: the fourth sample sequence MSA data (Base MSA) and the fourth sample insertion MSA data (Insertion MSA) of the sample candidate site. The fourth sample sequence MSA data is used to characterize the base changes of the sample candidate site, that is, the fourth sample sequence MSA data indicates the specific base type, whether there is a deletion, and whether it is not detected at the sample candidate site. The fourth sample insertion MSA data is used to characterize the base insertion of the sample candidate site, that is, the sample candidate site does not have an insertion, or, in the case of an insertion variation at the sample candidate site, the insertion base type of the base inserted at the sample candidate site.
[0384] Specifically, step 417 is implemented as step 4171, step 4172 and step 4173:
[0385] Step 4171, taking each sample candidate site of the sample candidate sites as the center of the window, extracting the sample gene sequence in the window in the fourth sample alignment data, each sample sequencing fragment in the sample gene sequence corresponds to at least one of base insertion information, base deletion information and base change information;
[0386] Step 4172, based on the base deletion information and base change information corresponding to each sample sequencing fragment in the sample gene sequence, determine the fourth sample sequence MSA data of each sample candidate site, based on the base insertion information corresponding to each sample sequencing fragment in the sample gene sequence, determine the fourth sample insertion MSA data of each sample candidate site;
[0387] Step 4173, combining the fourth sample sequence MSA data and the fourth sample insertion MSA data corresponding to each sample candidate site of the sample candidate site to obtain fourth sample MSA data.
[0388] The window size is preset, and the window size is the same for different sample candidate sites. The window depth is preset, and the window depth is the same for different sample candidate sites. The window is expressed as [start, end], and the window size is expressed as window = end-start. The sample candidate site is the center of the window, and the sample candidate site is expressed as center = (start + end) / 2. The fourth sample alignment data can be a BAM file, and the fourth sample alignment data includes sample gene sequences, each sample gene sequence includes one or more sample sequencing fragments (reads), and each sample sequencing fragment is stored in the BAM file in Cigar String format. Cigar String includes a series of operation codes, and each operation code is used to describe the detailed information of base insertion, base deletion, and base change when the sample sequencing fragment is aligned to the reference feature sequence.
[0389] Specifically, the computer device takes each sample candidate site of the sample candidate site as the center of the window, extracts the sample gene sequence in the window in the fourth sample alignment data, and each sample sequencing fragment in the sample gene sequence corresponds to at least one of base insertion information, base deletion information, and base change information. Based on the base deletion information and base change information corresponding to each sample sequencing fragment in the sample gene sequence, the fourth sample sequence MSA data of each sample candidate site is determined, and based on the base insertion information corresponding to each sample sequencing fragment in the sample gene sequence, the fourth sample insertion MSA data of each sample candidate site is determined. The fourth sample sequence MSA data and the fourth sample insertion MSA data corresponding to each sample candidate site of the sample candidate site are combined to obtain the fourth sample MSA data.
[0390] As an example, for a sample variant cell, the fourth sample sequence MSA data of a sample candidate site can be a matrix, represented as: M base ∈N k×l , k represents the number of sample sequencing fragments (reads) located in the window, l represents the window size, M base The MSA data includes: letters A, G, C, T, U, and symbols "." or "-". Letters A, G, C, T, and U represent specific base types of sample candidate sites, the symbol "-" indicates that the sample candidate site is deleted, and the symbol "." indicates that the sample candidate site is not detected and belongs to a GAP. The fourth sample insertion MSA data of a sample candidate site can be a matrix, represented by M ins ∈N k×l, k represents the number of sample sequencing fragments (reads) located in the window, l represents the window size, M ins The '.' includes: letters A, G, C, T, U or the symbol ".". Letters A, G, C, T, U represent the type of inserted bases at the sample candidate site, and the symbol "." indicates that there is no insertion at the sample candidate site. In the specific example, the window size is 129 and the maximum depth is 64.
[0391] In some embodiments, after obtaining the fourth sample sequence MSA data and the fourth sample insertion MSA data corresponding to each sample candidate site, the sample sequencing fragments (reads) in the fourth sample sequence MSA data and the fourth sample insertion MSA data are also converted row by row into corresponding base encoding values (IDs) according to the sorting in the fourth sample alignment data. The IDs may be in digital form. Next, the fourth sample sequence MSA data and the fourth sample insertion MSA data corresponding to each sample candidate site of the sample candidate site are combined to obtain the fourth sample MSA data.
[0392] In this embodiment, a method for determining the fourth sample MSA data is provided. The fourth sample MSA data includes the fourth sample sequence MSA data and the fourth sample insertion MSA data. In this way, the base insertion, deletion, and change of each sample candidate site can be retained to improve the model accuracy, and the fourth sample MSA data can be streamlined to avoid excessive memory usage during training and improve the training speed of the basic model. Since the sample normal cells and the sample mutant cells each correspond to the same sample candidate sites, the alignment of the reference gene sequence, the third sample MSA data, and the fourth sample MSA data in the sample MSA data of the second sample individual can also be ensured.
[0393] Next, the somatic variation detection method provided in the embodiments of the present application is generally described.
[0394] 1. Training phase
[0395] The training phase mainly includes: 1. Data processing; 2. Basic model training; 3. Somatic variant caller model training. The basic model is also called the MSA basic model, which is determined based on the unified sequence model (USM). The basic model training can also be called pre-training. The somatic variant caller model training can also be called fine-tuning training.
[0396] 1. Data processing
[0397] Data processing includes: 1.1 screening of suspicious sites; 1.2 conversion of aligned data into MSA data; 1.3 construction of pre-training dataset; 1.4 construction of fine-tuning training dataset; 1.5 label construction.
[0398] 1.1 Screening of suspicious sites
[0399] Suspicious sites are gene sites that may have mutations in somatic cells. Somatic cells include first somatic cells and second somatic cells. Among them, the first somatic cells are normal cells, and the second somatic cells are cancer cells. The suspicious sites corresponding to the first somatic cells and the second somatic cells of an individual are the same. Taking the first somatic cell of an individual as an example, after aligning the original sequencing data of the first somatic cell of the individual with the reference gene sequence, the first alignment data is obtained. The first alignment data contains the base information and sequencing information corresponding to each gene site. These first alignment data can be simply divided into: unmutated regions, noise regions, and mutated regions. For unmutated regions, this part of the gene sequence is exactly the same as the reference gene sequence, and its base information and sequencing information are redundant. For noise regions, this part of the gene sequence has a small amount of base changes, which are caused by sequencing system errors and comparison errors, and its comparison quality value is usually relatively low.
[0400] In order to determine these suspicious sites, it is necessary to compare the base types on the sequencing fragments (reads) corresponding to each gene site with the base types at the corresponding position of the reference gene sequence. If the ratio of the bases that are different between the sequencing fragments and the reference gene sequence at the gene site to all sequencing fragments reaches a certain threshold, it means that the gene site is likely to have a mutation. In this embodiment, the suspicious site is determined as follows: in the first alignment data, when there is a base change in the column data corresponding to the gene site, and the minor allele frequency of the gene site is greater than the threshold, the gene site is determined as a candidate site. The threshold can be set according to actual technical needs.
[0401] 1.2 Alignment data converted to MSA data
[0402] The method for generating the first MSA data of the first somatic cell is consistent with the method for generating the second MSA data of the second somatic cell. Taking the first somatic cell of an individual as an example, the first alignment data is a BAM file. Taking the candidate site as the center of the window, extract all sequencing fragments (reads) located in a window [start, end] in the BAM file. The center of start and end, center = (start + end) / 2, is the position of the candidate site, and the window size is window = end-start. Each sequencing fragment is stored in the BAM file in Cigar String format. Cigar String includes a series of operation codes, each of which is used to describe the detailed information of base insertion, base deletion, and base change when the sequencing fragment is aligned to the reference feature sequence.
[0403] Create the matrix M base ∈N k×l and M ins ∈N k×l Among them, M base Record base changes, M ins Record the insertion changes. k represents the number of sequencing fragments (reads) within the window, l represents the window size, and the gene sequence outside the window will be truncated. base The letters A, G, C, T, U, and the symbol "." or "-" are included. The letters A, G, C, T, and U represent the specific base types of the candidate sites, the symbol "-" indicates that the candidate site is deleted, and the symbol "." indicates that the candidate site is not detected and belongs to a GAP. ins The letters A, G, C, T, U or the symbol "." are included. The letters A, G, C, T, and U represent the insertion base type of the candidate site, and the symbol "." indicates that there is no insertion at the candidate site. The sequencing fragments (reads) are converted into corresponding base encoding values (IDs) line by line according to the order in the BAM file, which can be in digital form. At this point, the M of each candidate site is obtained. base and M ins , the first MSA data of the first somatic cell is obtained by combining. Similarly, the second MSA data of the second somatic cell is obtained.
[0404] 1.3 Pre-training dataset construction
[0405] For the first somatic cell and the second somatic cell, based on 1.1 suspicious site screening and 1.2 alignment data conversion to MSA data, the first alignment data is converted to the first MSA data, and the second alignment data is converted to the second MSA data as pre-training data for pre-training of the basic model. At the same time, in order to allow the basic model to learn the characteristics of the reference gene sequence, the reference gene sequence is truncated according to the preset length and also used as part of the pre-training data.
[0406] 1.4 Fine-tuning training data set construction
[0407] The first MSA data of the first somatic cell is paired with the second MSA data of the second somatic cell and annotated with the corresponding label information as fine-tuning training data. Fine-tuning training is performed on the pre-trained basic model, and the fine-tuning training result is tested. Among them, the first somatic cell is a normal cell, and the second somatic cell is a cancer cell. Since there are few real paired data sets for normal cells and cancer cells, synthetic paired data sets can also be used for training in the training stage. In one example, considering that there are large genetic differences between normal cells and cancer cells, and there are also large genetic differences between somatic cells from different individuals, the sequencing data of the somatic cells of one individual can be used as the genetic data of normal cells, and the sequencing data of the somatic cells of another individual can be used as the genetic data of cancer cells to synthesize a paired data set. The real paired data set can be used for testing. For the fine-tuning data set, it is also necessary to determine the candidate sites and extract the corresponding MSA data based on the candidate sites. The genetic data from the two somatic cells will extract MSA data respectively. At the same time, it is also necessary to extract the alignment quality value, base quality value, and positive and negative chain information in the sequencing data for constructing training features.
[0408] 1.5 Tag Construction
[0409] The label information includes the mutation type. Among them, the first somatic cell is a normal cell, and the second somatic cell is a cancer cell. According to whether the normal cell mutates and whether the cancer cell mutates, it is divided into four types of mutations: noise mutation (artifact), system mutation (somatic), normal cell mutation only (normal-only), germline mutation (germline). Noise mutation (artifact) also includes the situation where no mutation occurs, which means that neither normal cells nor cancer cells have mutated. System mutation (somatic) means that normal cells have not mutated and cancer cells have mutated. Normal cell mutation only (normal-only) means that normal cells have mutated and cancer cells have not mutated. Germline mutation (germline) means that both normal cells and cancer cells have mutated. During the training stage, it is necessary to sample training data according to different label ratios to prevent large differences in the number of samples with different labels. No sampling is required during testing, so that the test data is close to the natural distribution.
[0410] 2. Training of basic models
[0411] 2.1 Model Structure
[0412] refer to Figure 5The basic model is the Unified Sequence Model (USM). The basic model includes: the second coding layer (MSA Embedding), a stacked feature extraction unit (USM Block), and a conversion layer (LM Head). The second coding layer is cascaded with the feature extraction unit, and the feature extraction unit is cascaded with the conversion layer. There are N stacked feature extraction units, N is greater than or equal to 1, and the structure and calculation operation of each feature extraction unit in the N feature extraction units are consistent.
[0413] 2.2 Training method
[0414] (1) The first encoding layer (MSA Embedding) is used to encode MSA data and is implemented using a standard Embedding layer. The feature extraction unit (USM Block) is used to extract MSA features based on self-attention calculations, including column attention calculations and row attention calculations. The input features are calculated through column attention to learn the information of bases aligned at the same position. Since the amount of information in the column direction of MSA data is low, after the column attention calculation is completed, the column attention features are average pooled in the column direction and row dimension. The average pooled features are further extracted through row attention calculations.
[0415] (2) Pre-training method: The pre-training of the basic model adopts the dynamic mask (Mask Token) method, which combines two masking schemes: column masking and global random masking. Column masking refers to randomly masking the entire column. Since column masking is difficult to learn, a smaller ratio is used during training, set to 5%. Global random masking operation refers to dynamically randomly masking a single character (Token). As the training progresses, the ratio is set from high to low, from 0.3 to 0.15.
[0416] 3. Training of somatic variant detection models
[0417] 3.1 Model Structure
[0418] refer to Fig.11 The somatic variation detection model for executing the somatic variation detection method includes: a first encoding layer (Embedding), a basic model layer (USM Core), and a classifier (Classifier); the first encoding layer is cascaded with the basic model layer, and the basic model layer is cascaded with the classifier.
[0419] The somatic variation detection model is adjusted based on the basic model. The somatic variation detection model removes the conversion layer (LM Head) of the basic model and adds a classifier (Classifier). The model parameters of the first encoding layer (Embedding) of the somatic variation detection model are the same as the model parameters of the second encoding layer (MSA embedding) of the pre-trained basic model, and the model parameters of the basic model layer (USM Core) are the same as the N feature extraction units (USM Block) stacked in the pre-trained basic model.
[0420] 3.2 Training method
[0421] The training loss of the somatic variation detection model is the cross entropy loss. The input data of the somatic variation detection model are: reference gene sequence, sequence MSA data of normal cells and cancer cells, insertion MSA data, alignment quality value of each base, and positive and negative chain information during gene sequencing. Among them, the MSA data from normal cells and cancer cells are merged. The first encoding layer (Embedding) is implemented as a standard Embedding layer and / or Linear layer. Among them, the MSA of continuous values is encoded using the Linear layer, and the categorical MSA is encoded using the Embedding layer. The various encoded features are added and input into the basic model layer (USM Core). The output features of the basic model layer only use the first row of features for classification. The first row of features passes through the classifier to obtain the mutation type: noise mutation (artifact), system mutation (somatic), normal-only mutation (normal-only), germline mutation (germline) and the corresponding probability.
[0422] (II) Application stage
[0423] The somatic variation detection model provided in the embodiments of the present application has at least the following application scenarios:
[0424] 1. Application scenario: somatic cell mutation detection
[0425] refer to Fig.12 , the computer device stores the somatic cell variation detection model. 1-1. The computer device obtains individual cancer cells; performs 2-1. sequencing in sequence; 3-1. sequence alignment; obtains 4-1. tumor MSA data; 1-2. The computer device obtains individual normal cells; performs 2-2. sequencing in sequence; 3-2. sequence alignment; obtains 4-2. normal MSA data; next, performs 5. splicing; 6. inputs the spliced MSA data into the somatic cell variation detection model to obtain the somatic cell variation detection result; performs 7. disease analysis, for example, detecting disease information, for disease screening, prenatal diagnosis and other tasks.
[0426] 2. Application scenario: early cancer screening
[0427] After obtaining the somatic variation detection result, the computer device can provide the somatic variation detection result to the cancer prediction model and use it as an input feature of the cancer prediction model to provide support for obtaining subsequent cancer prediction results.
[0428] (III) Performance comparison
[0429] Referring to Table 1, the prediction accuracy of the Unified Sequence Model (USM), the deep learning-based variant identification model (DeepVariant), and the variant detection model (ClairS-Pileup / ClairS-Full Alignment) are compared. These models were trained on the first 1-19 chromosomes of the human HG003-HG004 synthetic dataset and tested on the 20th chromosome. The input information of these models is MSA data. It can be seen that the prediction accuracy of the USM model is higher than that of the DeepVariant and ClairS models.
[0430] Table 1 Comparison results
[0431] Model Global Accuracy USM 99.72 Deepvariant 99.06 Clair S-Pileup 99.70 ClairS-Full Alignment 99.71
[0432] Fig.13 800 is a block diagram of a somatic variation detection device provided by an exemplary embodiment of the present application. The somatic variation detection device 800 includes: an acquisition module 820 , a combination module 840 , an encoding module 860 , and at least some of the modules in a classification module 880 .
[0433] An acquisition module 820 is used to acquire a reference gene sequence, a first MSA data of a first somatic cell of an individual, and a second MSA data of a second somatic cell of the individual;
[0434] A combining module 840 is used to combine the reference gene sequence, the first MSA data and the second MSA data to obtain the MSA data of the individual;
[0435] An encoding module 860, configured to encode the encoding features of the MSA data; and extract the MSA features corresponding to the encoding features;
[0436] The classification module 880 is used to classify the MSA features and obtain somatic variation detection results of the first somatic cell and the second somatic cell relative to the reference gene sequence.
[0437] In some embodiments, the encoding module 860 is used to:
[0438] A self-attention calculation is performed on the encoded feature to obtain the MSA feature.
[0439] In some embodiments, the encoding module 860 is used to:
[0440] Perform column attention calculation on the encoded features to obtain column attention features;
[0441] Perform pooling on the column attention features in the column direction to obtain column pooling features;
[0442] The column pooling features are subjected to row attention calculation to obtain the MSA features.
[0443] In some embodiments, the classification module 880 is used to:
[0444] Perform classification based on the MSA feature to obtain somatic variation detection results of the first somatic cell and the second somatic cell relative to the reference gene sequence;
[0445] The somatic variation detection result includes a mutation type and a probability corresponding to the mutation type, and the mutation type includes at least one of a noise mutation, a system mutation, a normal cell mutation only, and a germline mutation.
[0446] In some embodiments, the classification module 880 is used to:
[0447] Extracting the first row of MSA features from the MSA features, where the first row of MSA features is used to characterize the global features corresponding to the candidate loci in the gene loci of the MSA data;
[0448] Classification is performed on the first row of MSA features to obtain the somatic variation detection results of the first somatic cell and the second somatic cell relative to the reference gene sequence.
[0449] In some embodiments, the acquisition module 820 is used to:
[0450] Acquiring first sequencing data of the first somatic cell;
[0451] Aligning the first sequencing data with the reference gene sequence to obtain the first aligned data;
[0452] Determining the candidate sites in the first alignment data that meet the screening condition;
[0453] The first MSA data is obtained based on the first alignment data and the candidate sites.
[0454] In some embodiments, the acquisition module 820 is used to:
[0455] In the first alignment data, when there is a base change in the column data corresponding to a gene locus, and the minor allele frequency of the gene locus is greater than a threshold, the gene locus is determined as the candidate locus.
[0456] In some embodiments, the first MSA data includes first sequence MSA data and first insertion MSA data of the candidate site, the first sequence MSA data is used to characterize the base change of the candidate site, and the first insertion MSA data is used to characterize the base insertion of the candidate site;
[0457] The acquisition module 820 is used to:
[0458] Taking each candidate site of the candidate sites as the center of the window, extracting the gene sequence in the window in the first alignment data, wherein each sequencing fragment in the gene sequence corresponds to at least one of base insertion information, base deletion information and base change information;
[0459] Determine the first sequence MSA data of each candidate site based on the base deletion information and the base change information corresponding to each sequencing fragment in the gene sequence, and determine the first insertion MSA data of each candidate site based on the base insertion information corresponding to each sequencing fragment in the gene sequence;
[0460] The first sequence MSA data and the first insertion MSA data corresponding to each candidate site of the candidate site are combined to obtain the first MSA data.
[0461] In some embodiments, the acquisition module 820 is used to:
[0462] Acquiring second sequencing data of the second somatic cell;
[0463] Aligning the second sequencing data with the reference gene sequence to obtain the second aligned data;
[0464] Based on the second alignment data and the candidate sites, the second MSA data is obtained.
[0465] In some embodiments, the second MSA data includes second sequence MSA data and second insertion MSA data of the candidate site, the second sequence MSA data is used to characterize the base change of the candidate site, and the second insertion MSA data is used to characterize the base insertion at the candidate site;
[0466] The acquisition module 820 is used to:
[0467] Taking each candidate site of the candidate sites as the center of the window, extracting the gene sequence in the window in the second alignment data, wherein each sequencing fragment in the gene sequence corresponds to at least one of base insertion information, base deletion information and base change information;
[0468] Determine the second sequence MSA data of each candidate site based on the base deletion information and the base change information corresponding to each sequencing fragment in the gene sequence, and determine the second insertion MSA data of each candidate site based on the base insertion information corresponding to each sequencing fragment in the gene sequence;
[0469] The second sequence MSA data and the second insertion MSA data corresponding to each candidate site of the candidate site are combined to obtain the second MSA data.
[0470] In some embodiments, the first MSA data includes base information and sequencing information of the candidate site of the first somatic cell, the base information includes: base changes in the first sequence MSA data, base insertions in the first insertion MSA data, and at least one of the alignment quality values of each base in the first MSA data; the sequencing information includes at least one of the base quality values of base calls in the first MSA data and the positive and negative strand information of each sequencing fragment of the gene sequence during gene sequencing;
[0471] The second MSA data includes base information and sequencing information of the candidate site of the second somatic cell, and the base information includes: base changes in the second sequence MSA data, base insertions in the second insertion MSA data, and at least one of the comparison quality values of each base in the second MSA data; the sequencing information includes at least one of the base quality values during base calling in the second MSA data and the positive and negative chain information of each sequencing fragment of the gene sequence during gene sequencing.
[0472] In some embodiments, a somatic variation detection model for performing the somatic variation detection method comprises: a first encoding layer, a base model layer, and a classifier; the first encoding layer is cascaded with the base model layer, and the base model layer is cascaded with the classifier;
[0473] Among them, the first encoding layer is used to encode the encoding features of the MSA data; the basic model layer is used to extract the MSA features corresponding to the encoding features; the classifier is used to classify the MSA features to obtain the somatic variation detection results of the first somatic cell and the second somatic cell relative to the reference gene sequence.
[0474] In some embodiments, the acquisition module 820 is used to:
[0475] Acquire the reference gene sequence, first sample MSA data of sample normal cells of a first sample individual, and second sample MSA data of sample variant cells of the first sample individual;
[0476] In some embodiments, the combination module 840 is used to:
[0477] combining the reference gene sequence, the first sample MSA data, and the second sample MSA data to obtain sample MSA data of the first sample individual, wherein the sample MSA data includes a sample mutation type;
[0478] In some embodiments, the encoding module 860 is used to:
[0479] Encoding, based on the first encoding layer, sample encoding features of the sample MSA data;
[0480] Based on the basic model layer, extracting the sample MSA feature corresponding to the sample coding feature;
[0481] In some embodiments, the classification module 880 is used to:
[0482] Based on the classifier, classify the MSA features of the sample to obtain a predicted mutation type;
[0483] In some embodiments, the invention further comprises: a training module; a training module for:
[0484] The model parameters of the somatic variation detection model are adjusted with the training goal of reducing the difference between the predicted mutation type and the sample mutation type.
[0485] In some embodiments, the encoding module 860 is used to:
[0486] Based on the basic model layer, self-attention calculation is performed on the sample encoding feature to obtain the sample MSA feature.
[0487] In some embodiments, the encoding module 860 is used to:
[0488] Based on the basic model layer, performing column attention calculation on the sample encoding feature to obtain a sample column attention feature;
[0489] Performing pooling on the sample column attention features in the column direction to obtain sample column pooling features;
[0490] The sample column pooling features are subjected to row attention calculation to obtain the sample MSA features.
[0491] In some embodiments, the training module is used to:
[0492] Determining a training loss based on the predicted mutation type and the sample mutation type;
[0493] Taking reducing the training loss as a training goal, the model parameters of the somatic variation detection model are adjusted.
[0494] In some embodiments, the training module is used to:
[0495] Determining a cross entropy loss based on the predicted mutation type and the sample mutation type;
[0496] The cross entropy loss is determined as the training loss.
[0497] In some embodiments, the acquisition module 820 is used to:
[0498] Acquire first sample sequencing data of normal cells of the sample;
[0499] Aligning the first sample sequencing data with the reference gene sequence to obtain first sample alignment data;
[0500] Determining sample candidate sites that meet screening conditions in the first sample alignment data;
[0501] Based on the first sample alignment data and the sample candidate sites, the first sample MSA data is determined.
[0502] In some embodiments, the acquisition module 820 is used to:
[0503] In the first sample alignment data, when there is a base change in the column data corresponding to the sample gene site and the minor allele frequency of the sample gene site is greater than a threshold, the sample gene site is determined as the sample candidate site.
[0504] In some embodiments, the first sample MSA data includes first sample sequence MSA data and first sample insertion MSA data of the sample candidate site, the first sample sequence MSA data is used to characterize the base change of the sample candidate site, and the first sample insertion MSA data is used to characterize the base insertion of the sample candidate site;
[0505] The acquisition module 820 is used to:
[0506] Taking each sample candidate site of the sample candidate sites as the center of a window, extracting a sample gene sequence in the window in the first sample alignment data, wherein each sample sequencing fragment in the sample gene sequence corresponds to at least one of base insertion information, base deletion information and base change information;
[0507] Determine the first sample sequence MSA data of each sample candidate site based on the base deletion information and the base change information corresponding to each sample sequencing fragment in the sample gene sequence, and determine the first sample insertion MSA data of each sample candidate site based on the base insertion information corresponding to each sample sequencing fragment in the sample gene sequence;
[0508] The first sample sequence MSA data corresponding to each sample candidate site of the sample candidate site and the first sample insertion MSA data are combined to obtain the first sample MSA data.
[0509] In some embodiments, the acquisition module 820 is used to:
[0510] Obtaining second sample sequencing data of the sample mutant cells;
[0511] Aligning the second sample sequencing data with the reference gene sequence to obtain second sample alignment data;
[0512] Based on the second sample alignment data and the sample candidate sites, the second sample MSA data is determined.
[0513] In some embodiments, the second sample MSA data includes second sample sequence MSA data and second sample insertion MSA data of the sample candidate site, the second sample sequence MSA data is used to characterize the base change of the sample candidate site, and the second sample insertion MSA data is used to characterize the base insertion of the sample candidate site;
[0514] The acquisition module 820 is used to:
[0515] Taking each sample candidate site of the sample candidate sites as the center of a window, extracting a sample gene sequence in the window in the second sample alignment data, wherein each sample sequencing fragment in the sample gene sequence corresponds to at least one of base insertion information, base deletion information and base change information;
[0516] Determine the second sample sequence MSA data of each sample candidate site based on the base deletion information and the base change information corresponding to each sample sequencing fragment in the sample gene sequence, and determine the second sample insertion MSA data of each sample candidate site based on the base insertion information corresponding to each sample sequencing fragment in the sample gene sequence;
[0517] The second sample sequence MSA data and the second sample insertion MSA data corresponding to each sample candidate site of the sample candidate site are combined to obtain the second sample MSA data.
[0518] In some embodiments, the base model layer in the somatic variation detection model includes: a stacked feature extraction unit in a pre-trained base model, the base model includes: a second encoding layer, the stacked feature extraction units, and a conversion layer, the second encoding layer is cascaded with the feature extraction unit, and the feature extraction unit is cascaded with the conversion layer;
[0519] The model parameters of the first encoding layer of the somatic variation detection model are the same as the model parameters of the second encoding layer of the pre-trained basic model.
[0520] In some embodiments, the acquisition module 820 is used to:
[0521] Acquire the reference gene sequence, third sample MSA data of sample normal cells of the second sample individual, and fourth sample MSA data of sample variant cells of the second sample individual;
[0522] In some embodiments, the combination module 840 is used to:
[0523] combining the reference gene sequence, the third sample MSA data and the fourth sample MSA data to obtain sample MSA data of the second sample individual, wherein the sample MSA data includes a sample mutation type;
[0524] In some embodiments, the encoding module 860 is used to:
[0525] encoding, based on the second encoding layer, sample encoding features of the sample MSA data;
[0526] Based on the feature extraction unit, perform self-attention calculation on the sample coding feature to obtain a sample MSA feature corresponding to the sample coding feature;
[0527] In some embodiments, the invention further includes: a conversion module; the conversion module is used to:
[0528] Based on the conversion layer, convert the sample MSA features to obtain a predicted mutation type;
[0529] In some embodiments, the training module is used to:
[0530] The model parameters of the basic model are adjusted with the training goal of reducing the difference between the predicted mutation type and the sample mutation type.
[0531] In some embodiments, the encoding module 860 is used to:
[0532] Based on the feature extraction unit, performing column attention calculation on the sample encoding feature to obtain a sample column attention feature;
[0533] Performing pooling on the sample column attention features in the column direction to obtain sample column pooling features;
[0534] The column pooling features are subjected to row attention calculation to obtain the sample MSA features.
[0535] In some embodiments, the conversion module is used to:
[0536] Performing random masking on at least a portion of the mask area in the sample MSA feature to obtain the sample MSA mask feature, wherein the at least a portion of the mask area includes at least a portion of the columns and at least a portion of the single characters in the sample MSA feature;
[0537] Based on the conversion layer, the predicted base type in the at least a portion of the mask region of the sample MSA mask feature is predicted to obtain the predicted mutation type.
[0538] In some embodiments, the acquisition module 820 is used to:
[0539] Acquire sequencing data of a third sample of normal cells of the sample;
[0540] Aligning the third sample sequencing data with the reference gene sequence to obtain third sample alignment data;
[0541] Determining sample candidate sites that meet screening conditions in the third sample alignment data;
[0542] Based on the third sample alignment data and the sample candidate sites, the third sample MSA data is determined.
[0543] In some embodiments, the acquisition module 820 is used to:
[0544] In the third sample alignment data, when there is a base change in the column data corresponding to the sample gene site, and the minor allele frequency of the sample gene site is greater than a threshold, the sample gene site is determined as the sample candidate site.
[0545] In some embodiments, the third sample MSA data includes third sample sequence MSA data and third sample insertion MSA data of the sample candidate site, the third sample sequence MSA data is used to characterize the base change of the sample candidate site, and the third sample insertion MSA data is used to characterize the base insertion of the sample candidate site;
[0546] The acquisition module 820 is used to:
[0547] Taking each sample candidate site of the sample candidate sites as the center of the window, extracting the sample gene sequence in the window in the third sample alignment data, wherein each sample sequencing fragment in the sample gene sequence corresponds to at least one of base insertion information, base deletion information and base change information;
[0548] Determine the third sample sequence MSA data of each sample candidate site based on the base deletion information and the base change information corresponding to each sample sequencing fragment in the sample gene sequence, and determine the third sample insertion MSA data of each sample candidate site based on the base insertion information corresponding to each sample sequencing fragment in the sample gene sequence;
[0549] The third sample sequence MSA data and the third sample insertion MSA data corresponding to each sample candidate site of the sample candidate site are combined to obtain the third sample MSA data.
[0550] In some embodiments, the acquisition module 820 is used to:
[0551] Acquire fourth sample sequencing data of the sample mutant cells;
[0552] Aligning the fourth sample sequencing data with the reference gene sequence to obtain fourth sample alignment data;
[0553] Based on the fourth sample alignment data and the sample candidate sites, the fourth sample MSA data is determined.
[0554] In some embodiments, the fourth sample MSA data includes fourth sample sequence MSA data and fourth sample insertion MSA data of the sample candidate site, the fourth sample sequence MSA data is used to characterize the base change of the sample candidate site, and the fourth sample insertion MSA data is used to characterize the base insertion of the sample candidate site;
[0555] The acquisition module 820 is used to:
[0556] Taking each sample candidate site of the sample candidate sites as the center of the window, extracting the sample gene sequence in the window in the fourth sample alignment data, wherein each sample sequencing fragment in the sample gene sequence corresponds to at least one of base insertion information, base deletion information and base change information;
[0557] Determine the fourth sample sequence MSA data of each sample candidate site based on the base deletion information and the base change information corresponding to each sample sequencing fragment in the sample gene sequence, and determine the fourth sample insertion MSA data of each sample candidate site based on the base insertion information corresponding to each sample sequencing fragment in the sample gene sequence;
[0558] The fourth sample sequence MSA data and the fourth sample insertion MSA data corresponding to each sample candidate site of the sample candidate sites are combined to obtain the fourth sample MSA data.
[0559] It should be noted that the specific limitations in the embodiments of the one or more somatic variation detection devices 800 provided above can refer to the limitations of the somatic variation detection method above, and will not be repeated here. Each module of the above-mentioned device can be implemented in whole or in part by software, hardware, and a combination thereof. Each module can be embedded in or independent of the processor of the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to each module.
[0560] An embodiment of the present application also provides a computer device, which includes: a processor and a memory, wherein a computer program is stored in the memory; and the processor is used to execute the computer program in the memory to implement the somatic cell variation detection method provided by the above-mentioned method embodiments.
[0561] For example, Fig.14 1 is a structural block diagram of a computer device provided by an exemplary embodiment of the present application. Optionally, the computer device is a server 1000.
[0562] Typically, the server 1000 includes: a processor 1001 and a memory 1002 .
[0563] The processor 1001 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 1001 may be implemented in at least one hardware form of digital signal processing (DSP), field programmable gate array (FPGA), and programmable logic array (PLA). The processor 1001 may also include a main processor and a coprocessor. The main processor is a processor for processing data in an awake state, also known as a central processing unit (CPU); the coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 1001 may be integrated with a graphics processing unit (GPU), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 1001 may also include an artificial intelligence (AI) processor, which is used to process computing operations related to machine learning.
[0564] The memory 1002 may include one or more computer-readable storage media, which may be non-transitory. The memory 1002 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 1002 is used to store at least one instruction, which is used to be executed by the processor 1001 to implement the somatic cell variation detection method provided in each method embodiment of the present application.
[0565] In some embodiments, the server 1000 may also optionally include: an input interface 1003 and an output interface 1004. The processor 1001, the memory 1002, the input interface 1003, and the output interface 1004 may be connected via a bus or a signal line. Each peripheral device may be connected to the input interface 1003 and the output interface 1004 via a bus, a signal line, or a circuit board. The input interface 1003 and the output interface 1004 may be used to connect at least one peripheral device related to input / output (I / O) to the processor 1001 and the memory 1002. In some embodiments, the processor 1001, the memory 1002, the input interface 1003, and the output interface 1004 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 1001, the memory 1002, the input interface 1003, and the output interface 1004 may be implemented on a separate chip or circuit board, which is not limited in the embodiments of the present application.
[0566] Those skilled in the art will understand that Fig.14 The structure shown in the figure does not constitute a limitation on the computer device, and may include more or less components than shown in the figure, or combine some components, or adopt a different arrangement of components.
[0567] An embodiment of the present application also provides a chip, which includes a programmable logic circuit and / or program instructions. When the chip runs on a computer device, it is used to implement the somatic cell variation detection method provided by the above-mentioned method embodiments.
[0568] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. The computer program is loaded and executed by a processor to implement the somatic cell variation detection method provided by the above-mentioned method embodiments.
[0569] The present application embodiment also provides a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the processor of the computer device loads and executes to implement the somatic cell variation detection method provided by the above-mentioned method embodiments.
[0570] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0571] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned computer-readable storage medium may be a read-only memory, a disk or an optical disk, etc.
[0572] Those skilled in the art should be aware that in one or more of the above examples, the functions described in the embodiments of the present application can be implemented with hardware, software, firmware, or any combination thereof. When implemented using software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein the communication media include any media that facilitates the transmission of a computer program from one place to another. The storage medium can be any available medium that a general or special-purpose computer can access.
[0573] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A method for detecting somatic cell variation, characterized in that: The method comprises: Obtaining a reference gene sequence, and first MSA data of a first somatic cell of an individual, and second MSA data of a second somatic cell of the individual; combining the reference gene sequence, the first MSA data, and the second MSA data to obtain MSA data of the individual; Encoding a coding feature of the MSA data; and extracting an MSA feature corresponding to the coding feature; The MSA features are classified to obtain somatic variation detection results of the first somatic cell and the second somatic cell relative to the reference gene sequence.
2. The method according to claim 1, characterized in that The extracting the MSA feature corresponding to the coding feature includes: A self-attention calculation is performed on the encoding feature to obtain the MSA feature.
3. The method according to claim 2, characterized in that The performing self-attention calculation on the encoding feature to obtain the MSA feature includes: Perform column attention calculation on the encoded features to obtain column attention features; Perform pooling on the column attention features in the column direction to obtain column pooling features; The column pooling features are subjected to row attention calculation to obtain the MSA features.
4. The method according to any one of claims 1 to 3, characterized in that: The classifying the MSA feature to obtain the somatic variation detection results of the first somatic cell and the second somatic cell relative to the reference gene sequence includes: Perform classification based on the MSA feature to obtain somatic variation detection results of the first somatic cell and the second somatic cell relative to the reference gene sequence; The somatic variation detection result includes a mutation type and a probability corresponding to the mutation type, and the mutation type includes at least one of a noise mutation, a system mutation, a normal cell mutation only, and a germline mutation.
5. The method according to claim 4, characterized in that The performing classification based on the MSA feature to obtain the somatic variation detection results of the first somatic cell and the second somatic cell relative to the reference gene sequence includes: Extracting the first row of MSA features from the MSA features, where the first row of MSA features is used to characterize the global features corresponding to the candidate loci in the gene loci of the MSA data; Classification is performed on the first row of MSA features to obtain the somatic variation detection results of the first somatic cell and the second somatic cell relative to the reference gene sequence.
6. The method according to any one of claims 1 to 5, characterized in that: The step of obtaining first MSA data of a first somatic cell of an individual comprises: Acquiring first sequencing data of the first somatic cell; Aligning the first sequencing data with the reference gene sequence to obtain the first alignment data; Determining the candidate sites in the first alignment data that meet the screening condition; The first MSA data is obtained based on the first alignment data and the candidate sites.
7. The method according to claim 6, characterized in that The determining the candidate site in the first alignment data that meets the screening condition comprises: In the first alignment data, when there is a base change in the column data corresponding to a gene locus, and the minor allele frequency of the gene locus is greater than a threshold, the gene locus is determined as the candidate locus.
8. The method according to claim 6, characterized in that The first MSA data includes first sequence MSA data and first insertion MSA data of the candidate site, the first sequence MSA data is used to characterize the base change of the candidate site, and the first insertion MSA data is used to characterize the base insertion of the candidate site; The obtaining the first MSA data based on the first alignment data and the candidate sites includes: Taking each candidate site of the candidate sites as the center of the window, extracting the gene sequence in the window in the first alignment data, wherein each sequencing fragment in the gene sequence corresponds to at least one of base insertion information, base deletion information and base change information; Determine the first sequence MSA data of each candidate site based on the base deletion information and the base change information corresponding to each sequencing fragment in the gene sequence, and determine the first insertion MSA data of each candidate site based on the base insertion information corresponding to each sequencing fragment in the gene sequence; The first sequence MSA data and the first insertion MSA data corresponding to each candidate site of the candidate site are combined to obtain the first MSA data.
9. The method according to any one of claims 1 to 8, characterized in that: The step of obtaining second MSA data of a second somatic cell of the individual comprises: Acquiring second sequencing data of the second somatic cell; Aligning the second sequencing data with the reference gene sequence to obtain the second aligned data; Based on the second alignment data and the candidate sites, the second MSA data is obtained.
10. The method according to claim 9, characterized in that The second MSA data includes second sequence MSA data and second insertion MSA data of the candidate site, the second sequence MSA data is used to characterize the base change of the candidate site, and the second insertion MSA data is used to characterize the base insertion at the candidate site; The obtaining the second MSA data based on the second alignment data and the candidate site comprises: Taking each candidate site of the candidate sites as the center of the window, extracting the gene sequence in the window in the second alignment data, wherein each sequencing fragment in the gene sequence corresponds to at least one of base insertion information, base deletion information and base change information; Determine the second sequence MSA data of each candidate site based on the base deletion information and the base change information corresponding to each sequencing fragment in the gene sequence, and determine the second insertion MSA data of each candidate site based on the base insertion information corresponding to each sequencing fragment in the gene sequence; The second sequence MSA data and the second insertion MSA data corresponding to each candidate site of the candidate site are combined to obtain the second MSA data.
11. The method according to any one of claims 1 to 10, characterized in that: The first MSA data includes base information and sequencing information of the candidate site of the first somatic cell, wherein the base information includes: base changes in the first sequence MSA data, base insertions in the first insertion MSA data, and at least one of a comparison quality value of each base in the first MSA data; the sequencing information includes at least one of a base quality value during base calling in the first MSA data and positive and negative strand information of each sequencing fragment of the gene sequence during gene sequencing; The second MSA data includes base information and sequencing information of the candidate site of the second somatic cell, and the base information includes: base changes in the second sequence MSA data, base insertions in the second insertion MSA data, and at least one of the comparison quality values of each base in the second MSA data; the sequencing information includes at least one of the base quality values during base calling in the second MSA data and the positive and negative chain information of each sequencing fragment of the gene sequence during gene sequencing.
12. The method according to any one of claims 1 to 10, characterized in that: The somatic variation detection model for executing the somatic variation detection method comprises: a first encoding layer, a base model layer, and a classifier; the first encoding layer is cascaded with the base model layer, and the base model layer is cascaded with the classifier; Among them, the first encoding layer is used to encode the encoding features of the MSA data; the basic model layer is used to extract the MSA features corresponding to the encoding features; the classifier is used to classify the MSA features to obtain the somatic variation detection results of the first somatic cell and the second somatic cell relative to the reference gene sequence.
13. The method according to claim 12, characterized in that The method further comprises: Acquire the reference gene sequence, first sample MSA data of sample normal cells of a first sample individual, and second sample MSA data of sample variant cells of the first sample individual; combining the reference gene sequence, the first sample MSA data, and the second sample MSA data to obtain sample MSA data of the first sample individual, wherein the sample MSA data includes a sample mutation type; Encoding, based on the first encoding layer, sample encoding features of the sample MSA data; Based on the basic model layer, extracting the sample MSA feature corresponding to the sample coding feature; Based on the classifier, classify the MSA features of the sample to obtain a predicted mutation type; The model parameters of the somatic variation detection model are adjusted with the training goal of reducing the difference between the predicted mutation type and the sample mutation type.
14. The method according to claim 12, characterized in that The basic model layer in the somatic variation detection model includes: a feature extraction unit stacked in a pre-trained basic model, the basic model includes: a second encoding layer, the stacked feature extraction units, and a conversion layer, the second encoding layer is cascaded with the feature extraction unit, and the feature extraction unit is cascaded with the conversion layer; The model parameters of the first encoding layer of the somatic variation detection model are the same as the model parameters of the second encoding layer of the pre-trained basic model.
15. The method according to claim 14, characterized in that The method further comprises: Acquire the reference gene sequence, third sample MSA data of sample normal cells of the second sample individual, and fourth sample MSA data of sample variant cells of the second sample individual; combining the reference gene sequence, the third sample MSA data and the fourth sample MSA data to obtain sample MSA data of the second sample individual, wherein the sample MSA data includes a sample mutation type; encoding, based on the second encoding layer, sample encoding features of the sample MSA data; Based on the feature extraction unit, perform self-attention calculation on the sample coding feature to obtain a sample MSA feature corresponding to the sample coding feature; Based on the conversion layer, convert the sample MSA features to obtain a predicted mutation type; The model parameters of the basic model are adjusted with the training goal of reducing the difference between the predicted mutation type and the sample mutation type.
16. The method according to claim 15, characterized in that The converting the sample MSA feature based on the conversion layer to obtain the predicted mutation type includes: Performing random masking on at least a portion of the mask area in the sample MSA feature to obtain the sample MSA mask feature, wherein the at least a portion of the mask area includes at least a portion of the columns and at least a portion of the single characters in the sample MSA feature; Based on the conversion layer, the predicted base type in the at least a portion of the mask region of the sample MSA mask feature is predicted to obtain the predicted mutation type.
17. A somatic cell variation detection device, characterized in that: The device comprises: An acquisition module, used to acquire a reference gene sequence, a first MSA data of a first somatic cell of an individual, and a second MSA data of a second somatic cell of the individual; A combination module, used for combining the reference gene sequence, the first MSA data and the second MSA data to obtain the MSA data of the individual; An encoding module, used for encoding the encoding features of the MSA data; and extracting the MSA features corresponding to the encoding features; A classification module is used to classify the MSA features to obtain somatic variation detection results of the first somatic cell and the second somatic cell relative to the reference gene sequence.
18. A computer device, characterized in that: The computer device comprises: a processor and a memory, wherein the memory stores a computer program, and the computer program is loaded and executed by the processor to implement the somatic variation detection method according to any one of claims 1 to 16.
19. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is loaded and executed by a processor to implement the somatic variation detection method according to any one of claims 1 to 16.
20. A computer program product, characterized in that The computer program product includes computer instructions, which are stored in a computer-readable storage medium. The processor obtains the computer instructions from the computer-readable storage medium, so that the processor loads and executes them to implement the somatic variation detection method according to any one of claims 1 to 16.
Citation Information
Patent Citations
Method for analyzing gene mutation based on second-generation sequencing data
CN108304694A
Somatic mutation extraction method and device for single cell transcriptome sequencing data
CN115631790A
Method, apparatus, medium and program product for predicting protein complex structure
CN117292743A