A high-performance gene matching discrimination method and system based on feature vectors
Through a high-performance gene matching discrimination method based on feature vectors, using CPU multi-threading and GPU to calculate the centroid value, combined with DNN model training, the problems of slow speed and high computing power requirements in genome assembly and alignment are solved, and efficient and accurate gene matching discrimination is achieved.
Patent Information
- Application Number
- CN202211034348.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-26
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2042-08-26
AI Technical Summary
In the existing genome assembly and reference genome comparison process, finding the similarity of sequencing fragment reads and aligning the front and back overlaps is slow and requires a lot of computing power, resulting in excessively high costs.
A high-performance gene matching discrimination method based on feature vectors is adopted, and CPU multi-threading is used to parse gene data. In combination with GPU calculation of centroid values and DNN model training, unsupervised machine learning and neural network fuzzy matching algorithm are used to achieve base sequence similarity evaluation and matching alignment.
It achieves low-cost and high-performance matching and discrimination of genetic data, improves the speed and accuracy of the genome analysis process, and can obtain accurate analysis results more quickly.
Smart Images

Figure CN115410651B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of bioinformatics, and in particular relates to a high-performance gene matching discrimination method and system based on feature vectors. Background Art
[0002] Since Roche launched its first second-generation sequencer, the Roche 454, in 2005, life sciences have officially entered the era of high-throughput sequencing. The introduction of Illumina's sequencing platforms has significantly reduced the price of second-generation sequencing, making high-throughput sequencing widely available across various life science research fields. To this day, second-generation short-read sequencing technology maintains a dominant position in the global sequencing market.
[0003] In the field of bioinformatics, finding gene sequence similarities is a core issue in genome analysis. Although second-generation sequencing technology has greatly increased sequencing throughput, the individual sequences it obtains are very short, often only 50 to 300 base pairs. Furthermore, due to the deeper sequencing coverage, the number of sequences that need to be processed in genome projects has increased rapidly. These shorter sequences need to be aligned front-to-back to enable the splicing of longer sequences and back-to-back comparison with reference genomes.
[0004] Currently, due to the limitations of alignment technology and the complexity of actual situations, the computing power required for final alignment and matching is prohibitively high. The mainstream algorithms for pairwise alignment are Blast and dynamic programming. Blast uses a heuristic algorithm (seed-extend), which consumes significant computing power during the process of extending the seed to both sides. Dynamic programming is significantly affected by the scoring matrix and, as a global alignment in pairwise alignment, cannot achieve head-to-tail matching and splicing. Summary of the Invention
[0005] The purpose of the present invention is to provide a multi-threaded method and system for genome assembly to solve the technical problems of slow speed and high computing power requirement in finding similarity and front-back overlap alignment of sequencing fragment reads in genome assembly and reference genome comparison.
[0006] The purpose of the present invention is to adopt the following technical solution to achieve: a high-performance gene matching discrimination method based on feature vectors, comprising the following steps:
[0007] S1: CPU multi-threaded gene analysis, obtains the ID, base sequence and sequence length of gene data reads, and transmits them back to the GPU;
[0008] S2: GPU calculates the centroid value of each gene data read fragment;
[0009] S3: Randomly select two base sequences for alignment and score the matching results to evaluate the similarity of the base sequences;
[0010] S4: The two sets of centroid values and sequence lengths of the two base sequences are transformed to within [-1, 1] through linear feature scaling and used as the input vector x of the data set;
[0011] S5: Output the result of the alignment of the two base sequences as the output vector of the data set;
[0012] S6: Training the DNN model: Send the input vector x to the input layer of the DNN network for forward propagation, and obtain the forward output y' after passing through several hidden layers;
[0013] S7: Calculate the error between y' and the true value y, and adjust the connection weights of the DNN network;
[0014] S8: After completing the training of the DNN model, the trained DNN model is used to identify the matching relationship between the genetic data reads, thereby obtaining the similarity relationship between each genetic data read.
[0015] Furthermore, step S1 specifically includes: the CPU uses a built-in RAID card or NFS protocol or directly reads the gene sequencing data file to perform multi-threaded parallel calculation of gene analysis to obtain the ID, base sequence and sequence length of the gene data reads sequence, and reads the base sequence from different positions, that is: trimming the head and tail of each gene data read by n and m bases respectively, to obtain gene data reads fragments with n bases removed from the head and tail and m bases removed from the head and tail respectively, and transmits the gene data reads fragments and corresponding ID numbers back to the GPU.
[0016] Furthermore, step S2 specifically includes: using asynchronous operation, when the GPU receives a gene data reads fragment, immediately starting the kernel function without waiting for all data to be returned, and calculating the centroid feature value of each gene data reads fragment through the gene numerical expression algorithm, where a gene data read has a total of four centroid values.
[0017] Furthermore, step S3 specifically includes: randomly selecting two base sequences for matching and alignment, and scoring the matching results to evaluate the similarity of the base sequences. If the similarity score is above 0.8, it is considered that the two base sequences can be matched, otherwise they cannot.
[0018] Furthermore, step S4 specifically includes: transforming two groups of 8 front and back centroid values of the two base sequences and ten components of their sequence lengths to within [-1, 1] through linear feature scaling as the input vector x of the data set.
[0019] Furthermore, the step S5 specifically includes: outputting the result of the alignment of the two base sequences, returning TRUE (y=1) if the two base sequences are aligned, and returning FALSE (y=0) if the two base sequences are not aligned, with y serving as the output vector of the data set.
[0020] Furthermore, the step S6 specifically includes:
[0021] S61: Before training, first set a random distribution with a mean of 0 to initialize the network weights;
[0022] S62: During training, the input vector x is first sent to the input layer of the DNN network for forward propagation, and the forward output y' is obtained after passing through several hidden layers.
[0023] Furthermore, step S7 specifically includes: calculating the error between y' and the true value y, and then backpropagating the error from the output layer to the first hidden layer, and adjusting each connection weight of the DNN network in the direction of reducing the error.
[0024] Furthermore, step S8 specifically includes: continuously looping the process of adjusting the weights in step S7 until the training error converges to a minimum value, that is, obtaining the DNN network weights that meet the requirements, and using the trained DNN model to identify the matching relationship between the genetic data reads, thereby obtaining the similarity relationship between each genetic data read.
[0025] A high-performance gene matching discrimination system based on feature vectors includes a gene analysis module, a data set generation module, and a neural network model training module. The gene analysis module is used to extract base sequences, IDs, and sequence lengths; the data set generation module is used to calculate feature values before and after gene data reads and match results; and the neural network model training module is used to train using the data set and adjust network connection weights to obtain a neural network model with minimal convergence error and the highest accuracy.
[0026] The beneficial effects of the present invention are: the present invention creatively proposes a high-performance gene matching discrimination method and system based on feature vectors, which completes low-cost and high-performance matching discrimination of gene sequencing data. Compared with previous matching methods, the present invention does not use scoring matrices and sequence indexes, but digitizes the sequencing bases through unsupervised machine learning and other methods, and converts the similarity relationship of sequence matching into the similarity relationship between feature values through a neural network fuzzy matching algorithm, thereby realizing the front-to-back matching alignment of gene data, so as to realize the splicing of longer sequences and the reply comparison of reference genomes. In short, the present invention is a gene matching discrimination solution that integrates high precision, high performance and high efficiency, which greatly improves the speed of the bioinformatics analysis process and helps bioinformatics analysts to obtain accurate analysis results at a faster speed and in a shorter time. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the structures shown in these drawings without paying any creative work.
[0028] Figure 1 A flowchart for the invention;
[0029] Figure 2 This is a system block diagram of the present invention. DETAILED DESCRIPTION
[0030] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions of the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings herein can be arranged and designed in various different configurations.
[0031] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, it does not need to be further defined or explained in subsequent drawings.
[0032] The following embodiments of the present invention are described in detail with reference to the accompanying drawings. In the absence of conflict, the following embodiments and features in the embodiments may be combined with each other.
[0033] Example 1:
[0034] See Figure 1, a high-performance gene matching discrimination method based on feature vectors, comprising the following steps:
[0035] S1: CPU multi-threaded gene analysis, obtains the ID, base sequence and sequence length of gene data reads, and transmits them back to the GPU;
[0036] S2: GPU calculates the centroid value of each gene data read fragment;
[0037] S3: Randomly select two base sequences for alignment and score the matching results to evaluate the similarity of the base sequences;
[0038] S4: The two sets of centroid values and sequence lengths of the two base sequences are transformed to within [-1, 1] through linear feature scaling and used as the input vector x of the data set;
[0039] S5: Output the result of the alignment of the two base sequences as the output vector of the data set;
[0040] S6: Training the DNN model: Send the input vector x to the input layer of the DNN network for forward propagation, and obtain the forward output y' after passing through several hidden layers;
[0041] S7: Calculate the error between y' and the true value y, and adjust the connection weights of the DNN network;
[0042] S8: After completing the training of the DNN model, the trained DNN model is used to identify the matching relationship between the genetic data reads, thereby obtaining the similarity relationship between each genetic data read.
[0043] In this embodiment, the step S1 specifically includes: the CPU uses a built-in RAID card or NFS protocol or directly reads the gene sequencing data file to perform multi-threaded parallel calculation of gene analysis to obtain the ID, base sequence and sequence length of the gene data reads sequence, and reads the base sequence from different positions, that is: each gene data read is trimmed of n and m bases at the beginning and end, to obtain gene data reads fragments with n bases removed from the beginning and m bases removed from the end, and the gene data reads fragments and corresponding ID numbers are returned to the GPU. Furthermore, step S1 can be regarded as gene analysis of sequencing fragment reads, the purpose of which is to obtain base sequence, ID, and sequence length. The CPU reads the contents of the FASTQ file line by line and removes special characters at the beginning and end of the line; the special characters include space characters and carriage return characters. To obtain base sequence information, obtain the last line in the file that begins with the character @. After obtaining the base sequence, trim the sequence from the beginning to n and from the end to m bases, respectively, to obtain read fragments with n bases removed from the beginning and m bases removed from the end. Then replace the line that begins with the character @ with the custom ID number of this read, retaining the value in the "length=number" field, which represents the sequence length, and pass the above information to the GPU.
[0044] In this embodiment, step S2 specifically includes: using asynchronous operation, when the GPU receives the gene data reads fragment, immediately starting the kernel function without waiting for all data to be returned, and calculating the centroid feature value of each gene data reads fragment through the gene numerical expression algorithm, where a gene data read has a total of four centroid values.
[0045] In this embodiment, step S3 specifically includes: randomly selecting two base sequences for matching and alignment, and scoring the matching results to evaluate the similarity of the base sequences. If the similarity score is above 0.8, that is, there are 80% or more completely matched bases in the overlapping part, then the two base sequences are considered to be able to match, otherwise they are not.
[0046] In this embodiment, step S4 specifically includes: transforming two groups of 8 front and back centroid values of the two base sequences and ten components of their sequence lengths to within [-1, 1] through linear feature scaling as the input vector x of the data set.
[0047] In this embodiment, step S5 specifically includes: outputting the result of aligning the two base sequences, returning TRUE (y=1) if the two sequences are aligned, and returning FALSE (y=0) if the two sequences are not aligned, where y serves as the output vector of the data set.
[0048] Furthermore, steps S2-S5 can be considered as the generation of a neural network model dataset, aiming to obtain the input vectors required for neural network model training. The GPU uses unsupervised machine learning methods to convert each read segment mapping into centroid features. A read has four centroid values. Two sequences are randomly selected for alignment and the matches are scored to assess sequence similarity. If the similarity score is above 0.8, the two sequences are considered compatible; otherwise, they are not compatible. The two groups of eight front and back centroid values of the two sequences and their ten components, including their sequence lengths (the centroid coordinates of the first sequence with the first n bases removed (x1, y1), the centroid coordinates of the first sequence with the tail n bases removed (x2, y2), the centroid coordinates of the first sequence with the first m bases removed (x3, y3), the centroid coordinates of the first sequence with the tail m bases removed (x4, y4), the centroid coordinates of the second sequence with the first n bases removed (x5, y5), the centroid coordinates of the second sequence with the tail n bases removed (x6, y6), the centroid coordinates of the second sequence with the first m bases removed (x7, y7), the centroid coordinates of the second sequence with the tail m bases removed (x8, y8), the length of the first sequence length1, and the length of the second sequence length2) are transformed to within [-1, 1] through linear feature scaling and used as the input vector x of the dataset. Output the alignment of the two sequences. If they are aligned (similar), return TRUE, y=1; if they are not aligned (dissimilar), return FALSE, y=0. y is used as the output vector of the dataset. This yields the dataset required for the neural network model.
[0049] In this embodiment, step S6 specifically includes:
[0050] S61: Before training, first set a random distribution with a mean of 0 to initialize the network weights;
[0051] S62: During training, the input vector x is first sent to the input layer of the DNN network for forward propagation, and the forward output y' is obtained after passing through several hidden layers.
[0052] In this embodiment, step S7 specifically includes: calculating the error between y' and the true value y, then backpropagating the error from the output layer to the first hidden layer, and adjusting each connection weight of the DNN network in the direction of reducing the error.
[0053] In this embodiment, step S8 specifically includes: continuously looping the process of adjusting the weights in step S7 until the training error converges to a minimum value, that is, obtaining the DNN network weights that meet the requirements, and using the trained DNN model to identify the matching relationship between the genetic data reads, thereby obtaining the similarity relationship between each genetic data read.
[0054] Furthermore, steps S6-S8 can be considered as the training process of the neural network model. Before training, a random distribution with a mean of 0 is first set to initialize the network weights. During training, the input vector x is first sent to the input layer of the DNN network for forward propagation. After passing through several hidden layers, the forward output y' is obtained. The error between y' and the true value y is calculated, and then the error is backpropagated from the output layer to the first hidden layer, and the various connection weights of the network are adjusted in the direction of reducing the error. The process of adjusting the weights in step S7 is continuously repeated until the training error converges to a minimum value, that is, the DNN network weights that meet the requirements are obtained. The trained DNN model is used to identify the matching relationship between the sequencing file reads, thereby obtaining the similarity relationship between each read.
[0055] See Figure 2 Based on the same inventive concept, the present invention also provides a high-performance gene matching discrimination system based on feature vectors to implement the above-mentioned high-performance gene matching discrimination method based on feature vectors. The system includes a gene analysis module, a data set generation module, and a neural network model training module, wherein the gene analysis module is used to extract base sequences, IDs, and sequence lengths; the data set generation module is used to calculate feature values before and after gene data reads fragments and calculate matching results; the neural network model training module is used to train through data sets and adjust network connection weights to obtain a neural network model with extremely small convergence error and the highest accuracy.
[0056] The present invention has at least the following technical effects:
[0057] The present invention creatively proposes a high-performance gene matching discrimination method and system based on feature vectors, which completes low-cost and high-performance matching discrimination of gene sequencing data. Compared with previous matching methods, the present invention does not use scoring matrices and sequence indexes, but digitizes the sequencing bases through unsupervised machine learning and other methods, and converts the similarity relationship of sequence matching into the similarity relationship between feature values through a neural network fuzzy matching algorithm, thereby realizing the front-to-back matching alignment of gene data, so as to achieve splicing of longer sequences and reply comparison of reference genomes. In short, the present invention is a gene matching discrimination solution that integrates high precision, high performance and high efficiency, which greatly improves the speed of the bioinformatics analysis process and helps bioinformatics analysts obtain accurate analysis results at a faster speed and in a shorter time.
[0058] It should be noted that for the aforementioned embodiments, for simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that this application is not limited by the order of the actions described, because according to this application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are preferred embodiments, and the actions involved are not necessarily required by this application.
[0059] The above embodiments describe the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The above embodiments and descriptions are merely illustrative of the principles of the present invention. Without departing from the spirit and scope of the present invention, modifications and variations made by those skilled in the art without departing from the spirit and scope of the present invention should be within the scope of protection of the appended claims.
Claims
1. A high-performance gene matching discrimination method based on feature vectors, characterized in that: The steps include: S1: CPU multi-threaded gene parsing, obtains the ID, base sequence, and sequence length of the gene data reads, and transmits them back to the GPU; Step S1 specifically includes: the CPU uses a built-in RAID card or NFS protocol or directly reads the gene sequencing data file to perform multi-threaded parallel gene parsing to obtain the ID, base sequence, and sequence length of the gene data read sequence, and reads the base sequence from different positions, that is, trims the head and tail of each gene data read by n and m bases respectively, to obtain gene data read fragments with n bases removed from the head and tail, and m bases removed from the head and tail, respectively, and transmits the gene data read fragments and corresponding ID numbers back to the GPU; S2: The GPU calculates the centroid value of each gene data read segment. Step S2 specifically includes: using asynchronous operation, when the GPU receives the gene data read segment, it immediately starts the kernel function without waiting for all data to be returned, and calculates the centroid feature value of each gene data read segment through the gene numerical expression algorithm, where a gene data read has a total of four centroid values; S3: Randomly select two base sequences for alignment and score the matching results to evaluate the similarity of the base sequences; S4: The two sets of centroid values and sequence lengths of the two base sequences are transformed to within [-1, 1] through linear feature scaling and used as the input vector x of the data set; S5: Output the result of the alignment of the two base sequences as the output vector of the data set; S6: Training the DNN model: Send the input vector x to the input layer of the DNN network for forward propagation, and obtain the forward output y' after passing through several hidden layers; S7: Calculate the error between y' and the true value y, and adjust the connection weights of the DNN network; S8: After completing the training of the DNN model, the trained DNN model is used to identify the matching relationship between the genetic data reads, thereby obtaining the similarity relationship between each genetic data read; step S8 specifically includes: continuously looping the process of adjusting the weights in step S7 until the training error converges to a minimum value, that is, obtaining the DNN network weights that meet the requirements, and using the trained DNN model to identify the matching relationship between the genetic data reads, thereby obtaining the similarity relationship between each genetic data read.
2. A high-performance gene matching discrimination method based on feature vectors as claimed in claim 1, characterized in that: The step S3 specifically includes: randomly selecting two base sequences for matching and alignment, and scoring the matching results to evaluate the similarity of the base sequences. If the similarity score is above 0.8, it is considered that the two base sequences can be matched, otherwise they cannot.
3. A high-performance gene matching discrimination method based on feature vectors as claimed in claim 1, characterized in that: The step S4 specifically includes: transforming two groups of 8 front and back centroid values of the two base sequences and ten components of their sequence lengths to within [-1, 1] through linear feature scaling, and using them as the input vector x of the data set.
4. A high-performance gene matching discrimination method based on feature vectors as claimed in claim 1, characterized in that: The step S5 specifically includes: outputting the result of the alignment of the two base sequences, returning TRUE (y=1) if the two base sequences are aligned, and returning FALSE (y=0) if the two base sequences are not aligned, with y serving as the output vector of the data set.
5. A high-performance gene matching discrimination method based on feature vectors as claimed in claim 1, characterized in that: The step S6 specifically includes: S61: Before training, first set a random distribution with a mean of 0 to initialize the network weights; S62: During training, the input vector x is first sent to the input layer of the DNN network for forward propagation, and the forward output y' is obtained after passing through several hidden layers.
6. A high-performance gene matching discrimination method based on feature vectors as claimed in claim 1, characterized in that: The step S7 specifically includes: calculating the error between y' and the true value y, then backpropagating the error from the output layer to the first hidden layer, and adjusting each connection weight of the DNN network in the direction of reducing the error.
7. A high-performance gene matching discrimination system based on feature vectors, used to implement the high-performance gene matching discrimination method based on feature vectors according to any one of claims 1 to 6, characterized in that: It includes a gene analysis module, a data set generation module, and a neural network model training module. The gene analysis module is used to extract base sequences, IDs, and sequence lengths; the data set generation module is used to calculate feature values before and after gene data reads and match results; and the neural network model training module is used to train through the data set and adjust network connection weights to obtain a neural network model with minimal convergence error and the highest accuracy.