Base calling method, base calling model training method, and electronic device

By preprocessing and feature extraction of signal data from nanopore sequencing technology, and using an adaptive stride convolution module and an improved Conformer coding module, the problems of noise in electrical signal data and insufficient model fitting were solved, achieving high efficiency and high accuracy in base identification.

WO2026000404A1PCT designated stage Publication Date: 2026-01-02SHENZHEN HUADA GENE INST
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/102675
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2024-06-28
Publication Date
2026-01-02

AI Technical Summary

Technical Problem

In existing nanopore sequencing technologies, the accuracy of base recognition is low due to noise in the electrical signal data and insufficient model fitting and memory capabilities, making it difficult to balance the relationship between recognizing long electrical signal sequences and accuracy.

Method used

By performing a first preprocessing step on the signal data, including data normalization and removal of low-frequency offset amplitude, feature extraction is performed using a pre-trained base recognition model, and decoding is performed using a preset decoder. The accuracy of feature extraction and decoding is improved by combining an adaptive stride convolution module and an improved Conformer encoding module.

Benefits of technology

It improves the efficiency and accuracy of base identification, enhances the training efficiency and prediction accuracy of the model, and increases the accuracy of base identification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024102675_02012026_PF_FP_ABST
    Figure CN2024102675_02012026_PF_FP_ABST
Patent Text Reader

Abstract

Provided are a base calling method, a base calling model training method, and an electronic device. The base calling method comprises: performing first pre-processing on signal data, and obtaining first pre-processed data; inputting the first pre-processed data into a pre-trained base calling model, and obtaining a data feature of the first pre-processed data; and using a decoder to decode the data feature, and obtaining a base sequence corresponding to the signal data. The base calling model training method comprises: performing second pre-processing on sample data, and obtaining second pre-processed sample data; and training a preset model on the basis of the second pre-processed sample data, and obtaining a base calling model that meets a preset requirement. By using the described method, the precision of prediction by a base calling model can be improved, thereby improving the accuracy of base calling.
Need to check novelty before this filing date? Find Prior Art

Description

Base recognition method, base recognition model training method and electronic device TECHNICAL FIELD

[0001] The present application relates to the technical field of biological medicine, in particular to a base recognition method, a base recognition model training method and an electronic device. BACKGROUND

[0002] Nanopore sequencing technology is a high-throughput sequencing method based on single-molecule current measurement. It can use a nanopore composed of a protein or a solid material to guide deoxyribonucleic acid (DNA) and / or ribonucleic acid (RNA) molecules through the pore one by one, and measure the current between different bases in the DNA and / or RNA as the signal data when the DNA and / or RNA pass through the pore. By analyzing the signal data, the base sequence of the DNA and / or RNA can be inferred.

[0003] However, due to the unstable rate of DNA and / or RNA molecules passing through the nanopore, the technical limitations of the current signal detector, and other reasons, there may be noise or abnormal data in the electrical signal data, which reduces the accuracy of related base recognition algorithms. In addition, the base recognition model based on deep learning used in the related technology usually cannot solve the balance problem between recognizing long electrical signal sequences and ensuring recognition accuracy, resulting in low usability of the model.

[0004] SUMMARY

[0005] In view of the above, it is necessary to propose a base recognition method, a base recognition model training method and an electronic device, which can solve the problem of low base recognition accuracy caused by the dispersion of electrical signal feature distribution, training data noise, insufficient model fitting and memory capacity, and other reasons.

[0006] Embodiments of the present application provide a base recognition method, which comprises: performing first preprocessing on signal data to obtain first preprocessed data; inputting the first preprocessed data into a pre-trained base recognition model, and using the base recognition model to extract features of the first preprocessed data to obtain data features of the first preprocessed data; inputting the data features into a preset decoder, and using the decoder to decode the data features to obtain a base sequence corresponding to the signal data.

[0007] In an embodiment, the method further comprises collecting the signal data, comprising: collecting electrical signal data obtained by nanopore sequencing of deoxyribonucleic acid (DNA) or ribonucleic acid (RNA), the electrical signal data comprising a plurality of electrical signal amplitude data varying over time; and taking the electrical signal data as the signal data.

[0008] In an embodiment, the first preprocessing comprises: normalizing a plurality of electrical signal amplitude data in the signal data, taking the normalized signal data as updated signal data; determining an offset value of a first numerical sequence in each preset window length range in the updated signal data based on a sliding window algorithm, and updating the first numerical sequence based on the offset value to obtain the first preprocessed data.

[0009] In an embodiment, the base recognition model comprises a convolution module, the convolution module comprising a plurality of convolution layers connected in sequence, wherein a step length of a last convolution layer of the convolution module and a data length of the first preprocessed data and a number of bases contained in a longest base sequence label in the data set have a corresponding relationship.

[0010] In an embodiment, the base recognition model comprises a convolution module, the convolution module comprising a first convolution layer, a second convolution layer, and a third convolution layer, wherein: the (input length, input dimension, output dimension, step length) of the first convolution layer is represented as (L, n1, n2, b1), wherein L represents a data length of the first preprocessed data, and n1, n2, and b1 represent preset numerical values; the (input length, input dimension, output dimension, step length) of the second convolution layer is represented as (L, n2, n3, b1), wherein n3 represents a preset numerical value; and the (input length, input dimension, output dimension, step length) of the third convolution layer is represented as (L, n3, n3, step), wherein step = L / l, and l represents a number of bases contained in a longest base sequence label in the data set.

[0011] In an embodiment, the base recognition model comprises a Conformer encoding module, the Conformer encoding module comprising a feedforward neural network, the feedforward neural network comprising an up-sampling fully connected layer and a down-sampling fully connected layer, wherein: the up-sampling fully connected layer is configured to up-sample feature data output by the convolution module based on a preset up-sampling ratio to obtain feature data of a preset dimension; and the down-sampling fully connected layer is configured to down-sample the feature data of the preset dimension to restore the feature data of the preset dimension to a dimension of the feature data output by the convolution module.

[0012] In an embodiment, the preset decoder comprises a connectionist temporal classification (CTC) decoder.

[0013] Embodiments of the present application provide a base recognition model training method, which comprises: collecting sample data, performing second preprocessing on the sample data to obtain second preprocessed sample data; training a preset model based on the second preprocessed sample data to obtain a base recognition model meeting preset requirements.

[0014] In one embodiment, the sample data comprises a plurality of historical signal data, and the second preprocessing comprises: determining abnormal data in the sample data, eliminating abnormal data from the plurality of historical signal data to obtain a plurality of filtered historical signal data; performing normalization processing on each of the plurality of filtered historical signal data, and taking each of the normalized historical signal data as updated historical signal data; determining an offset value of a second numerical sequence in each preset window length range of the updated historical signal data based on a sliding window algorithm, and updating the second numerical sequence based on the offset value to obtain second preprocessed historical signal data.

[0015] In one embodiment, the method further comprises collecting the historical signal data, comprising: collecting historical electrical signal data obtained by nanopore sequencing of historical deoxyribonucleic acid (DNA) or historical ribonucleic acid (RNA), the historical electrical signal data comprising electrical signal amplitude data varying with time; and taking the historical electrical signal data as the historical signal data.

[0016] In one embodiment, the determination of abnormal data in the sample data comprises: performing normalization processing on a plurality of electrical signal amplitudes of each historical signal data in the plurality of historical signal data based on a preset kurtosis algorithm; determining a kurtosis value of each normalized historical signal data, and taking historical signal data with a kurtosis value less than a preset kurtosis threshold as abnormal data.

[0017] In one embodiment, the preset model comprises an adaptive step convolution module, and the adaptive step convolution module comprises a first convolution layer, a second convolution layer, and a third convolution layer, wherein: the (input length, input dimension, output dimension, step) of the first convolution layer is represented as (L, n1, n2, b1), wherein L represents the data length of each historical signal data in the sample data, and n1, n2, and b1 represent preset numerical values; the (input length, input dimension, output dimension, step) of the second convolution layer is represented as (L, n2, n3, b1), wherein n3 represents a preset numerical value; and the (input length, input dimension, output dimension, step) of the third convolution layer is represented as (L, n3, n3, step), wherein step = L / l, and l represents the number of bases contained in the longest base sequence label in the data set.

[0018] In an embodiment, the preset model comprises an improved Conformer encoding module, the improved Conformer encoding module comprises a feedforward neural network, the feedforward neural network comprises an up-sampling full connection layer and a down-sampling full connection layer, wherein: the up-sampling full connection layer is configured to perform up-sampling on feature data output by the convolution module based on a preset up-sampling ratio to obtain feature data of a preset dimension; and the down-sampling full connection layer is configured to perform down-sampling on the feature data of the preset dimension to restore the feature data of the preset dimension to a dimension of the feature data output by the convolution module.

[0019] In an embodiment, the preset requirement comprises one or more requirements in combination, for example: an average accuracy of a model prediction result obtained by the preset model is greater than a preset accuracy threshold; a median of the accuracy of the model prediction result obtained by the preset model is greater than a preset median threshold; and a total time consumed by the preset model for predicting a preset number of historical data sequences is less than a preset time length threshold.

[0020] An embodiment of the present application provides a base recognition device, which comprises: a preprocessing module configured to perform first preprocessing on signal data to obtain first preprocessing data; a feature extraction module configured to input the first preprocessing data into a pre-trained base recognition model, and perform feature extraction on the first preprocessing data by using the base recognition model to obtain data features of the first preprocessing data; and a decoding module configured to input the data features into a preset decoder, and perform decoding on the data features by using the decoder to obtain a base sequence corresponding to the signal data.

[0021] An embodiment of the present application provides an electronic device, which comprises a processor and a memory, and the processor is configured to implement the base recognition method or the base recognition model training method when executing a computer program stored in the memory.

[0022] An embodiment of the present application provides a computer readable storage medium, and the computer readable storage medium stores a computer program, and the computer program is configured to implement the base recognition method or the base recognition model training method when executed by a processor.

[0023] In summary, the base recognition method provided in the application can improve the efficiency and accuracy of base recognition by performing first preprocessing on the signal data to realize data normalization and low frequency offset amplitude removal of the signal data, using a pre-trained base recognition model to extract features from the first preprocessed data, and using a preset decoder to decode the extracted features. The base recognition model is trained by the base recognition model training method provided in the application. The second preprocessing is performed on the sample data to realize noise filtering, data normalization and low frequency offset amplitude removal of the sample data, and the preset model is trained using the second preprocessed sample data, so as to improve the training efficiency of the model and the prediction accuracy of the model, thereby improving the accuracy of base recognition. BRIEF DESCRIPTION OF DRAWINGS

[0024] FIG. 1 is a structural diagram of an electronic device provided in an embodiment of the application.

[0025] FIG. 2 is a flowchart of a base recognition method provided in an embodiment of the application.

[0026] FIG. 3 is a principle example diagram of a sliding window algorithm provided in an embodiment of the application.

[0027] FIG. 4 is a structural example diagram of a base recognition model provided in an embodiment of the application.

[0028] FIG. 5 is a flowchart of a base recognition model training method provided in an embodiment of the application.

[0029] FIG. 6 is an example diagram of signal peak value distribution provided in an embodiment of the application.

[0030] FIG. 7 is an example diagram of verification results of a base recognition model provided in an embodiment of the application.

[0031] FIG. 8 is an example diagram of a data loading process provided in an embodiment of the application.

[0032] FIG. 9 is a structural diagram of a base recognition device provided in an embodiment of the application. DETAILED DESCRIPTION

[0033] In order to more clearly understand the above-mentioned purposes, features and advantages of the application, the application will be described in detail below in combination with the drawings and specific embodiments. It should be noted that the embodiments of the application and the features in the embodiments can be combined with each other without conflict.

[0034] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the application belongs. The terms used in the specification of the application are only for the purpose of describing the embodiments of the embodiments in one embodiment, and are not intended to limit the application.

[0035] It should be noted that “at least one” in the present application means one or more, and “multiple” means two or more than two. “And / or” describes the association between the associated objects, which means that there can be three relationships, for example, A and / or B can represent the following three cases: A exists alone, A and B exist together, and B exists alone, where A and B can be singular or plural. The terms “first”, “second”, “third”, “fourth” and the like (if any) in the specification and claims of the present application and the drawings are used to distinguish similar objects, and are not used to describe a specific order or sequence.

[0036] In the embodiments of the present application, the words “exemplary” or “for example” are used to mean serving as an example or illustration. Any embodiment or design presented as “exemplary” or “for example” in the embodiments of the present application should not be interpreted as being more preferred or advantageous than other embodiments or design solutions. Rather, the use of “exemplary” or “for example” is intended to present relevant concepts in a specific manner. The embodiments described below and the features in the embodiments can be combined with each other without conflict, if possible.

[0037] In one embodiment, the nanopore sequencing technology is a high-throughput sequencing method based on single-molecule current measurement. Deoxyribonucleic acid (DNA) and / or ribonucleic acid (RNA) molecules can be guided through the pore one by one by using nanopores composed of proteins or solid-state materials, and the electric current between the different bases in the DNA and / or RNA passing through the pore can be measured. The corresponding electric signal data of the DNA and / or RNA is obtained as signal data, and the base sequence of the DNA and / or RNA can be inferred by analyzing the signal data.

[0038] However, due to the unstable rate of DNA and / or RNA molecules passing through the nanopore, the technical limitations of the current signal detector, and other reasons, there may be noise or abnormal data in the electric signal data, which affects the accuracy and stability of the downstream base recognition algorithm, and reduces the accuracy of the related base recognition algorithm.

[0039] For example, if a nanopore sequencing technology uses a biological nanopore such as a protein nanopore, when different molecules in a nucleic acid (e.g., DNA or RNA) sequence pass through the biological nanopore, the biological nanopore, while controlling the nucleic acid to pass through the nanopore, also acts as a signal sensor, and the size of the electrical signal detected by the biological nanopore is basically positively correlated with the size of the space occupied by the nucleotide to be detected in the nucleic acid inside the nanopore. Due to the instability of the biological nanopore, the biological nanopore as a signal sensor can only work in a small range of voltage and temperature, and the signal-to-noise ratio of the electrical signal data detected is relatively low. In addition, since it is difficult to mass-produce solid-state nanopores, although solid-state nanopores are more stable than biological nanopores, biological nanopores are more widely used.

[0040] The event detector is used to intercept the effective electrical signal to be used for base recognition from the original sequencing electrical signal, and to divide the effective electrical signal data into a time series of numerical feature approximations, i.e., so-called events, each event consisting of features such as the average value, standard deviation, start time, and length of the electrical signal data. In an ideal case, each base entering the nanopore will generate a new event, but due to the instability of the rate at which the base passes through the nanopore, the event detector may make the following two error cases when dividing to generate event data: (a) the event detector incorrectly divides the original sequencing electrical signal data corresponding to one base into two events (i.e., only one base passing through the nanopore generates two events), and the corresponding base recognition result will produce a base insertion error; (b) the event detector generates an event from the original data points of two bases (i.e., two consecutive bases passing through the nanopore generate one event), and the recognition result will produce a deletion error.

[0041] In addition, the base recognition model based on deep learning used in the related art generally cannot solve the balance problem between recognizing long signal sequences and ensuring recognition accuracy, resulting in low performance of the model. For example, the Hidden Markov Model (HMM) used in the early related art can only model short-term dependencies, while long-term dependencies exist in nanopore signal data, so it is difficult for HMM to capture long-term dependencies. In addition, HMM is a prior model based on known nucleic acid sequences, which may result in a high error rate when processing unknown base sequences. Although the Long Short-Term Memory (LSTM) used in the recent related art can improve the accuracy of base recognition to some extent, due to the complexity of the model structure of LSTM, the time cost of model training and prediction is high, and the computing power required for model processing long sequence data is also very large. Therefore, for very long time series data such as nanopore signal data, the feature expression ability of LSTM is still insufficient. Therefore, under the current circumstances, the high-precision model using LSTM may be limited by the characteristics of the data, and a compromise is made in balancing accuracy and the number of model parameters. This means that using a model with fewer parameters may result in lower accuracy.

[0042] Secondly, the deep learning method in the related art generally uses a simple data normalization method (such as min-max normalization, Z-score normalization, etc.) as a preprocessing technique, but these normalization methods only use global amplitude offset and scaling, and cannot remove the low-frequency amplitude offset caused by the existence of long signal sequences.

[0043] In summary, the related art has the problem of low base recognition accuracy caused by dispersed electric signal feature distribution, training data noise, insufficient model fitting and memory capacity, etc.

[0044] To solve the above problems, the embodiment of the present application provides a base recognition method, which performs first preprocessing on signal data to realize data normalization and removal of low-frequency offset amplitude of the signal data, uses a pre-trained base recognition model to extract features from the first preprocessed data, and uses a preset decoder to decode the extracted features, which can improve the efficiency and accuracy of base recognition. The base recognition model is trained by the base recognition model training method provided by the embodiment of the present application, which performs second preprocessing on sample data to realize noise filtering, data normalization and removal of low-frequency offset amplitude of the sample data, and trains a preset model using the second preprocessed sample data, which can improve the training efficiency of the model and the prediction accuracy of the model, thereby improving the accuracy of base recognition.

[0045] FIG. 1 is a structural schematic diagram of an electronic device provided by an embodiment of the present application. The electronic device 10 can be a computer, a server, a mobile phone, a tablet computer, a notebook computer, a cloud server, a cloud computer, or the like. The specific type of the electronic device is not limited in the embodiments of the present application.

[0046] As shown in FIG. 1, the electronic device 10 can include a communication module 101, a memory 102, a processor 103, an input / output (I / O) interface 104, and a bus 105. The processor 103 is coupled to the communication module 101, the memory 102, and the I / O interface 104 through the bus 105.

[0047] The communication module 101 can include a wired communication module and / or a wireless communication module. The wired communication module can provide one or more of the following wired communication solutions: universal serial bus (USB), controller area network (CAN) bus, and the like. The wireless communication module can provide one or more of the following wireless communication solutions: wireless fidelity (Wi-Fi), bluetooth (BT), mobile communication network, frequency modulation (FM), near field communication (NFC), infrared (IR) technology, and the like.

[0048] The memory 102 can include one or more random access memories (RAMs) and one or more non-volatile memories (NVMs). The random access memory can be directly readable and writable by the processor 103, and can be used to store executable programs (e.g., machine instructions) of an operating system or other programs that are running, and can also be used to store data of users and applications, and the like. The random access memory can include static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), and the like.

[0049] The non-volatile memory can also store executable programs and data of users and applications, and the like, which can be loaded in advance into the random access memory for direct reading and writing by the processor 103. The non-volatile memory can include a disk storage device, a flash memory.

[0050] The memory 102 is configured to store one or more computer programs. The one or more computer programs are configured to be executed by the processor 103. The one or more computer programs include a plurality of instructions, which, when executed by the processor 103, implement the base calling method executed on the electronic device 10.

[0051] In other embodiments, the electronic device 10 further includes an external memory interface for connecting an external memory to extend the storage capacity of the electronic device 10.

[0052] The processor 103 can include one or more processing units, for example: the processor 103 can include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units can be independent devices or integrated into one or more processors.

[0053] The processor 103 provides computing and control capabilities, for example, the processor 103 is configured to execute computer programs stored in the memory 102 to implement the base calling method described above.

[0054] The I / O interface 104 is configured to provide a channel for user input or output, for example, the I / O interface 104 can be used to connect various input and output devices, such as a mouse, a keyboard, a touch device, a display screen, etc., so that the user can input information or make the information visualized. Alternatively, the I / O interface 104 can also be used to provide a data transmission channel with a nanopore sequencing device, so that the electronic device can obtain signal data (such as electrical signals) from the nanopore sequencing device.

[0055] The bus 105 is at least used to provide a communication channel for the communication module 101, the memory 102, the processor 103, and the I / O interface 104 in the electronic device 10 to communicate with each other.

[0056] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 10. In other embodiments of this application, the electronic device 10 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0057] Figure 2 is a flowchart of a base recognition method provided in an embodiment of this application. The base recognition method is applied in an electronic device, such as the electronic device 10 in Figure 1, and specifically includes the following steps. Depending on different requirements, the order of the steps in the flowchart can be changed, and some steps can be omitted.

[0058] S201, Perform first preprocessing on the signal data to obtain first preprocessed data.

[0059] In some embodiments of this application, signal data is first acquired based on an event detector to identify the base sequence. The acquisition of signal data includes at least: acquiring electrical signal data obtained from nanopore sequencing of deoxyribonucleic acid (DNA) or ribonucleic acid (RNA), and using this electrical signal data as the signal data. The electrical signal data includes multiple electrical signal amplitude data that vary over time.

[0060] In some embodiments, the electronic device can acquire electrical signal data obtained from sequencing DNA or RNA from the event detector as signal data according to the sampling frequency of the event detector. For example, if the sampling frequency of the event detector is 5000 samples / sec, that is, the event detector outputs an electrical signal data with a fixed data length of 5000 per second, the electronic device can acquire the electrical signal data per second as signal data. The electrical signal data can represent the electrical signal data obtained in the current sequencing process, or it can be historical electrical signal data, such as the electrical signal data of a previously completed sequencing process.

[0061] Since electrical signal data can include time-varying electrical signal amplitude data, signal data can be viewed as a one-dimensional data vector or sequence composed of multiple electrical signal amplitudes. For example, signal data can be a data sequence of length n, z = {z1, z2, ..., zn}. i ,…,z n}, where each data point can be represented as z for example. i i = {1, 2, ..., n}, where n represents the total length of the signal data. The value of n can be set according to actual needs, and this application does not impose specific restrictions on it. For example, the value of n is 5000.

[0062] In one embodiment, the first preprocessing of the signal data may include, but is not limited to: normalizing multiple electrical signal amplitude data in the signal data, using the normalized signal data as updated signal data; determining the offset value of a first numerical sequence within a preset window length range in the updated signal data based on a sliding window algorithm, and updating the first numerical sequence accordingly based on the offset value to obtain the first preprocessed data.

[0063] In one embodiment, the signal data can be normalized based on the median, and the formula used for normalization may include:

[0064] Where the data sequence z = {z1, z2, ..., z} i ,…,z n} represents the signal data, median(z) represents the median of z, and s represents the normalized signal data (i.e., the updated signal data), s={s1,s2,…,s i ,…,s n}, i = {1, 2, ..., n}, where n represents the total length of the signal data. The value of n can be set according to actual needs, and this application does not impose specific restrictions on it. For example, the value of n can be 5000.

[0065] In other embodiments, other normalization methods can be used to normalize the signal data, such as min-max normalization, Z-score normalization, etc.

[0066] In one embodiment, the low-frequency offset value within each preset window of the updated signal data is calculated based on a sliding window algorithm, using the following formula:

[0067] o j =s j -f j ,

[0068] Among them, f j This indicates that the sliding window has moved to the updated signal data s = {s1, s2, ..., s...} i ,…,s n The j-th position is the offset value corresponding to the first numerical sequence within the window. The value of j is an integer ranging from 0 to (n-width) / p, where n represents the data length of the updated signal data (e.g., 5000), width represents the length of the preset window (e.g., 500), and p represents the preset step size (e.g., 50). jdenotes a matrix of length width that is the matrix of the jth first numerical sequence s i ,…,s n} with the subscript j*p to j*p+width, i.e., the jth first numerical sequence, i.e., s j =[s j*p ,s j*p+1 ,…,s j*p+wid ]; w=w width×1 =[1 / width,1 / width,…,1 / width]; o j denotes a matrix o j =[o k ,o j ,…,o j ] obtained by subtracting the corresponding offset value f j*p from each element s j*p+1 in the jth first numerical sequence s j*p+width , so that the first preprocessed data o=(o0...o j ...o n-wid / p ) can be obtained.

[0069] Specifically, referring to the principle example diagram of the sliding window algorithm shown in FIG. 3, the window of length width is slid through the updated signal data s={s1,s2,...,s i ,…,s n} with a step size p, and the offset value of the first numerical sequence in the window length range at each position is calculated every time the window is slid to a position. Then, the corresponding offset value is subtracted from each data point in the first numerical sequence in each range, so that the update of the first numerical sequence in the window can be realized. After the data sequence of the entire updated signal data s is updated, the first preprocessed data can be obtained. The sliding window algorithm is equivalent to a more refined normalization processing of the updated signal data. In an embodiment, the first preprocessing can also be normalization, standardization, removal of offset values, or denoising, etc. Referring to the corresponding description in the training method of the subsequent base recognition model, since the preprocessing of the sample data in the training process includes normalization processing and offset value elimination processing, similar preprocessing is performed in the application process, which can improve the prediction accuracy of the model inference application process.

[0070] S202, input the first preprocessed data into a pre-trained base recognition model, and use the base recognition model to extract features of the first preprocessed data to obtain data features of the first preprocessed data.

[0071] In one embodiment, the base recognition model at least includes a convolution module (for example, an adaptive step convolution module), an improved Conformer encoding module (for example, as shown in FIG. 4). Among them, the adaptive step convolution module can include a preset first number of one-dimensional convolution layers (1D-CNN\1D-conv), which is used for feature extraction of the first preprocessed data. The preset first number can be set according to actual needs, and can also be determined through the parameter optimization process in the model training process. For example, according to the model training process, it can be determined that the preset first number is 3 (for example, as shown in FIG. 4), indicating that the performance of the model obtained by using 3 1D-CNNs in the adaptive step convolution module is optimal.

[0072] Specifically, by sliding a window of a fixed size, the 1D-CNN can use the trained convolution kernel to perform convolution operation on the first preprocessed data in the window, thereby realizing local perception and feature extraction of the input data in the window, and then mapping the extracted features to the next layer. For example, the convolution module includes a plurality of convolution layers connected in sequence. Among them, the step length of the last convolution layer of the convolution module has a corresponding relationship between the data length (for example, L=5000) of the first preprocessed data and the number of bases contained in the longest base sequence label in the data set (for example, l=5). For example, the step length step of the last convolution layer of the convolution module is L / 1 of the data length of each historical signal data in the sample data / the number of bases contained in the longest base sequence label in the data set.

[0073] Among them, the data set represents the model training data set. For example, the data set can include a plurality of historical signal data, wherein each historical signal data can be a vector with a dimension of 1*5000; each historical signal data can have a corresponding base sequence label, and l represents the number of bases contained in the longest base sequence label in the data set. For example, there are three historical signal data in the data set, and the base sequence labels of the three historical signal data are AAAGC, AAGT, and TCG, respectively. Among them, the longest base sequence label is AAAGC, so l=5. Among them, A represents adenine (Adenine), T represents thymine (Thymine), G represents guanine (Guanine), and C represents cytosine (Cytosine)

[0074] In one embodiment, the convolution module includes a first convolution layer, a second convolution layer, and a third convolution layer connected in sequence.

[0075] The (input length, input dimension, output dimension, step) of the first convolutional layer is represented as (L, n1, n2, b1), wherein L represents the data length of the first pre-processed data, n1, n2, and b1 represent preset numerical values. For example, if L = 5000, n1 = 1, n2 = 4, and b1 = 1, the (input length, input dimension, output dimension, step) of the first convolutional layer is represented as (5000, 1, 4, 1), the input data is a 5000*1 matrix, that is, the dimension of each electrical signal value in 5000 electrical signal values is 1; the output dimension is 4, that is, the output matrix is a 5000*4 matrix, and the dimension of each electrical signal value becomes 4-dimensional. The size of each convolutional kernel in the first convolutional layer is 1*1, the number of convolutional kernels is 1*4, wherein 1 represents the input channel number and 4 represents the output channel number, and the step is 1.

[0076] The (input length, input dimension, output dimension, step) of the second convolutional layer is represented as (L, n2, n3, b1), wherein n3 represents a preset numerical value. For example, if L = 5000, n3 = 16, and b1 = 1, the (input length, input dimension, output dimension, step) of the second convolutional layer is represented as (5000, 4, 16, 1), the input data is a 5000*4 matrix, that is, the dimension of each electrical signal value in 5000 electrical signal values is 4; the output dimension is 16, that is, the output matrix is a 5000*16 matrix, and the dimension of each electrical signal value becomes 16-dimensional. The size of each convolutional kernel in the second convolutional layer is 1*1, the number of convolutional kernels is 4*16, wherein 4 represents the input channel number and 16 represents the output channel number, and the step is 1.

[0077] The (input length, input dimension, output dimension, step) of the third convolutional layer is represented as (L, n3, n3, step), wherein step = L / l, and l represents the number of bases contained in the longest base sequence label in the data set. For example, the (input length, input dimension, output dimension, step) of the third convolutional layer is represented as (5000, 16, 16, step), the input data is a 5000*16 matrix, that is, the dimension of each electrical signal value in 5000 electrical signal values is 16; the output dimension is 16, that is, the output matrix is a 5000*16 matrix, and the dimension of each electrical signal value becomes 16-dimensional. The size of each convolutional kernel in the third convolutional layer is 1*step, the number of convolutional kernels is 16*16, wherein 16 represents the input channel number and 16 represents the output channel number, and the step is step. The step directly determines that the length of the time dimension of the output matrix of the third convolutional layer is L / step = l, that is, the length satisfies the probability learning of all labels in the data set.

[0078] In one example, as shown in FIG. 4, an activation layer can be connected after each 1D-CNN, which can use a preset activation function (such as a Gelu (Gaussian Error Linear Unit) function) to perform element-wise nonlinear mapping on the feature representation output by the 1D-CNN, thereby learning more complex and nonlinear feature representations and improving the feature prediction and expression capabilities of the model. The Gelu function combines the characteristics of a Gaussian distribution and the nonlinear properties of a sigmoid function, and can achieve smooth, continuous, and derivable nonlinear transformation, compressing the negative part while keeping the positive part unchanged and maintaining high numerical stability, thereby better handling the problems of gradient vanishing and gradient explosion and improving model performance. In another example, other activation functions or approximate Gelu function formulas, such as a Fast Gelu function, can also be used to reduce computational complexity and improve the efficiency of nonlinear mapping.

[0079] In one embodiment, the Conformer encoding module is a model structure combining convolutional neural network (CNN) and Transformer. A general Conformer encoding module mainly consists of the following key components: (1) feedforward module: usually includes a linear normalization layer and an activation layer, which are used to preliminarily process and convert the input data, for example, the feedforward module can adopt a macaron-like structure, i.e., two feedforward layers are connected through a residual connection, which helps to alleviate the problem of gradient vanishing in deep neural networks; (2) native multi-head attention mechanism module: can adaptively weight different positions in the input sequence to obtain the importance of each position, for example, the multi-head self-attention module can use relative position encoding technology, which enables the model to more accurately capture the structural information in the input sequence. Relative position encoding is obtained by calculating the relative relationship between different positions in the input sequence, which helps the model to better generalize to inputs of different lengths; (3) native convolution operation module: responsible for capturing local features of input data, the convolution module can include gating mechanisms (such as point-wise convolution and gated linear units), one-dimensional deep convolution layers, and batch normalization operations; (4) linear normalization layer: residual connections and layer normalization operations can be used between the various parts of the Conformer encoding module to enhance the stability and training efficiency of the model. Residual connections help to alleviate the problem of gradient vanishing in deep neural networks, while layer normalization makes the training process of the model more stable.

[0080] Different from the related art, some embodiments of the present application propose an improved Conformer encoding module. The base recognition model is preset with a second number (for example, N in FIG. 4, for example, N = 4) of improved Conformer encoding modules. Specifically, an up-sampling full connection layer and a down-sampling full connection layer are added in the feedforward neural network in the improved Conformer encoding module, wherein: the up-sampling full connection layer is used to up-sample the feature data output by the adaptive step convolution module based on a preset up-sampling ratio, to obtain feature data of a preset dimension; and the down-sampling full connection layer is used to down-sample the feature data of the preset dimension, to restore the feature data of the preset dimension to the dimension of the feature data output by the adaptive step convolution module. The up-sampling full connection layer can improve the model feature perception ability, so that more feature parameters can be obtained; and the down-sampling full connection layer can scale the data to a preset dimension size.

[0081] For example, the feature dimension before up-sampling is the output dimension of the third convolution layer (L / step, batch size, 16), when the up-sampling ratio is r, the feature dimension after up-sampling is (L / step, batch size, r*16), and after down-sampling, it is restored to (L / step, batch size, 16), wherein L represents the data length of the input data (for example, 50000), l represents the number of bases contained in the longest base sequence label in the data set, and batch size represents the number of input data that the model network can process in one forward and backward propagation. In an embodiment, after the normalized feature vector output by the improved Conformer module is activated via a Softmax layer, the data feature of the first preprocessed data is obtained, for example, the data feature can be represented as a probability matrix with a dimension of L / step rows and 4^k columns, wherein k is the k value of the k-mer, such as 3.

[0082] Specifically, the k-mer represents the smallest encoding unit that the model can recognize, that is, each probability value in the probability matrix output by the model corresponds to the probability of a current k-mer, for example, the base sequence label is: GTCACC, and the k-mer encoding is [GTC, TCA, CAC, ACC], that is, a label with a length of J (for example, 6) can be replaced by an equivalent combination of J-2 (for example, 4) k-mers (k = 3) in sequence. If k = 3, the probability matrix output by the model is L / step = l rows and 4^3 = 64 columns, each row represents each step of actual decoding using the decoder subsequently, and each column represents the probability of occurrence of each k-mer at the current decoding step; since k takes 3, which represents taking three bases as an encoding, and each encoding can be composed of every 3 of the 4 bases A, T, C, and G, there are 64 different combinations corresponding to 4^3 = 64 columns.

[0083] Specifically, other introductions of the base recognition model can also be referred to the descriptions in the subsequent training method of the base recognition model. In other embodiments, the Conformer model of the base recognition model can be further fine-tuned, for example, the number of network layers and the parameters of the hidden layer.

[0084] S203, inputting the data features into a preset decoder, decoding the data features by using the decoder to obtain a base sequence corresponding to the signal data.

[0085] In one embodiment, the preset decoder includes a Connectionist Temporal Classification decoder (CTC decoder). Since the task of the decoder of the base recognition model is to output the classification result (for example, the base sequence) of the base corresponding to the entire signal data according to the data features of the first preprocessed data, and the dimensions of the data features of the first preprocessed data and the base recognition result may be different, the CTC decoder which can handle the case of incomplete alignment between the input (for example, the data features of the first preprocessed data) and the label (for example, the base sequence) can be used as the decoder of the base recognition model, thereby improving the recognition accuracy and robustness of the model.

[0086] For example, if the signal data is obtained by sequencing DNA, the dimension of the context feature vector of each time step of the signal data is 768, and the decoding and classification of the plurality of context feature vectors of the signal data can obtain a base sequence composed of the following 4 bases: Adenine (A), Thymine (T), Guanine (G), and Cytosine (C). Among them, the base sequence can be regarded as the label of the signal data or the plurality of context feature vectors of the signal data, and the dimension of the label may be different from the total dimension of the plurality of context feature vectors (for example, the dimension of the label is much smaller than the total dimension of the plurality of context feature vectors), and such a decoder is a decoder that can handle the decoding operation of the incomplete alignment between the input and the label.

[0087] In some embodiments, when the CTC decoder decodes the data features, a special blank marker (or placeholder) can be introduced to explore multiple candidate classification results at each time step using beam search algorithm, viterbi algorithm, etc., and the multiple candidate classification results can be aggregated and the most likely classification result can be selected according to the probability distribution and the parameters of the decoder, so as to obtain the base sequence corresponding to the signal data. For example, if the signal data is obtained by sequencing DNA, the multiple candidate classification results include: adenine A, thymine T, guanine G, cytosine C, and a placeholder, wherein the placeholder is used to solve the problem that the dimension of the input (for example, multiple context feature vectors) is larger than the dimension of the label (for example, the base sequence).

[0088] The base recognition method provided by the embodiments of the present application can improve the accuracy of recognizing the base sequence of the signal data by performing data normalization and low-frequency value offset removal on the signal data to obtain model input data, performing feature extraction on the input data by using the base recognition model, and decoding the data features by using the decoder.

[0089] The above embodiments introduce the application inference process of the base recognition model. Next, the base recognition model training method provided by the embodiments of the present application will be described. Referring to FIG. 5, a flowchart of the base recognition model training method provided by an embodiment of the present application is shown. The base recognition model training method is applied in an electronic device, for example, the electronic device 10 in FIG. 1, and specifically includes the following steps. According to different requirements, the order of the steps in the flowchart can be changed, and some steps can be omitted.

[0090] S301, collecting sample data, and performing second preprocessing on the sample data to obtain second preprocessed sample data.

[0091] In one embodiment, the sample data includes a plurality of historical signal data, and the method further includes collecting the historical signal data, including: collecting historical electric signal data obtained by nanopore sequencing of historical deoxyribonucleic acid (DNA) or historical ribonucleic acid (RNA), the historical electric signal data including time-varying electric signal amplitude data; and taking the historical electric signal data as the historical signal data. As described in S201, the electronic device can collect a plurality of historical electric signal data corresponding to a plurality of events detected by the event detector as the plurality of historical signal data, wherein each historical electric signal data corresponds to a historical DNA or a historical RNA.

[0092] In an embodiment, since the model training process can employ a supervised training method, the method can further include: obtaining a true base sequence of the historical DNA or the historical RNA corresponding to the historical electrical signal data; taking the true base sequence as a label of the corresponding historical electrical signal data to obtain labeled historical signal data.

[0093] In an embodiment, the second preprocessing method used by the model training process is different from the first preprocessing method used by the model inference process. Specifically, the second preprocessing includes: determining abnormal data in the sample data, eliminating abnormal data from the plurality of historical signal data to obtain a plurality of filtered historical signal data; performing normalization processing on each of the plurality of filtered historical signal data, and taking each of the normalized historical signal data as updated historical signal data; determining an offset value of a second numerical sequence in each preset window length range in the updated historical signal data based on a sliding window algorithm, and updating the second numerical sequence based on the offset value to obtain second preprocessed historical signal data.

[0094] In an embodiment, the determination of the abnormal data in the sample data includes: performing normalization processing on a plurality of electrical signal amplitudes of each of the plurality of historical signal data based on a preset kurtosis algorithm; determining a kurtosis value of each of the normalized historical signal data, and taking the historical signal data corresponding to the kurtosis value less than a preset kurtosis threshold as abnormal data.

[0095] In an embodiment, the kurtosis algorithm can include a fourth-order standard moment algorithm, and the formula used includes:

[0096] wherein the data sequence x = {x1, x2, …, x i ,…,x n} represents the frequency domain data corresponding to the historical signal data (for example, the frequency domain data obtained by performing Fast Fourier Transformation (FFT) on the historical signal data), x i represents the i-th frequency domain data in the frequency domain data corresponding to the historical signal data; μ represents the mean value corresponding to the frequency domain data x of the historical signal data, and σ represents the variance corresponding to the frequency domain data x of the historical signal data; the data sequence y = {y1, y2, …, y i ,…,y n} represents the updated frequency domain data obtained by performing normalization processing on the frequency domain data x corresponding to the historical signal data, represents the mean value corresponding to the updated frequency domain data y; K represents the kurtosis value corresponding to the frequency domain data x corresponding to the historical signal data; i = {1, 2, …, n}, n represents the total length of the signal data, and the value of n can be set according to actual needs, which is not specifically limited in the present application. For example, n takes a value of 5000.

[0097] In an embodiment, the preset kurtosis threshold can be set according to actual needs, which is not specifically limited in the present application. For example, the preset kurtosis threshold takes a value of 0.6, that is, the frequency domain data corresponding to the historical signal data with K < 0.6 can be filtered as abnormal data. In an example, as shown in FIG. 6, an example diagram of the frequency domain data distribution corresponding to the non-effective signal of the abnormal data (for example, the abnormal electrical signal data corresponding to the abnormal pore state) provided by the embodiment of the present application and an example diagram of the frequency domain data distribution corresponding to the effective signal of the normal data are shown. The horizontal axis represents the kurtosis, and the vertical axis represents the sample number. It can be seen that the kurtosis distribution of the frequency domain data corresponding to the non-effective signal is concentrated in the part less than 0.6, and the kurtosis distribution of the frequency domain data corresponding to the effective signal is concentrated in the part greater than or equal to 0.6. Therefore, the frequency domain data corresponding to the historical signal data with K < 0.6 can be filtered as abnormal data. In other embodiments, the peak threshold can also be adjusted by algorithm.

[0098] Referring to the description in S201, the second preprocessing is equivalent to performing abnormal filtering on the abnormal data in the sample data before the first preprocessing. The normalization processing and the offset value removal method based on the sliding window algorithm after that are similar to those used in the first preprocessing, which will not be repeated here.

[0099] By removing the invalid sample data based on the frequency domain data corresponding to the historical signal data, the data that fails to be filtered by the event detector, such as the electrical signal data corresponding to the non-base sequence, for example, the abnormal electrical signal data corresponding to the abnormal pore state caused by the blockage of the nucleic acid passing through the biological nanopore, can be filtered out, thereby improving the quality of the training sample and further improving the accuracy of the model.

[0100] By performing normalization processing on the sample data after abnormal filtering, the model can focus more on the internal mode and relationship of the signal data, rather than being affected by the numerical size of the signal data, which helps to improve the generalization ability and prediction accuracy of the model, so that the model can better adapt to new data and unknown situations. In addition, the signal data can also be adjusted to a suitable numerical range, thereby accelerating the convergence process of the model and improving the training efficiency of the model.

[0101] By removing the offset value from the normalized sample data based on the sliding window algorithm, the low-frequency offset value in the signal data can be removed, and the problem that the current global amplitude offset and scaling preprocessing method cannot remove the existing low-frequency amplitude offset of the long electrical signal sequence is solved.

[0102] In S302, the preset model is trained based on the second preprocessed sample data to obtain a base recognition model meeting preset requirements.

[0103] In one embodiment, a supervised training method can be used to train the preset model based on the second preprocessed sample data. Specifically, the second preprocessed sample data can be used to perform at least one iteration update on the preset model. In each update of the at least one iteration update, the data in a batch corresponding to each update in the second preprocessed sample data can be used for updating. If the preset model obtained by the update does not meet the preset requirements, the next batch of data in the first set is used for the next update, until the preset model meeting the preset requirements is obtained as the base recognition model.

[0104] In one embodiment, the preset requirements can include, but are not limited to, one or more combinations of the following requirements: the loss function corresponding to the preset model meets the preset convergence condition; the number of the at least one iteration update reaches the preset iteration number threshold; the average accuracy of the model prediction result obtained by the preset model is greater than the preset accuracy threshold; the median of the accuracy of the model prediction result obtained by the preset model is greater than the preset median threshold; the total time consumed by the preset model for predicting a preset number of historical data sequences is less than the preset time threshold.

[0105] In an example, the results of verifying the base recognition model using 1318 pieces of verification set data are shown in FIG. 7, where the accuracy calculation method is: accuracy = number of correctly interpreted bases / reference sequence length; “mean” represents the average accuracy; “median” represents the accuracy median; “took time” represents the time (unit: seconds) taken to interpret 1318 sequences; “speed (samples / sec)” represents the number of current signals processed per second; “speed (bases / sec)” represents the number of bases interpreted per second; “val_chunks_num” represents the number of chunks (one chunk is one second of current signal) of the verification set. It can be seen that the base recognition model can have a high prediction accuracy while ensuring the prediction efficiency, and the performance of the model is very good.

[0106] In an embodiment, the base recognition model comprises a convolution module (for example, an adaptive step convolution module), and an improved Conformer encoding module (for example, as shown in FIG. 4), wherein the adaptive step convolution module comprises a first convolution layer, a second convolution layer, and a third convolution layer, wherein: the (input length, input dimension, output dimension, step) of the first convolution layer is represented as (L, 1, 4, 1), wherein L represents the data length of each historical signal data in the sample data; the (input length, input dimension, output dimension, step) of the second convolution layer is represented as (L, 4, 16, 1); and the (input length, input dimension, output dimension, step) of the third convolution layer is represented as (L, 16, 16, step), wherein step = L / l, and l represents the number of bases contained in the longest base sequence label in the data set. Other descriptions of the base recognition model can be referred to the description in S202.

[0107] The base recognition model training method provided by the embodiments of the present application proposes a preprocessing method for the base call scene, solves the problem that the current global amplitude offset and scaling processing method cannot remove the existing low-frequency amplitude offset of the long electrical signal sequence; determines the receptive field and step of one-dimensional convolution according to the ratio of k-mer, electrical signal length, and actual base number, and proposes an optimized Conformer structure to solve the problems of insufficient feature expression capability and no support for parallel computing when using LSTM in the base call process, improve the data parallel computing capability and data feature acquisition capability, and improve the accuracy of base call.

[0108] In an embodiment, the hardware environment and software development environment used in the model training process in the embodiments of the present application can be shown as follows in Table 1:

[0109] Table 1

[0110] Model training assisted by a graphics processing unit (GPU) and a central processing unit (CPU) can effectively improve the training efficiency of the model.

[0111] FIG. 8 is an example diagram of a data loading process provided by an embodiment of the present application. The present application uses a multi-machine multi-card data loading method, wherein the worker is a data loading process, different blocks represent non-repeated training data, and the number of GPUs is n.

[0112] FIG. 9 is a structural diagram of a base recognition device provided by an embodiment of the present application.

[0113] In some embodiments, the base recognition device 70 can include a plurality of function modules composed of computer program segments. The computer programs of each program segment in the base recognition device 70 can be stored in the memory of an electronic device and executed by at least one processor to perform the functions of base recognition (see Figure 2 for details).

[0114] In this embodiment, the base recognition device 70 can be divided into a plurality of function modules according to the functions it performs. The function modules can include a preprocessing module 701, a feature extraction module 702, and a decoding module 703. The module referred to in this application refers to a series of computer program segments that can be executed by at least one processor and can complete a fixed function, which are stored in the memory. In this embodiment, the function implementation of each module of the base recognition device 70 can be referred to the above definition of the base recognition method, which will not be described here.

[0115] The preprocessing module 701 is configured to perform first preprocessing on the signal data to obtain first preprocessed data.

[0116] The feature extraction module 702 is configured to input the first preprocessed data into a pre-trained base recognition model, and use the base recognition model to extract features of the first preprocessed data to obtain data features of the first preprocessed data.

[0117] The decoding module 703 is configured to input the data features into a preset decoder, and use the decoder to decode the data features to obtain a base sequence corresponding to the signal data.

[0118] In another embodiment, the application also provides a base recognition model training device, which can include a plurality of function modules composed of computer program segments. The computer programs of each program segment in the base recognition model training device can be stored in the memory of an electronic device and executed by at least one processor to perform the functions of base recognition model training (see Figure 5 for details). The function implementation of each module of the base recognition model training device can be referred to the above definition of the base recognition model training method, which will not be described here.

[0119] The application also provides a computer readable storage medium, which stores a computer program. The computer program includes program instructions. The method implemented by the program instructions can refer to the method in each embodiment of the application.

[0120] The computer readable storage medium can be an internal storage of the electronic device, such as a hard disk or a memory of the electronic device. The computer readable storage medium can also be an external storage of the electronic device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, and the like.

[0121] In some embodiments, the computer readable storage medium can include a program storage area and a data storage area. The program storage area can store an operating system, an application required by at least one function, and the like. The data storage area can store data created according to use of the electronic device, and the like.

[0122] In the above embodiments, the description of each embodiment has its own focus. The parts not described or recorded in detail in a certain embodiment can be referred to the relevant description of other embodiments.

[0123] Those skilled in the art can understand that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be realized by electronic hardware or a combination of computer software and electronic hardware. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0124] In the embodiments provided in the present application, it should be understood that the disclosed apparatus / terminal device and method can be implemented by other ways. For example, the apparatus / terminal device embodiments described above are only schematic, for example, the division of the modules or units is only a logical function division, and there can be another division manner in actual implementation, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the display or discussion of the mutual coupling or direct coupling or communication connection between the units can be indirect coupling or communication connection through some interfaces, devices or units, and can be electrical, mechanical or other forms.

[0125] The units described as separate components can or can not be physically separate, and the components displayed as units can or can not be physical units, that is, they can be located in one place, or can be distributed on a plurality of network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the present embodiment.

[0126] The above-described embodiments are only used to illustrate the technical solutions of the present application, but not limit them; although the present application is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement to part of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.

Claims

1. A base calling method, characterized by, The method comprises: performing first preprocessing on signal data to obtain first preprocessed data; inputting the first preprocessed data into a pre-trained base recognition model, using the base recognition model to extract features of the first preprocessed data, and obtaining data features of the first preprocessed data; inputting the data features into a preset decoder, using the decoder to decode the data features, and obtaining a base sequence corresponding to the signal data.

2. The base calling method of claim 1, wherein, The method further comprises collecting the signal data, comprising: collecting electrical signal data obtained by nanopore sequencing of deoxyribonucleic acid (DNA) or ribonucleic acid (RNA), the electrical signal data comprising a plurality of electrical signal amplitude data varying over time; using the electrical signal data as the signal data.

3. The base calling method according to claim 1 or 2, characterized in that, The first preprocessing comprises: normalizing the plurality of electrical signal amplitude data in the signal data, and using the normalized signal data as updated signal data; determining an offset value of a first numerical sequence in each preset window length range in the updated signal data based on a sliding window algorithm, and updating the first numerical sequence based on the offset value to obtain the first preprocessed data.

4. The base calling method of claim 1, wherein, The base recognition model comprises a convolution module, and the convolution module comprises a plurality of convolution layers connected in sequence, wherein the step length of the last convolution layer of the convolution module and the data length of the first preprocessed data and the number of bases contained in the longest base sequence label in the data set have a corresponding relationship.

5. The base calling method of claim 1, wherein, The base recognition model comprises a convolution module, and the convolution module comprises a first convolution layer, a second convolution layer, and a third convolution layer, wherein: the (input length, input dimension, output dimension, step length) of the first convolution layer is represented as (L, n1, n2, b1), wherein L represents the data length of the first preprocessed data, n1, n2, and b1 represent preset numerical values; the (input length, input dimension, output dimension, step length) of the second convolution layer is represented as (L, n2, n3, b1), wherein n3 represents a preset numerical value; the (input length, input dimension, output dimension, step length) of the third convolution layer is represented as (L, n3, n3, step), wherein step = L / l, and l represents the number of bases contained in the longest base sequence label in the data set.

6. The base calling method of claim 1, wherein, The base recognition model comprises a Conformer encoding module, and the Conformer encoding module comprises a feedforward neural network, and the feedforward neural network comprises an up-sampling full connection layer and a down-sampling full connection layer, wherein: the up-sampling full connection layer is used to up-sample feature data output by the convolution module based on a preset up-sampling ratio to obtain feature data of a preset dimension; the down-sampling full connection layer is used to down-sample the feature data of the preset dimension to restore the feature data of the preset dimension to the dimension of the feature data output by the convolution module. The preset decoder comprises a connection time sequence classification (CTC) decoder.

7. The base calling method of claim 1, wherein, The method comprises: 8.A base recognition model training method, characterized in that, collecting sample data, performing second preprocessing on the sample data, and obtaining second preprocessed sample data; ​ Train the preset model based on the second preprocessed sample data to obtain a base recognition model meeting preset requirements.

9. The base calling model training method of claim 8, wherein, The sample data includes a plurality of historical signal data, and the second preprocessing includes: Determining abnormal data in the sample data, and removing abnormal data from the plurality of historical signal data to obtain a plurality of filtered historical signal data; Normalizing each of the plurality of filtered historical signal data, and taking each of the normalized historical signal data as updated historical signal data; Based on a sliding window algorithm, determining an offset value of a second value sequence in each preset window length range of the updated historical signal data, and updating the second value sequence based on the offset value to obtain second preprocessed historical signal data.

10. The base calling model training method of claim 9, wherein, The method further includes collecting the historical signal data, including: Collecting historical electrical signal data obtained by nanopore sequencing of historical deoxyribonucleic acid (DNA) or historical ribonucleic acid (RNA), the historical electrical signal data including electrical signal amplitude data varying over time; Taking the historical electrical signal data as the historical signal data.

11. The base calling model training method of claim 9, wherein, The determination of the abnormal data in the sample data includes: Based on a preset kurtosis algorithm, normalizing a plurality of electrical signal amplitudes of each historical signal data in the plurality of historical signal data; Determining the kurtosis value of each normalized historical signal data, and taking the historical signal data corresponding to the kurtosis value less than a preset kurtosis threshold as abnormal data.

12. The base calling model training method of claim 8, wherein, The preset model includes a convolution module, and the convolution module includes a first convolution layer, a second convolution layer, and a third convolution layer, wherein: The (input length, input dimension, output dimension, step) of the first convolution layer is represented as (L, n1, n2, b1), wherein L represents the data length of each historical signal data in the sample data, n1, n2, and b1 represent preset values; The (input length, input dimension, output dimension, step) of the second convolution layer is represented as (L, n2, n3, b1), wherein n3 represents a preset value; The (input length, input dimension, output dimension, step) of the third convolution layer is represented as (L, n3, n3, step), wherein step = L / l, and l represents the number of bases contained in the longest base sequence label in the data set.

13. The base calling model training method of claim 8, wherein, The preset model includes an improved Conformer encoding module, and the improved Conformer encoding module includes a feedforward neural network, and the feedforward neural network includes an upsampling fully connected layer and a downsampling fully connected layer, wherein: The upsampling fully connected layer is configured to upsample feature data output by the convolution module based on a preset upsampling ratio to obtain feature data of a preset dimension; The downsampling fully connected layer is configured to downsample the feature data of the preset dimension to restore the feature data of the preset dimension to the dimension of the feature data output by the convolution module.

14. The base calling model training method of claim 8, wherein, The preset requirements include one or more combinations of the following requirements: The average accuracy of the model prediction result obtained by the preset model is greater than a preset accuracy threshold; A median of accuracy of a model prediction result obtained by the preset model is greater than a preset median threshold. A total time consumed by the preset model for predicting a preset number of historical data sequences is less than a preset time length threshold.

15. An electronic device, comprising: The electronic device comprises a processor and a memory, and the processor is configured to execute a computer program stored in the memory to implement the base recognition method according to any one of claims 1 to 7 or implement the base recognition model training method according to any one of claims 8 to 14.

Citation Information

Patent Citations

  • Method for quickly identifying single-molecule nanopore sequencing bases based on deep network

    CN112183486A

  • Base identification method and device for nanopore sequencing based on Transform architecture and storage medium

    CN118038972A

  • Formation and calibration of nanopore sequencing cells

    US20170370903A1

  • Analysis of nanopore signal using a machine-learning technique

    US20200176082A1

  • Calibration and profiling of a nanopore array device

    US20230296582A1