Method for training gene model, method for classifying gene sequence, device and product
Patent Information
- Application Number
- CN202411765699.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2026-09-22
- Estimated Expiration
- 2044-11-29
AI Technical Summary
本申请实施例提供了一种基因模型的训练方法、装置、设备、介质及程序产品,在本申请实施例中,在对基因模型进行训练的过程中,所应用的训练集中包括基因序列信息,基因序列信息中包含异常序列信息,该异常序列信息是将基因序列信息与标准基因序列进行比较,得到的,异常序列信息至少用于表征所述基因序列信息中异常基因的异常位置和异常类型;也就是说,本申请实施例中在对基因模型进行训练的过程中除了利用人类标准基因序列或者多物种的标准基因序列之外,还应用了异常基因序列以及该异常基因序列所对应的可以表征异常基因的异常位置和异常类型的异常信息,从而可以提升基于该训练集所训练得到的基因模型在个体数据的泛化能力,进而可以降低将训练后的基因模型应用到相关下游任务中的复杂度。
Smart Images

Figure CN119626341B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of computer technology. Specifically, this application relates to a method for training a gene model, a method for classifying gene sequences, an apparatus, and a product. Background Technology
[0002] With the rise of large language models in recent years, there are more and more biological language models. Existing large gene language models are mainly deoxyribonucleic acid (DNA) language models. These models use human reference genes or reference genomes of multiple species to pre-train pure sequence language models, and then apply them to multiple DNA sequence-related downstream tasks, such as gene variation, disease auxiliary diagnosis and other related tasks.
[0003] Because these types of models only use reference genes, they have weak generalization ability on individual data and are difficult to apply to related downstream tasks. Summary of the Invention
[0004] The purpose of this application is to provide a training method, gene sequence classification method, device, and product for gene models that can improve the generalization ability of models on individual data and can be better applied to related downstream tasks.
[0005] To achieve the above objectives, the technical solutions provided in this application are as follows: Firstly, a method for training a gene model is provided, the method comprising: A training set is obtained, which includes gene sequence information. The gene sequence information is compared with a standard gene sequence to obtain abnormal sequence information in the gene sequence information. The abnormal sequence information is used to characterize at least the abnormal location and abnormal type of the abnormal gene in the gene sequence information. Based on the training set, the gene model is trained to obtain the first trained model.
[0006] In one possible implementation, training the gene model based on the training set to obtain the trained gene model includes: For each abnormal gene at an abnormal position, a target encoding method corresponding to the abnormal type of the abnormal gene is determined, and the abnormal position in the abnormal sequence information or the abnormal position in the standard gene sequence is encoded using the target encoding method to obtain the encoded sequence information. The gene model is trained based on the encoded sequence information to obtain the trained gene model.
[0007] In another possible implementation, the method further includes: Determine the target number of abnormal bases in the abnormal gene at each abnormal location; For each anomalous location, the target encoding method corresponding to that anomalous location is determined based on the anomalous type of the anomalous gene at that location, including: For each anomalous location, the target encoding method is determined based on the target number of anomalous bases in the anomalous gene at that location and the anomalous type of the anomalous gene at that location.
[0008] In another possible implementation, for each anomalous location, determining the target encoding method based on the target number of anomalous bases in the anomalous gene at that location and the anomalous type of the anomalous gene at that location includes: If the target quantity is greater than the preset threshold quantity, at the abnormal position, the base at the abnormal position is replaced with a preset string corresponding to the abnormal type at the abnormal position; If the target number is not greater than the preset threshold number, if the anomaly type is the target type, the string corresponding to the target type is inserted into the abnormal gene sequence in the anomaly sequence information or the standard gene sequence corresponding to the abnormal gene sequence. If the anomaly type is not the target type, the abnormal gene sequence in the anomaly sequence information or the standard gene sequence corresponding to the abnormal gene sequence is used as the encoded sequence information.
[0009] In another possible implementation, the target type includes a base insertion type or a base deletion type; If the anomaly type is the target type, insert the string corresponding to the target type into the abnormal gene sequence or the standard gene sequence corresponding to the abnormal gene sequence in the anomaly sequence information, including: If the target type is a base insertion type, a preset string corresponding to the base insertion type is used to insert the standard gene sequence corresponding to the abnormal gene sequence; If the target type is a base deletion type, a preset string corresponding to the base deletion type is used to insert into the abnormal gene sequence.
[0010] In another possible implementation, the training set further includes: chromosome position information and base position information corresponding to the gene sequence information, wherein each position information in the chromosome sequence information represents the chromosome identifier of each base in the gene sequence, and each position information in the base position sequence represents the position identifier of each base in the gene sequence in that chromosome. For each base, obtain the position identifier of that base within the chromosome, including: Determine the actual location of the base in the chromosome; Determine the target position parameter, which represents the total number of bases contained in the chromosome; Based on the actual position information of the base in the chromosome and the target position parameter, the position identifier of the base in the chromosome is determined.
[0011] In another possible implementation, the gene sequence information includes multiple abnormal gene sequence information and at least one standard gene sequence information, wherein the multiple abnormal gene sequence information includes at least one abnormal gene sequence information of an individual object and at least one abnormal gene sequence information of a population, each of the abnormal gene sequence information includes a standard gene sequence and an abnormal gene sequence of the standard gene sequence, and each standard gene sequence information includes two standard gene sequences. Among them, the number of standard gene sequence information is greater than the number of abnormal gene sequence information in individuals, and the number of abnormal gene sequence information in individuals is greater than the number of abnormal gene sequence information in the population.
[0012] In another possible implementation, training the gene model based on the training set to obtain the trained gene model includes: Masking at least one base of an abnormal gene sequence in gene sequence information, and masking at least one base of a standard gene sequence corresponding to an abnormal gene sequence. The gene model is pre-trained based on the masked gene sequence information to obtain a pre-trained mask prediction model, which serves as the trained gene model; wherein, the gene model is used to predict the bases corresponding to the mask in the gene sequence information based on the input masked gene sequence information. The target training loss of the masked prediction model includes anomaly sequence prediction loss and standard sequence prediction loss. The anomaly sequence prediction loss is determined based on at least one gene in the masked abnormal gene sequence and the corresponding gene prediction result. The standard sequence training loss is determined based on at least one gene in the masked standard gene sequence and the corresponding gene prediction result.
[0013] Secondly, a method for gene sequence classification is provided, including: Obtain gene sequence information to be classified, wherein the gene sequence information to be classified includes: the gene sequence to be classified; The gene sequence information to be classified is classified using a target classification model to obtain the classification result corresponding to the gene sequence to be classified. The target classification model is obtained by fine-tuning the trained gene model; The trained gene model is obtained by the gene model training method described in any possible implementation of the first aspect.
[0014] In one possible implementation, the gene sequence information to be classified further includes: a chromosome identifier sequence corresponding to the gene sequence to be classified, a position identifier sequence corresponding to the gene sequence to be classified, and an object identifier sequence corresponding to the gene sequence to be classified; the chromosome identifier sequence includes the identifier of the chromosome corresponding to each base in the gene sequence to be classified, and the position identifier sequence includes the position identifier of each base in the gene sequence to be classified within the chromosome. The step of classifying the gene sequence information to be classified using a target classification model to obtain the classification result corresponding to the gene sequence to be classified includes: The gene sequence to be classified, the chromosome identifier sequence corresponding to the gene sequence to be classified, the position identifier sequence corresponding to the gene sequence to be classified, and the object identifier sequence corresponding to the gene sequence to be classified are spliced together to obtain the spliced gene sequence. The spliced gene sequence is classified using the target classification model to obtain the classification result corresponding to the gene sequence to be classified.
[0015] In one possible implementation, the trained gene model includes: a trained feature extraction sub-model and a trained mask output sub-model; The target classification model is obtained by fine-tuning the trained gene model in the following way: Obtain multiple training samples with classification labels; wherein the training samples include at least one abnormal gene sequence and a standard gene reference sequence of the abnormal gene sequence; Based on the multiple training samples, the gene sequence classification model is fine-tuned to obtain the target classification model. The target classification model is used to classify the variant gene sequence based on the input variant gene sequence and the corresponding standard gene sequence. The gene sequence classification model includes a trained feature extraction sub-model and a classification sub-model.
[0016] Thirdly, a model training device is provided, the device comprising: An acquisition module is used to acquire a training set, which includes gene sequence information. The training set is compared with a standard gene sequence to obtain abnormal sequence information in the gene sequence information. The abnormal sequence information is used to characterize at least the abnormal location and abnormal type of the abnormal gene in the gene sequence information. The training module is used to train the gene model based on the training set to obtain the trained gene model.
[0017] In one possible implementation, the anomaly type includes the anomaly type of the abnormal gene at each anomaly location; When the training module trains the gene model based on the training set to obtain the trained gene model, it is specifically used for: For each abnormal gene at an abnormal position, a target encoding method corresponding to the abnormal type of the abnormal gene is determined, and the abnormal position in the abnormal sequence information or the abnormal position in the standard gene sequence is encoded using the target encoding method to obtain the encoded sequence information. The gene model is trained based on the encoded sequence information to obtain the trained gene model.
[0018] In another possible implementation, the apparatus further includes: a determining module, wherein, The determining module is used to determine the target number of abnormal bases in the abnormal gene at each abnormal location. Specifically, when the training module determines the target encoding method corresponding to each abnormal location based on the abnormality type of the abnormal gene at that location, it is used for: For each anomalous location, the target encoding method is determined based on the target number of anomalous bases in the anomalous gene at that location and the anomalous type of the anomalous gene at that location.
[0019] Specifically, when the training module determines the target encoding method for each anomalous location based on the target number of abnormal bases in the anomalous gene at that location and the anomalous type of the anomalous gene at that location, it is used for: If the target quantity is greater than the preset threshold quantity, at the abnormal position, the base at the abnormal position is replaced with a preset string corresponding to the abnormal type at the abnormal position; If the target number is not greater than the preset threshold number, if the anomaly type is the target type, the string corresponding to the target type is inserted into the abnormal gene sequence in the anomaly sequence information or the standard gene sequence corresponding to the abnormal gene sequence. If the anomaly type is not the target type, the abnormal gene sequence in the anomaly sequence information or the standard gene sequence corresponding to the abnormal gene sequence is used as the encoded sequence information.
[0020] In another possible implementation, the target type includes a base insertion type or a base deletion type; the training module, when inserting a string corresponding to the target type into the abnormal gene sequence in the abnormal sequence information or the standard gene sequence corresponding to the abnormal gene sequence if the anomaly type is the target type, is specifically used for: If the target type is a base insertion type, a preset string corresponding to the base insertion type is used to insert the standard gene sequence corresponding to the abnormal gene sequence; If the target type is a base deletion type, a preset string corresponding to the base deletion type is used to insert into the abnormal gene sequence.
[0021] In another possible implementation, the training set further includes: chromosome position information and base position information corresponding to the gene sequence information, wherein each position information in the chromosome sequence information represents the chromosome identifier of each base in the gene sequence, and each position information in the base position sequence represents the position identifier of each base in the gene sequence in that chromosome. When the acquisition module acquires the position identifier of each base in the chromosome, it is specifically used for: Determine the actual location of the base in the chromosome; Determine the target position parameter, which represents the total number of bases contained in the chromosome; Based on the actual position information of the base in the chromosome and the target position parameter, the position identifier of the base in the chromosome is determined.
[0022] In another possible implementation, the gene sequence information includes multiple abnormal gene sequence information and at least one standard gene sequence information, wherein the multiple abnormal gene sequence information includes at least one abnormal gene sequence information of an individual object and at least one abnormal gene sequence information of a population, each of the abnormal gene sequence information includes a standard gene sequence and an abnormal gene sequence of the standard gene sequence, and each standard gene sequence information includes two standard gene sequences. Among them, the number of standard gene sequence information is greater than the number of abnormal gene sequence information in individuals, and the number of abnormal gene sequence information in individuals is greater than the number of abnormal gene sequence information in the population.
[0023] In another possible implementation, when the training module trains the gene model based on the training set to obtain the trained gene model, it is specifically used for: Masking at least one base of an abnormal gene sequence in gene sequence information, and masking at least one base of a standard gene sequence corresponding to an abnormal gene sequence. The gene model is pre-trained based on the masked gene sequence information to obtain a pre-trained mask prediction model, which serves as the trained gene model; wherein, the gene model is used to predict the bases corresponding to the mask in the gene sequence information based on the input masked gene sequence information. The target training loss of the masked prediction model includes anomaly sequence prediction loss and standard sequence prediction loss. The anomaly sequence prediction loss is determined based on at least one base in the masked abnormal gene sequence and the corresponding base prediction result. The standard sequence training loss is determined based on at least one base in the masked standard gene sequence and the corresponding base prediction result.
[0024] Fourthly, a device for gene sequence classification is provided, comprising: A gene sequence information acquisition module is used to acquire gene sequence information to be classified, wherein the gene sequence information to be classified includes the gene sequence to be classified. The classification module is used to classify the gene sequence information to be classified through the target classification model to obtain the classification result corresponding to the gene sequence to be classified. The target classification model is obtained by fine-tuning the trained gene model; The trained gene model is obtained through the gene model training method described in any possible implementation of the third aspect.
[0025] In one possible implementation, the gene sequence information to be classified further includes: a chromosome identifier sequence corresponding to the gene sequence to be classified, a position identifier sequence corresponding to the gene sequence to be classified, and an object identifier sequence corresponding to the gene sequence to be classified; the chromosome identifier sequence includes the identifier of the chromosome corresponding to each base in the gene sequence to be classified, and the position identifier sequence includes the position identifier of each base in the gene sequence to be classified within the chromosome. Specifically, when the classification module classifies the gene sequence information to be classified using a target classification model to obtain the classification result corresponding to the gene sequence to be classified, it is used for: The gene sequence to be classified, the chromosome identifier sequence corresponding to the gene sequence to be classified, the position identifier sequence corresponding to the gene sequence to be classified, and the object identifier sequence corresponding to the gene sequence to be classified are spliced together to obtain the spliced gene sequence. The spliced gene sequence is classified using the target classification model to obtain the classification result corresponding to the gene sequence to be classified.
[0026] In one possible implementation, the trained gene model includes: a trained feature extraction sub-model and a trained mask output sub-model; The target classification model is obtained by fine-tuning the trained gene model in the following way: Obtain multiple training samples with classification labels; wherein the training samples include at least one abnormal gene sequence and a standard gene reference sequence of the abnormal gene sequence; Based on the multiple training samples, the gene sequence classification model is fine-tuned to obtain the target classification model. The target classification model is used to classify the variant gene sequence based on the input variant gene sequence and the corresponding standard gene sequence. The gene sequence classification model includes a trained feature extraction sub-model and a classification sub-model.
[0027] Fifthly, embodiments of this application also provide an electronic device, the payment verification device including a memory and a processor, the memory storing a computer program, the processor executing the computer program to implement the gene model training method provided by any possible implementation of the first aspect.
[0028] In a sixth aspect, embodiments of this application also provide an electronic device, the chargeback request processing device including a memory and a processor, the memory storing a computer program, the processor executing the computer program to implement the gene sequence classification method provided in any possible implementation of the second aspect.
[0029] In a seventh aspect, embodiments of this application also provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements a method for training a gene model provided by any possible implementation of the first aspect.
[0030] Eighthly, embodiments of this application also provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the gene sequence classification method provided by any possible implementation of the second aspect.
[0031] In a ninth aspect, embodiments of this application also provide a computer program product comprising a computer program that, when executed by a processor, implements a method for training a gene model provided by any possible implementation of the first aspect.
[0032] In a tenth aspect, embodiments of this application also provide a computer program product comprising a computer program that, when executed by a processor, implements the gene sequence classification method provided by any possible implementation of the second aspect.
[0033] The beneficial effects of the technical solution provided in this application are as follows: This application provides a method, apparatus, device, medium, and program product for training a gene model. In this application, during the training of the gene model, the training set includes gene sequence information, which contains abnormal sequence information. This abnormal sequence information is obtained by comparing the gene sequence information with standard gene sequences. The abnormal sequence information is used to characterize at least the abnormal position and abnormal type of the abnormal gene in the gene sequence information. That is, in the process of training the gene model, in addition to using human standard gene sequences or standard gene sequences of multiple species, this application also uses abnormal gene sequences and the abnormal information corresponding to these abnormal gene sequences that can characterize the abnormal position and abnormal type of the abnormal gene. This can improve the generalization ability of the gene model trained based on the training set on individual data, thereby reducing the complexity of applying the trained gene model to related downstream tasks. This application provides a method, apparatus, device, medium, and program product for gene sequence classification. In this application embodiment, a gene sequence to be classified is obtained, and it is classified by a target classification model to obtain the classification result corresponding to the gene sequence to be classified. The target classification model is obtained by fine-tuning a trained gene model. In addition to using standard human gene sequences or standard gene sequences of multiple species, the training set used by the trained gene model also uses abnormal gene sequences and abnormal information corresponding to the abnormal gene sequences that can characterize the abnormal position and abnormal type of the abnormal gene. This can improve the generalization ability of the gene model trained based on the training set on individual data, thereby reducing the complexity of applying the trained gene model to related downstream tasks. Attached Figure Description
[0034] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments of this application will be briefly introduced below.
[0035] Figure 1 This is an example diagram illustrating an exemplary implementation environment in the embodiments of this application; Figure 2 This is a schematic diagram of the training process of a gene model in an embodiment of this application; Figure 3 This is a schematic diagram of the training process of another gene model in the embodiments of this application; Figure 4 This is a schematic diagram of a long variant encoding in an embodiment of this application; Figure 5 This is a schematic diagram of a short variant encoding in an embodiment of this application; Figure 6 This is an example diagram of an overall gene encoding in an embodiment of this application; Figure 7 This is a schematic diagram of the structure of a UGM basic model in an embodiment of this application; Figure 8 This is a schematic diagram of the design structure of a UGM Block in an embodiment of this application; Figure 9a This is a schematic flowchart of a gene sequence classification method in an embodiment of this application; Figure 9b This is a schematic diagram illustrating a method for gene sequence classification in an embodiment of this application. Figure 10 This is a schematic diagram of a training device for a gene model in an embodiment of this application; Figure 11 This is a schematic diagram of a gene sequence classification device in an embodiment of this application; Figure 12 This is a schematic diagram of the device structure of an electronic device according to an embodiment of this application. Detailed Implementation
[0036] The embodiments of this application are described below with reference to the accompanying drawings. It should be understood that the embodiments described below with reference to the accompanying drawings are exemplary descriptions for explaining the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions of the embodiments of this application.
[0037] Those skilled in the art will understand that, unless specifically stated otherwise, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the terms “comprising” and “including” as used in embodiments of this application mean that the corresponding feature can be implemented as the presented feature, information, data, step, operation, element, and / or component, but do not exclude implementation as other features, information, data, step, operation, element, component, and / or combinations thereof supported by the art. It should be understood that when we say that an element is “connected” or “coupled” to another element, the one element can be directly connected or coupled to the other element, or it can mean that the one element and the other element establish a connection relationship through an intermediate element. Furthermore, “connected” or “coupled” as used herein can include wireless connection or wireless coupling. The term “and / or” as used herein indicates at least one of the items defined by the term; for example, “A and / or B” can be implemented as “A,” or as “B,” or as “A and B.” When describing multiple (two or more) items, if the relationship between the multiple items is not explicitly defined, the multiple items can refer to one, several or all of the multiple items. For example, the description of "parameter A includes A1, A2, A3" can be implemented as parameter A includes A1 or A2 or A3, or it can be implemented as parameter A includes at least two of the three items A1, A2 and A3.
[0038] With the development of gene sequencing technology, our understanding of gene variations is becoming increasingly profound. This understanding is of great significance in modern medical and biological research, helping us to understand an individual's genetic characteristics, predict disease risk, and assess drug responses, thus providing a basis for precision medicine. The human reference genome is a standardized genome sequence. It is a consensus sequence constructed by sequencing and comparing the genomes of multiple different individuals. An individual's gene variation refers to the change in an individual's DNA segments relative to a reference genome. Learning the correlation between variations or gene abnormalities and diseases from large amounts of individual sequencing data is crucial to assisting medical professionals in relevant treatments.
[0039] Large-scale gene language models, primarily DNA language models such as DNABERT, NT, DNAGPT, and HyenaDNA, are pre-trained pure sequence language models using human reference genes or reference genomes from multiple species. These models are then applied to various downstream tasks related to DNA sequences. The main structures of these models are BERT and GPT. However, model training uses only DNA sequences and does not perform positional coding on genes. Furthermore, because they only use reference genes, their generalization ability on individual data is weak, and they cannot be applied to tasks related to gene variation or disease-aided diagnosis.
[0040] In the field of disease-aided discrimination, relevant methods primarily standardize patient clinical and variant information into tables. Table-based learning methods, such as traditional machine learning techniques like random forests and decision trees, are then used to train disease discrimination models. However, these methods cannot utilize massive amounts of variant data, require significantly more expert knowledge compared to large language models, and are difficult to generalize to a wide range of disease-aided discrimination tasks.
[0041] Furthermore, related pre-trained gene models, such as DNABERT and NT, only learn DNA sequences. Since individual variations relative to the reference genome are sparse, simply learning DNA sequences is highly inefficient and time-consuming. Gene mutations require both the mutated gene sequence (also known as an abnormal gene sequence) and the standard gene sequence (also known as a reference sequence). Inputting only one sequence leaves the model lacking information about gene location, making it unsuitable for gene sequence classification tasks. Because human gene sequences are extremely long, existing models cannot input complete individual information, making it impossible to classify gene sequences at the individual level, and they are also unlikely to provide auxiliary identification for diseases related to gene sequences.
[0042] Related models that classify gene sequences to aid in disease classification rely on tabular learning methods to statistically analyze large amounts of variation information. However, these models cannot accept fine-grained sequence features as input, making it difficult to learn the correlation between variations and diseases at the sequence level. Furthermore, they require extensive expert knowledge and have poor generalizability.
[0043] Existing mutation coding methods have the following problems: 1) Encoding gene name, sequence information lost; 2) Information such as the number of encoded mutations and the location of lost mutations.
[0044] Based on the aforementioned related technologies and their technical problems, the embodiments of this application can be used to solve the following problems: (1) By using a unified gene base model, we can learn the population variation distribution and individual variation distribution from a large amount of data (learn the relationship between variations in the same individual, since the variations are not independent of each other due to gene linkage disequilibrium). (2) To address the diversity of gene variation types, a universal encoding method is used to effectively encode short variation (less than 50 BP) and long variation (greater than 50 BP) types, including common variation types such as insertion, deletion, single base variation, copy number, replication, and inversion.
[0045] (3) Utilize large language models to learn the correlation between variations and diseases, reduce expert-designed features, and improve the generalization and universality of the model.
[0046] Furthermore, to address the aforementioned technical issues, this application aims to establish a unified human genome foundation model that learns the differences between individual genes and human reference genes, providing a foundational model for downstream pan-genome disease auxiliary diagnostic tasks such as cancer, heart disease, and lupus. This application's embodiments have the following key technical points: 1) By using unsupervised learning and a large amount of computing resources, a general human genome basic model (UGM) is trained using human reference genome and gene variation data.
[0047] 2) A unified gene type encoding method is proposed to effectively encode common gene variation types such as non-variable, short variant, and structural variant.
[0048] 3) A unified gene location coding method is proposed, which effectively encodes information such as chromosomes, locations, and samples, and is more universal and effective than existing gene name coding methods.
[0049] 4) A novel gene model pre-training method is proposed, including context learning, germline variant learning, and variant correlation learning, which effectively improves the generalization of the basic model.
[0050] Before providing a further detailed description of the embodiments of this application, the nouns and terms involved in the embodiments of this application will be explained, and the nouns and terms involved in the embodiments of this application shall be interpreted as follows.
[0051] UGM: Unified Genomics Model, such as a DNA sequence and DNA variation language model; BERT: Bidirectional Encoder Representation from Transformers, a bidirectional encoder transformer model trained using random masked inputs; SNP: Single Nucleotide Polymorphism; HLA: Linkage disequilibrium refers to the probability that alleles belonging to two or more gene loci are simultaneously located on a chromosome, which is higher than the frequency of random occurrence. LORA: Low-Rank Adaptation of Large Language Models, a model fine-tuning method; To address the aforementioned technical problems, embodiments of this application provide a gene model training method and a gene sequence classification method, which can be applied to, for example... Figure 1 The exemplary implementation environment shown may include a terminal 101 and a server 102, wherein the terminal 101 and the server 102 communicate with each other via a communication network. Optionally, the communication network may be a wired network or a wireless network, and the communication network may be at least one of a local area network, a metropolitan area network, and a wide area network. Terminal 101 can be a mobile terminal such as a smartphone, tablet, or laptop computer, or a desktop computer or projector computer. Terminal 101 can obtain the gene sequence information of an object to be classified. The gene sequence information to be classified includes the gene sequence to be classified and the standard gene sequence corresponding to the gene sequence to be classified. Terminal 101 can be a gene sequencing device to obtain the gene sequence information of the object to be classified, or it can obtain the gene sequence information of the object to be classified from other devices. Server 102 can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery network (CDN), and big data and artificial intelligence platforms. In this embodiment, server 102 is the backend server corresponding to terminal 101. A target classification model can be set in server 102. Terminal 101 can classify the gene sequence information to be classified through the target classification model to obtain the classification result corresponding to the gene sequence to be classified, and transmit the obtained classification result corresponding to the gene sequence to be classified to terminal 101 for display. The target classification model is obtained by fine-tuning the gene sequence classification model. Fine-tuning the gene sequence classification model can be performed in server 102 or in other electronic devices (not shown in the figure), which is not limited in this embodiment. Furthermore, the gene sequence classification model includes a trained feature extraction sub-model and a classification sub-model. The trained feature extraction sub-model can be located in the pre-trained mask prediction model (trained gene model). The trained mask prediction model further includes a mask output sub-model. The pre-trained mask prediction model is obtained by pre-training the first model. The device for pre-training the gene model and the device for fine-tuning the gene sequence classification model can be the same device or different devices. No limitation is made in this embodiment.
[0052] It should be noted that, Figure 1 This is merely an example of a possible application environment and is not intended to limit the application environment to which the embodiments of this application are adapted.
[0053] Based on the above application environment, this application embodiment introduces a method for training a gene model and a method for gene sequence classification. Specifically, this application embodiment provides a method for training a gene model, such as... Figure 2 As shown, the operation is performed by an electronic device. In this embodiment of the application, the electronic device can be a terminal or a server, for example, it can be the one described above. Figure 1 The method of the server 102 shown may include: Step S201: Obtain the training set.
[0054] The training set includes gene sequence information. This gene sequence information is compared with a standard gene sequence (reference sequence) to obtain abnormal sequence information within the gene sequence information. In this embodiment, the abnormal sequence information may include: abnormal gene sequences and abnormal information about those abnormal gene sequences. The abnormal gene sequence may be referred to as a variant sequence.
[0055] Among them, abnormal sequence information is used to characterize at least the abnormal location and abnormal type of abnormal genes in gene sequence information. That is to say, the abnormal information of abnormal gene sequences characterizes at least the abnormal location (also called variant location) and abnormal type (also called variant type) of abnormal genes in gene sequence information.
[0056] Specifically, gene sequence information can be obtained through second- or third-generation gene sequencing. The sequencing data undergoes routine secondary analysis processes, such as quality control and deduplication, to align the sequencing sequence to a standard gene sequence (also known as a reference gene sequence). After alignment, variant calling is performed. Variant calling tools are not limited to common variant calling software such as GATK to obtain abnormal sequence information.
[0057] The standard gene sequence can be obtained from a gene sequence database, uploaded by the target object, or obtained through other means; this application embodiment does not impose any limitations.
[0058] Step S202: Based on the training set, train the gene model to obtain the trained gene model.
[0059] Specifically, after obtaining the training set through the above embodiments, the gene model is trained to obtain the trained gene model. In the embodiments of this application, the gene model can be an initial model or a model that has undergone a certain amount of training; no limitation is made in the embodiments of this application.
[0060] This application provides a method for training a gene model. In this application, during the training of the gene model, the training set includes gene sequence information, which contains abnormal sequence information. This abnormal sequence information is obtained by comparing the gene sequence information with standard gene sequences. The abnormal sequence information is used to characterize the abnormal location and abnormal type of the abnormal gene in the gene sequence information. In other words, in the process of training the gene model, this application not only uses human standard gene sequences or standard gene sequences of multiple species, but also applies abnormal gene sequences and the abnormal information corresponding to these abnormal gene sequences that can characterize the abnormal location and abnormal type of the abnormal gene. This can improve the generalization ability of the gene model trained based on this training set on individual data, thereby reducing the complexity of applying the trained gene model to related downstream tasks. Specifically, step S202, which involves training the gene model based on the training set to obtain the trained gene model, may include steps S2021 and S2022, such as... Figure 3 As shown, where, Step S2021: Mask at least one base of the abnormal gene sequence in the gene sequence information, and mask at least one base of the standard gene sequence corresponding to the abnormal gene sequence.
[0061] In this embodiment of the application, random masking is performed on the abnormal gene sequence and its corresponding standard gene sequence. That is, at least one base in the abnormal gene sequence and at least one base in the standard gene sequence can be randomly masked.
[0062] In one possible implementation, a random masking ratio can be set, for example, 5%, that is, 15% of the bases are randomly masked (e.g., 5% of the bases in the abnormal gene sequence are masked and / or 5% of the bases in the corresponding standard gene sequence are randomly masked). For example, the masked bases in the sequence are replaced with [mask] or "M".
[0063] In another possible implementation, each gene sequence (including standard gene sequences and abnormal gene sequences) is divided into multiple tokens according to K-mer, and the tokens are randomly masked to obtain the masked gene sequence. k-mer can be understood as dividing a long sequence into many short sequences of length k. k is chosen according to application requirements and can take values of 3, 4, 5, etc. It's based on dividing the sequence into multiple tokens according to k-mer, with each token containing k bases. When k is 3, the gene sequence is divided into tokens of 3 bases each, meaning each token contains 3 bases. After token division, the tokens are randomly masked. A random masking ratio is set, for example, 5%. This means that 5% of the tokens are randomly masked. Three masking methods are used during the masking process: a first ratio randomly replaces some tokens with the mask; a second ratio randomly assigns values to some tokens; and a third ratio keeps some tokens with their original values. The sum of the first, second, and third ratios is 1. For example, if the first ratio is 80% and the second and third ratios are 10%, then 5% of the tokens will be masked using these three methods at ratios of 80%, 10%, and 10%. The resulting masked gene sequence is obtained after the masking process.
[0064] Furthermore, it should be noted that other masking methods can be used to mask at least one base of the abnormal gene sequence in the gene sequence information, and to mask at least one base of the standard gene sequence corresponding to the abnormal gene sequence. These methods are not limited in the embodiments of this application.
[0065] Step S2022: Based on the gene sequence information after masking, pre-train the gene model to obtain the pre-trained masked prediction model, which is used as the trained gene model.
[0066] The gene model is used to predict the bases corresponding to the mask in the gene sequence information based on the input masked gene sequence information. That is, it predicts the bases corresponding to the mask in abnormal gene sequences and / or predicts the bases corresponding to the mask in the corresponding standard gene sequences.
[0067] The target training loss of the masked prediction model includes abnormal sequence prediction loss and standard sequence prediction loss. The abnormal sequence prediction loss is determined based on at least one base in the masked abnormal gene sequence and the corresponding base prediction result. The standard sequence training loss is determined based on at least one base in the masked standard gene sequence and the corresponding base prediction result.
[0068] The gene model includes a feature extraction sub-model and a mask output sub-model. Further, the gene model is pre-trained based on the masked gene sequence information to obtain a pre-trained gene model, which can include: pre-training the feature extraction sub-model and the mask output sub-model based on the masked gene sequence information to obtain a pre-trained mask prediction model (trained feature extraction sub-model and trained mask output sub-model).
[0069] Furthermore, to address the diversity of gene variant types, a universal encoding method is used for effective encoding, thereby improving the speed and accuracy of model training.
[0070] Furthermore, the abnormality type includes the abnormality type of the abnormal gene at each abnormal position; in the embodiments of this application, the abnormality type in the mutated gene sequence can be obtained through variant calling processing.
[0071] The anomaly types include the anomaly type of each mutated base. These include common anomaly types such as insertion, deletion, single-base variation, copy number error, replication error, and inversion.
[0072] Specifically, in step S202, the gene model is trained based on the training set to obtain the trained gene model, including: for each abnormal gene at an abnormal position, determining the target encoding method corresponding to the abnormal type of the abnormal gene, encoding the abnormal position in the abnormal sequence information or the abnormal position in the standard gene sequence using the target encoding method to obtain the encoded sequence information; and training the gene model based on the encoded sequence information to obtain the trained gene model.
[0073] In the embodiments of this application, the abnormal gene sequence is encoded based on the abnormal type of the abnormal gene at each abnormal position; or, the standard gene sequence (the standard gene sequence corresponding to the abnormal gene sequence mentioned above) is encoded based on the abnormal type of the abnormal gene in the abnormal gene sequence; or, the abnormal gene sequence and the standard gene sequence of the abnormal gene sequence are encoded based on the abnormal type of the abnormal gene in the abnormal gene sequence.
[0074] Furthermore, based on the encoded sequence information (i.e., the gene sequence after encoding processing through the above embodiments), the gene model is trained to obtain the trained gene model.
[0075] Furthermore, the method further includes: determining the target number of abnormal bases in the abnormal gene at each abnormal position. In embodiments of this application, after obtaining the abnormal type of the abnormal gene in the abnormal gene sequence, the method may include: determining the target number of abnormal bases in the abnormal gene at each abnormal position (or, after determining the abnormal position of the abnormal gene, determining the target number of abnormal bases in the abnormal gene at each abnormal position). In another possible implementation, the target number of abnormal bases in the abnormal gene at the abnormal position may also be obtained simultaneously with or after obtaining the abnormal type of the abnormal gene in the mutated gene sequence; that is, the target number of consecutively mutated bases at that position.
[0076] Specifically, if the number of targets is greater than the preset threshold, the mutation occurring at this abnormal location is called a long mutation; if the number of targets is not greater than the preset threshold, the number of mutations occurring at this abnormal location is called a short mutation.
[0077] In one possible implementation, the target number can also be characterized by the length of consecutive abnormal bases at the anomalous position. The preset threshold number can also be called a preset length threshold. For example, the preset length threshold could be 50 BP. That is, if the length of consecutive abnormal bases at the anomalous position is less than 50 BP, then the anomalous position or variation at that position can be called a short variation; otherwise, it is called a long variation. Short variations include SNPs, insertions, deletions, and compound variations, while long variations also refer to structural variations, including insertions, deletions, duplications, inversions, and CNVs (Copy Number Variations).
[0078] Among these, for an abnormal gene sequence, there may be only short variants, only long variants, or both short and long variants. Alternatively, for an abnormal gene sequence, at least two types of variants (e.g., insertion and deletion) may occur for short variants, or at least two types of variants (e.g., deletion and CNV) may occur for long variants, or at least one type of variant may occur for long variants, and at least one type of variant may occur for short variants. This situation can be called a compound variant.
[0079] Specifically, for each abnormal position, determining the target encoding method corresponding to the abnormal position based on the abnormal type of the abnormal gene at that abnormal position may include: for each abnormal position, determining the target encoding method based on the target number of abnormal bases in the abnormal gene at that abnormal position and the abnormal type of the abnormal gene at that abnormal position.
[0080] Specifically, for a mutation location (abnormal location), the encoding method is different depending on whether it belongs to a long mutation or a short mutation.
[0081] Specifically, based on the type and target number of abnormalities in the abnormal gene sequence—that is, for an abnormal gene sequence, if the number of abnormal bases (target number) at an abnormal position exceeds a preset threshold (i.e., it belongs to a long variant)—then a first encoding method is used to encode the abnormal gene sequence at the abnormal position based on the type of abnormality. If the number of abnormal bases at an abnormal position does not exceed the preset threshold, a second encoding method is used to encode the abnormal gene sequence or the standard gene sequence at the abnormal position based on the type of abnormality. In the embodiments of this application, for both long and short variants, it can be determined whether to encode the abnormal gene sequence or the standard gene sequence based on the type of abnormality.
[0082] Specifically, for each abnormal location, determining the target encoding method based on the target number of abnormal bases in the abnormal gene at that abnormal location and the abnormal type of the abnormal gene at that abnormal location includes: if the target number is greater than a preset threshold number, at the abnormal location, replacing the bases at that abnormal location with a preset string corresponding to the abnormal type at that abnormal location; if the target number is not greater than the preset threshold number, if the abnormal type is the target type, inserting the string corresponding to the target type into the abnormal gene sequence in the abnormal sequence information or the standard gene sequence corresponding to the abnormal gene sequence; if the abnormal type is not the target type, using the abnormal gene sequence in the abnormal sequence information or the standard gene sequence corresponding to the abnormal gene sequence as the encoded sequence information. In the embodiments of this application, for long encoded variants, different variant types may correspond to different first preset strings; since the variant sequence (abnormal sequence) is too long, it can be encoded using start base and end base representation, that is, the start base and end base will be used to represent the mutated bases (suggestions for abnormality) to alleviate memory pressure, and ultra-long structural variants are generally fatal, simplifying the expression of structural variants also helps the model input more variant sites. Figure 4 As shown, taking Deletion as an example, DELS indicates the start of deletion and DELE indicates the end of deletion; taking CNV as an example, CNVS indicates the start of copy number mutation and CNVE indicates the end of copy number mutation; taking DUP as an example, DUPS indicates the start of duplication mutation and DUPE indicates the end of copy number mutation.
[0083] Specifically, if the target number is not greater than the preset threshold number, that is, the abnormal position belongs to a short mutation, the abnormal type of the abnormal gene sequence includes at least one of the base insertion type or base deletion type; at this time, for the mutation position of the base insertion type, the target position corresponding to the mutation position in the standard gene sequence is determined, and a second preset string is inserted at the target position; for the mutation position of the base deletion type, a third preset string is inserted at the mutation position in the mutated gene sequence.
[0084] Specifically, for abnormal positions of base insertion type, a second preset string is inserted at the target position in the standard gene sequence at the abnormal position. The second preset string can be characterized by at least one "-". "-" indicates that the base has been deleted. Inserting at least one "-" in the standard gene sequence indicates that the abnormal gene sequence contains the inserted base.
[0085] Specifically, for abnormal positions involving base deletion, a third preset string is inserted at the abnormal position in the abnormal gene sequence. Inserting at least one "-" at the abnormal position in the abnormal gene sequence indicates that a base at that position has been deleted.
[0086] Taking DNA sequences as an example, abnormal gene sequences can also include base changes. The basic bases include A, C, G, T, and N. For example, a base at a certain position may change from C to G, which is a base change.
[0087] like Figure 5 As shown, if a base in a mutated gene sequence (abnormal gene sequence) changes from T to A, it is a single nucleotide variant. If three G-type bases are inserted into the mutated gene sequence, three "-" bases will be inserted at the target position in the standard gene sequence, which is an insertion variant. If three bases "C", "T", and "A" are deleted from the mutated gene sequence, three "-" bases will be inserted at the insertion position, which is a deletion variant. If a base in a mutated gene sequence changes from G to C, or if three bases "C", "T", and "A" are deleted from the mutated gene sequence, they are compound variants (or mixed variants).
[0088] In our anomaly type coding (variation type coding), all gene variations are converted into reference sequences (standard gene sequences) and variant sequences (variant gene sequences). This coding is complete and fine-grained. Thus, all variations are at the single-base level. By combining reference and variant bases, we can obtain the base variation type. For example, "AA" indicates that the reference base is A, the variant base is A, and no variation has occurred at this site. "A-" indicates that the reference base is A, the variant base is a deletion, and the site has been deleted. Similarly, "AINSS" indicates that the reference base is A, and this site is the start position of the insertion.
[0089] Furthermore, based on the above embodiments, that is, after encoding the abnormal gene sequence or the standard gene sequence in the above manner, if the abnormal gene sequence is encoded, then in step S2021 at least one base of the encoded abnormal gene sequence is masked. Similarly, if the standard gene sequence is encoded, then in step S2021 at least one base of the encoded standard gene sequence is masked.
[0090] The specific methods for masking can be found in the above embodiments, and will not be repeated here.
[0091] Furthermore, the model lacks gene location information, making it unsuitable for downstream tasks (e.g., gene sequence classification to aid disease diagnosis). Therefore, the training set also includes: chromosome location information and base location information corresponding to the gene sequence information. Each location information in the chromosome sequence information represents the chromosome identifier of each base in the gene sequence, and each location information in the base location sequence represents the location identifier of each base in the gene sequence within that chromosome. In other words, the training set can at least include variant gene sequences and standard gene sequences of those variant gene sequences, and can also include corresponding chromosome location sequences, base location sequences, and further, corresponding sample identifier sequences. The location of the mutation is determined by the chromosome number (chromosome position sequence) and its position on the chromosome (base position sequence), for example... Figure 6 As shown, this represents three variants (or three abnormalities), categorized as follows: a non-variant at position 10 on chromosome 1; a complex variant (SNP and deletion) at positions 20-23 on chromosome 2; and an insertion variant at positions 80-81 on chromosome 3, involving the insertion of a CAAAA segment. There are a total of 24 positional codes, including chromosome IDs.
[0092] In addition to the usual chromosome and base position analysis, some downstream tasks, such as the auxiliary identification of familial genetic diseases, require inputting multiple gene variations from the father, mother, and child simultaneously. In such cases, a sample ID is needed to distinguish the sequencing data from different individuals.
[0093] Since chromosome 1 can reach a maximum size of 249.25 Mb, directly encoding numerical values would cause numerical overflow. To reduce numerical overflow caused by encoding numerical values, for each base, the position identifier of that base in the chromosome is obtained. Specifically, this may include: determining the actual position information of the base in the chromosome; determining the target position parameter, which represents the total number of bases contained in the chromosome; and determining the position identifier of the base in the chromosome based on the actual position information and the target position parameter.
[0094] For example, dividing the base position by 100,000 yields a floating-point position, which serves as the identifier of the base's location within the chromosome.
[0095] Furthermore, based on the above embodiments, the first model can be a UGM basic model such as... Figure 7 As shown, the model takes multiple variant sites (or anomalous sites) as input. All anomalous types (variation types) are converted into reference sequences, variant sequences, chromosome IDs, positions, and sample IDs, and then concatenated into complete reference sequences, variant sequences, first base position sequences, second base position sequences, and sample identifier sequences. The model includes five types of embeddings: reference embedding, variant embedding, chromosome embedding, and sample embedding use standard embedding layers, while position embedding uses a linear layer because it requires continuous coordinates as input. UGM, as the base model, can replace the common DNABERT for DNA sequence-related tasks.
[0096] The UGM Core is composed of multiple stacked UGM Blocks. The design of the UGM Blocks is as follows: Figure 8As shown. The UGM model is not limited to the UGM Block; other similar Transformers can also be used. After the UGM Core extracts features, the LM Head is used to predict the type of base variation. The LM Head consists of Root Mean Square Layer Normalization (RMSNorm) and a Linear layer.
[0097] The model is pre-trained using random masked reference sequences and variant sequences. The model's loss function is the standard cross-entropy loss.
[0098] Another possible implementation of this application embodiment is that the gene sequence information includes multiple abnormal gene sequence information and at least one standard gene sequence information, wherein the multiple abnormal gene sequence information includes at least one abnormal gene sequence information of an individual object and at least one abnormal gene sequence information of a population, each abnormal gene sequence information includes a standard gene sequence and an abnormal gene sequence of the standard gene sequence, and each standard gene sequence information includes two standard gene sequences. Among them, the number of standard gene sequence information is greater than the number of abnormal gene sequence information in individuals, and the number of abnormal gene sequence information in individuals is greater than the number of abnormal gene sequence information in the population.
[0099] Specifically, the training set consists of three parts, used for Context Learning (at least one standard gene sequence information), Germline Variant Learning (abnormal gene sequence information of at least one population), and Variant Correlation Learning (abnormal gene sequence information of at least one individual object). The ratio of these three parts of the dataset can be 5:3:2.
[0100] In this approach, Context Learning uses a human reference genome to construct a Non-Variant type. The Referencesequence serves as the context for the Variant Sequence. During the reference genome learning process, the base model continuously strengthens its understanding of the context of real variant types. Context Learning, along with existing models such as DNABERT and NT, learns from the reference genome; our approach also incorporates gene location learning. During Context Learning, the sample ID defaults to 0, indicating that all sequences are population reference sequences.
[0101] Germline Variant Learning utilizes the dbSNP and dbVar datasets to construct short and long variant types. These two datasets represent human population variant distribution datasets, containing all known human variants. Incorporating population distribution datasets during pre-training allows the model to learn possible variants (or anomalies) at different gene locations. During training, the sample ID defaults to 0, indicating human population variants, thus distinguishing between individual and population variants.
[0102] Variant Correlation Learning utilizes real-world individual variants. The distribution of variants across genes within the same individual is not random; linkage disequilibrium exists. Furthermore, the distribution of gene variants (gene abnormalities) in individuals with specific genetic diseases follows certain patterns. During pre-training, using real-world individual variant data allows the model to learn the correlation between diseases and variant points, as well as the correlation between variant points themselves.
[0103] This application provides a method for gene sequence classification, executed by an electronic device, such as... Figure 9a As shown, the method may include: Step S901: Obtain the gene sequence information to be classified.
[0104] The gene sequence information to be classified includes: the gene sequence to be classified.
[0105] Furthermore, the gene sequence information to be classified may also include the standard gene sequence corresponding to the gene sequence to be classified.
[0106] Furthermore, the gene sequence information to be classified also includes: the chromosome position sequence corresponding to the gene sequence to be classified, the base position sequence corresponding to the gene sequence to be classified, and the identifier sequence corresponding to the gene sequence to be classified. The identifier sequence corresponding to the gene sequence to be classified can be used to identify the object to which the gene sequence information to be classified belongs.
[0107] In one possible implementation, the gene sequence information to be classified can be obtained from the variant detection file (such as VCF, MAF, etc.) input from the patient. In another case, the gene sequence to be classified can also be a standard gene sequence.
[0108] Step S902: Classify the gene sequence information to be classified using the target classification model to obtain the classification result corresponding to the gene sequence to be classified.
[0109] Specifically, in this embodiment, the gene sequence information to be classified is classified using a target classification model to obtain the probability of the classification result corresponding to the gene sequence to be classified. In this embodiment, the features output by the target classification model are selected from either the features of the first token or the average of the features of all tokens for classification. In this embodiment, the bases in the gene sequence to be classified can be divided into multiple tokens, for example, three bases constitute one token.
[0110] The target classification model is obtained by fine-tuning the trained gene model; The trained gene model is obtained through the gene model training method shown in the above embodiments. The specific method for training the gene model to obtain the trained gene model in this application embodiment is detailed in the above embodiments and will not be repeated here.
[0111] This application provides a method for gene sequence classification. In this application, a gene sequence to be classified is obtained, and it is classified using a target classification model to obtain the classification result corresponding to the gene sequence to be classified. The target classification model is obtained by fine-tuning a trained gene model. In addition to using standard human gene sequences or standard gene sequences of multiple species, the training set used by the trained gene model also uses abnormal gene sequences and abnormal information corresponding to the abnormal gene sequences that can characterize the abnormal position and abnormal type of the abnormal gene. This can improve the generalization ability of the gene model trained based on the training set on individual data, thereby reducing the complexity of applying the trained gene model to related downstream tasks.
[0112] Furthermore, the trained gene model includes: a trained feature extraction sub-model and a trained mask output sub-model; in this embodiment, the target classification model is obtained by fine-tuning the trained gene model in the following way: obtaining multiple training samples with classification labels; wherein, the training samples include at least one abnormal gene sequence and a standard gene reference sequence of the abnormal gene sequence; based on the multiple training samples, the gene sequence classification model is fine-tuned to obtain the target classification model.
[0113] In this embodiment, the training samples used for fine-tuning may be a part of the samples used in the pre-training or may be completely different from the samples used in the pre-training. This embodiment does not impose any limitations.
[0114] The target classification model is used to classify the variant gene sequence based on the input variant gene sequence and the corresponding standard gene sequence. The gene sequence classification model includes a trained feature extraction sub-model and a classification sub-model. That is, based on multiple training samples, the classification sub-model and the trained feature extraction sub-model are fine-tuned to obtain the target classification model. In this embodiment, the fine-tuning method is not limited to LORA, full-scale fine-tuning, etc.
[0115] The target classification model is used to classify the variant gene sequence based on the input variant gene sequence and the corresponding standard gene sequence.
[0116] Furthermore, the gene sequence information to be classified also includes: the chromosome identifier sequence corresponding to the gene sequence to be classified, the position identifier sequence corresponding to the gene sequence to be classified, and the object identifier sequence corresponding to the gene sequence to be classified; the chromosome identifier sequence includes the identifier of the chromosome corresponding to each base in the gene sequence to be classified, and the position identifier sequence includes: the position identifier of each base in the gene sequence to be classified within the chromosome.
[0117] In step S902, the gene sequence information to be classified is classified using a target classification model to obtain the classification result corresponding to the gene sequence to be classified. Specifically, this may include: splicing the gene sequence to be classified, the standard gene sequence corresponding to the gene sequence to be classified, the chromosome identifier sequence corresponding to the gene sequence to be classified, the position identifier sequence corresponding to the gene sequence to be classified, and the object identifier sequence corresponding to the gene sequence to be classified to obtain the spliced gene sequence; and then classifying the spliced gene sequence using the target classification model to obtain the classification result corresponding to the gene sequence to be classified.
[0118] To better understand and illustrate the practical value of the solutions provided in the embodiments of this application, the optional implementation methods of this application will be described below in conjunction with specific scenario embodiments. The abnormal gene sequence in this application scenario is the abnormal gene sequence shown above.
[0119] I. Training Process: 1. Obtain alignment sequence samples for each gene; a gene alignment series sample includes a variant gene sequence and the corresponding reference gene sequence (or standard gene sequence). 2. Other devices can be used to detect the mutation type and mutation location of each mutated gene sequence; where the mutation type refers to the mutation type of each mutated site; and the mutation location refers to the position of the mutated location in the gene sequence (which chromosome and which specific location). 3. Obtain the mutation type and mutation location for each mutated gene sequence; 4. Encode each variant gene sequence based on its variant type to obtain an encoded gene sequence set; wherein, an encoded gene sequence set includes an encoded variant gene sequence and its corresponding encoded reference gene sequence; For example, taking DNA sequences as an example, the basic base types include: A, C, G, T, N, INSS, INSE, DELS, DELE, INVS, INVE, DUPS, DUPE, CNVS, CNVE, -, M, P. Here, "-" indicates a deleted base, "M" represents a masking base, and "P" represents a padding base. Long variant coding: When a long gene sequence mutates, this long gene sequence is characterized by four bases. The two middle bases represent the starting and ending bases of the mutation, respectively; the other two bases represent the bases adjacent to the starting base and the bases adjacent to the ending base, respectively.
[0120] 5. Encode the mutation sites to obtain the position sequence groups corresponding to the encoded mutated gene sequences; The position sequence group includes: chromosome position sequence (first base position sequence), and sequence located at chromosome position (second base position sequence). Among them, the chromosome position sequence (first base position sequence) indicates which chromosome each base in the encoded variant gene sequence is located on; The sequence located on the chromosome (second base position sequence) indicates the position of each base in the encoded variant gene sequence on the chromosome; 6. Obtain the sample number sequence to which the first gene coding sequence belongs, to identify which sample the gene sequence belongs to; For example, it can represent different people, different locations where gene sequences are obtained, etc. 7. The first gene coding sequence, the second gene coding sequence, the first position sequence, the second position sequence, and the sample coding sequence of the same sample are spliced together to obtain the spliced sample sequence; thereby obtaining each spliced sample sequence; wherein, the first gene coding sequence and the second gene coding sequence of the same sample can be the result of the variant gene sequence coding above and the corresponding standard gene sequence coding result, or it can be the result of two standard gene sequences; 8. Pre-train each spliced sample sequence using the initial UGM to obtain the pre-trained UGM model; The UGM model consists of a UGM core and an LM head. The UGM core is composed of multiple UGM blocks connected in series.
[0121] The step of pre-training each spliced sample sequence using an initial UGM to obtain a pre-trained UGM model includes: The coding sequences of the first and second genes are masked, wherein after masking, some bases (bases at the same position) in the coding sequences of the first and second genes are replaced with the mask. The masked first gene coding sequence, the masked second gene coding sequence, the first position sequence, the second position sequence, and the sample coding sequence are concatenated to obtain the masked concatenated sample sequence. The masked spliced sample sequence is passed through the initial UGM model to output the predicted first base (bases in the coding sequence of the first gene) and the predicted second base (bases in the coding sequence of the second gene). The predicted first base (the base on the coding sequence of the first gene) and the original first base are used to determine the first prediction loss; The predicted second base (the base on the coding sequence of the second gene) and the original second base are used to determine the second prediction loss; The initial UGM model is trained based on the first prediction loss and the second prediction loss.
[0122] 9. Combine the pre-trained UGM core and classification head to form a new model, fine-tune the new model, and obtain the target classification model; Specifically, the gene disease discrimination model, after being pre-trained on 8 datasets, is further fine-tuned on specific disease data. Unlike the base model, the discrimination model replaces mask classification with variant gene sequence classification. The model outputs features, selecting either the features of the first token or the average of the features of all tokens for classification.
[0123] II. The process of online application: Figure 9b The following is an example of a scenario shown below: First, sequencing data is obtained through second- or third-generation gene sequencing. The sequencing data undergoes routine secondary analysis processes, such as quality control and deduplication, to align the sequencing sequence to a reference genome (also known as a standard gene sequence). After alignment, variant calling is performed to obtain gene variant sites. These sites are then input into a fine-tuned target classification model to assist doctors in disease diagnosis and serve as a reference for doctors in issuing clinical reports.
[0124] 1. Obtain the gene sequence to be classified; the gene sequence information to be classified includes: the gene sequence to be classified and the standard gene sequence corresponding to the gene sequence to be classified, the chromosome identifier sequence corresponding to the gene sequence to be classified, the position identifier sequence corresponding to the gene sequence to be classified, and the object identifier sequence corresponding to the gene sequence to be classified; the chromosome identifier sequence includes the chromosome identifier corresponding to each base in the gene sequence to be classified, and the position identifier sequence includes: the position identifier of each base in the gene sequence to be classified in the chromosome.
[0125] 2. The gene sequence to be classified, the standard gene sequence corresponding to the gene sequence to be classified, the chromosome identifier sequence corresponding to the gene sequence to be classified, the position identifier sequence corresponding to the gene sequence to be classified, and the object identifier sequence corresponding to the gene sequence to be classified are spliced together to obtain the spliced gene sequence. 3. The spliced gene sequences are classified using a target classification model to obtain the classification results corresponding to the gene sequences to be classified.
[0126] Furthermore, in a more specific example, the method shown in the embodiments of this application can be applied to the auxiliary diagnosis of certain diseases, such as the auxiliary diagnosis of pangenetic diseases like cancer, heart disease, and lupus. For example, taking the gene sequence of subject A as an example, it can be used to assist in detecting whether subject A may have pangenetic diseases such as cancer, heart disease, or lupus. Specifically, it can be as follows: First, second- or third-generation sequencing of the gene of the subject A is performed to obtain sequencing data. This data undergoes standard secondary analysis procedures, such as quality control and deduplication, to align the sequencing sequences to a reference genome (also known as a standard gene sequence). After alignment, variant calling is performed to identify gene variant sites. These sites are then input into a fine-tuned target classification model to assist doctors in disease diagnosis and serve as a reference for issuing clinical reports. Specifically… 1. Obtain the gene sequence of the subject A to be tested; the gene sequence information of the subject A to be tested includes: the gene sequence of the subject A to be tested and the corresponding standard gene sequence, the chromosome identifier sequence corresponding to the gene sequence of the subject A to be tested, the position identifier sequence corresponding to the gene sequence of the subject A to be tested, and the object identifier sequence corresponding to the gene sequence of the subject A to be tested; the chromosome identifier sequence includes the chromosome identifier corresponding to each base in the gene sequence of the subject A to be tested, and the position identifier sequence includes: the position identifier of each base in the gene sequence of the subject A to be tested within the chromosome.
[0127] 2. The gene sequence of the test subject A, the standard gene sequence (human standard gene sequence) corresponding to the gene sequence of the test subject A, the chromosome identifier sequence corresponding to the gene sequence of the test subject A, the position identifier sequence corresponding to the gene sequence of the test subject A, and the object identifier sequence corresponding to the gene sequence of the test subject A are spliced together to obtain the spliced gene sequence. 3. The spliced gene sequences are classified using a target classification model to obtain the classification results corresponding to the gene sequences to be classified. This allows medical personnel to determine whether the subject A may have pangenetic diseases such as cancer, heart disease, or lupus based on the classification results.
[0128] This application provides a training device for a gene model, such as... Figure 10 As shown, the gene model training device 100 may include: an acquisition module 1001 and a training module 1002, wherein, The acquisition module 1001 is used to acquire a training set, which includes gene sequence information. The gene sequence information is compared with a standard gene sequence to obtain abnormal sequence information in the gene sequence information. The abnormal sequence information is used to characterize the abnormal location and abnormal type of abnormal genes in the gene sequence information. Training module 1002 is used to train the gene model based on the training set to obtain the trained gene model.
[0129] In one possible implementation, the anomaly type includes the anomaly type of the abnormal gene at each anomaly location; Training module 1002, when training a gene model based on a training set to obtain a trained gene model, is specifically used for: For each abnormal gene at an abnormal position, determine the target encoding method corresponding to the abnormal type of the abnormal gene, and use the target encoding method to encode the abnormal position in the abnormal sequence information or the abnormal position in the standard gene sequence to obtain the encoded sequence information. Based on the encoded sequence information, the gene model is trained to obtain the trained gene model.
[0130] In another possible implementation, the device 100 further includes: a determining module, wherein, The determination module is used to determine the target number of abnormal bases in the abnormal gene at each abnormal location; Specifically, when the training module 1002 determines the target encoding method corresponding to each abnormal location based on the abnormality type of the abnormal gene at that location, it is used for: For each anomalous location, the target encoding method is determined based on the target number of anomalous bases in the anomalous gene at that location and the anomalous type of the anomalous gene at that location.
[0131] Specifically, when the training module 1002 determines the target encoding method for each anomalous position based on the target number of abnormal bases in the anomalous gene at that position and the anomalous type of the anomalous gene at that position, it is used for: If the target quantity is greater than the preset threshold quantity, at the abnormal position, the base at the abnormal position is replaced with a preset string corresponding to the abnormal type at the abnormal position; If the target number is not greater than the preset threshold number, and if the anomaly type is the target type, the string corresponding to the target type is inserted into the abnormal gene sequence in the anomaly sequence information or the standard gene sequence corresponding to the abnormal gene sequence. If the anomaly type is not the target type, the abnormal gene sequence in the anomaly sequence information or the standard gene sequence corresponding to the abnormal gene sequence is used as the encoded sequence information.
[0132] In another possible implementation, the target type includes a base insertion type or a base deletion type; the training module 1002, when inserting a string corresponding to the target type into the abnormal gene sequence in the abnormal sequence information or the standard gene sequence corresponding to the abnormal gene sequence if the anomaly type is the target type, is specifically used for: If the target type is a base insertion type, use the preset string corresponding to the base insertion type to insert the standard gene sequence corresponding to the abnormal gene sequence; If the target type is a base deletion type, use the preset string corresponding to the base deletion type to insert into the abnormal gene sequence.
[0133] In another possible implementation, the training set also includes: chromosome position information corresponding to gene sequence information and base position information, where each position information in the chromosome sequence information represents the chromosome identifier of each base in the gene sequence, and each position information in the base position sequence represents the position identifier of each base in the gene sequence in that chromosome. When obtaining the position identifier of each base in the chromosome, module 1001 is specifically used for: Determine the actual location of the base in the chromosome; Determine the target position parameter, which represents the total number of bases contained in the chromosome; Based on the actual position information and target position parameters of the base in the chromosome, the position identifier of the base in the chromosome is determined.
[0134] In another possible implementation, the gene sequence information includes multiple abnormal gene sequence information and at least one standard gene sequence information, wherein the multiple abnormal gene sequence information includes at least one abnormal gene sequence information of an individual object and at least one abnormal gene sequence information of a population, each abnormal gene sequence information includes a standard gene sequence and an abnormal gene sequence of the standard gene sequence, and each standard gene sequence information includes two standard gene sequences. Among them, the number of standard gene sequence information is greater than the number of abnormal gene sequence information in individuals, and the number of abnormal gene sequence information in individuals is greater than the number of abnormal gene sequence information in the population.
[0135] In another possible implementation, when training the gene model based on the training set to obtain the trained gene model, the training module 1002 is specifically used for: Masking at least one base of an abnormal gene sequence in gene sequence information, and masking at least one base of a standard gene sequence corresponding to an abnormal gene sequence. The gene model is pre-trained based on the masked gene sequence information to obtain the pre-trained masked prediction model, which serves as the trained gene model. The gene model is used to predict the bases corresponding to the mask in the gene sequence information based on the input masked gene sequence information. The target training loss of the masked prediction model includes abnormal sequence prediction loss and standard sequence prediction loss. The abnormal sequence prediction loss is determined based on at least one base in the masked abnormal gene sequence and the corresponding base prediction result. The standard sequence training loss is determined based on at least one base in the masked standard gene sequence and the corresponding base prediction result.
[0136] This application provides a device for gene sequence classification, such as... Figure 11 As shown, the gene sequence classification device 110 includes: a gene sequence information acquisition module 1101 and a classification module 1102, wherein, The gene sequence information acquisition module 1101 is used to acquire gene sequence information to be classified, which includes: gene sequence to be classified; The classification module 1102 is used to classify the gene sequence information to be classified through the target classification model to obtain the classification result corresponding to the gene sequence to be classified. The target classification model is obtained by fine-tuning the trained gene model; The trained gene model is obtained through the gene model training method, as detailed in the above embodiments, and will not be repeated here.
[0137] In one possible implementation, the gene sequence information to be classified further includes: a chromosome identifier sequence corresponding to the gene sequence to be classified, a position identifier sequence corresponding to the gene sequence to be classified, and an object identifier sequence corresponding to the gene sequence to be classified; the chromosome identifier sequence includes the identifier of the chromosome corresponding to each base in the gene sequence to be classified, and the position identifier sequence includes: the position identifier of each base in the gene sequence to be classified within the chromosome. Specifically, the classification module 1102, when classifying the gene sequence information to be classified using the target classification model to obtain the classification result corresponding to the gene sequence to be classified, is used for: The gene sequence to be classified, the chromosome identifier sequence corresponding to the gene sequence to be classified, the position identifier sequence corresponding to the gene sequence to be classified, and the object identifier sequence corresponding to the gene sequence to be classified are spliced together to obtain the spliced gene sequence. The spliced gene sequences are classified using a target classification model to obtain the classification results corresponding to the gene sequences to be classified.
[0138] In one possible implementation, the trained gene model includes: a trained feature extraction sub-model and a trained mask output sub-model; The target classification model is obtained by fine-tuning the trained gene model in the following way: Obtain multiple training samples with classification labels; wherein, the training samples include at least one abnormal gene sequence and a standard gene reference sequence of the abnormal gene sequence; Based on multiple training samples, the gene sequence classification model is fine-tuned to obtain the target classification model. The target classification model is used to classify the variant gene sequence based on the input variant gene sequence and the corresponding standard gene sequence. The gene sequence classification model includes a trained feature extraction sub-model and a classification sub-model.
[0139] Figure 12 A schematic diagram of the structure of an electronic device to which this application embodiment applies is shown, such as... Figure 12 As shown, the electronic device can be a server or a user terminal, and can be used to implement the methods provided in any embodiment of this application. That is, the electronic device can be used to implement a model training method provided in any embodiment of this application; the electronic device can also be used to implement a gene sequence classification method provided in any embodiment of this application. like Figure 12 As shown, the electronic device 2000 may primarily include at least one processor 2001. Figure 12The diagram shows components such as a memory 2002, a communication module 2003, and an input / output interface 2004. Optionally, these components can be connected and communicate with each other via a bus 2005. It should be noted that... Figure 12 The structure of the electronic device 2000 shown is merely illustrative and does not constitute a limitation on the electronic devices to which the methods provided in the embodiments of this application are applicable.
[0140] The memory 2002 can be used to store operating systems and applications, etc. The applications may include computer programs that implement the methods shown in the embodiments of this application when invoked by the processor 2001, and may also include programs for implementing other functions or services. The memory 2002 may be ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, RAM (Random Access Memory) or other types of dynamic storage devices that can store information and computer programs, or it may be EEPROM (Electrically Erasable Programmable Read Only Memory), CD-ROM (CompactDisc Read Only Memory) or other optical disc storage, optical disk storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited thereto.
[0141] Processor 2001 is connected to memory 2002 via bus 2005, and implements corresponding functions by calling application programs stored in memory 2002. Processor 2001 can be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 2001 can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0142] Electronic device 2000 can connect to a network via communication module 2003 (which may include, but is not limited to, components such as a network interface) to communicate with other devices (such as user terminals or servers) through the network and achieve data interaction, such as sending data to or receiving data from other devices. Communication module 2003 may include wired network interfaces and / or wireless network interfaces, meaning the communication module may include at least one of wired or wireless communication modules.
[0143] Electronic device 2000 can connect to required input / output devices, such as keyboards and display devices, via input / output interface 2004. Electronic device 2000 itself may have a display device, and other display devices can also be connected externally via input / output interface 2004. Optionally, storage devices, such as hard drives, can also be connected via input / output interface 2004 to store data from electronic device 2000, retrieve data from storage device, or store data from storage device into memory 2002. It is understood that input / output interface 2004 can be a wired interface or a wireless interface. Depending on the actual application scenario, the device connected to input / output interface 2004 can be a component of electronic device 2000 or an external device connected to electronic device 2000 when needed.
[0144] The bus 2005 used to connect the components may include a pathway for transmitting information between the components. The bus 2005 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. Depending on its function, the bus 2005 can be divided into address bus, data bus, control bus, etc.
[0145] Optionally, for the solution provided in the embodiments of this application, the memory 2002 can be used to store a computer program that executes the solution of this application, and the processor 2001 runs the computer program. When the processor 2001 runs the computer program, it implements the operation of the method or apparatus provided in the embodiments of this application.
[0146] Based on the same principle as the method provided in the embodiments of this application, the embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a processor, can implement the corresponding content of the aforementioned method embodiments.
[0147] This application also provides a computer program product, which includes a computer program that, when executed by a processor, can implement the corresponding content of the aforementioned method embodiments.
[0148] It should be noted that the terms "first," "second," "third," "fourth," "1," "2," etc. (if present) in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in a sequence other than that shown in the figures or text.
[0149] In the embodiments of this application, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.
[0150] It should be understood that although arrows indicate various operation steps in the flowcharts of this application's embodiments, the order in which these steps are implemented is not limited to the order indicated by the arrows. Unless explicitly stated herein, in some implementation scenarios of this application's embodiments, the implementation steps in each flowchart can be executed in other orders as required. Furthermore, some or all steps in each flowchart, based on the actual implementation scenario, may include multiple sub-steps or multiple stages. Some or all of these sub-steps or stages can be executed at the same time, and each sub-step or stage can also be executed at different times. In scenarios where execution times differ, the execution order of these sub-steps or stages can be flexibly configured according to requirements, and this application's embodiments do not limit this.
[0151] The above description is only an optional implementation method for some implementation scenarios of this application. It should be noted that for those skilled in the art, other similar implementation methods based on the technical concept of this application without departing from the technical concept of this application also fall within the protection scope of the embodiments of this application.
Claims
1. A method for training a gene model, characterized in that, The method includes: A training set is obtained, which includes gene sequence information. The gene sequence information is compared with a standard gene sequence to obtain abnormal sequence information in the gene sequence information. The abnormal sequence information is used to characterize at least the abnormal position and abnormal type of the abnormal gene in the gene sequence information. The abnormal type includes the abnormal type of the abnormal gene at each abnormal position. Based on the training set, the gene model is trained to obtain the trained gene model, including: For each abnormal location, the target encoding method is determined based on the target number of abnormal bases in the abnormal gene at that abnormal location and the abnormal type of the abnormal gene at that abnormal location. This includes: if the target number is not greater than a preset threshold number, if the abnormal type is a base insertion type in the target type, a preset string corresponding to the base insertion type is used to insert the standard gene sequence corresponding to the abnormal gene sequence; if the abnormal type is a base deletion type in the target type, a preset string corresponding to the base deletion type is used to insert the abnormal gene sequence. The abnormal position in the abnormal sequence information or the abnormal position in the standard gene sequence is encoded using the target encoding method to obtain the encoded sequence information; The gene model is trained based on the encoded sequence information to obtain the trained gene model.
2. The method according to claim 1, characterized in that, The method further includes: Determine the target number of abnormal bases in the abnormal gene at each abnormal location.
3. The method according to claim 1, characterized in that, For each anomalous location, determining the target encoding method based on the target number of anomalous bases in the anomalous gene at that location and the anomalous type of the anomalous gene at that location includes: If the target quantity is greater than the preset threshold quantity, at the abnormal position, the base at the abnormal position is replaced with a preset string corresponding to the abnormal type at the abnormal position; If the target number is not greater than the preset threshold number, and if the anomaly type is a non-target type, the abnormal gene sequence in the abnormal sequence information or the standard gene sequence corresponding to the abnormal gene sequence will be used as the encoded sequence information.
4. The method according to claim 1, characterized in that, The training set also includes: chromosome position information and base position information corresponding to the gene sequence information, wherein each position information in the chromosome sequence information represents the chromosome identifier of each base in the gene sequence, and each position information in the base position sequence represents the position identifier of each base in the gene sequence in that chromosome. For each base, obtain the position identifier of that base within the chromosome, including: Determine the actual location of the base in the chromosome; Determine the target position parameter, which represents the total number of bases contained in the chromosome; Based on the actual position information of the base in the chromosome and the target position parameter, the position identifier of the base in the chromosome is determined.
5. The method according to claim 1, characterized in that, The gene sequence information includes multiple abnormal gene sequence information and at least one standard gene sequence information. The multiple abnormal gene sequence information includes at least one abnormal gene sequence information of an individual object and at least one abnormal gene sequence information of a population. Each abnormal gene sequence information includes a standard gene sequence and an abnormal gene sequence of the standard gene sequence. Each standard gene sequence information includes two standard gene sequences. Among them, the number of standard gene sequence information is greater than the number of abnormal gene sequence information in individuals, and the number of abnormal gene sequence information in individuals is greater than the number of abnormal gene sequence information in the population.
6. The method according to claim 1, characterized in that, The step of training the gene model based on the training set to obtain the trained gene model includes: Masking at least one base of an abnormal gene sequence in gene sequence information, and masking at least one base of a standard gene sequence corresponding to an abnormal gene sequence. The gene model is pre-trained based on the masked gene sequence information to obtain a pre-trained mask prediction model, which serves as the trained gene model; wherein, the gene model is used to predict the bases corresponding to the mask in the gene sequence information based on the input masked gene sequence information. The target training loss of the masked prediction model includes anomaly sequence prediction loss and standard sequence prediction loss. The anomaly sequence prediction loss is determined based on at least one base in the masked abnormal gene sequence and the corresponding base prediction result. The standard sequence prediction loss is determined based on at least one base in the masked standard gene sequence and the corresponding base prediction result.
7. A method for gene sequence classification, characterized in that, include: Obtain gene sequence information to be classified, wherein the gene sequence information to be classified includes the gene sequence to be classified; The gene sequence information to be classified is classified using a target classification model to obtain the classification result corresponding to the gene sequence to be classified. The target classification model is obtained by fine-tuning the trained gene model; The trained gene model is obtained by the training method of the gene model according to any one of claims 1 to 6.
8. The method according to claim 7, characterized in that, The gene sequence information to be classified further includes: the chromosome identifier sequence corresponding to the gene sequence to be classified, the position identifier sequence corresponding to the gene sequence to be classified, and the object identifier sequence corresponding to the gene sequence to be classified; the chromosome identifier sequence includes the identifier of the chromosome corresponding to each base in the gene sequence to be classified, and the position identifier sequence includes: the position identifier of each base in the gene sequence to be classified in the chromosome. The step of classifying the gene sequence information to be classified using a target classification model to obtain the classification result corresponding to the gene sequence to be classified includes: The gene sequence to be classified, the chromosome identifier sequence corresponding to the gene sequence to be classified, the position identifier sequence corresponding to the gene sequence to be classified, and the object identifier sequence corresponding to the gene sequence to be classified are spliced together to obtain the spliced gene sequence. The spliced gene sequence is classified using the target classification model to obtain the classification result corresponding to the gene sequence to be classified.
9. The method according to claim 7, characterized in that, The trained gene model includes: a trained feature extraction sub-model and a trained mask output sub-model; The target classification model is obtained by fine-tuning the trained gene model in the following way: Obtain multiple training samples with classification labels; wherein the training samples include at least one abnormal gene sequence and a standard gene reference sequence of the abnormal gene sequence; Based on the multiple training samples, the gene sequence classification model is fine-tuned to obtain the target classification model. The target classification model is used to classify the variant gene sequence based on the input variant gene sequence and the corresponding standard gene sequence. The gene sequence classification model includes a trained feature extraction sub-model and a classification sub-model.
10. A training device for a gene model, characterized in that, The device includes: An acquisition module is used to acquire a training set, which includes gene sequence information. The training set is compared with a standard gene sequence to obtain abnormal sequence information in the gene sequence information. The abnormal sequence information is used to characterize at least the abnormal position and abnormal type of the abnormal gene in the gene sequence information. The abnormal type includes the abnormal type of the abnormal gene at each abnormal position. The training module is used to train the gene model based on the training set to obtain the trained gene model. Specifically, it is used to: for each abnormal position, determine the target encoding method according to the target number of abnormal bases in the abnormal gene at the abnormal position and the abnormal type of the abnormal gene at the abnormal position; specifically, if the target number is not greater than a preset threshold number, if the abnormal type is a base insertion type in the target type, use a preset string corresponding to the base insertion type to insert the standard gene sequence corresponding to the abnormal gene sequence; if the abnormal type is a base deletion type in the target type, use a preset string corresponding to the base deletion type to insert the abnormal gene sequence; encode the abnormal position in the abnormal sequence information or the abnormal position in the standard gene sequence using the target encoding method to obtain the encoded sequence information; and train the gene model based on the encoded sequence information to obtain the trained gene model.
11. The apparatus according to claim 10, characterized in that, The device further includes: a determining module; The determining module is used to determine the target number of abnormal bases in the abnormal gene at each abnormal location.
12. The apparatus according to claim 10, characterized in that, When the training module determines the target encoding method for each anomalous location based on the target number of abnormal bases in the anomalous gene at that location and the anomalous type of the anomalous gene at that location, it is specifically used for: If the target quantity is greater than the preset threshold quantity, at the abnormal position, the base at the abnormal position is replaced with a preset string corresponding to the abnormal type at the abnormal position; If the target number is not greater than the preset threshold number, and if the anomaly type is a non-target type, the abnormal gene sequence in the abnormal sequence information or the standard gene sequence corresponding to the abnormal gene sequence will be used as the encoded sequence information.
13. The apparatus according to claim 10, characterized in that, The training set also includes: chromosome position information and base position information corresponding to the gene sequence information, wherein each position information in the chromosome sequence information represents the chromosome identifier of each base in the gene sequence, and each position information in the base position sequence represents the position identifier of each base in the gene sequence in that chromosome. When the acquisition module acquires the position identifier of each base in the chromosome, it is specifically used for: Determine the actual location of the base in the chromosome; Determine the target position parameter, which represents the total number of bases contained in the chromosome; Based on the actual position information of the base in the chromosome and the target position parameter, the position identifier of the base in the chromosome is determined.
14. The apparatus according to claim 10, characterized in that, The gene sequence information includes multiple abnormal gene sequence information and at least one standard gene sequence information. The multiple abnormal gene sequence information includes at least one abnormal gene sequence information of an individual object and at least one abnormal gene sequence information of a population. Each abnormal gene sequence information includes a standard gene sequence and an abnormal gene sequence of the standard gene sequence. Each standard gene sequence information includes two standard gene sequences. Among them, the number of standard gene sequence information is greater than the number of abnormal gene sequence information in individuals, and the number of abnormal gene sequence information in individuals is greater than the number of abnormal gene sequence information in the population.
15. The apparatus according to claim 10, characterized in that, When the training module trains the gene model based on the training set to obtain the trained gene model, it is specifically used for: Masking at least one base of an abnormal gene sequence in gene sequence information, and masking at least one base of a standard gene sequence corresponding to an abnormal gene sequence. The gene model is pre-trained based on the masked gene sequence information to obtain a pre-trained mask prediction model, which serves as the trained gene model; wherein, the gene model is used to predict the bases corresponding to the mask in the gene sequence information based on the input masked gene sequence information. The target training loss of the masked prediction model includes anomaly sequence prediction loss and standard sequence prediction loss. The anomaly sequence prediction loss is determined based on at least one base in the masked abnormal gene sequence and the corresponding base prediction result. The standard sequence prediction loss is determined based on at least one base in the masked standard gene sequence and the corresponding base prediction result.
16. A device for gene sequence classification, characterized in that, include: A gene sequence information acquisition module is used to acquire gene sequence information to be classified, wherein the gene sequence information to be classified includes the gene sequence to be classified. The classification module is used to classify the gene sequence information to be classified through the target classification model to obtain the classification result corresponding to the gene sequence to be classified. The target classification model is obtained by fine-tuning the trained gene model; The trained gene model is obtained using the gene model training device described in claim 10.
17. The apparatus according to claim 16, characterized in that, The gene sequence information to be classified further includes: the chromosome identifier sequence corresponding to the gene sequence to be classified, the position identifier sequence corresponding to the gene sequence to be classified, and the object identifier sequence corresponding to the gene sequence to be classified; the chromosome identifier sequence includes the identifier of the chromosome corresponding to each base in the gene sequence to be classified, and the position identifier sequence includes: the position identifier of each base in the gene sequence to be classified in the chromosome. Specifically, when the classification module classifies the gene sequence information to be classified using a target classification model to obtain the classification result corresponding to the gene sequence to be classified, it is used for: The gene sequence to be classified, the chromosome identifier sequence corresponding to the gene sequence to be classified, the position identifier sequence corresponding to the gene sequence to be classified, and the object identifier sequence corresponding to the gene sequence to be classified are spliced together to obtain the spliced gene sequence. The spliced gene sequence is classified using the target classification model to obtain the classification result corresponding to the gene sequence to be classified.
18. The apparatus according to claim 16, characterized in that, The trained gene model includes: a trained feature extraction sub-model and a trained mask output sub-model; The target classification model is obtained by fine-tuning the trained gene model in the following way: Obtain multiple training samples with classification labels; wherein the training samples include at least one abnormal gene sequence and a standard gene reference sequence of the abnormal gene sequence; Based on the multiple training samples, the gene sequence classification model is fine-tuned to obtain the target classification model. The target classification model is used to classify the variant gene sequence based on the input variant gene sequence and the corresponding standard gene sequence. The gene sequence classification model includes a trained feature extraction sub-model and a classification sub-model.
19. An electronic device, characterized in that, The electronic device includes a memory and a processor, the memory storing a computer program, and the processor executing the method according to any one of claims 1 to 9 when running the computer program.
20. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the method described in any one of claims 1 to 9.
21. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Sequence variation verifying method, device, method for generating variation sequence and electronic equipment
CN109935275A
Parallel processing hardware acceleration unit based on Smith-Waterman algorithm
CN110471642A