Method, device, equipment, storage medium and program product for generating prediction result
Patent Information
- Application Number
- CN202310860818.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-13
- Publication Date
- 2026-10-09
- Estimated Expiration
- 2043-07-13
AI Technical Summary
[0004]然而,上述需要针对不同的任务类型特别设计对应的模型,模型对于任务的泛化性较差,预测效率较低
[0020]By acquiring gene fragment sequences and task instructions, the gene fragment sequences include at least one of proteome fragment sequences and transcriptome fragment sequences. The task instructions indicate at least one of multiple prediction task types. The gene fragment sequences and task instructions are encoded and fused to obtain a first coding sequence. The first coding sequence includes the gene coding sequence corresponding to the gene fragment sequence and the task coding sequence corresponding to the task instructions. A pre-trained gene language model is used to predict the first coding sequence to obtain a prediction result. The gene language model is used to generate prediction results corresponding to at least one prediction task type in the task instructions. The prediction results are decoded to obtain the target result. The target result is the result obtained by predicting the gene fragment sequence according to at least one task type. This gene language model realizes the direct generation of corresponding task results based on different task coding sequences, which can adapt to multiple different prediction task types, improves the model's generalization for prediction tasks, and improves prediction efficiency.
Smart Images

Figure CN116959559B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of bioinformatics, and in particular to a method, apparatus, device, storage medium, and program product for generating prediction results. Background Technology
[0002] Research based on gene fragment sequence information can be divided into statistical learning-based research methods and machine learning-based research methods. Due to the in-depth study of gene fragment sequence information, a variety of research tasks are designed.
[0003] In related technologies, research methods based on non-pre-trained deep learning are adopted to design and train different deep learning models for different tasks.
[0004] However, the above requires specific model design for different task types, and the model has poor generalization ability and low prediction efficiency. Summary of the Invention
[0005] This application provides a method, apparatus, device, storage medium, and program product for generating prediction results, which can improve the task generalization ability of the model. The technical solution is as follows.
[0006] On the one hand, a method for generating prediction results is provided, the method comprising:
[0007] Obtain gene fragment sequences and task instructions, wherein the gene fragment sequences include at least one of proteome fragment sequences and transcriptome fragment sequences, and the task instructions are used to indicate at least one of multiple prediction task types;
[0008] The gene fragment sequence and the task instruction are encoded and fused to obtain a first coding sequence, wherein the first coding sequence includes the gene coding sequence corresponding to the gene fragment sequence and the task coding sequence corresponding to the task instruction;
[0009] The first coding sequence is predicted by a pre-trained gene language model to obtain a prediction result, wherein the gene language model is used to generate a prediction result corresponding to at least one prediction task type in the task instruction.
[0010] The prediction result is decoded to obtain the target result, which is the result obtained by predicting the gene fragment sequence according to the at least one prediction task type.
[0011] On the other hand, an apparatus for generating prediction results is provided, the apparatus comprising:
[0012] An acquisition module is used to acquire gene fragment sequences and task instructions, wherein the gene fragment sequences include at least one of proteome fragment sequences and transcriptome fragment sequences, and the task instructions are used to indicate at least one of multiple prediction task types;
[0013] The processing module is used to encode and fuse the gene fragment sequence and the task instruction to obtain a first encoding sequence, wherein the first encoding sequence includes the gene encoding sequence corresponding to the gene fragment sequence and the task encoding sequence corresponding to the task instruction;
[0014] The processing module is further configured to predict the first coding sequence using a pre-trained gene language model to obtain a prediction result, wherein the gene language model is configured to generate a prediction result corresponding to at least one prediction task type in the task instruction.
[0015] The processing module is further configured to decode the prediction result to obtain a target result, wherein the target result is the result obtained by predicting the gene fragment sequence according to the at least one prediction task type.
[0016] On the other hand, a computer device is provided, the computer device including a processor and a memory, the memory storing at least one instruction, at least one program, code set or instruction set, the at least one instruction, the at least one program, the code set or instruction set being loaded and executed by the processor to implement the prediction result generation method as described in any of the above embodiments of this application.
[0017] On the other hand, a computer-readable storage medium is provided, wherein at least one instruction, at least one program, code set, or instruction set is stored therein, wherein the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by a processor to implement the method for generating prediction results as described in any of the embodiments of this application above.
[0018] On the other hand, a computer program product or computer program is provided, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the prediction result generation method described in any of the above embodiments.
[0019] The beneficial effects of the technical solutions provided in this application include at least the following:
[0020] By acquiring gene fragment sequences and task instructions, the gene fragment sequences include at least one of proteome fragment sequences and transcriptome fragment sequences. The task instructions indicate at least one of multiple prediction task types. The gene fragment sequences and task instructions are encoded and fused to obtain a first coding sequence. The first coding sequence includes the gene coding sequence corresponding to the gene fragment sequence and the task coding sequence corresponding to the task instructions. A pre-trained gene language model is used to predict the first coding sequence to obtain a prediction result. The gene language model is used to generate prediction results corresponding to at least one prediction task type in the task instructions. The prediction results are decoded to obtain the target result. The target result is the result obtained by predicting the gene fragment sequence according to at least one task type. This gene language model realizes the direct generation of corresponding task results based on different task coding sequences, which can adapt to multiple different prediction task types, improves the model's generalization for prediction tasks, and improves prediction efficiency. Attached Figure Description
[0021] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0022] Figure 1 This is a schematic diagram of an implementation environment provided by an exemplary embodiment of this application;
[0023] Figure 2 This is a flowchart of a method for generating prediction results provided in an exemplary embodiment of this application;
[0024] Figure 3 This is a schematic diagram illustrating the application of a gene language model provided in an exemplary embodiment of this application;
[0025] Figure 4 This is a flowchart of an exemplary embodiment of the encoding fusion method provided in this application;
[0026] Figure 5 This is a flowchart of a gene language model training method provided in an exemplary embodiment of this application;
[0027] Figure 6 This is a schematic diagram of gene language model training provided in an exemplary embodiment of this application;
[0028] Figure 7 This is a flowchart of a data expansion method provided in an exemplary embodiment of this application;
[0029] Figure 8This is a schematic diagram of the structure of a gene language model provided in an exemplary embodiment of this application;
[0030] Figure 9 This is a structural block diagram of a device for generating prediction results provided in an exemplary embodiment of this application;
[0031] Figure 10 This is a structural block diagram of a prediction result generation device module provided in an exemplary embodiment of this application;
[0032] Figure 11 This is a structural block diagram of a terminal provided in an exemplary embodiment of this application. Detailed Implementation
[0033] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0034] It should be understood that although the terms first, second, etc., may be used in this disclosure to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, a first parameter may also be referred to as a second parameter without departing from the scope of this disclosure, and similarly, a second parameter may also be referred to as a first parameter. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."
[0035] Research based on gene fragment sequence information can be divided into statistical learning-based and machine learning-based methods. Due to the in-depth study of gene fragment sequence information, a wide variety of research tasks are designed. Among related technologies, pre-trained deep learning methods are employed, using large amounts of data to pre-train deep learning models to obtain a data-generalizable deep learning model. However, while this method expands the model's data generalization ability, it requires the design of specific task branches for different task types, resulting in poor generalization ability for the model across tasks.
[0036] The prediction result generation method provided in this application embodiment obtains a gene fragment sequence and a task instruction. The gene fragment sequence includes at least one of a proteome fragment sequence and a transcriptome fragment sequence. The task instruction indicates at least one of multiple prediction task types. The gene fragment sequence and the task instruction are encoded and fused to obtain a first coding sequence. The first coding sequence includes a gene coding sequence corresponding to the gene fragment sequence and a task coding sequence corresponding to the task instruction. The first coding sequence is predicted using a pre-trained gene language model to obtain a prediction result. The gene language model is used to generate prediction results corresponding to at least one prediction task type in the task instruction. The prediction result is decoded to obtain a target result. The target result is the result obtained by predicting the gene fragment sequence according to at least one task type. This gene language model realizes the direct generation of corresponding task results based on different task coding sequences, which can adapt to multiple different prediction task types, improves the model's generalization for prediction tasks, and improves prediction efficiency.
[0037] First, the implementation environment of this application will be introduced. Please refer to... Figure 1 The diagram illustrates an implementation environment provided by an exemplary embodiment of this application, which includes a terminal 110.
[0038] In some embodiments, a pre-trained gene language model is deployed in the terminal 110. The terminal 110 acquires gene fragment sequences and task instructions. The gene fragment sequences include at least one of proteome fragment sequences and transcriptome fragment sequences, and the task instructions indicate at least one of multiple prediction task types. The terminal 110 performs encoding fusion on the gene fragment sequences and task instructions to obtain a first coding sequence. The first coding sequence includes a gene coding sequence corresponding to the gene fragment sequence and a task coding sequence corresponding to the task instructions. The terminal 110 uses the pre-trained gene language model to predict the first coding sequence, obtaining a prediction result. The gene language model generates prediction results corresponding to at least one prediction task type in the task instructions. The prediction results are decoded to obtain a target result, which is the result obtained by predicting the gene fragment sequence according to at least one task type.
[0039] In some embodiments, the aforementioned gene fragment sequences and task instructions are obtained based on a prediction task, which may be preset or constructed in real time based on user operations or instructions.
[0040] In some embodiments, the implementation environment also includes a server 120 and a communication network 130, through which the terminal 110 and the server 120 transmit data.
[0041] In some embodiments, a pre-trained gene language model is deployed in server 120. This model generates prediction results corresponding to at least one prediction task type in the task instructions. Terminal 110 sends a prediction instruction to server 120 based on the prediction task. This instruction instructs server 120 to acquire gene fragment sequences and task instructions, and to execute the corresponding prediction task based on these instructions. After acquiring the gene fragment sequences and task instructions, server 120 performs encoding fusion on the sequences to obtain a first encoded sequence. This first encoded sequence includes a gene encoding sequence corresponding to the gene fragment sequence and a task encoding sequence corresponding to the task instructions. The pre-trained gene language model then predicts the first encoded sequence to obtain a prediction result. The prediction result is then decoded to obtain a target result, which is the result obtained by predicting the gene fragment sequence according to at least one task type. Server 120 sends the target result corresponding to the prediction task to terminal 110 via communication network 130.
[0042] The aforementioned terminal is optional and can be a desktop computer, laptop computer, mobile phone, tablet computer, e-book reader, Moving Picture Experts Group Audio Layer III (MP3) player, Moving Picture Experts Group Audio Layer IV (MP4) player, smart TV, smart vehicle, and other types of terminal devices. This application embodiment does not limit the specific terminal device to these types.
[0043] It is worth noting that the aforementioned servers can be independent physical servers, server clusters or distributed systems composed of multiple physical servers, or cloud servers that provide basic cloud computing services such as cloud services, cloud security, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.
[0044] Cloud technology refers to a hosting technology that unifies a series of resources such as hardware, software, and networks within a wide area network or local area network to achieve data computing, storage, processing, and sharing.
[0045] In some embodiments, the server described above can also be implemented as a node in a blockchain system.
[0046] It should be noted that all information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.), and signals involved in this application have been authorized by the user or fully authorized by all parties, and the collection, use, and processing of related data must comply with the relevant laws, regulations, and standards of the relevant regions. For example, gene fragment sequences involved in this application were obtained with full authorization.
[0047] This is illustrative; please refer to it. Figure 2 This document illustrates a flowchart of a prediction result generation method provided in an exemplary embodiment of this application. This method can be applied to a terminal, a server, or executed jointly by both. This embodiment uses the application of this method to a terminal as an example for illustration. Figure 2 As shown, the method includes the following steps:
[0048] Step 210: Obtain gene fragment sequences and task instructions.
[0049] The gene fragment sequence includes at least one of the proteome fragment sequence and the transcriptome fragment sequence, and the task instruction is used to indicate at least one of a variety of prediction task types.
[0050] In some embodiments, the proteome fragment sequence is a deoxyribonucleic acid (DNA) sequence, and the transcriptome fragment sequence is a ribonucleic acid (RNA) sequence.
[0051] In some embodiments, the gene fragment sequence is a fragment sequence sampled from the human reference genome and transcriptome data GRCH38.
[0052] In some embodiments, the task instruction is used to indicate at least one of a variety of prediction task types, such as classification, sequence generation, and numerical regression.
[0053] In some embodiments, a gene fragment sequence and a task instruction are obtained based on a prediction task to be performed. For example, if the prediction task is implemented to predict the species category to which a specified DNA sequence belongs, then the specified DNA sequence is obtained as a gene fragment sequence, and the species classification task instruction is obtained.
[0054] Step 220: The gene fragment sequence and the task instructions are encoded and fused to obtain the first coding sequence.
[0055] The first coding sequence includes the gene coding sequence corresponding to the gene fragment sequence and the task coding sequence corresponding to the task instruction.
[0056] In some embodiments, the gene fragment sequence includes multiple bases or base pairs. Optionally, the DNA sequence includes multiple base pairs in a double-stranded form, and the RNA sequence includes multiple bases in a single-stranded form.
[0057] In some embodiments, the gene fragment sequence includes at least one of the following five bases: adenine, cytosine, guanine, thymine, and uracil. Specifically, the DNA sequence includes at least one base selected from adenine, cytosine, guanine, and thymine, while the RNA sequence includes at least one base selected from adenine, cytosine, guanine, and uracil.
[0058] In some embodiments, encoding fusion refers to encoding at least two contents to be encoded separately to obtain at least two corresponding encoding sequences, and then fusing the at least two encoding sequences to obtain a fused target encoding sequence. The target encoding sequence may include the at least two encoding sequences mentioned above, or it may include the encoding elements in the at least two encoding sequences mentioned above.
[0059] Optionally, at least two coding sequences can be sequentially arranged according to a preset coding order to obtain a target coding sequence; or multiple coding elements can be sampled from at least two coding sequences and combined according to a preset coding order to obtain a target coding sequence; or multiple coding elements in at least two coding sequences can be rearranged and combined according to a preset coding order to obtain a target coding sequence.
[0060] Indicatively, assuming the first and second encoded contents are two contents to be encoded, encoding the first content yields encoding sequence 1 as "abcde", and encoding the second content yields sequence 2 as "123". Encoding sequences 1 and 2 are then merged to obtain a fused target encoded sequence. The fusion process can be as follows: encoding sequences 1 and 2 can be sequentially ordered according to a preset encoding order to obtain the target encoded sequence "abcde123"; alternatively, encoding elements "a" and "b" can be sampled from encoding sequence 1, and the encoding element "1" can be sampled from encoding sequence 1, combining multiple encoding elements according to a preset encoding order to obtain the target encoded sequence "1ab"; or, multiple encoding elements "a", "b", "c", "d", "e", "1", "2", and "3" from encoding sequences 1 and 2 can be rearranged and combined according to a preset encoding order to obtain the target encoded sequence "1ab2cd3e".
[0061] It is worth noting that the above-mentioned fusion methods are merely illustrative examples and are not intended to limit the scope of this application.
[0062] In some embodiments, gene fragment sequences are encoded to obtain gene coding sequences, task instruction sequences are encoded to obtain task coding sequences, and gene coding sequences and task coding sequences are fused to obtain a first coding sequence.
[0063] In some embodiments, a first coding sequence is input as a prompt sequence into a pre-trained gene language model, and the first coding sequence is used to prompt the gene language model to perform a prediction task based on the gene coding sequence and the task coding sequence.
[0064] In some embodiments, gene fragment sequences and task instructions are encoded based on a pre-constructed encoding vocabulary, which includes the correspondence between gene coding sequences and gene fragment sequences, as well as the correspondence between task coding sequences and task instructions.
[0065] Indicatively, the coding vocabulary includes the correspondence between each base and its encoding in a gene fragment sequence. "A" encodes adenine, "C" encodes cytosine, "G" encodes guanine, and "T" encodes thymine or uracil. In a DNA sequence, "T" encodes thymine, and in an RNA sequence, "T" encodes uracil. The coding vocabulary also pre-defines the correspondence between task instructions and task coding sequences. For example, using... <cls>Identify and classify tasks. <reg>Identify numerical regression tasks, <gen>Identifier generation tasks, etc.
[0066] Indicatively, for a given DNA sequence task instruction of species classification, the gene coding sequence and the task coding sequence are fused to obtain the first coding sequence:
[0067] <dna>AAAGTCTGAC <organism> <cls>,
[0068] in, <dna>AAAGTCTGAC is the gene coding sequence. <dna>Used to identify gene fragment sequences as DNA sequences, AAAGTCTGAC is used to represent the bases encoded in that DNA sequence. <organism> <cls>Encode the sequence for the task. <organism>Prediction tasks used to indicate species orientation <cls>Used to indicate that the prediction task type belongs to a classification task.
[0069] To illustrate, assuming that the DNA fragment is predicted to belong to species 0 based on the first coding sequence described above, the prediction result can be represented by numerical encoding, for example:
[0070] <dna>AAAGTCTGAC <organism> <cls><0> ,
[0071] in, <0> The prediction result is used to indicate that the DNA fragment AAAGTCTGAC belongs to species 0.
[0072] In some embodiments, since the gene fragment sequence is long, i.e. the number of bases in the gene fragment sequence exceeds a preset threshold, it is necessary to divide the gene fragment sequence.
[0073] In some embodiments, the gene fragment sequence is divided into multiple unit gene fragment sequences according to a preset fragment length, wherein the fragment length is used to indicate the number of bases in the unit gene fragment sequence. The multiple unit gene fragment sequences and the task instruction are encoded and fused to obtain a first coding sequence. The first coding sequence includes multiple unit gene coding sequences corresponding to the multiple unit gene fragment sequences and a task coding sequence corresponding to the task instruction.
[0074] Optionally, the segments can be divided evenly according to a preset segment length.
[0075] Indicatively, assuming a DNA sequence of length M base pairs, with a pre-defined fragment length of K base pairs, the DNA sequence is uniformly divided into groups of K base pairs, resulting in multiple unit gene fragment sequences. The number of unit gene fragment sequences is... Where M and K are positive integers.
[0076] Optionally, the segments can be divided by shifting according to a preset segment length.
[0077] To illustrate, suppose there is a DNA sequence of length M base pairs, and the preset fragment length is K base pairs. The DNA sequence is divided into multiple unit gene fragment sequences by shifting fragments according to K base pairs as a group, and the number of unit gene fragment sequences is M-K+1, where M and K are positive integers. The first unit gene fragment sequence includes the first K base pairs of the DNA sequence, and the second unit gene fragment sequence includes the second to the (K+1)th base pairs of the DNA sequence.
[0078] Step 230: Predict the first coding sequence using a pre-trained gene language model to obtain the prediction result.
[0079] Among them, the gene language model is used to generate prediction results corresponding to at least one prediction task type in the task instructions.
[0080] In some embodiments, the first coding sequence is input into the gene language model as a prompt sequence, and a prediction result is output. The first coding sequence is used to prompt the gene language model to perform a prediction task corresponding to the task instruction on the gene coding sequence according to the task coding sequence.
[0081] To illustrate, suppose DNA and RNA sequences are randomly extracted from multiple chromosomes. The prediction task is to determine which chromosome the sequence is located on and whether it is flipped. Based on the chromosome determination instruction, the first coding sequence is obtained as follows: <dna>ATCTGC… <cls> <chr>,in, <dna>ATCTGC… is a gene coding sequence. <cls> <chr>Encode the sequence for the task. <cls>Used to indicate classification tasks <chr>This is used to indicate that a gene segment sequence is located on the corresponding chromosome. Assuming the prediction result is that the DNA sequence is located on chromosome 1, we can obtain... <dna>ATCTGC… <cls> <chr><1> The prediction result is then used as input for the next task to construct the first encoded sequence:
[0082] <dna>ATCTGC… <cls> <chr> <1> <cls> <flip>,
[0083] in, <cls> <flip>This is the task encoding sequence in this prediction, used to indicate the binary classification task of judging the flipping situation, where, <cls>Used to indicate classification tasks <flip>Used to indicate the flipping judgment task. Assuming... <0> Indicates that it has not been flipped. <1> Indicates flipping, and the predicted result is:
[0084] <dna>ATCTGC… <cls> <chr> <1> <cls> <flip><0> ,
[0085] in, <0> This is used to indicate that the DNA sequence has not been flipped.
[0086] In some embodiments, step 230 is implemented by inputting the first coding sequence into the gene language model and obtaining the prediction result through iterative output.
[0087] The gene language model generates the (i+1)th output result based on the first coding sequence and the first i output results, and stops outputting when the (i+1)th output result meets the preset termination result, where i is a positive integer.
[0088] Indicatively, the first coding sequence is input into the gene language model as a prompt sequence. The first output result is obtained based on the first coding sequence and is denoted as [1]. [1] is input into the gene language model. The second output result is generated based on the first coding sequence and [1] and is denoted as [2]. [2] is input into the gene language model. The third output result is generated based on the first coding sequence and [1] and [2] and is denoted as [3]. And so on, until the (i+1)th output result meets the preset termination result and the output stops.
[0089] Optionally, the preset termination result is <pad> , <pad>Encoded representations used in a pre-built encoded vocabulary to indicate the termination output of the model.
[0090] Indicatively, the gene language model generates the (i+1)th output based on the first coding sequence and the first i outputs, until the (i+1)th output is... <pad>Stop output.
[0091] This is illustrative; please refer to it. Figure 3 , Figure 3 This is a schematic diagram illustrating the application of a gene language model provided in an exemplary embodiment of this application, such as... Figure 3 As shown, a gene fragment sequence 310 and a task instruction 320 are obtained. The gene fragment sequence 310 is divided into shifted segments and encoded to obtain a gene coding sequence 311. The task instruction is encoded to obtain a task coding sequence 321. The gene coding sequence 311 and the task coding sequence 321 are fused to obtain a first coding sequence 330. The first coding sequence 330 is used as a prompt sequence and input into a gene language model 340. A prediction result 350 is obtained through iterative output. The prediction result 350 is decoded to obtain the target result 360.
[0092] Step 240: Decode the prediction result to obtain the target result.
[0093] The target result is the result obtained by predicting gene fragment sequences according to at least one prediction task type.
[0094] Optionally, the prediction result can be decoded by a pre-trained decoder, or the target result corresponding to the prediction result can be obtained based on a preset result mapping table, which includes the correspondence between the prediction result and the target result.
[0095] Indicative, <dna>ATCTGC… <cls> <chr> <1> <cls> <flip><0> For example, the prediction result is <0> This is used to indicate that the DNA sequence ATCTGC… belongs to species 0. Assuming that by looking up the result mapping table, species 0 is determined to be human, then the target result, i.e., the species classification result corresponding to this DNA sequence, is human.
[0096] In some embodiments, before generating prediction results, the gene language model is pre-trained based on a preset coding vocabulary, so that the gene language model can learn the correspondence between gene fragment sequences and gene coding sequences, as well as the correspondence between task instructions and task coding sequences.
[0097] In some embodiments, the coding vocabulary also includes numerical codes [0], [1], [2], [3], [4], [5], [6], [7], [8], and [9]. These numerical codes can identify prediction results such as category results corresponding to classification tasks, and can also be used in combination with other codes.
[0098] In summary, the method provided in this application involves acquiring gene fragment sequences and task instructions. The gene fragment sequences include at least one of proteome fragment sequences and transcriptome fragment sequences. The task instructions indicate at least one of multiple prediction task types. The gene fragment sequences and task instructions are encoded and fused to obtain a first coding sequence. The first coding sequence includes a gene coding sequence corresponding to the gene fragment sequence and a task coding sequence corresponding to the task instructions. A pre-trained gene language model is used to predict the first coding sequence to obtain a prediction result. The gene language model generates prediction results corresponding to at least one prediction task type in the task instructions. The prediction results are decoded to obtain a target result. The target result is the result obtained by predicting the gene fragment sequence according to at least one task type. This gene language model enables the direct generation of corresponding task results based on different task coding sequences, adapting to multiple different prediction task types, improving the model's generalization ability for prediction tasks, and increasing prediction efficiency.
[0099] The method provided in this application embodiment can indicate multiple prediction task types through task instructions, including at least one of classification tasks, regression tasks, and sequence generation tasks. By inputting a first coding sequence containing the task coding sequence corresponding to the task instruction into the gene language model, the input format of different tasks is unified, providing a basis for realizing multiple prediction tasks based on the gene language model.
[0100] In some embodiments, step 220 above includes the following two steps:
[0101] The first step is to divide the gene fragment sequence into multiple unit gene fragment sequences according to the preset fragment length.
[0102] The fragment length is used to indicate the number of bases in a single gene fragment sequence.
[0103] Optionally, the segments can be divided evenly according to a preset segment length.
[0104] Indicatively, assuming a DNA sequence of length M base pairs, with a pre-defined fragment length of K base pairs, the DNA sequence is uniformly divided into groups of K base pairs, resulting in multiple unit gene fragment sequences. The number of unit gene fragment sequences is... Where M and K are positive integers.
[0105] Optionally, the segments can be divided by shifting according to a preset segment length.
[0106] To illustrate, suppose there is a DNA sequence of length M base pairs, and the preset fragment length is K base pairs. The DNA sequence is divided into multiple unit gene fragment sequences by shifting fragments according to K base pairs as a group, and the number of unit gene fragment sequences is M-K+1, where M and K are positive integers. The first unit gene fragment sequence includes the first K base pairs of the DNA sequence, and the second unit gene fragment sequence includes the second to the (K+1)th base pairs of the DNA sequence.
[0107] The second step involves encoding and fusing multiple unit gene fragment sequences and task instructions to obtain the first coding sequence.
[0108] The first coding sequence includes multiple unit gene coding sequences corresponding to multiple unit gene fragment sequences, as well as a task coding sequence corresponding to the task instruction.
[0109] In some embodiments, individual gene fragment sequences and task instructions are encoded based on a pre-constructed coding vocabulary.
[0110] Optionally, the coding vocabulary includes a gene coding map and a task coding map. The gene coding map includes the correspondence between proteome fragment sequences and transcriptome fragment sequences and gene coding sequences, while the task coding map includes the correspondence between different types of task instructions and task coding sequences.
[0111] Please refer to Figure 4 , Figure 4 This is a flowchart of an exemplary embodiment of the encoding fusion method provided in this application. This method can be applied to a terminal, a server, or executed jointly by both. This embodiment uses the application of this method to a terminal as an example for illustration. Figure 4 As shown, the second step above includes the following steps:
[0112] Step 410: Obtain the preset gene coding mapping table.
[0113] The gene coding mapping table includes the correspondence between proteome fragment sequences and gene coding sequences, as well as the correspondence between transcriptome fragment sequences and gene coding sequences.
[0114] In some embodiments, the gene coding mapping table includes preset sequence type codes, for example, <dna> 、 <rna> 、 <ncrna>and <mrna>etc., used to identify whether a gene fragment sequence is a proteome fragment sequence or a transcriptome fragment sequence, among which, <dna>Used to identify DNA sequences <rna>Used to identify RNA sequences <ncrna>Used to identify non-coding RNA (NCRNA). <mrna>Used to identify messenger RNA (mRNA).
[0115] In some embodiments, the gene coding mapping table includes preset base codes, such as A, T, G, and C, wherein A is used to encode adenine, C is used to encode cytosine, G is used to encode guanine, and T is used to encode thymine or uracil. When located in a DNA sequence, T is used to encode thymine, and when located in an RNA sequence, T is used to encode uracil.
[0116] In some embodiments, a gene coding sequence is represented by a sequence type encoding followed by the base encoding corresponding to the gene fragment sequence.
[0117] Indicative, <rna>CCTCAGCCCC is used to represent an RNA sequence containing the bases corresponding to CCTCAGCCCC. <dna>TTCCGAATGCA is used to represent DNA sequences containing base pairs corresponding to TTCCGAATGCA.
[0118] In some embodiments, the gene coding mapping table includes preset chromosome codes, for example... <chr> 、 <chrx> 、 <chry>and <chrm>etc., used to identify the location of gene fragment sequences on corresponding chromosomes, where, <chr>This is used to indicate that a gene segment sequence is located on a corresponding chromosome. It can be combined with numerical codes to indicate the specific chromosome, for example... <chr><2> Used to indicate that a gene segment sequence is located on chromosome 2. <chrx>Used to indicate that a gene segment sequence is located on the X chromosome. <chry>Used to indicate that a gene segment sequence is located on the sex chromosome Y. <chrm>Used to indicate that a gene segment sequence is located on an autosome other than a sex chromosome.
[0119] Step 420: Encode multiple unit gene fragment sequences based on the gene coding mapping table to obtain multiple unit gene coding sequences.
[0120] To illustrate, assuming the DNA sequence is TTCCGA, this DNA sequence is fragmented into four DNA sequence fragments: TTC, TCC, CCG, and CGA. Based on a coding mapping table, these four unit gene fragment sequences are encoded to obtain the four unit gene coding sequences as follows: <dna>TTC、 <dna>TCC、 <dna>CCG and <dna>CGA.
[0121] Step 430: Obtain the preset task code mapping table.
[0122] The task coding mapping table includes the correspondence between task instructions and task coding sequences for different prediction task types.
[0123] Optionally, the various prediction task types include at least one of classification tasks, regression tasks, and sequence generation tasks.
[0124] In some embodiments, the task code mapping table includes preset task codes, for example... <cls>Identify and classify tasks. <reg>Identify numerical regression tasks, <gen>Identify and generate tasks.
[0125] Indicative, <dna>AAAGTCTGAC <organism> <cls><0> This indicates that a species classification prediction task was performed on the DNA sequence AAAGTCTGAC, and the prediction result is that the DNA sequence belongs to species 0. <mrna>ATGATCATGTAA <abundance> <reg><1> <1> <1> This indicates that a peak regression task was performed on the mRNA sequence ATGATCATGTAA, and the predicted result was 111 mRNA peaks. <gen> <function> <rna>CCTCAGCCCCTTCCGAATGCA indicates the generation of RNA with a specific function, and the predicted result is the RNA sequence CCTCAGCCCCTTCCGAATGCA, where... <function>Used to indicate a specific function, it can be replaced with the function code sequence corresponding to the actual function in practical applications.
[0126] Step 440: Encode the task instructions based on the task encoding mapping table to obtain the task encoding sequence.
[0127] Indicatively, the task instruction is implemented as an instruction for a species classification task, and the task instruction is encoded to obtain a task encoding sequence. <organism> <cls>The task instruction is implemented as an instruction indicating the peak regression task, and the task instruction is encoded to obtain the task encoding sequence. <abundance> <reg>The task instruction is implemented as an instruction to generate a task, and the task instruction is encoded to obtain a task encoding sequence. <gen>.
[0128] Step 450: Fuse multiple unit gene coding sequences and task coding sequences to obtain the first coding sequence.
[0129] Optionally, multiple unit gene coding sequences may correspond to different task coding sequences.
[0130] In some embodiments, the first coding sequence includes multiple sets of coding sequences, each set of coding sequences including a unit gene coding sequence and a corresponding task coding sequence.
[0131] In summary, the method provided in this application divides gene fragment sequences into multiple unit gene fragment sequences according to a preset fragment length, and encodes and fuses the multiple unit gene fragment sequences and task instructions to obtain a first encoded sequence. This clarifies the method for dividing gene fragment sequences, refines the model input, and can improve prediction efficiency.
[0132] The method provided in this application embodiment obtains a preset gene coding mapping table, encodes multiple unit gene fragment sequences based on the gene coding mapping table to obtain multiple unit gene coding sequences, obtains a preset task coding mapping table, encodes task instructions based on the task coding mapping table to obtain task coding sequences, and fuses multiple unit gene coding sequences and task coding sequences to obtain a first coding sequence. This clarifies the coding method and improves data generalization.
[0133] In some embodiments, before predicting the first coding sequence using a pre-trained gene language model to obtain a prediction result, a training process for the gene language model is also included. Please refer to... Figure 5 , Figure 5 This is a flowchart of a gene language model training method provided in an exemplary embodiment of this application. This method can be applied to a terminal, a server, or executed jointly by both. This embodiment uses the application of this method to a terminal as an example for illustration. Figure 5 As shown, the method includes the following steps:
[0134] Step 510: Obtain the sample gene fragment sequence, sample task instructions, and preset task results.
[0135] In some embodiments, the sample gene fragment sequence includes at least one of the sample proteome fragment sequence and the sample transcriptome fragment sequence, and the sample task instruction is used to indicate at least one of a variety of prediction task types.
[0136] In some embodiments, the sample proteome fragment sequence is the sample DNA sequence, and the sample transcriptome fragment sequence is the sample RNA sequence.
[0137] In some embodiments, the sample gene fragment sequence is a fragment sequence sampled from the human reference genome and transcriptome data GRCH38.
[0138] In some embodiments, the sample task instruction is used to indicate at least one of a variety of prediction task types, such as classification, sequence generation, and numerical regression.
[0139] To illustrate, the sample gene fragment sequence is obtained as the DNA sequence CCTCAGCCCCTT, the sample acquisition task instruction is to perform a species classification task, and the preset task result is that the DNA sequence belongs to humans.
[0140] Step 520: Encode and fuse the sample gene fragment sequence, sample task instructions, and preset task results to obtain the sample coding sequence.
[0141] The sample coding sequence includes multiple sample gene coding sequences corresponding to the sample gene fragment sequence, sample task coding sequences corresponding to the sample task instructions, and task result codes corresponding to the preset task results.
[0142] In some embodiments, the sample gene fragment sequence, sample task instructions, and preset task results are encoded and fused based on a preset vocabulary encoding table to obtain a sample encoding sequence. Optionally, the vocabulary encoding table includes the correspondence between sample gene fragment sequences and sample gene encoding sequences, the correspondence between sample task instructions and sample task codes, and the correspondence between task results and task result codes.
[0143] Step 530: Generate the j-th prediction result based on the gene coding sequence of the j-th sample using the candidate gene language model.
[0144] Where j is a positive integer.
[0145] This is illustrative; please refer to it. Figure 6 , Figure 6 This is a schematic diagram of gene language model training provided in an exemplary embodiment of this application, such as... Figure 6 As shown, the sample gene fragment sequence 610, sample task instruction 620, and preset task result 630 are obtained. The sample gene fragment sequence 610, sample task instruction 620, and preset task result 630 are encoded and fused to obtain a sample coding sequence 640. The sample coding sequence 640 includes multiple sample gene coding sequences 611 corresponding to the sample gene fragment sequence, a sample task coding sequence 621 corresponding to the sample task instruction, and a task result code 631 corresponding to the preset task result. The j-th sample gene coding sequence is input into the candidate gene language model 600, and the output is... The j-th prediction result is the prediction result of the gene coding sequence of the (j+1)-th sample. For example, the gene coding sequence of the sample includes 4 coding sequences, namely [0], [1], [2], and [3]. [0] is input into the candidate gene language model to predict [1]'. During the training process, [1] and [1]' are compared to determine the prediction loss value in this round of training. When [3] is input into the candidate gene language model to predict the sample prediction result, the sample prediction result is compared with the task result code 631 to determine the prediction loss value in this round of training.
[0146] Step 540: Determine the j-th first prediction loss based on the difference between the j-th prediction result and the gene coding sequence of the (j+1)-th sample.
[0147] The Nth first prediction loss is determined based on the difference between the Nth prediction result and the task result encoding, where N is used to indicate the number of sample gene fragment sequences and is a positive integer.
[0148] In some embodiments, the purpose of training the candidate gene language model is to predict the current sample gene coding sequence based on the sample gene coding sequences preceding each sample gene coding sequence in the sample coding sequence, and to calculate the cross-entropy.
[0149] In some embodiments, step 540 includes the following two steps:
[0150] The first step is to determine the probability that the j-th prediction result is consistent with the gene coding sequence of the (j+1)-th sample, assuming that the prediction results before the j-th prediction result meet the preset conditions.
[0151] In some embodiments, the j-th first probability is implemented as follows:
[0152] P j =P(u j |u1,…,u j-1 ),
[0153] Among them, u j P(u) represents the reference value for the j-th prediction result. j |u1,…,u j-1 P represents the probability that the gene coding sequence of the j-th prediction result is consistent with that of the (j+1)-th sample, assuming that the prediction results before the j-th prediction result meet the preset conditions. j Let j be the first probability.
[0154] The second step is to take the logarithm of the j-th first probability to obtain the j-th first prediction loss.
[0155] Schematic, the j-th first prediction loss is implemented as follows:
[0156] loss j =log P(u j |u1,…,u j-1 ),
[0157] Where, loss j Let be the first prediction loss for the j-th time.
[0158] Step 550: Integrate N first prediction losses to obtain the target prediction loss, and train the candidate gene language model based on the target prediction loss to obtain the gene language model.
[0159] Optionally, the target prediction loss can be obtained by directly adding the N first prediction losses, or by weighted summing of the N first prediction losses, or by sorting the N first prediction losses from high to low and determining the target prediction loss based on the first n first prediction losses, where n is a positive integer.
[0160] It is worth noting that the above method of integrating N first prediction losses to obtain the target prediction loss is merely an example, and this application does not limit it.
[0161] As an illustration, the target prediction loss is realized as follows:
[0162] L=∑ j=1 logP(u j |u1,…,u j-1 ),
[0163] Where L is the target prediction loss, ∑ j=1 logP(u j |u1,…,u j-1 ) is the sum of the losses of the N first predictions.
[0164] In some embodiments, candidate gene language models are trained based on target prediction loss until they meet the training requirements, thus obtaining a gene language model.
[0165] Optionally, the training requirements include at least one of the following: convergence of the target prediction loss, the target prediction loss reaching a preset loss threshold, and the number of training iterations of the candidate gene language model reaching a preset training iteration threshold.
[0166] In summary, the method provided in this application obtains sample gene fragment sequences, sample task instructions, and preset task results; encodes and fuses these sequences to obtain sample coding sequences; generates a j-th prediction result based on the j-th sample gene coding sequence using a candidate gene language model; determines a j-th first prediction loss based on the difference between the j-th prediction result and the (j+1)-th sample gene coding sequence; integrates N first prediction losses to obtain a target prediction loss; and trains the candidate gene language model based on the target prediction loss to obtain a gene language model. This clarifies the model training method, enabling the model to predict the current sample gene coding sequence based on the sample gene coding sequences preceding each sample gene coding sequence in the sample coding sequence. This provides a foundation for iterative model output to obtain prediction results and improves prediction efficiency.
[0167] In some embodiments, a data expansion process is also included before model training. Please refer to [link / reference]. Figure 7 , Figure 7 This is a flowchart of a data expansion method provided in an exemplary embodiment of this application. This method can be applied to a terminal, a server, or executed jointly by both. This embodiment uses the application of this method to a terminal as an example for illustration. Figure 7 As shown, the method includes the following steps:
[0168] Step 710: Obtain the flip judgment task encoding sequence corresponding to the flip judgment task instruction.
[0169] The flipping judgment task instruction is used to instruct the prediction task of the sequence orientation of the sample gene fragment sequence. Optionally, when the sequence orientation of the sample gene fragment sequence is consistent with the preset orientation, the sample gene fragment sequence is regarded as a forward sequence, and the corresponding prediction result is no flipping; when the sequence orientation of the sample gene fragment sequence is inconsistent with the preset orientation, the sample gene fragment sequence is regarded as a reverse sequence, and the corresponding prediction result is flipping.
[0170] In some embodiments, the flip judgment task encoding sequence corresponding to the flip judgment task instruction is obtained based on a preset encoding vocabulary, and the encoding vocabulary includes the correspondence between the flip judgment task instruction and the flip judgment task encoding sequence.
[0171] As an illustration, the encoding sequence of the flip judgment task corresponding to the flip judgment task instruction is obtained as follows: <cls> <flip>.
[0172] Step 720: Construct the flip judgment task based on the sample gene fragment sequence and the flip judgment task encoding sequence.
[0173] Indicative, build task 1:
[0174] <dna>ATCTGC… <cls> <chr> <1> <cls> <flip><0> ,
[0175] Build Task 2:
[0176] <rna>ATCTGC… <cls> <chr> <1> <cls> <flip><1> ,
[0177] Task 1 indicates that the DNA sequence ATCTGC… located on chromosome 1 is flipped, and the predicted result is that the DNA sequence is not flipped. Task 2 indicates that the RNA sequence ATCTGC… located on chromosome 1 is flipped, and the predicted result is that the RNA sequence is flipped.
[0178] Among them, "not flipped" means that the gene fragment sequence conforms to the forward sequence order from the 3' end to the 5' end, while "flipped" means that the gene fragment sequence conforms to the reverse sequence order from the 5' end to the 3' end.
[0179] Step 730: Based on the judgment result obtained by performing the flip judgment task using the candidate gene language model, construct the flipped gene fragment sequence corresponding to the sample gene fragment sequence.
[0180] Among them, the flipped gene fragment sequence is used to participate in the training process of the candidate gene language model.
[0181] Schematic illustration: Based on the judgment results obtained from Task 1 above, the DNA sequence is flipped to obtain the corresponding flipped gene fragment sequence, which is a gene fragment sequence that conforms to the reverse sequence order. Based on the judgment results obtained from Task 2 above, the RNA sequence is flipped to obtain the corresponding flipped gene fragment sequence, which is a gene fragment sequence that conforms to the forward sequence order. Using the flipped gene fragment sequences obtained above in the training process of the candidate gene language model can expand the richness of the sample data.
[0182] In some embodiments, multi-sequence data can also be constructed during the data expansion process.
[0183] Schematic, a single-sequence input refers to a gene coding sequence consisting of a single sequence type encoding and a single string of bases encoding, for example, <dna>ATCTGC…; Multiple sequence input refers to a gene coding sequence formed by multiple sequence type codes, multiple base sequences, and numerical codes, for example, <dna><0> ATCTGC <dna><1> TACGAT….
[0184] In summary, the method provided in this application obtains the flip judgment task encoding sequence corresponding to the flip judgment task instruction, constructs a flip judgment task based on the sample gene fragment sequence and the flip judgment task encoding sequence, constructs a flipped gene fragment sequence corresponding to the sample gene fragment sequence based on the judgment result obtained by executing the flip judgment task on the candidate gene language model, and uses the flipped gene fragment sequence to participate in the training process of the candidate gene language model, thereby expanding the sample data, increasing the richness of the sample sequence, and improving the training efficiency of the model.
[0185] Please refer to Figure 8 , Figure 8 This is a schematic diagram of the gene language model structure provided in an exemplary embodiment of this application, such as... Figure 8 As shown, the gene language model 800 adopts a translation (Transformer) model from natural language tasks, including an embedding block 810, a decoder block 820, and a linear layer 830. The embedding block requires the input gene coding sequence (tokens) and the length of the tokens, which are then converted into position vectors from 0 to N-1, where N is the length of the input tokens. The tokens and positions are input to the embedding module in the embedding layer 810 to calculate the corresponding embedding values and sum them to obtain the final embedding value. After passing through multiple decoder layers and one linear layer, the model outputs the final result. The decoder layer 820 uses a multi-head attention layer with residual connections and a feed forward layer, and uses an activation module (GaussianError Linear Unit, GELU) for activation processing and a layer normalization module for normalization processing.
[0186] Figure 9 This is a structural block diagram of a prediction result generation apparatus provided in an exemplary embodiment of this application, such as... Figure 9 As shown, the device includes the following parts:
[0187] The acquisition module 910 is used to acquire gene fragment sequences and task instructions, wherein the gene fragment sequences include at least one of proteome fragment sequences and transcriptome fragment sequences, and the task instructions are used to indicate at least one of multiple prediction task types;
[0188] The processing module 920 is used to encode and fuse the gene fragment sequence and the task instruction to obtain a first encoding sequence, wherein the first encoding sequence includes the gene encoding sequence corresponding to the gene fragment sequence and the task encoding sequence corresponding to the task instruction;
[0189] The processing module 920 is further configured to predict the first coding sequence using a pre-trained gene language model to obtain a prediction result, wherein the gene language model is configured to generate a prediction result corresponding to at least one prediction task type in the task instruction.
[0190] The processing module 920 is further configured to decode the prediction result to obtain a target result, wherein the target result is the result obtained by predicting the gene fragment sequence according to the at least one prediction task type.
[0191] In some embodiments, the processing module 920 is used to input the first coding sequence into the gene language model and obtain the prediction result through iterative output, wherein the gene language model generates the (i+1)th output result based on the first coding sequence and the first i output results, and stops outputting when the (i+1)th output result meets the preset termination result, where i is a positive integer.
[0192] Please refer to Figure 10 , Figure 10 This is a structural block diagram of a prediction result generation device module provided in an exemplary embodiment of this application, as shown below. Figure 10 As shown, in some embodiments, the processing module 920 includes:
[0193] Fragment segmentation unit 921 is used to segment the gene fragment sequence according to a preset fragment length to obtain multiple unit gene fragment sequences, wherein the fragment length is used to indicate the number of bases in the unit gene fragment sequence;
[0194] The coding fusion unit 922 is used to perform coding fusion on the plurality of unit gene fragment sequences and the task instruction to obtain the first coding sequence. The first coding sequence includes the plurality of unit gene coding sequences corresponding to the plurality of unit gene fragment sequences and the task coding sequence corresponding to the task instruction.
[0195] In some embodiments, the coding fusion unit 922 is configured to:
[0196] Obtain a preset gene coding mapping table, which includes the correspondence between the proteome fragment sequence and the gene coding sequence, as well as the correspondence between the transcriptome fragment sequence and the gene coding sequence;
[0197] The multiple unit gene fragment sequences are encoded based on the gene coding mapping table to obtain the multiple unit gene coding sequences;
[0198] Obtain a preset task encoding mapping table, which includes the correspondence between task instructions and task encoding sequences for different predicted task types;
[0199] The task instructions are encoded based on the task encoding mapping table to obtain the task encoding sequence;
[0200] The first coding sequence is obtained by fusing the multiple unit gene coding sequences and the task coding sequence.
[0201] In some embodiments, the acquisition module 910 is used to acquire sample gene fragment sequences, sample task instructions, and preset task results;
[0202] The processing module 920 includes:
[0203] The first processing unit 901 is used to encode and fuse the sample gene fragment sequence, the sample task instruction and the preset task result to obtain a sample encoding sequence. The sample encoding sequence includes multiple sample gene encoding sequences corresponding to the sample gene fragment sequence, a sample task encoding sequence corresponding to the sample task instruction, and a task result encoding corresponding to the preset task result.
[0204] The second processing unit 902 is used to generate the j-th prediction result based on the j-th sample gene coding sequence through the candidate gene language model, where j is a positive integer;
[0205] The third processing unit 903 is used to determine the j-th first prediction loss based on the difference between the j-th prediction result and the (j+1)-th sample gene coding sequence, wherein the N-th first prediction loss is determined based on the difference between the N-th prediction result and the task result coding, and N is used to indicate the number of sample gene fragment sequences, and N is a positive integer;
[0206] The fourth processing unit 904 is used to integrate N first prediction losses to obtain a target prediction loss, and to train the candidate gene language model based on the target prediction loss to obtain the gene language model.
[0207] In some embodiments, the third processing unit 903 is configured to:
[0208] If the prediction results before the j-th prediction result meet the preset conditions, the probability that the j-th prediction result is consistent with the gene coding sequence of the (j+1)-th sample is the j-th first probability;
[0209] The j-th first prediction loss is obtained by taking the logarithm of the j-th first probability.
[0210] In some embodiments, the processing module 920 is configured to:
[0211] Obtain the flip judgment task encoding sequence corresponding to the flip judgment task instruction, wherein the flip judgment task instruction is used to indicate the prediction task of predicting the sequence orientation of the sample gene fragment sequence;
[0212] A flipping judgment task is constructed based on the sample gene fragment sequence and the flipping judgment task encoding sequence;
[0213] Based on the judgment result obtained by performing the flip judgment task based on the candidate gene language model, a flipped gene fragment sequence corresponding to the sample gene fragment sequence is constructed, and the flipped gene fragment sequence is used to participate in the training process of the candidate gene language model.
[0214] In some embodiments, the multiple prediction task types include at least one of classification tasks, regression tasks, and sequence generation tasks.
[0215] In summary, the apparatus provided in this application acquires gene fragment sequences and task instructions. The gene fragment sequences include at least one of proteome fragment sequences and transcriptome fragment sequences. The task instructions indicate at least one of multiple prediction task types. The gene fragment sequences and task instructions are encoded and fused to obtain a first coding sequence. The first coding sequence includes a gene coding sequence corresponding to the gene fragment sequence and a task coding sequence corresponding to the task instructions. A pre-trained gene language model is used to predict the first coding sequence to obtain a prediction result. The gene language model is used to generate prediction results corresponding to at least one prediction task type in the task instructions. The prediction results are decoded to obtain a target result. The target result is the result obtained by predicting the gene fragment sequence according to at least one task type. Through this gene language model, corresponding task results can be directly generated based on different task coding sequences. It can adapt to multiple different prediction task types, improve the model's generalization for prediction tasks, and improve prediction efficiency.
[0216] It should be noted that the prediction result generation device provided in the above embodiments is only an example of the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0217] Figure 11 This illustration shows a structural block diagram of a terminal 1100 provided in an exemplary embodiment of this application. The terminal 1100 may be a smartphone, tablet computer, MP3 player, MP4 player, laptop computer, or desktop computer. The terminal 1100 may also be referred to as user equipment, portable terminal, laptop terminal, desktop terminal, or other names.
[0218] Typically, terminal 1100 includes a processor 1101 and a memory 1102.
[0219] Processor 1101 may include one or more processing cores, such as a quad-core processor, an octa-core processor, etc. Processor 1101 may be implemented using at least one hardware form selected from Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). Processor 1101 may also include a main processor and a coprocessor. The main processor, also known as the Central Processing Unit (CPU), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 1101 may integrate a Graphics Processing Unit (GPU), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, processor 1101 may also include an Artificial Intelligence (AI) processor, which is used to handle computational operations related to machine learning.
[0220] The memory 1102 may include one or more computer-readable storage media, which may be non-transitory. The memory 1102 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in the memory 1102 is used to store at least one instruction, which is executed by the processor 1101 to implement the prediction result generation method provided in the method embodiments of this application.
[0221] In some embodiments, the terminal 1100 also includes other components, as those skilled in the art will understand. Figure 11 The structure shown does not constitute a limitation on terminal 1100 and may include more or fewer components than shown, or combine certain components, or use different component arrangements.
[0222] Embodiments of this application also provide a computer device that can be implemented as follows: Figure 1 The terminal or server shown. The computer device includes a processor and a memory, the memory storing at least one instruction, at least one program, code set, or instruction set, wherein the at least one instruction, at least one program, code set, or instruction set is loaded and executed by the processor to implement the prediction result generation method provided in the above-described method embodiments.
[0223] Embodiments of this application also provide a computer-readable storage medium storing at least one instruction, at least one program, code set, or instruction set, wherein the at least one instruction, at least one program, code set, or instruction set is loaded and executed by a processor to implement the prediction result generation method provided in the above-described method embodiments.
[0224] Embodiments of this application also provide a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the prediction result generation method provided in the above-described method embodiments.
[0225] Optionally, the computer-readable storage medium may include: read-only memory (ROM), random access memory (RAM), solid-state drives (SSDs), or optical discs, etc. The random access memory may include resistive random access memory (ReRAM) and dynamic random access memory (DRAM). The sequence numbers of the embodiments described above are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0226] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.
[0227] The above description is merely an optional embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.< / dna> < / dna> < / dna> < / flip> < / cls> < / chr> < / cls> < / rna> < / flip> < / cls> < / chr> < / cls> < / dna> < / flip> < / cls> < / gen> < / reg> < / abundance> < / cls> < / organism> < / function> < / rna> < / function> < / gen> < / reg> < / abundance> < / mrna> < / cls> < / organism> < / dna> < / gen> < / reg> < / cls> < / dna> < / dna> < / dna> < / dna> < / chrm> < / chry> < / chrx> < / chr> < / chr> < / chrm> < / chry> < / chrx> < / chr> < / dna> < / rna> < / mrna> < / ncrna> < / rna> < / dna> < / mrna> < / ncrna> < / rna> < / dna> < / flip> < / cls> < / chr> < / cls> < / dna> < / pad> < / pad> < / pad> < / flip> < / cls> < / chr> < / cls> < / dna> < / flip> < / cls> < / flip> < / cls> < / flip> < / cls> < / chr> < / cls> < / dna> < / chr> < / cls> < / dna> < / chr> < / cls> < / chr> < / cls> < / dna> < / chr> < / cls> < / dna> < / cls> < / organism> < / dna> < / cls> < / organism> < / cls> < / organism> < / dna> < / dna> < / cls> < / organism> < / dna> < / gen> < / reg> < / cls>
Claims
1. A method for generating prediction results, characterized in that, The method includes: Obtain gene fragment sequences and task instructions, wherein the gene fragment sequences include at least one of proteome fragment sequences and transcriptome fragment sequences, and the task instructions are used to indicate at least one of multiple prediction task types; The gene fragment sequence and the task instruction are encoded and fused to obtain a first encoding sequence. The first encoding sequence includes the gene encoding sequence corresponding to the gene fragment sequence and the task encoding sequence corresponding to the task instruction. The gene fragment sequence and the task instruction are encoded based on a preset encoding vocabulary, which includes the correspondence between the gene fragment sequence and the gene encoding sequence, as well as the correspondence between the task instruction and the task encoding sequence based on different prediction task types. The first coding sequence is predicted by a pre-trained gene language model to obtain a prediction result, wherein the gene language model is used to generate a prediction result corresponding to at least one prediction task type in the task instruction. The prediction result is decoded to obtain the target result, which is the result obtained by predicting the gene fragment sequence according to the at least one prediction task type.
2. The method according to claim 1, characterized in that, The step of predicting the first coding sequence using a pre-trained gene language model to obtain a prediction result includes: The first coding sequence is input into the gene language model, and the prediction result is obtained by iterative output. The gene language model generates the (i+1)th output result based on the first coding sequence and the first i output results, and stops outputting when the (i+1)th output result meets the preset termination result. i is a positive integer.
3. The method according to claim 1, characterized in that, The process of encoding and fusing the gene fragment sequence and the task instruction to obtain a first coding sequence includes: The gene fragment sequence is divided into multiple unit gene fragment sequences according to a preset fragment length, and the fragment length is used to indicate the number of bases in the unit gene fragment sequence. The plurality of unit gene fragment sequences and the task instruction are encoded and fused to obtain the first coding sequence, which includes the plurality of unit gene coding sequences corresponding to the plurality of unit gene fragment sequences and the task coding sequence corresponding to the task instruction.
4. The method according to claim 3, characterized in that, The process of encoding and fusing the plurality of unit gene fragment sequences and the task instructions to obtain the first encoded sequence includes: Obtain a preset gene coding mapping table, which includes the correspondence between the proteome fragment sequence and the gene coding sequence, as well as the correspondence between the transcriptome fragment sequence and the gene coding sequence; The multiple unit gene fragment sequences are encoded based on the gene coding mapping table to obtain the multiple unit gene coding sequences; Obtain a preset task encoding mapping table, which includes the correspondence between task instructions and task encoding sequences for different predicted task types; The task instructions are encoded based on the task encoding mapping table to obtain the task encoding sequence; The first coding sequence is obtained by fusing the multiple unit gene coding sequences and the task coding sequence.
5. The method according to any one of claims 1 to 4, characterized in that, Before obtaining the prediction result by predicting the first coding sequence using a pre-trained gene language model, the method further includes: Obtain sample gene fragment sequences, sample task instructions, and preset task results; The sample gene fragment sequence, the sample task instruction, and the preset task result are encoded and fused to obtain a sample encoding sequence. The sample encoding sequence includes multiple sample gene encoding sequences corresponding to the sample gene fragment sequence, a sample task encoding sequence corresponding to the sample task instruction, and a task result encoding corresponding to the preset task result. Based on the gene coding sequence of the j-th sample, the candidate gene language model generates the j-th prediction result, where j is a positive integer; The j-th first prediction loss is determined based on the difference between the j-th prediction result and the (j+1)-th sample gene coding sequence, wherein the N-th first prediction loss is determined based on the difference between the N-th prediction result and the task result coding, where N is used to indicate the number of sample gene fragment sequences and N is a positive integer; The target prediction loss is obtained by integrating N first prediction losses, and the candidate gene language model is trained based on the target prediction loss to obtain the gene language model.
6. The method according to claim 5, characterized in that, The determination of the j-th first prediction loss based on the difference between the j-th prediction result and the (j+1)-th sample gene coding sequence includes: If the prediction results before the j-th prediction result meet the preset conditions, the probability that the j-th prediction result is consistent with the gene coding sequence of the (j+1)-th sample is the j-th first probability; The j-th first prediction loss is obtained by taking the logarithm of the j-th first probability.
7. The method according to claim 5, characterized in that, Before generating the j-th prediction result based on the j-th sample gene coding sequence using the candidate gene language model, the process also includes: Obtain the flip judgment task encoding sequence corresponding to the flip judgment task instruction, wherein the flip judgment task instruction is used to indicate the prediction task of predicting the sequence orientation of the sample gene fragment sequence; A flipping judgment task is constructed based on the sample gene fragment sequence and the flipping judgment task encoding sequence; Based on the judgment result obtained by performing the flip judgment task based on the candidate gene language model, a flipped gene fragment sequence corresponding to the sample gene fragment sequence is constructed, and the flipped gene fragment sequence is used to participate in the training process of the candidate gene language model.
8. The method according to any one of claims 1 to 4, characterized in that, The various prediction task types include at least one of classification tasks, regression tasks, and sequence generation tasks.
9. A device for generating prediction results, characterized in that, The device includes: An acquisition module is used to acquire gene fragment sequences and task instructions, wherein the gene fragment sequences include at least one of proteome fragment sequences and transcriptome fragment sequences, and the task instructions are used to indicate at least one of multiple prediction task types; The processing module is used to encode and fuse the gene fragment sequence and the task instruction to obtain a first encoding sequence. The first encoding sequence includes a gene encoding sequence corresponding to the gene fragment sequence and a task encoding sequence corresponding to the task instruction. The gene fragment sequence and the task instruction are encoded based on a preset encoding vocabulary, which includes the correspondence between the gene fragment sequence and the gene encoding sequence, as well as the correspondence between the task instruction and the task encoding sequence based on different prediction task types. The processing module is further configured to predict the first coding sequence using a pre-trained gene language model to obtain a prediction result, wherein the gene language model is configured to generate a prediction result corresponding to at least one prediction task type in the task instruction. The processing module is further configured to decode the prediction result to obtain a target result, wherein the target result is the result obtained by predicting the gene fragment sequence according to the at least one prediction task type.
10. A computer device, characterized in that, The computer device includes a processor and a memory, the memory storing at least one computer program, which is loaded and executed by the processor to implement the method for generating prediction results as described in any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that, The storage medium stores at least one computer program, which is loaded and executed by a processor to implement the method for generating prediction results as described in any one of claims 1 to 8.
12. A computer program product, characterized in that, It includes a computer program that, when executed by a processor, implements the method for generating prediction results as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Transcriptome sequencing data calculating and analyzing method
CN107203703A
Gene sequencing method and device
CN112992270A