Gene off-target prediction model training method, prediction method, device and electronic equipment

Through the gene off-target prediction model training method, segmentation and mask processing technologies are used to accurately predict the off-target probability in the gene editing process, solving the problems of gene editing inaccuracy and risk in the existing technology, and improving the efficiency and effectiveness of gene editing. Security.

CN114334007BActive Publication Date: 2024-10-18TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210068027.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-20
Publication Date
2024-10-18
Estimated Expiration
2042-01-20

AI Technical Summary

Technical Problem

During the gene editing process, existing technology is difficult to accurately predict the probability of gene off-target, leading to unexpected gene mutations and cancer risks, affecting clinical treatment effects and the reliability of experimental results.

Method used

A gene off-target prediction model training method is proposed. By obtaining the sample set and similarity label, the gene sequence is segmented and masked according to the target segmentation method, and the pre-training and fine-tuning model is used to predict the similarity of the gene sequence to characterize The probability of a gene being off-target.

Benefits of technology

It achieves accurate prediction of gene off-target probability, reduces the risk of gene editing, improves the efficiency of gene editing, and accelerates clinical application.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114334007B_ABST
    Figure CN114334007B_ABST
Patent Text Reader

Abstract

The present application discloses a gene off-target prediction model training method, prediction method, device and electronic device. Each first sample gene sequence is segmented according to a target segmentation method to obtain multiple base groups included in each first sample gene sequence, at least one base group in each first sample gene sequence is masked to obtain a training gene sequence corresponding to each first sample gene sequence, and each first sample gene sequence and its corresponding training gene sequence are used to pre-train the prediction model, and multiple groups of sample sequences included in a second sample set and similarity labels corresponding to each group of sample sequences are used to fine-tune the pre-trained prediction model to obtain a target prediction model. The target prediction model is used to predict the similarity of two gene sequences, and the similarity of the two gene sequences is used to characterize the probability of gene off-target, thereby achieving accurate prediction of the probability of gene off-target.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and more specifically, to a gene off-target prediction model training method, prediction method, device and electronic equipment. Background Art

[0002] Genes are all the nucleotide sequences required to produce a polypeptide chain or functional RNA, and store all the information about the processes of life, such as gestation, growth, and apoptosis. With the development of science and technology, scientists have switched from reading genetic information to modifying genetic information, which is gene editing. Gene editing technology is the application of the phenomenon of DNA breakage in organisms and its repair mechanism. As a common molecular biological event, DNA double-strand breaks (DSBs) occur every day in actively dividing mammalian cells. After DSBs occur, cells can repair them in a variety of ways, including deletion and addition. However, due to the complexity of genes, deletion or addition can easily lead to dangers. For example, when the goal is to repair a certain gene point, but it acts on other gene points, then off-target occurs.

[0003] At present, off-target can cause unexpected gene mutations and even lead to cancer. Therefore, off-target is the key to affecting the clinical treatment effect and the reliability of experimental results. The occurrence of off-target may be caused by the fault tolerance of the gene sequence in the genome, that is, the gene sequence can not only bind and cut with the target site of complete complementary pairing, but also bind and cut with other similar sequences in the genome. Therefore, accurately predicting the probability of off-target of genes in the genome during gene editing, so as to avoid the probability of a gene sequence in the genome binding to other gene sequences in the genome and cutting, is a technical problem that needs to be solved urgently. Summary of the invention

[0004] In view of the above problems, the embodiments of the present application propose a gene off-target prediction model training, prediction method, device and electronic device to improve the above problems.

[0005] In a first aspect, an embodiment of the present application provides a gene off-target prediction model training method, the method comprising: obtaining a first sample set and a second sample set, the first sample set including multiple first sample gene sequences, the second sample set including multiple groups of sample sequences and similarity labels corresponding to each group of sample sequences, each group of sample sequences consisting of two second sample gene sequences; segmenting each of the first sample gene sequences according to a target segmentation method to obtain multiple base groups included in each of the first sample gene sequences, each base group including at least one base; masking at least one base group in each of the first sample gene sequences to obtain a training gene sequence corresponding to each of the first sample gene sequences, and using each of the first sample gene sequences and the training gene sequence corresponding to each of the first sample gene sequences to pre-train a prediction model to obtain a pre-trained prediction model; using the multiple groups of sample sequences included in the second sample set and the similarity labels corresponding to each group of sample sequences, fine-tuning the pre-trained prediction model to obtain a target prediction model, wherein the target prediction model is used to predict the similarity of two gene sequences, and the similarity of the two gene sequences is used to characterize the probability of gene off-target.

[0006] In the second aspect, an embodiment of the present application provides a gene off-target prediction method, the method comprising: obtaining a gene sequence group to be predicted, the gene sequence group to be predicted comprising two gene sequences; inputting the gene sequence group to be predicted into a target prediction model obtained using the above-mentioned gene off-target prediction model training method, and obtaining the similarity of the two gene sequences in the gene sequence group to be predicted, and the similarity is used to characterize the probability of gene off-target in the two gene sequences in the gene sequence group to be predicted.

[0007] In a third aspect, an embodiment of the present application provides a gene off-target prediction model training device, which includes: a sample set acquisition module, a segmentation processing module, a pre-training module, and a fine-tuning training module. The sample set acquisition module is used to acquire a first sample set and a second sample set, wherein the first sample set includes multiple first sample gene sequences, and the second sample set includes multiple groups of sample sequences and similarity labels corresponding to each group of sample sequences, and each group of sample sequences is composed of two second sample gene sequences; the segmentation processing module is used to segment each of the first sample gene sequences according to a target segmentation method to obtain multiple base groups each of the first sample gene sequences includes, and each base group includes at least one base; the pre-training module is used to mask at least one base group in each of the first sample gene sequences. The code is processed to obtain a training gene sequence corresponding to each first sample gene sequence, and a prediction model is pre-trained using each first sample gene sequence and the training gene sequence corresponding to each first sample gene sequence to obtain a pre-trained prediction model; a fine-tuning training module is used to use multiple groups of sample sequences included in the second sample set and similarity labels corresponding to each group of sample sequences to fine-tune the pre-trained prediction model to obtain a target prediction model, wherein the target prediction model is used to predict the similarity of two gene sequences, and the similarity of the two gene sequences is used to characterize the probability of gene off-target.

[0008] In one possible implementation, the device further includes: a corresponding relationship obtaining module and a segmentation method determining module. The segmentation processing module is further used to segment each third sample gene sequence in the third sample set according to multiple segmentation methods, respectively, to obtain multiple base groups obtained by segmenting each third sample gene sequence according to each segmentation method, and the number of bases included in the base groups obtained by segmenting in the same segmentation method is the same; the pre-training module is further used to perform masking processing on at least one base group obtained by segmenting each third sample gene sequence according to the segmentation method for each segmentation method, to obtain a training gene sequence corresponding to each third sample gene sequence under the segmentation method, and to pre-train the prediction model using each third sample gene sequence and the training gene sequence corresponding to each third sample gene sequence under the segmentation method; the corresponding relationship acquisition module is further used to obtain the corresponding relationship between the model accuracy and the number of training times under each segmentation method obtained during the pre-training of the prediction model; the segmentation method determination module is used to select a segmentation method from the multiple segmentation methods as the target segmentation method according to the corresponding relationship between the model accuracy and the number of training times of the prediction model under each segmentation method.

[0009] In one feasible implementation, the segmentation method confirmation module is also used to obtain an accuracy fitting curve corresponding to each segmentation method based on the correspondence between the model accuracy of the prediction model under each segmentation method and the number of training times; according to the accuracy fitting curve corresponding to each segmentation method, the accuracy mean corresponding to each segmentation method is determined, and the segmentation method corresponding to the largest accuracy mean is selected as the target segmentation method.

[0010] In one embodiment, the multiple cutting methods include a first cutting method, a second cutting method and a third cutting method, the number of bases included in the base group obtained by the first cutting method is less than the number of bases included in the base group obtained by the second cutting method, and the number of bases included in the base group obtained by the second cutting method is less than the number of bases included in the base group obtained by the third cutting method.

[0011] In one embodiment, the number of bases in the base group obtained by the first cutting method is 2, the number of bases in the base group obtained by the second cutting method is 3, and the number of bases in the base group obtained by the third cutting method is 4.

[0012] In one possible implementation, the first sample set includes the third sample set.

[0013] In one possible implementation, the pre-training module includes an encoding submodule, a mask processing submodule, and a pre-training submodule. The encoding submodule is used to encode the multiple base groups included in each of the first sample gene sequences to obtain the encoding vectors corresponding to each of the first sample gene sequences; the mask processing submodule is used to perform mask processing on the encoding corresponding to at least one base group in the encoding vector corresponding to each of the first sample gene sequences to obtain the encoding vector of the training gene sequence corresponding to each of the first sample gene sequences; the pre-training submodule is used to pre-train the prediction model using the encoding vector corresponding to each of the first sample gene sequences and the encoding vector of the training gene sequence corresponding to each of the first sample gene sequences to obtain the pre-trained prediction model.

[0014] In one possible implementation, the encoding submodule is also used to input the encoding vector corresponding to the first sample gene sequence and the encoding vector corresponding to the training gene sequence into the prediction model for any encoding vector corresponding to the first sample gene sequence and the encoding vector corresponding to the training gene sequence, so as to extract the features of the encoding vector corresponding to the first sample gene sequence through the prediction model, and extract the features of each code based on the context information between the codes in the encoding vector of the training gene sequence, and obtain the features of the encoding vector of the training gene sequence based on the features of each code; determine the loss value based on the features of the encoding vector corresponding to each first sample gene sequence and the features of the encoding vector of the corresponding training gene sequence, if the loss value meets the training end condition, end the training and obtain the pre-trained feature extraction module, if not, adjust the model parameters of the prediction model.

[0015] In a fourth aspect, an embodiment of the present application provides a gene off-target prediction device, which includes a gene sequence acquisition module and an off-target prediction module. The gene sequence acquisition module is used to obtain a gene sequence group to be predicted, wherein the gene sequence group to be predicted includes two gene sequences; the off-target prediction module is used to input the gene sequence group to be predicted into a target prediction model obtained by using a gene off-target prediction model training device to obtain the similarity of the two gene sequences in the gene sequence group to be predicted, and the similarity is used to characterize the probability of gene off-target in the two gene sequences in the gene sequence group to be predicted.

[0016] In the fifth aspect, an embodiment of the present application also provides an electronic device, comprising: a processor; a memory, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the gene off-target prediction model training method or gene off-target prediction method as described above is implemented.

[0017] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium having computer-readable instructions stored thereon. When the computer-readable instructions are executed by a processor, the gene off-target prediction model training method or gene off-target prediction method as described above is implemented.

[0018] In a seventh aspect, an embodiment of the present application provides a computer program product or a computer program, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device obtains the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the above method.

[0019] The present application provides a gene off-target prediction model training method, prediction method, device and electronic device, which divide each first sample gene sequence according to the target division method to obtain multiple base groups included in each first sample gene sequence, mask at least one base group in each first sample gene sequence to obtain a training gene sequence corresponding to each first sample gene sequence, and use each first sample gene sequence and each first sample gene sequence The corresponding training gene sequence is used to pre-train the prediction model to obtain a pre-trained prediction model, and use multiple groups of sample sequences included in the second sample set and the similarity labels corresponding to each group of sample sequences to fine-tune the pre-trained prediction model to obtain a target prediction model, wherein the target prediction model is used to predict the similarity of two gene sequences, and the similarity of the two gene sequences is used to characterize the probability of gene off-target. Accurate prediction of the probability of gene off-target can be achieved. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present application, and together with the specification are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0021] Figure 1 A schematic diagram showing an exemplary system architecture to which the technical solution of the embodiments of the present application can be applied;

[0022] Figure 2 It is a flow chart of a gene off-target prediction model training method provided according to an embodiment of the present application;

[0023] Figure 3 A schematic diagram of the structure of a detection model provided in an embodiment of the present application is shown;

[0024] Figure 4 A schematic diagram of the model structure of a transformer model provided in an embodiment of the present application is shown;

[0025] Figure 5 Shows Figure 2 Schematic diagram of the process of step S130;

[0026] Figure 6 A schematic diagram showing multiple groups of sample sequences included in the second sample set provided in an embodiment of the present application is shown;

[0027] Figure 7 is another flow chart of a gene off-target prediction model training method provided according to an embodiment of the present application;

[0028] Figure 8 A schematic diagram showing a curve of the change of model accuracy of each segmentation method with the number of training times in multiple segmentation methods;

[0029] Fig. 9 It is a flow chart of a gene off-target prediction method provided according to an embodiment of the present application;

[0030] Fig.10 It is a connection block diagram of a gene off-target prediction model training device according to an embodiment of the present application;

[0031] Fig.11 is a connection block diagram of a gene off-target prediction device according to an embodiment of the present application;

[0032] Fig.12 A schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present application is shown. DETAILED DESCRIPTION

[0033] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this application will be more comprehensive and complete and fully convey the concept of the example embodiments to those skilled in the art.

[0034] In addition, described feature, structure or characteristic can be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present application. However, those skilled in the art will appreciate that the technical scheme of the present application can be put into practice without one or more of the specific details, or other methods, components, devices, steps, etc. can be adopted. In other cases, known methods, devices, realizations or operations are not shown or described in detail to avoid blurring the various aspects of the application.

[0035] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0036] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.

[0037] It should be noted that the “plurality” mentioned in this article refers to two or more.

[0038] With the research and advancement of artificial intelligence technology, artificial intelligence technology has been studied and applied in many fields and played an increasingly important role.

[0039] Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Take the application of artificial intelligence in machine learning as an example:

[0040] Among them, machine learning (ML) is a multi-disciplinary cross-discipline involving probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and other disciplines. It specializes in how computers simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications are spread across all fields of artificial intelligence. Machine learning and deep learning usually include artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and learning by formula. The scheme of this application is mainly machine learning to predict gene off-target for predicted gene sequence groups.

[0041] Before going into detail, the terms used in this application are explained as follows:

[0042] A gene sequence is a real or hypothetical primary structure of a DNA molecule carrying genetic information represented by a string of letters. Partial DNA sequences or gene sequences use a string of letters to represent the real or hypothetical primary structure of a DNA molecule carrying genetic information. The possible letters in the primary structure of a DNA molecule carrying genetic information represented by letters are only A, C, G and T, which represent the four nucleotides that make up DNA. Among them, A represents adenine, C represents cytosine, G represents guanine, and T represents thymine. Each letter represents a base, and two bases form a base pair. The pairing rule of base pairs is fixed, that is, AT forms a base pair, and CG forms a base pair. Typically, multiple bases are arranged together without spacing to form a gene sequence, such as the gene sequence AAAGTCTGAC. It should be understood that a string of nucleotides with any base length greater than 4 (including a string of nucleotide sequences of at least 4 bases) is called a gene sequence.

[0043] The first sample set refers to a set consisting of multiple first sample gene sequences, each of which has no corresponding label information. After each first sample gene sequence is divided according to the target segmentation method, multiple base groups can be obtained, and the number of bases included in each base group obtained according to the target segmentation method is the same, for example, it can be 1, 2, 3 or 4.

[0044] Masking refers to covering or replacing at least one base group among the multiple base groups included in each first sample gene sequence to construct a gene sequence similar to the first sample gene sequence, that is, a training gene sequence corresponding to the first sample gene sequence.

[0045] The implementation details of the technical solution of the embodiment of the present application are described in detail below:

[0046] Figure 1 is a schematic diagram of an application scenario according to an embodiment of the present application, such as Figure 1 As shown, the application scenario includes a terminal 10 and a server 20 connected to the terminal 10 through a network, and the network can be a wide area network or a local area network, or a combination of the two. The terminal 10 can be a smart phone, a tablet computer, a computer or other devices. Figure 1 Only a schematic diagram showing that the terminal is a smart phone is shown.

[0047] The user can input a gene sequence to the terminal 10, such as a first sample gene sequence and multiple groups of sample sequences and the similarity of each group of sample sequences, and establish a first sample set and a second sample set at the terminal 10, so that the first sample set includes multiple first sample gene sequences, and the second sample set includes multiple groups of sample sequences, each group of sample sequences includes two second sample gene sequences and corresponding similarity labels. For example, Figure 1 As shown, the gene sequence AAAGTCTGAC input by the user on the terminal is shown on the terminal 10. After the terminal 10 completes the establishment of the first sample set and the second sample set, it can be uploaded to the server 20, or can be directly stored so as to be called by the server 20.

[0048] The server 20 can obtain a first sample set and a second sample set; segment each first sample gene sequence according to a target segmentation method to obtain a plurality of base groups included in each first sample gene sequence, each base group including at least one base; mask at least one base group in each first sample gene sequence to obtain a training gene sequence corresponding to each first sample gene sequence, and use each first sample gene sequence and the training gene sequence corresponding to each first sample gene sequence to pre-train a prediction model to obtain a pre-trained prediction model; use multiple groups of sample sequences included in the second sample set and similarity labels corresponding to each group of sample sequences to fine-tune the pre-trained prediction model to obtain a target prediction model, wherein the target prediction model is used to predict the similarity of two gene sequences, and the similarity of the two gene sequences is used to characterize the probability of gene off-target.

[0049] By adopting the above method, the gene off-target prediction model (i.e., the target model) can be trained, so that when off-target prediction is required for the two gene sequences to be predicted in the future, the two gene sequences only need to be input into the trained target model to achieve off-target prediction.

[0050] It should be understood that the above prediction process can be performed on the server 20 or on the terminal 10. When the prediction process is performed on the server 20, the target model is deployed on the server 20; when the prediction process is performed on the terminal 10, the target model is deployed on the terminal 10. Similarly, the above model training process can be performed on the server 20 or on the terminal 10.

[0051] Figure 2 This is a flow chart of a method for detecting a target area according to an embodiment of the present application. The method can be executed by an electronic device with processing capabilities, such as a server, a terminal, or a server and a terminal interacting to implement the present solution, etc., which is not specifically limited here. Figure 2 As shown, the method at least includes steps S110 to S140, which are described in detail as follows:

[0052] Step S110: Acquire a first sample set and a second sample set.

[0053] The first sample set includes a plurality of first sample gene sequences, the second sample set includes a plurality of groups of sample sequences and similarity labels corresponding to each group of sample sequences, and each group of sample sequences is composed of two second sample gene sequences.

[0054] There are many ways to obtain the first sample set. For example, it can be to receive multiple first sample gene sequences input by a user, or to obtain the first sample set from an electronic device or a storage device or cloud platform associated with the electronic device, or to obtain the first sample set from an experimental platform, which is not specifically limited here.

[0055] There may be multiple ways to obtain the second sample set. For example, it may be to receive multiple groups of sample sequences input by the user and the similarity labels corresponding to each group of sample sequences, or it may be to obtain multiple groups of sample sequences and the similarity labels corresponding to each group of sample sequences from a public data set. No specific limitation is made here and it can be limited according to actual needs.

[0056] Step S120: segmenting each first sample gene sequence according to the target segmentation method to obtain a plurality of base groups included in each first sample gene sequence, each base group including at least one base.

[0057] The target segmentation method may be preset. The target segmentation method may also be a segmentation method selected from multiple segmentation methods, for example, a segmentation method randomly selected from multiple segmentation methods, or an optimal segmentation method selected after comparing multiple segmentation methods.

[0058] In one possible implementation, if the target segmentation method is an optimal segmentation method selected after comparing multiple segmentation methods, the specific selection method of the target segmentation method can be: for a third sample set including multiple third sample gene sequences, each third sample gene sequence is segmented according to each segmentation method to obtain multiple base groups corresponding to each third sample gene sequence according to each segmentation method; for each segmentation method, an unsupervised learning model is used to learn the multiple base groups included in each third sample gene sequence obtained by the segmentation method to obtain a target unsupervised learning model, and multiple gene sequences to be identified with labels are respectively input into the target unsupervised learning model corresponding to each segmentation method to obtain identification results obtained by respectively identifying the multiple gene sequences to be identified under each segmentation method; a target segmentation method is selected from multiple segmentation methods according to the identification results and labels corresponding to the multiple gene sequences to be identified under each segmentation method.

[0059] In this method, a target segmentation method is selected from multiple segmentation methods according to the identification results and labels corresponding to each of the multiple gene sequences to be identified under each segmentation method. Specifically, the prediction result accuracy corresponding to each segmentation method is obtained according to the identification results and labels corresponding to each of the multiple gene sequences to be identified under each segmentation method, and a target segmentation method is determined according to the accuracy corresponding to each segmentation method. Specifically, determining the target segmentation method can be: selecting the segmentation method with the highest accuracy as the target segmentation method according to the accuracy corresponding to each segmentation method; or it can be that each segmentation method is sorted according to the accuracy, and the segmentation methods with the number of sorted segments set before are obtained, and a segmentation method is randomly selected from the obtained segmentation methods as the target segmentation method.

[0060] Each first sample sequence is segmented according to the target segmentation method, and the base groups included in each obtained first sample sequence can have the same or different numbers of bases, which is not specifically limited here and is determined according to the target segmentation method.

[0061] Step S130: Masking is performed on at least one base group in each first sample gene sequence to obtain a training gene sequence corresponding to each first sample gene sequence, and each first sample gene sequence and the training gene sequence corresponding to each first sample gene sequence are used to pre-train a prediction model to obtain a pre-trained prediction model.

[0062] The masking of at least one base group in each first sample gene sequence means that, for each sample gene sequence, a masking rule is set for at least one base group in the first sample gene sequence to be replaced or changed to obtain a gene sequence similar to each first sample gene sequence (a training gene sequence corresponding to each first sample gene sequence).

[0063] For example, 80% of the base groups that need to be masked in the first gene sequences can be replaced with mask marks, 10% can be replaced with other characters, and 10% can remain unchanged. In the subsequent pre-training process, the context information is used to predict the base groups after the masking process, so as to obtain the training error for back propagation.

[0064] When selecting a base group for mask processing, the base group may be selected randomly or according to certain rules. There is no specific limitation here and the method may be set according to actual needs.

[0065] The above-mentioned prediction model may specifically be any model that can perform gene sequence similarity prediction or gene sequence matching, for example, it may be a BERT model or an MLM model.

[0066] In one possible implementation of the present application, the prediction model is a BERT model. Among them, the BERT model is a pre-trained bidirectional language model, specifically a feature extraction model including a bidirectional transformer (Transformer). By pre-training on large-scale text data, a powerful text sequence modeling capability is obtained. The BERT model is based on the encoder framework of the Transformer, and achieves the purpose of constructing a bidirectional language model through a cloze-style masking method, and has achieved good results in multiple tasks of natural language processing.

[0067] like Figure 3 As shown in the figure, Bert is composed of multiple layers of bidirectional Transformers, which can generally be 12 or 24 layers. Figure 3 In the code, E1, E2…EN represent inputs, T1, T2…TN represent outputs, and Trm represents each Transformer node of Bert. The lines represent the dependencies between words. The dependencies in Bert include both previous and subsequent contexts. Bert can be obtained through pre-training and fine-tuning. The training data of Bert is corpus information. Bert mainly includes two tasks during pre-training. The first is to randomly deduct words in the training corpus (the base groups in the first training sample gene sequence) and replace them with masks, so that the model can predict the replaced words. The second task is that each training data is a sentence (if the upper sentence refers to the first sample gene sequence, then the lower sentence refers to the training gene sequence corresponding to the first sample gene sequence), among which the lower sentence of some training data is truly related to the upper sentence, while the lower sentence of some training data is unrelated to the upper sentence, and the model needs to judge the relationship between the upper and lower sentences in the training data. The model is optimized based on the loss values ​​of the two tasks. The training process of Bert can make full use of the context information to make the model more expressive.

[0068] Transformer is a neural network framework, including an encoding part and a decoding part. The encoding part includes multiple sequentially connected encoding layers, and the decoding part includes multiple sequentially connected decoding layers. Each encoding layer and decoding layer includes a self-attention layer, and the self-attention layer can adopt a multi-head attention mechanism. The use of the attention mechanism can make the model fully interact with the input gene sequence, effectively capture the global information of the input gene sequence, and obtain rich context representation.

[0069] Please refer to Figure 4, is a model structure of a transformer model, which includes an encoding part and a decoding part. The encoding part includes multiple encoding layers, and the decoding part includes multiple decoding layers. The figure takes the encoding part including 3 encoding layers and the decoding part including 3 decoding layers as an example, but the number of encoding layers included in the encoding part and the number of decoding layers included in the decoding part are not actually limited. The encoding output of the last encoding layer in the encoding part can be input to each decoding layer in the decoding part, and each decoding layer performs decoding based on the encoding output of the last encoding layer and the decoding output of the previous decoding layer.

[0070] In the process of pre-training the prediction model, there are many pre-training methods that can be used.

[0071] In one possible implementation, during the pre-training of the prediction model, each first sample gene sequence and each training gene sequence corresponding to each first sample gene sequence can be input into the prediction model, and the features of each base group included in the training gene sequence can be extracted to obtain a feature vector of the training gene sequence, and the features of each base group included in the first sample gene sequence can be extracted to obtain a feature vector of the first sample gene sequence, and the prediction model loss can be determined based on the feature vector of the first sample gene sequence and the feature vector of the training gene sequence corresponding to the first sample gene sequence, and the prediction model can be reversely trained based on the model loss until the training end condition is met to obtain the pre-trained prediction model.

[0072] Here, the prediction model is taken as an example to illustrate that the BERT model reaches the training end condition. Based on the BERT model and the fully connected network, the masked base group in the masked first sample gene sequence can be accurately predicted. There are many possible training requirements that the BERT model and the fully connected network model need to meet.

[0073] In one possible implementation, the loss function value can be calculated based on the set loss function, and each sample user has masked at least one base group that is actually masked in the first sample gene sequence and at least one base group that is predicted to be masked. If the current loss function value converges, it means that the training requirements are met; if the loss function value has not yet converged, it means that the BERT model and the fully connected network model still need to be trained. Exemplarily, the loss function value can be calculated based on the loss function of the mask processing in the BERT model (the loss function of the mask token), and when the loss function value converges, it is determined that the training of the BERT model and the fully connected network model is completed.

[0074] In a possible implementation, the training end condition may be reached when the number of times the model parameters are adjusted based on the loss of the first sample gene sequence reaches a preset number.

[0075] In yet another possible implementation, the training end condition may be reached when losses are obtained for all first sample gene sequences and an operation of adjusting parameters based on the losses is performed.

[0076] See also Figure 5 In another possible implementation, during the training of the prediction model, the following steps may be specifically included:

[0077] Step S132: Encode the multiple base groups included in each first sample gene sequence to obtain a coding vector corresponding to each first sample gene sequence.

[0078] There are many ways to encode the base group, such as one-hot encoding, numerical encoding (such as binary encoding, octal encoding, decimal encoding or hexadecimal encoding, etc.), extended ASCII code, etc.

[0079] In one possible implementation of the present application, the base groups included in each of the first sample gene sequences may be encoded in a numerical encoding manner. During the encoding process, the electronic device may pre-store the correspondence between different base groups and encoding values, and when encoding the first sample gene sequences, the multiple base groups included in each of the first sample gene sequences may be encoded according to the pre-stored correspondence.

[0080] Exemplarily, when the number of bases included in the base groups obtained by the target segmentation method is the same and is 3, the base groups consisting of 3 bases may include: AAA, AAT, AAC, AAG, ATA, ATT, ATC, ATG, ACA, ACT, ACC, ACG, AGA, AGT, AGC, AGG, TAA, TAT, TAC, TAG, TTA, TTT, TTC, TTG, TCA, TCT, TCC, TCG, TGA, TGT, TGC, TGG, CAA, CAT, There are 64 base groups, namely CAC, CAG, CTA, CTT, CTC, CTG, CCA, CCT, CCC, CCG, CGA, CGT, CGC, CGG, GAA, GAT, GAC, GAG, GTA, GTT, GTC, GTG, GCA, GCT, GCC, GCG, GGA, GGT, GGC, and GGG. The above base groups can be encoded in sequence according to the numbers 01, 02, 03, ..., 64, so that each base group corresponds to a code. Then, a coding vector corresponding to a gene sequence can be obtained.

[0081] Step S134: masking the code corresponding to at least one base group in the code vector corresponding to each first sample gene sequence to obtain the code vector of the training gene sequence corresponding to each first sample gene sequence.

[0082] Among them, the manner of performing mask processing on the code corresponding to at least one base group can refer to the specific description of the mask processing on the base group in the previous text, and will not be repeated here.

[0083] Step S136: pre-training the prediction model using the encoding vector corresponding to each first sample gene sequence and the encoding vector of the training gene sequence corresponding to each first sample gene sequence to obtain a pre-trained prediction model.

[0084] During the pre-training process, the following training steps can be repeated until the pre-training loss value meets the pre-training end condition to obtain the pre-trained prediction model:

[0085] The training step includes: for any encoding vector corresponding to the first sample gene sequence and the encoding vector of the corresponding training gene sequence, the encoding vector corresponding to the first sample gene sequence and the encoding vector of the corresponding training gene sequence are input into the prediction model, so as to extract the features of the encoding vector corresponding to the first sample gene sequence through the prediction model, and based on the context information between each encoding in the encoding vector of the training gene sequence, extract the features of each encoding, and obtain the features of the encoding vector of the training gene sequence based on the features of each encoding; based on the features of the encoding vector corresponding to each first sample gene sequence and the features of the encoding vector of the corresponding training gene sequence, determine the loss value, if the loss value meets the training end condition, end the training and obtain the pre-trained feature extraction module; if not, adjust the model parameters of the prediction model and repeat the above training steps.

[0086] The training step may also include: inputting the coding vector corresponding to each first sample gene sequence and the coding vector of the training gene sequence corresponding to each first sample gene sequence into the prediction model, and before outputting the vector feature of the coding vector of one training gene sequence through the output layer of the prediction model, inputting the coding vector of another training gene sequence into the prediction model, so as to process the coding vectors of at least two training gene sequences in parallel through the prediction model to obtain the vector feature of the coding vector of each training gene sequence; based on the vector feature of the coding vector corresponding to each first sample gene sequence and the coding vector of the training gene sequence corresponding to each first sample gene sequence, determining the loss value, if the loss value meets the training end condition, ending the training and obtaining the pre-trained prediction model; if not, adjusting the model parameters of the prediction model and repeating the training step. In this training mode, by processing two training gene sequences in parallel, the training speed of pre-training the prediction model can be improved compared with the method of processing the training gene sequences one by one.

[0087] It should be understood that in the above two training methods, since the training gene sequence is obtained by replacing or masking the base groups in the first sample gene sequence, for a training gene sequence, when the prediction model is trained based on each first sample gene sequence and each training gene sequence, for a training gene sequence, the vector feature of the training gene sequence can be obtained based on the context information between the codes corresponding to each base group in the training gene sequence. The context information between each character can reflect the semantic association between each base group. Based on the context information, the semantics of the replaced character can be more accurately determined, thereby making the vector feature of the obtained training gene sequence more accurate.

[0088] The loss value represents the difference between the vector features of each first sample gene sequence and the vector features of the corresponding training gene sequence. When the loss value meets the training end condition, it indicates that the loss function converges.

[0089] Step S140: Fine-tune the pre-trained prediction model using the multiple groups of sample sequences included in the second sample set and the similarity labels corresponding to each group of sample sequences to obtain a target prediction model, wherein the target prediction model is used to predict the similarity of two gene sequences, and the similarity of the two gene sequences is used to characterize the probability of gene off-target.

[0090] The lengths of the two second sample gene sequences included in each group of sample sequences may be the same or different.

[0091] When fine-tuning, the preprocessed second sample set can be divided into a training set and a test set in proportion, wherein the second sample set includes multiple groups of sample sequences and similarity labels corresponding to each group of sample sequences, and each group of sample sequences consists of two second sample gene sequences; the pre-trained BERT model is loaded, the training set is input into the pre-trained BERT model, the output layer of the pre-trained BERT model is retrained, and the weights and biases of the pre-trained BERT model are updated using the stochastic gradient descent method until the loss function converges or the number of iterations reaches a preset value; the test set is used for testing, and if the model accuracy reaches the preset value at this time, the target prediction model is obtained.

[0092] The two second sample gene sequences in the training set can be arranged in a preset manner and then input into the pre-trained prediction model for training. Figure 6 As shown, during the fine-tuning process, Figure 6 In the arrangement shown, multiple groups of sample sequences in the training set are numbered, and the two second sample gene sequences and corresponding similarity labels included in each group of sample sequences are arranged in a comma-separated manner, and then input into the pre-trained prediction model for training, wherein one of the two second sample gene sequences included in each group of sample gene sequences is the main sample gene sequence, and the other is the off-target prediction sample gene sequence.

[0093] After completing the pre-training of the prediction model, the prediction model is fine-tuned for a specific task (such as the off-target probability prediction task in this application). Fine-tuning is a commonly used transfer learning technique in the field of deep learning. Fine-tuning can make the model better applicable to language knowledge in a specific scenario. For example, in this application, it can be applied to off-target prediction of two gene sequences in this application.

[0094] The gene off-target prediction model training method provided by the present application is to segment each first sample gene sequence according to the target segmentation method to obtain multiple base groups included in each first sample gene sequence, mask at least one base group in each first sample gene sequence to obtain the training gene sequence corresponding to each first sample gene sequence, and use each first sample gene sequence and the training gene sequence corresponding to each first sample gene sequence to pre-train the prediction model to obtain the pre-trained prediction model, and use the multiple groups of sample sequences included in the second sample set and the similarity labels corresponding to each group of sample sequences to fine-tune the pre-trained prediction model to obtain the target prediction model, wherein the target prediction model is used to predict the similarity of two gene sequences, and the similarity of the two gene sequences is used to characterize the probability of gene off-target. Accurate prediction of the probability of gene off-target can be achieved.

[0095] Taking into account that in the gene editing process, a gene sequence is usually given, and gene editing is performed based on the gene sequence to generate multiple gene sequences. By combining the given gene sequence with multiple gene sequences respectively to obtain a group of gene sequences and inputting them into the target prediction model obtained by the above prediction for off-target prediction, the off-target prediction results between each group of gene sequences can be obtained, so that genes can be more effectively knocked out or specific sequence genes can be accurately and effectively identified and deleted based on the off-target prediction results of each group of gene sequences. Therefore, by adopting the above-mentioned method of the present application, the accuracy of the prediction of the off-target probability of genes after gene editing can be improved, which greatly reduces the gene editing risks of scientific researchers. At the same time, the efficiency of gene editing can be greatly accelerated, so that it can be applied in clinical practice and enter the market faster.

[0096] See also Figure 7 Another embodiment of the present application provides a gene off-target prediction model training method applicable to electronic devices, the method comprising:

[0097] Step S210: Acquire a first sample set, a second sample set, and a third sample set.

[0098] The first sample set includes multiple first sample gene sequences, the second sample set includes multiple groups of sample sequences and similarity labels corresponding to each group of sample sequences, each group of sample sequences consists of two second sample gene sequences, and the third sample set includes multiple third sample gene sequences.

[0099] The third sample gene sequence in the third sample set may be the same as the first sample gene sequence in the first sample set, and the third sample gene sequence in the third sample set may also be a portion of sample gene sequences extracted from the first sample set.

[0100] Step S220: each third sample gene sequence in the third sample set is segmented according to a plurality of segmentation methods to obtain a plurality of base groups obtained by segmenting each third sample gene sequence according to each segmentation method, and the base groups obtained by segmenting in the same segmentation method have the same number of bases.

[0101] The multiple segmentation methods may be predetermined, and the number of bases included in the base groups obtained by segmentation corresponding to each segmentation method may be the same. For example, the number of bases included in the base groups obtained by segmentation corresponding to the multiple segmentation methods may be at least two of one, two, three, four, and five.

[0102] In one possible implementation of the present application, the multiple cutting methods include a first cutting method, a second cutting method and a third cutting method, the number of bases included in the base group obtained by the first cutting method is less than the number of bases included in the base group obtained by the second cutting method, and the number of bases included in the base group obtained by the second cutting method is less than the number of bases included in the base group obtained by the third cutting method.

[0103] In this implementation manner, the number of bases in the base group obtained by the first cutting method is 2, the number of bases in the base group obtained by the second cutting method is 3, and the number of bases in the base group obtained by the third cutting method is 4.

[0104] Step S230: For each segmentation method, masking is performed on at least one base group obtained by segmenting each third sample gene sequence according to the segmentation method to obtain a training gene sequence corresponding to each third sample gene sequence under the segmentation method, and a prediction model is pre-trained using each third sample gene sequence and the training gene sequence corresponding to each third sample gene sequence under the segmentation method.

[0105] Regarding the steps of segmenting each third sample gene sequence according to various segmentation methods and performing pre-training, reference may be made to the detailed description of steps S120-S130 above, which will not be described one by one here.

[0106] Step S240: Obtaining the corresponding relationship between the model accuracy and the number of training times under each segmentation method obtained during the pre-training of the prediction model.

[0107] It should be understood that during the pre-training process, as the number of training times increases, the model accuracy will gradually stabilize and gradually approach a fixed value, that is, as the number of training times increases, the model accuracy corresponding to different splitting methods will gradually approach a fixed value. And the model accuracy corresponding to different splitting methods is usually different. The above-mentioned correspondence between model accuracy and training times can be specifically represented by a curve of model accuracy changing with training times, or it can be represented in a set manner (establishing multiple tables or sets, each table or set stores multiple training times and the model accuracy corresponding to each training time).

[0108] Step S250: selecting a segmentation method from a plurality of segmentation methods as a target segmentation method according to the corresponding relationship between the model accuracy and the number of training times of the prediction model in each segmentation method.

[0109] There may be multiple methods for selecting a segmentation method from multiple segmentation methods as a target segmentation method according to the above-mentioned corresponding relationship.

[0110] In one possible implementation, the model accuracy or model accuracy mean corresponding to each segmentation method when the number of training times reaches a preset number can be obtained according to the corresponding relationship, and the segmentation method corresponding to the maximum model accuracy or model accuracy mean is used as the target segmentation method.

[0111] In another feasible implementation method, the model accuracy mean and model accuracy variance corresponding to each segmentation method can be obtained according to the corresponding relationship corresponding to each segmentation method, and a target segmentation method can be selected according to the model accuracy mean and model accuracy variance corresponding to each segmentation method.

[0112] In this implementation, the model accuracy mean and model accuracy variance corresponding to each segmentation method can be weightedly calculated to obtain the weight corresponding to each segmentation method, and the segmentation method with the largest weight is used as the target segmentation method.

[0113] In another possible implementation mode, the accuracy fitting curve corresponding to each segmentation method can be obtained based on the corresponding relationship between the model accuracy of the prediction model under each segmentation method and the number of training times; based on the accuracy fitting curve corresponding to each segmentation method, the mean accuracy corresponding to each segmentation method is determined, and the segmentation method corresponding to the largest mean accuracy is selected as the target segmentation method.

[0114] like Figure 8 As shown, a plurality of splitting methods are exemplarily shown, including a first splitting method, a second splitting method and a third splitting method, and when the number of bases in the base group obtained by the first splitting method is 2, the number of bases in the base group obtained by the second splitting method is 3, and the number of bases in the base group obtained by the third splitting method is 4, a curve of the change of the model accuracy of each splitting method obtained in the process of pre-training the base group obtained by using each splitting method varies with the number of training times.

[0115] from Figure 8 It can be seen that when the second segmentation method is adopted as the target segmentation method, that is, when the sample gene sequence is divided in a manner of every 3 bases as a base group, the obtained pre-trained detection model performs better than other numbers of bases as a base group in terms of accuracy and model stability. Therefore, in the embodiment of the present application, the sample gene sequence (the first sample gene sequence) is divided in a manner of proposing 3 bases as a base group.

[0116] Step S260: segmenting each first sample gene sequence according to the target segmentation method to obtain a plurality of base groups included in each first sample gene sequence, each base group including at least one base.

[0117] Step S270: Masking is performed on at least one base group in each first sample gene sequence to obtain a training gene sequence corresponding to each first sample gene sequence, and each first sample gene sequence and the training gene sequence corresponding to each first sample gene sequence are used to pre-train the prediction model to obtain a pre-trained prediction model.

[0118] Step S280: Using the multiple groups of sample sequences included in the second sample set and the similarity labels corresponding to each group of sample sequences, fine-tune the pre-trained prediction model to obtain a target prediction model, wherein the target prediction model is used to predict the similarity of two gene sequences, and the similarity of the two gene sequences is used to characterize the probability of gene off-target.

[0119] The gene off-target prediction model training method provided by the present application is to select a target segmentation method from multiple segmentation methods by performing segmentation processing on each first sample gene sequence according to the target segmentation method to obtain multiple base groups included in each first sample gene sequence, mask at least one base group in each first sample gene sequence to obtain a training gene sequence corresponding to each first sample gene sequence, and use each first sample gene sequence and each first sample gene sequence The corresponding training gene sequence is pre-trained to obtain a pre-trained prediction model, and the multiple groups of sample sequences included in the second sample set and the similarity labels corresponding to each group of sample sequences are used to fine-tune the pre-trained prediction model to obtain a target prediction model, wherein the target prediction model is used to predict the similarity of two gene sequences, and the similarity of the two gene sequences is used to characterize the probability of gene off-target. Accurate prediction of the probability of gene off-target can be achieved.

[0120] See also Fig. 9 The present application also provides a gene off-target prediction method applicable to electronic devices, the method comprising:

[0121] Step S310: obtaining a gene sequence group to be predicted, where the gene sequence group to be predicted includes two gene sequences.

[0122] Step S320: Input the gene sequence group to be predicted into the target prediction model obtained by using the gene off-target prediction model training method to obtain the similarity between the two gene sequences in the gene sequence group to be predicted, and the similarity is used to characterize the probability of gene off-target in the two gene sequences in the gene sequence group to be predicted.

[0123] The specific method of obtaining the target prediction model can refer to the specific description of the gene off-target prediction model training method in the above embodiment, which will not be described in detail here.

[0124] It should be understood that the number of the above-mentioned gene sequence groups to be predicted can be multiple groups, and the gene sequences in the multiple groups of gene sequences to be predicted include an identical gene sequence to be predicted. By combining multiple groups to obtain a group of gene sequences and inputting them into the target prediction model obtained by the above prediction for off-target prediction, the off-target prediction results between the gene sequences of each group can be obtained, so that the gene can be knocked out more effectively or the specific sequence gene can be accurately and effectively identified and deleted based on the off-target prediction results of each group of gene sequences. Therefore, by adopting the above-mentioned method of the present application, the accuracy of the prediction of the off-target probability of genes after gene editing can be improved, which greatly reduces the gene editing risks of scientific researchers, and at the same time, the efficiency of gene editing can be greatly accelerated, so that it can be applied in clinical practice and enter the market faster.

[0125] The following describes an apparatus embodiment of the present application, which can be used to execute the method in the above-mentioned embodiment of the present application. For details not disclosed in the apparatus embodiment of the present application, please refer to the above-mentioned method embodiment of the present application.

[0126] See also Fig.10 The embodiment of the present application also provides a gene off-target prediction model training device 400 that can be applied to electronic devices. The device 400 includes a sample set acquisition module 410, a segmentation processing module 420, a pre-training module 430 and a fine-tuning training module 440.

[0127] The sample set acquisition module 410 is used to acquire a first sample set and a second sample set, wherein the first sample set includes a plurality of first sample gene sequences, and the second sample set includes a plurality of groups of sample sequences and similarity labels corresponding to each group of sample sequences, and each group of sample sequences is composed of two second sample gene sequences; the segmentation processing module 420 is used to segment each first sample gene sequence according to a target segmentation method to obtain a plurality of base groups each of the first sample gene sequences includes, and each base group includes at least one base; the pre-training module 430 is used to perform segmentation processing on at least one base group in each first sample gene sequence. Masking is performed to obtain the training gene sequence corresponding to each first sample gene sequence, and each first sample gene sequence and the training gene sequence corresponding to each first sample gene sequence are used to pre-train the prediction model to obtain the pre-trained prediction model; a fine-tuning training module 440 is used to use the multiple groups of sample sequences included in the second sample set and the similarity labels corresponding to each group of sample sequences to fine-tune the pre-trained prediction model to obtain a target prediction model, wherein the target prediction model is used to predict the similarity of two gene sequences, and the similarity of the two gene sequences is used to characterize the probability of gene off-target.

[0128] In one possible implementation, the device 400 further includes: a corresponding relationship obtaining module and a segmentation method determining module.

[0129] The segmentation processing module 420 is further used to segment each third sample gene sequence in the third sample set according to multiple segmentation methods, respectively, to obtain multiple base groups obtained by segmenting each third sample gene sequence according to each segmentation method, and the number of bases included in the base groups obtained by segmenting in the same segmentation method is the same; the pre-training module 430 is further used to perform masking processing on at least one base group obtained by segmenting each third sample gene sequence according to the segmentation method for each segmentation method, to obtain a training gene sequence corresponding to each third sample gene sequence under the segmentation method, and to pre-train the prediction model using each third sample gene sequence and the training gene sequence corresponding to each third sample gene sequence under the segmentation method; the corresponding relationship acquisition module is further used to obtain the corresponding relationship between the model accuracy and the number of training times under each segmentation method obtained during the pre-training of the prediction model; the segmentation method determination module is used to select a segmentation method from multiple segmentation methods as the target segmentation method according to the corresponding relationship between the model accuracy and the number of training times of the prediction model under each segmentation method.

[0130] In one feasible implementation, the segmentation method confirmation module is also used to obtain the accuracy fitting curve corresponding to each segmentation method based on the correspondence between the model accuracy of the prediction model under each segmentation method and the number of training times; according to the accuracy fitting curve corresponding to each segmentation method, the accuracy mean corresponding to each segmentation method is determined, and the segmentation method corresponding to the largest accuracy mean is selected as the target segmentation method.

[0131] In one embodiment, the multiple cutting methods include a first cutting method, a second cutting method and a third cutting method, the number of bases included in the base group obtained by the first cutting method is less than the number of bases included in the base group obtained by the second cutting method, and the number of bases included in the base group obtained by the second cutting method is less than the number of bases included in the base group obtained by the third cutting method.

[0132] In one embodiment, the number of bases in the base group obtained by the first cutting method is 2, the number of bases in the base group obtained by the second cutting method is 3, and the number of bases in the base group obtained by the third cutting method is 4.

[0133] In one possible implementation, the first sample set includes the third sample set.

[0134] In one embodiment, the pre-training module 430 includes an encoding sub-module, a mask processing sub-module, and a pre-training sub-module.

[0135] The encoding submodule is used to encode the multiple base groups included in each first sample gene sequence to obtain the encoding vectors corresponding to each first sample gene sequence; the mask processing submodule is used to perform mask processing on the encoding corresponding to at least one base group in the encoding vector corresponding to each first sample gene sequence to obtain the encoding vector of the training gene sequence corresponding to each first sample gene sequence; the pre-training submodule is used to pre-train the prediction model using the encoding vector corresponding to each first sample gene sequence and the encoding vector of the training gene sequence corresponding to each first sample gene sequence to obtain the pre-trained prediction model.

[0136] In one possible implementation, the encoding submodule is also used to input the encoding vector corresponding to the first sample gene sequence and the encoding vector of the corresponding training gene sequence into the prediction model for the encoding vector corresponding to any first sample gene sequence and the encoding vector of the corresponding training gene sequence, so as to extract the features of the encoding vector corresponding to the first sample gene sequence through the prediction model, and extract the features of each code based on the context information between each code in the encoding vector of the training gene sequence, and obtain the features of the encoding vector of the training gene sequence based on the features of each code; determine the loss value based on the features of the encoding vector corresponding to each first sample gene sequence and the features of the encoding vector of the corresponding training gene sequence, if the loss value meets the training end condition, end the training and obtain the pre-trained feature extraction module, if not, adjust the model parameters of the prediction model.

[0137] See also Fig.11 The embodiment of the present application also provides a gene off-target prediction device 500 that can be applied to electronic devices. The device 500 includes a gene sequence acquisition module 510 and an off-target prediction module 520.

[0138] The gene sequence acquisition module 510 is used to obtain the gene sequence group to be predicted, which includes two gene sequences; the off-target prediction module 520 is used to input the gene sequence group to be predicted into the target prediction model obtained by using the gene off-target prediction model training device to obtain the similarity of the two gene sequences in the gene sequence group to be predicted, and the similarity is used to characterize the probability of gene off-target in the two gene sequences in the gene sequence group to be predicted.

[0139] It should be noted that the device embodiment in the present application corresponds to the aforementioned method embodiment. The specific principles in the device embodiment can be found in the contents of the aforementioned method embodiment and will not be repeated here.

[0140] The following will be combined Fig.12 An electronic device 100 provided in the present application is described.

[0141] See also Fig.12 Based on the gene off-target prediction model training method and gene off-target prediction method provided in the above embodiments, the embodiments of the present application also provide another electronic device 100 including a processor 102 that can execute the above method. The electronic device 100 can be a server 20 or a terminal device, and the terminal device can be a smart phone, a tablet computer, a computer, or a portable computer.

[0142] The electronic device 100 further includes a memory 104 . The memory 104 stores a program that can execute the contents of the aforementioned embodiments, and the processor 102 can execute the program stored in the memory 104 .

[0143] Among them, the processor 102 may include one or more cores for processing data and a message matrix unit. The processor 102 uses various interfaces and lines to connect various parts of the entire electronic device 100, and executes various functions and processes data of the electronic device 100 by running or executing instructions, programs, code sets or instruction sets stored in the memory 104, and calling data stored in the memory 104. Optionally, the processor 102 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 102 can integrate one or more combinations of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU), and a modem. Among them, the CPU mainly processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing display content; and the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 102, but may be implemented separately through a communication chip.

[0144] The memory 104 may include a random access memory (RAM) or a read-only memory (ROM). The memory 104 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 104 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function, instructions for implementing the following various method embodiments, etc. The data storage area may also store data (such as data to be recommended and operation methods) acquired by the electronic device 100 during use.

[0145] The electronic device 100 may also include a network module and a screen. The network module is used to receive and send electromagnetic waves, realize the mutual conversion between electromagnetic waves and electrical signals, and thus communicate with a communication network or other devices, such as communicating with an audio playback device. The network module may include various existing circuit components for performing these functions, such as antennas, radio frequency transceivers, digital signal processors, encryption / decryption chips, user identity modules (SIM) cards, memories, etc. The network module may communicate with various networks such as the Internet, corporate intranets, wireless networks, or communicate with other devices via wireless networks. The above-mentioned wireless networks may include cellular telephone networks, wireless local area networks, or metropolitan area networks. The screen may display interface content and perform data interaction.

[0146] In some embodiments, the electronic device 100 may further include: a peripheral interface 106 and at least one peripheral device. The processor 102, the memory 104 and the peripheral interface 106 may be connected via a bus or a signal line. Each peripheral device may be connected to the peripheral interface via a bus, a signal line or a circuit board. Specifically, the peripheral device includes: at least one of a radio frequency component 108, a positioning component 112, a camera 114, an audio component 116, a display screen 118 and a power supply 122.

[0147] The peripheral interface 106 may be used to connect at least one peripheral device related to I / O (Input / Output) to the processor 102 and the memory 104. In some embodiments, the processor 102, the memory 104, and the peripheral interface 106 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 102, the memory 104, and the peripheral interface 106 may be implemented on a separate chip or circuit board, which is not limited in the embodiments of the present application.

[0148] The radio frequency component 108 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency component 108 communicates with the communication network and other communication devices through electromagnetic signals. The radio frequency component 108 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals into electrical signals. Optionally, the radio frequency component 108 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, and the like. The radio frequency component 108 can communicate with other terminals through at least one wireless communication protocol. The wireless communication protocol includes, but is not limited to: the World Wide Web, a metropolitan area network, an intranet, various generations of mobile communication networks (2G, 3G, 4G and 5G), a wireless local area network and / or a WiFi (Wireless Fidelity) network. In some embodiments, the radio frequency component 108 may also include circuits related to NFC (Near Field Communication), which is not limited in this application.

[0149] The positioning component 112 is used to locate the current geographic location of the electronic device 100 to implement navigation or LBS (Location Based Service). The positioning component 112 can be a positioning component based on the US GPS (Global Positioning System), China's Beidou system or Galileo system.

[0150] The camera 114 is used to capture images or videos (such as capturing the image to be detected in this solution). Optionally, the camera 114 includes a front camera and a rear camera. Usually, the front camera is set on the front panel of the electronic device 100, and the rear camera is set on the back of the electronic device 100. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth of field camera, a wide-angle camera, and a telephoto camera, so as to realize the fusion of the main camera and the depth of field camera to realize the background blur function, the fusion of the main camera and the wide-angle camera to realize panoramic shooting and VR (Virtual Reality) shooting function or other fusion shooting functions. In some embodiments, the camera 114 may also include a flash. The flash can be a monochrome temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm light flash and a cold light flash, which can be used for light compensation at different color temperatures.

[0151] The audio component 116 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, and convert the sound waves into electrical signals and input them into the processor 102 for processing, or input them into the RF component 108 to achieve voice communication. For the purpose of stereo acquisition or noise reduction, there can be multiple microphones, which are respectively arranged at different parts of the electronic device 100. The microphone can also be an array microphone or an omnidirectional acquisition microphone. The speaker is used to convert the electrical signal from the processor 102 or the RF component 108 into sound waves. The speaker can be a traditional film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert the electrical signal into sound waves audible to humans, but also convert the electrical signal into sound waves inaudible to humans for purposes such as ranging. In some embodiments, the audio component 116 may also include a headphone jack.

[0152] The display screen 118 is used to display the UI (User Interface). The UI may include graphics, text, icons, videos, and any combination thereof. When the display screen 118 is a touch display screen, the display screen 118 also has the ability to collect touch signals on the surface or above the surface of the display screen 118. The touch signal can be input to the processor 102 as a control signal for processing. At this time, the display screen 118 can also be used to provide virtual buttons and / or virtual keyboards, also known as soft buttons and / or soft keyboards. In some embodiments, the display screen 118 can be one, and the front panel of the electronic device 100 is set; in other embodiments, the display screen 118 can be at least two, which are respectively set on different surfaces of the electronic device 100 or are folded; in some other embodiments, the display screen 118 can be a flexible display screen, which is set on the curved surface or folded surface of the electronic device 100. Even, the display screen 118 can also be set as a non-rectangular irregular shape, that is, a special-shaped screen. The display screen 118 can be made of materials such as LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode, machine light-emitting diode).

[0153] The power supply 122 is used to power various components in the electronic device 100. The power supply 122 can be an alternating current, a direct current, a disposable battery, or a rechargeable battery. When the power supply 122 includes a rechargeable battery, the rechargeable battery can be a wired rechargeable battery or a wireless rechargeable battery. A wired rechargeable battery is a battery that is charged through a wired line, and a wireless rechargeable battery is a battery that is charged through a wireless coil. The rechargeable battery can also be used to support fast charging technology.

[0154] The embodiment of the present application also provides a computer-readable storage medium. The computer-readable medium stores program codes, which can be called by a processor to execute the method described in the above method embodiment.

[0155] The computer-readable storage medium may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read-only memory), an EPROM, a hard disk or a ROM. Optionally, the computer-readable storage medium includes a non-transitory computer-readable storage medium. The computer-readable storage medium has storage space for program codes for executing any method steps in the above method. These program codes can be read from or written to one or more computer program products. The program code can be compressed, for example, in an appropriate form.

[0156] The embodiment of the present application also provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device performs the method described in the above various optional implementations.

[0157] In summary, the present application provides a gene off-target prediction model training method, prediction method, device and electronic device, by segmenting each first sample gene sequence according to the target segmentation method, obtaining multiple base groups included in each first sample gene sequence, masking at least one base group in each first sample gene sequence to obtain a training gene sequence corresponding to each first sample gene sequence, and using each first sample gene sequence and each first sample gene sequence The corresponding training gene sequence is pre-trained to obtain a pre-trained prediction model, and using multiple groups of sample sequences included in the second sample set and the similarity labels corresponding to each group of sample sequences, the pre-trained prediction model is fine-tuned and trained to obtain a target prediction model, wherein the target prediction model is used to predict the similarity of two gene sequences, and the similarity of the two gene sequences is used to characterize the probability of gene off-target. Accurate prediction of the probability of gene off-target can be achieved.

[0158] Furthermore, considering that in the gene editing process, a gene sequence is usually given, and gene editing is performed based on the gene sequence to generate multiple gene sequences, by combining the given gene sequence with multiple gene sequences respectively to obtain a group of gene sequences and inputting them into the target prediction model obtained by the above prediction for off-target prediction, the off-target prediction results between each group of gene sequences can be obtained, so that genes can be more effectively knocked out or specific sequence genes can be accurately and effectively identified and deleted based on the off-target prediction results of each group of gene sequences. Therefore, by adopting the above-mentioned method of the present application, the accuracy of the prediction of the off-target probability of genes after gene editing can be improved, which greatly reduces the gene editing risks of scientific researchers, and at the same time, the efficiency of gene editing can be greatly accelerated, so that it can be applied in clinical practice and enter the market faster.

[0159] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.

[0160] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software, or by combining software with necessary hardware. Therefore, the technical solution according to the implementation method of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the implementation method of the present application.

[0161] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the embodiments disclosed herein. The present application is intended to cover any variations, uses or adaptations of the present application, which follow the general principles of the present application and include common knowledge or customary technical means in the art that are not disclosed in the present application.

[0162] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims

1. A gene off-target prediction model training method, characterized in that: The method comprises: Obtain a first sample set and a second sample set, wherein the first sample set includes a plurality of first sample gene sequences, and the second sample set includes a plurality of groups of sample sequences and similarity labels corresponding to each group of sample sequences, and each group of sample sequences is composed of two second sample gene sequences; Segmenting each of the first sample gene sequences according to a target segmentation method to obtain a plurality of base groups included in each of the first sample gene sequences, each base group including at least one base; Performing masking processing on at least one base group in each of the first sample gene sequences to obtain a training gene sequence corresponding to each of the first sample gene sequences, and pre-training a prediction model using each of the first sample gene sequences and the training gene sequence corresponding to each of the first sample gene sequences to obtain a pre-trained prediction model; The pre-trained prediction model is fine-tuned using the multiple groups of sample sequences included in the second sample set and the similarity labels corresponding to each group of sample sequences to obtain a target prediction model, wherein the target prediction model is used to predict the similarity of two gene sequences, and the similarity of the two gene sequences is used to characterize the probability of gene off-target.

2. The method according to claim 1, characterized in that The target segmentation method is obtained by: Performing segmentation processing on each third sample gene sequence in the third sample set according to multiple segmentation methods respectively, to obtain multiple base groups obtained by segmenting each third sample gene sequence according to each segmentation method, wherein the base groups obtained by segmenting in the same segmentation method have the same number of bases; For each segmentation method, masking is performed on at least one base group obtained by segmenting each of the third sample gene sequences according to the segmentation method to obtain a training gene sequence corresponding to each of the third sample gene sequences under the segmentation method, and a prediction model is pre-trained using each of the third sample gene sequences and the training gene sequence corresponding to each of the third sample gene sequences under the segmentation method; Obtain the corresponding relationship between the model accuracy and the number of training times under each segmentation method during the pre-training of the prediction model; According to the corresponding relationship between the model accuracy and the number of training times of the prediction model in each segmentation method, a segmentation method is selected from the multiple segmentation methods as the target segmentation method.

3. The method according to claim 2, characterized in that According to the corresponding relationship between the model accuracy and the number of training times of the prediction model in each segmentation mode, a segmentation mode is selected from the multiple segmentation modes as the target segmentation mode, including: According to the corresponding relationship between the model accuracy of the prediction model in each segmentation method and the number of training times, the accuracy fitting curve corresponding to each segmentation method is obtained; According to the precision fitting curve corresponding to each segmentation method, the precision mean corresponding to each segmentation method is determined, and the segmentation method corresponding to the largest precision mean is selected as the target segmentation method.

4. The method according to claim 2, characterized in that: The multiple cutting methods include a first cutting method, a second cutting method and a third cutting method. The number of bases included in the base group obtained by the first cutting method is less than the number of bases included in the base group obtained by the second cutting method, and the number of bases included in the base group obtained by the second cutting method is less than the number of bases included in the base group obtained by the third cutting method.

5. The method according to claim 4, characterized in that The number of bases in the base group obtained by the first segmentation method is 2, the number of bases in the base group obtained by the second segmentation method is 3, and the number of bases in the base group obtained by the third segmentation method is 4.

6. The method according to claim 2, characterized in that The first sample set includes the third sample set.

7. The method according to claim 1, characterized in that Masking at least one base group in each of the first sample gene sequences to obtain a training gene sequence corresponding to each of the first sample gene sequences, and pre-training a prediction model using each of the first sample gene sequences and the training gene sequence corresponding to each of the first sample gene sequences to obtain a pre-trained prediction model, including: Encoding the multiple base groups included in each of the first sample gene sequences to obtain encoding vectors corresponding to each of the first sample gene sequences; Performing mask processing on the code corresponding to at least one base group in the code vector corresponding to each of the first sample gene sequences, to obtain the code vector of the training gene sequence corresponding to each of the first sample gene sequences; The prediction model is pre-trained using the encoding vector corresponding to each of the first sample gene sequences and the encoding vector of the training gene sequence corresponding to each of the first sample gene sequences to obtain a pre-trained prediction model.

8. The method according to claim 7, characterized in that Pre-training the prediction model using the encoding vector corresponding to each of the first sample gene sequences and the encoding vector of the training gene sequence corresponding to each of the first sample gene sequences to obtain the pre-trained prediction model, including: Repeat the following training steps until the pre-training loss value meets the pre-training end condition to obtain the pre-trained prediction model: For any encoding vector corresponding to the first sample gene sequence and the encoding vector of the corresponding training gene sequence, the encoding vector corresponding to the first sample gene sequence and the encoding vector of the corresponding training gene sequence are input into a prediction model, so as to extract features of the encoding vector corresponding to the first sample gene sequence through the prediction model, and based on context information between each code in the encoding vector of the training gene sequence, extract features of each code, and obtain features of the encoding vector of the training gene sequence based on the features of each code; Based on the characteristics of the encoding vector corresponding to each of the first sample gene sequences and the characteristics of the encoding vector of the corresponding training gene sequence, a loss value is determined; if the loss value meets the training end condition, the training is ended to obtain the pre-trained feature extraction module; if not, the model parameters of the prediction model are adjusted and the training step is repeated.

9. A gene off-target prediction method, characterized in that: The method comprises: Obtaining a gene sequence group to be predicted, wherein the gene sequence group to be predicted includes two gene sequences; The gene sequence group to be predicted is input into the target prediction model obtained by using any one of claims 1 to 8 to obtain the similarity between the two gene sequences in the gene sequence group to be predicted, and the similarity is used to characterize the probability of off-target genes in the two gene sequences in the gene sequence group to be predicted.

10. A gene off-target prediction model training device, characterized in that: The device comprises: A sample set acquisition module, used to acquire a first sample set and a second sample set, wherein the first sample set includes a plurality of first sample gene sequences, and the second sample set includes a plurality of groups of sample sequences and similarity labels corresponding to each group of sample sequences, and each group of sample sequences is composed of two second sample gene sequences; A segmentation processing module, used for segmenting each of the first sample gene sequences according to a target segmentation method to obtain a plurality of base groups respectively included in each of the first sample gene sequences, each base group including at least one base; a pre-training module, configured to perform masking on at least one base group in each of the first sample gene sequences to obtain a training gene sequence corresponding to each of the first sample gene sequences, and to pre-train a prediction model using each of the first sample gene sequences and the training gene sequence corresponding to each of the first sample gene sequences to obtain a pre-trained prediction model; A fine-tuning training module is used to use the multiple groups of sample sequences included in the second sample set and the similarity labels corresponding to each group of sample sequences to fine-tune the pre-trained prediction model to obtain a target prediction model, wherein the target prediction model is used to predict the similarity of two gene sequences, and the similarity of the two gene sequences is used to characterize the probability of gene off-target.

11. A gene off-target prediction device, characterized in that: The device comprises: A gene sequence acquisition module is used to acquire a gene sequence group to be predicted, wherein the gene sequence group to be predicted includes two gene sequences; An off-target prediction module is used to input the gene sequence group to be predicted into a target prediction model obtained using any one of claims 1-8 to obtain the similarity between two gene sequences in the gene sequence group to be predicted, and the similarity is used to characterize the probability of gene off-target in the two gene sequences in the gene sequence group to be predicted.

12. An electronic device, characterized in that: The method comprises a processor and a memory; one or more programs are stored in the memory and configured to be executed by the processor to implement the method according to any one of claims 1 to 10.

13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program code, wherein when the program code is executed by a processor, the method according to any one of claims 1 to 8 or claim 9 is executed.

14. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the method described in any one of claims 1 to 8 or claim 9 are implemented.

Citation Information

Patent Citations

  • Gene annotation method and system

    CN101894211A

  • CRISPR / Cas9 off-target prediction method based on an attention mechanism

    CN111613267A