Multi-stage gene data accurate matching method and system

By employing a multi-stage gene data precise matching method, and utilizing the collaborative work of Kmer-Index, FM-Index, and Direct-Index algorithms, the high resource consumption and low speed issues in the seed search stage are resolved, achieving faster gene alignment and higher memory utilization efficiency, making it suitable for large-scale genome data processing and precision medicine.

CN121983128APending Publication Date: 2026-05-05INST OF COMPUTING TECH CHINESE ACAD OF SCI
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
INST OF COMPUTING TECH CHINESE ACAD OF SCI
Filing Date
2025-12-31
Publication Date
2026-05-05

AI Technical Summary

Technical Problem

Existing gene sequence alignment technologies consume too much runtime in the seed search stage, and existing indexing algorithms struggle to balance hardware resource requirements and search speed. In particular, the Kmer-Index algorithm has a huge memory footprint, and the FM-Index algorithm's search speed is limited by irregular memory access.

Method used

A multi-stage gene matching method is adopted, which uses Kmer-Index, FM-Index and Direct-Index algorithms. The three indexing strategies work together to divide the seed search process into three stages based on the statistical characteristics of gene data, and use different index structures and algorithms for each stage to optimize memory efficiency and search speed.

Benefits of technology

It achieves faster seed search under limited hardware resources, reduces memory usage and low cache hit rate caused by irregular memory access, optimizes the overall performance and resource consumption of gene alignment, and is suitable for large-scale genomic data processing and precision medicine scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121983128A_ABST
    Figure CN121983128A_ABST
Patent Text Reader

Abstract

The invention relates to a multi-stage gene data accurate matching method and system, and the method comprises the steps: selecting K continuous basic groups from a to-be-processed read sequence as retrieval character strings according to a preset initial length K, and determining a matching interval of the retrieval character strings in a reference genome from a hash table constructed according to the length K in advance through a Kmer-Index algorithm; in the matching interval, carrying out base-by-base expansion and matching on the retrieval character string based on a pre-constructed FM index through an FM-Index algorithm until the number of matching positions of the retrieval character string and a reference genome is reduced to a preset matching frequency threshold value; and for each retrieval character string obtained after base-by-base expansion and matching, expanding according to a single base comparison mode until mismatching occurs, and taking the retrieval character string with the maximum number of matched bases as a finally determined seed sequence. According to the gene data accurate matching scheme, the seed search performance and the memory use efficiency can be improved, and the accurate matching position of the seed can be quickly searched under the condition of limited hardware resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to biological sequencing and genome data analysis, and in particular to methods and systems for sequence alignment. Background Technology

[0002] With the continuous increase in the throughput of sequencing equipment and the growing demand for precision medicine, how to process genomic data quickly and efficiently has become a key research focus in the field of bioinformatics. Gene sequence alignment is a crucial step in the genomic data analysis process, which refers to the process of aligning the reads output by the sequencer to a reference genome.

[0003] Current mainstream gene sequence alignment technologies generally follow a "seed-expansion" model. First, in the seed search phase, precise matching techniques are used to quickly identify short fragments (called "seeds") that are highly similar to and perfectly matched with the reference genome. Then, in the expansion phase, these seed locations are used as the core, and the sequence expands base-by-base to both sides, using non-precise matching techniques (allowing mismatches, insertions / deletions) for further matching and calculating matching scores. Finally, the match with the highest score is output. In this process, the seed search phase (i.e., the precise matching phase) accounts for more than half of the total execution time.

[0004] In the exact matching stage, a fixed-length short segment is first extracted from the read sequence as a seed. Then, a pre-built index structure (such as a hash table, suffix array, FM index, etc.) is used to quickly locate the exact matching position of the seed in the reference genome. Currently, the mainstream exact matching techniques are the Kmer-Index algorithm or the FM-Index algorithm to improve seed search performance. The Kmer-Index algorithm is based on a hash table for seed search, using all fixed-length k substrings (k-mers) in the reference genome as keys and their position list in the genome as values, thereby quickly locating the matching position of the seed. However, this method has a huge memory footprint and extremely high hardware resource requirements, usually requiring a dedicated hardware accelerator. The FM-Index algorithm is based on a compressed full-text index using the Burrows-Wheeler transform (BWT) for seed search. It utilizes the characteristics of BWT to transform the string matching problem into a range search of the BWT matrix, with a small memory footprint, making whole-genome alignment possible on ordinary servers or even personal computers. However, due to its irregular memory access characteristics, each character iteration during the search process involves multiple memory accesses, which limits the search speed to memory latency and bandwidth, resulting in high search latency. Summary of the Invention

[0005] In this regard, this application aims to provide a precise matching technology that can improve seed search performance and memory usage efficiency, so as to quickly find the precise matching location of a seed under limited hardware resources.

[0006] The purpose of this application is achieved through the following scheme:

[0007] According to a first aspect of the embodiments of this application, a multi-stage gene data precise matching method is provided. The method includes the following steps: selecting K consecutive bases from the read sequence to be processed as a search string based on a pre-set initial length K; determining the matching interval of the search string in a reference genome from a hash table pre-constructed according to length K using the Kmer-Index algorithm; within the matching interval, expanding and matching the search string base-by-base using the FM-Index algorithm based on a pre-constructed FM index until the number of matching positions with the reference genome decreases to a preset matching count threshold; for each search string obtained after base-by-base expansion and matching, expanding it using a single-base alignment method until a mismatch occurs, and using the search string with the most matching bases as the final determined seed sequence.

[0008] In this embodiment, a multi-stage matching strategy is employed. The Kmer-Index algorithm, with shorter search strings, requires only a small number of keys to construct, achieving high memory efficiency while consuming minimal memory resources. The FM-Index algorithm, pre-determined by the Kmer-Index algorithm within matching intervals that are typically smaller than the reference genome, significantly reduces the number of matches within those intervals, avoiding low cache hit rates caused by irregular memory access. The Direct-Index algorithm, through direct comparison, quickly obtains the final matching result. This scheme employs different indexing strategies at different stages, maximizing memory efficiency and optimizing precise matching speed, thereby achieving faster search performance and lower hardware resource requirements.

[0009] In some embodiments, the preset initial length K ranges between [10, 20], with a preferred length K being 14, 15, 16, or 17. Based on the statistical characteristics of gene data and extensive experimental analysis, when the initial length K of the first stage is between [10, 20], the multi-stage precise matching of gene data typically has higher memory efficiency.

[0010] In some embodiments, the matching interval determined by the Kmer-Index algorithm in the first stage is the position from the first occurrence of the search string to the last occurrence in the reference genome. This determined matching interval serves as the initial search space for the FM-Index algorithm in the second stage. Compared to the original reference genome, this matching interval significantly reduces the range that subsequent FM-Index algorithms need to match, reducing the number of memory accesses and thus mitigating the low cache hit problem caused by irregular memory accesses, thereby improving memory efficiency.

[0011] In some embodiments, the matching number threshold N in the second stage is set to a natural number less than 9, preferably 3 or 2. Based on the statistical characteristics of gene data and experimental analysis, when the base sequence length is approximately 30 bases, the number of matching positions can typically be reduced to a natural number less than 9. In this case, the memory efficiency of the Direct-Index algorithm will exceed that of the FM-Index algorithm. When the base sequence length is greater than 30 and gradually increases, the number of matching positions can be reduced to 3 or 2. In this case, switching from the FM-Index algorithm to the Direct-Index algorithm is more beneficial for maximizing memory efficiency.

[0012] In some embodiments, the pre-constructed hash table consists of keys and value ranges, wherein: each key corresponds to one of all base sequences of length K in the reference genome; and the value range corresponding to each key is the position of the first occurrence and the position of the last occurrence of the key in the reference genome.

[0013] In some embodiments, the multi-stage gene data precise matching method may further include a step of pre-constructing an FM index structure for the FM-Index algorithm based on a reference genome.

[0014] According to a second aspect of the embodiments of this application, a multi-stage gene data precise matching system is provided. The system includes a Kmer-Index processing module, an FM-Index processing module, and a Direct-Index processing module. The Kmer-Index processing module is configured to select K consecutive bases from the read sequence to be processed as a search string according to a pre-set initial length K, and determine the matching interval of the search string in the reference genome from a hash table pre-constructed according to length K using the Kmer-Index algorithm. The FM-Index processing module is configured to expand and match the search string base-by-base using the FM-Index algorithm based on a pre-constructed FM index within the matching interval, until the number of matching positions with the reference genome decreases to a preset matching count threshold. The Direct-Index processing module is configured to expand each search string from the FM-Index processing module in a single-base alignment manner until a mismatch occurs, and to use the search string with the most matching bases as the final determined seed sequence.

[0015] According to a third aspect of the present application, a computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements the method described in the first aspect of the present application.

[0016] Compared with the prior art, the gene data precise matching scheme according to the embodiments of this application uses a multi-stage matching strategy that is more in line with the statistical characteristics of gene data to accelerate the seed search process in gene alignment. By working together with three indexing strategies, Kmer-Index, FM-Index and Direct-Index, memory efficiency is maximized and the precise matching speed is optimized, thereby achieving faster search performance and lower hardware resource requirements.

[0017] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description

[0018] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application. It is obvious that the drawings described below are merely some embodiments of this application, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.

[0019] Figure 1 A schematic diagram illustrating the statistical characteristics of gene data according to an embodiment of this application is shown.

[0020] Figure 2The diagram illustrates the memory efficiency changes of the three stages of a multi-stage gene data precise matching method according to an embodiment of this application.

[0021] Figure 3 A flowchart illustrating a multi-stage gene data precise matching method according to an embodiment of this application is shown.

[0022] Figure 4 A schematic diagram of the seed search process of a multi-stage gene data precise matching method according to an embodiment of this application is shown. Detailed Implementation

[0023] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description of this application is provided in conjunction with the accompanying drawings and specific embodiments.

[0024] Furthermore, unless otherwise specified, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. Numerous specific details are provided in the following description to give a thorough understanding of embodiments of this application. However, those skilled in the art will recognize that the technical solutions of this application may be practiced without one or more of the specific details, or other methods, components, apparatuses, steps, etc. may be employed. In other instances, well-known methods, apparatuses, implementations, or operations are not shown or described in detail to avoid obscuring various aspects of this application.

[0025] The flowcharts shown in the accompanying drawings are merely illustrative and do not necessarily include all content and operations / steps, nor do they necessarily have to be performed in the described order. For example, some operations / steps can be broken down, while others can be combined or partially combined; therefore, the actual execution order may change depending on the specific circumstances.

[0026] As mentioned in the background section, current mainstream gene sequence alignment technologies generally follow a "seed-expansion" model, which includes a seed search phase (using exact matching techniques) and a seed expansion phase (using inaccurate matching techniques). During sequence alignment, the seed search phase (i.e., the exact matching phase) accounts for more than half of the runtime. In the exact matching phase, a fixed-length short fragment is first extracted from the read sequence as a seed, and then a pre-constructed index structure is used to quickly locate the exact matching position of the seed in the reference genome. Currently, mainstream exact matching techniques use the Kmer-Index algorithm or the FM-Index algorithm to improve seed search performance.

[0027] The Kmer-Index algorithm pre-builds an index structure using a hash table (which can be called the Kmer index). The construction of this Kmer index begins by determining the length parameter K of the seed sequence. Then, a sliding window is used to traverse the entire reference genome, sequentially extracting a K-base sequence (which can be called a Kmer). Each extracted base sequence is used as a key, and its position in the reference genome is used as a value, both stored in the hash table. Thus, during the seed lookup phase, the precise matching position of the seed can be quickly located by comparing it with the pre-built hash table. However, for each length K, for example, K=20, the Kmer index stores every 20bp sequence in the reference genome and all its occurrences. As the length K increases, the required storage space increases exponentially, and different hash tables need to be built for different seed sequence lengths. Therefore, the Kmer-Index algorithm has a huge memory footprint and extremely high hardware resource requirements, typically requiring a dedicated hardware accelerator.

[0028] In contrast, the FM-Index algorithm uses a compressed full-text index based on the Burrows-Wheeler transform (BWT) for seed search. It leverages the characteristics of BWT to transform the string matching problem into a range search of the BWT matrix, resulting in low memory usage and making whole-genome alignment possible on ordinary servers and even personal computers. The pre-built index structure of the FM-Index algorithm is called the FM index, which mainly includes a BWT array, a sampled suffix array (also denoted as SA), a count table (also denoted as Count table), and an occurrence table (also denoted as Occ table). The BWT array is a character array formed by sorting all cyclically shifted strings of the reference genome sequence in lexicographical order and taking the last column. The Count table records the total number of occurrences of all characters whose lexicographical order is less than each character in the BWT. The Occ table records the number of occurrences of each character in the BWT before each position. SA stores only the entries in the suffix array at fixed intervals, which can be used to map the BWT row numbers back to the original positions in the reference genome for location purposes.

[0029] The execution process of the FM-index algorithm essentially revolves around the dynamic shrinking of the matching interval [sp, ep]. Here, sp represents the start position of the matching interval, and ep represents the end position. Determining these two positions is the core process of the FM-index backward search. Initially, the matching interval covers the entire suffix array. Then, the algorithm iterates backward from the end of the pattern string P (corresponding to the input seed sequence), using the Count and Occ tables to continuously shrink the matching interval [sp, ep] precisely to the SA sub-interval corresponding to the currently processed suffix. The boundary is shrunk once for each character processed, until all characters of the pattern string P are processed or the interval is empty. The final size of the matching interval (ep-sp+1) is the number of matches for the pattern string P. Each element within the interval can be quickly converted into coordinates in the reference genome based on the sampled suffix array SA, thus obtaining the matching position of the seed sequence in the reference genome.

[0030] It can be seen that the FM-Index algorithm is essentially a memory-intensive computational model, involving a large number of irregular memory access operations during the matching process. The characteristics of this irregular memory access are: first, the accessed memory addresses are randomly distributed without any pattern (for example, in the FM-Index algorithm, addresses calculated based on the Count table and OCC table may be scattered across various memory locations). Second, the accessed addresses are unpredictable, rendering the prefetcher completely ineffective. Third, only one base can be matched at a time, resulting in a small amount of data read / written per operation, but a large number of accesses. Each transmission requires address establishment and waiting for a response, severely diluting the effective data transfer rate of the bus. A large number of scattered memory access requests consume bus bandwidth, and subsequent memory access requests need to queue, lengthening the overall running time of the algorithm and leading to low efficiency.

[0031] Through long-term research and practice in genome alignment, the inventors have noticed that most improvements to precise matching techniques currently focus on optimizing specific algorithms, such as the Kmer-Index or FM-Index algorithms. While these optimizations can improve seed search performance to some extent, they do not truly overcome the inherent limitations of either algorithm. Therefore, in this application, the inventors propose a novel precise matching technique based on the statistical characteristics of gene data itself. This technique can improve seed search performance and memory efficiency, enabling rapid location of precise seed matches with limited hardware resources.

[0032] The inventors discovered in their research that genomic data itself possesses certain statistical characteristics. For example... Figure 1 As shown, the number of matching positions with the reference genome decreases exponentially with the growth of the seed sequence. It can be seen that when the seed sequence grows from a single-digit length to between 10 and 20, the average hit count (i.e., the number of matching positions) decreases from 10...10 The nearby area quickly dropped to 10. 5 Nearly, this exponential decline can continue until the seed sequence length is approximately 30. Only after the seed sequence length is approximately 30 does the decline begin to level off.

[0033] Based on the above analysis of gene data characteristics, this application provides a solution to accelerate the seed search process using a multi-stage precise matching approach. The multi-stage approach is divided by seed sequence length, with different stages corresponding to different lengths or length ranges and employing different index structures. The longest precise match position is determined progressively through multi-stage collaboration. This scheme divides the seed search process into three stages: The first stage constructs a Kmer index and uses the Kmer-Index algorithm to determine the matching interval; the second stage constructs an FM index based on the determined matching interval and further uses the FM-Index algorithm for base expansion to narrow the matching interval until the number of matches is reduced to a preset threshold; in the third stage, the Direct-Index algorithm enumerates all matching positions within the matching interval and outputs the sequence corresponding to the longest precise match position as the final determined seed sequence. In this paper, the Direct-Index algorithm refers to the method of directly aligning the read sequence with the reference genome, which finds the longest precise match position by enumerating all matching positions within the matching interval. This method is generally not used alone for gene alignment because its enumeration method makes it difficult to handle a large number of matching positions, and therefore it is only suitable for cases with very few matching positions. Therefore, in the second stage, the threshold for the number of matches is usually set to a single digit (preferably 3 or 2) so that the Direct-Index algorithm in the third stage can be executed efficiently.

[0034] Furthermore, in order to enable the three search algorithms used in the multi-stage precise matching method of this application to work together to find seeds more quickly, the inventors conducted a large number of experiments and analyzed the memory efficiency of these three search algorithms. Figure 2 The graph shows the relationship between base sequence length and memory efficiency, where memory efficiency represents the number of bases that can be processed per second per 1GB of memory.

[0035] like Figure 2As shown, when the length of the queried base fragment is between [1-20], the Kmer-Index algorithm has higher memory efficiency than the FM-Index and Direct-Index algorithms. However, as the base fragment length increases, the memory occupied by the Kmer index increases rapidly, and the memory efficiency gradually decreases, even falling below that of the Direct-Index algorithm. The FM-Index algorithm, due to its compressed index structure, is insensitive to the base sequence length; its memory efficiency remains relatively constant as the length of the queried base fragment increases. When the length of the queried sequence is around [14-29], the FM-Index algorithm has better memory efficiency than the Kmer-Index and Direct-Index algorithms. The Direct-Index algorithm, because it matches all matching positions within a range through enumeration, has its memory efficiency dependent on the number of matching positions. Figure 1 The statistical characteristics of the gene data itself, as shown, reveal that the number of matching positions with the reference genome decreases exponentially with the growth of the seed sequence. When the base sequence length reaches 30 bases or more, the number of matching positions stabilizes at single digits. Therefore, when the base sequence length reaches around 30 bases, the Direct-Index algorithm has better memory efficiency than the Kmer-Index and FM-Index algorithms.

[0036] Through the above experimental analysis, the inventors discovered that the three algorithms exhibit different memory efficiencies depending on the length of the queried base fragment. Based on this, the seed search process is divided into three stages: the Kmer-Index algorithm is used in stage one, the FM-Index algorithm in stage two, and the Direct-Index algorithm in stage three. In stage one, the base sequence length is set in the range [10, 20], with preferred lengths of 14, 15, 16, or 17. In stage two, base-by-base expansion and matching are performed using the FM-Index algorithm, based on... Figure 1 Based on the statistical characteristics of gene data, as the base sequence length continues to expand, the number of matching positions decreases. Therefore, a matching count threshold is set for this stage. When the number of matching positions decreases below this threshold, the system switches to the third stage. This matching count threshold can be a natural number less than 9, preferably 3, 2, or 1.

[0037] In the multi-stage precise matching solution provided in this application, the first stage uses the Kmer-Index algorithm with a specified initial sequence length to quickly determine the matching interval of the initial sequence in the reference genome with less memory cost and far better memory efficiency than the other two algorithms; the second stage uses the FM-Index algorithm to expand the initial sequence based on this matching interval, reducing the number of memory accesses of the FM-Index algorithm; the third stage obtains the final matching result through efficient direct comparison.

[0038] Figure 3 A flowchart of a multi-stage gene data precise matching method according to an embodiment of this application is shown. The method mainly includes: Step 301, selecting K consecutive bases from the read sequence to be processed as a search string (i.e., a seed sequence or base fragment with an initial length) according to a pre-set initial length K, and determining the matching interval of the search string in the reference genome from a hash table pre-constructed according to length K using the Kmer-Index algorithm; Step 302, expanding and matching the search string base by base in the determined matching interval using the FM-Index algorithm until the number of matching positions with the reference genome decreases to a preset matching number threshold; Step 303, for each search string obtained after base-by-base expansion and matching (i.e., the seed sequence obtained after expansion), continuing to expand in the manner of single-base alignment until a mismatch occurs, and finally using the search string with the most matching bases as the final determined seed sequence.

[0039] The following is combined Figure 4 The provided reference genome and read sequence diagrams are used to illustrate the details. Figure 3 The various steps in the process. The example reference genome is:

[0040] {AACTCCGCTATCTATCTTTTGTCTAGGTGTAGCTCTCATCTTTATTAGAAAAAGCCATATCCCTA}; The read sequence is: {ACTATCTATCTACTCTCTCTCATCA}.

[0041] like Figure 4As shown, the seed search process is divided into three stages. In step S301 of stage one, it is assumed that the initial length K is preset to 4. It should be understood that the preset search string length of 4 here is only for illustrative purposes and is not intended to impose any restrictions. The initial length value should be selected based on the actual situation, such as the statistical characteristics of the gene data and the hardware resources for performing sequence alignment. The Kmer-Index algorithm traverses the reference genome, extracting all 4-base sequences such as AACT, ACTC…ATCT…CTCT… as keys, and the interval between the first and last occurrences of the base sequence in the reference genome as values. The keys and values ​​are stored together in the Kmer index. The construction of the Kmer index begins with the digital encoding of the reference genome. Specifically, the four nucleic acid bases (A, C, G, T) are mapped to a binary encoding space. For example, A is mapped to binary 00, C to 01, G to 10, and T to 11. For a seed sequence of length K, the binary sequence is concatenated end-to-end to form a complete binary number. This binary number is then converted into a unique decimal integer. For example, in this case, when the seed sequence is "ATCT", A, T, C, T are mapped to 00, 11, 01, 11, and concatenated end-to-end to form 00110111, which is then converted into the unique decimal number 55. This decimal integer serves as a unique and easily computed identifier for the corresponding seed sequence and is stored as the key in the Kmer index. Subsequently, four consecutive bases, "ATCT" and "CTCT", are selected from the read sequence to be processed as search strings. By referring to the pre-constructed Kmer index, the matching interval corresponding to the search string is directly obtained. Based on the same principle, when using the human genome as a reference gene, a K=14 Kmer index can be pre-constructed to quickly obtain the matching interval corresponding to any search string of length 14 that has appeared.

[0042] In step S302 of stage two, based on the matching interval obtained in step S301, the search string "ATCT" is expanded base-by-base using the FM-Index algorithm to form a new search string "ATCTA". This new search string is then matched within the matching interval to further narrow it down. The initial matching interval, determined in advance by the Kmer-Index algorithm, is typically smaller than the reference genome. The FM-Index algorithm significantly reduces the number of matches within this interval, avoiding low cache hit rates caused by irregular memory access. Furthermore, gene data characteristics show that the number of matching positions with the reference genome decreases exponentially with the growth of the seed sequence. Therefore, for each newly expanded search string, the FM-Index algorithm effectively eliminates a large number of unmatched candidate positions, significantly reducing the potential matching interval. This process can be repeated until the number of matching positions decreases to less than 9, at which point a match can be determined more quickly using Direct-Index. Based on the above principles, when the length of the search string reaches 30, the number of corresponding reference gene position matches can be reduced to a natural number less than 9, preferably 3 or 2. Meanwhile, the Direct-Index algorithm surpasses the FM-Index algorithm to become the order algorithm with the highest memory efficiency.

[0043] In step S303 of stage three, when the matching interval of the seed sequence ATCTA is sufficiently narrowed using the FM-Index sequence indexing technique until the number of matching positions is less than the threshold of 2, the seed sequence is extended backward by one base at a time based on the read sequence, forming a longer seed sequence ATCTAT. Matching is then performed using Direct-Index to enumerate all matching positions within the matching interval. If a match is found, this process is repeated until a mismatch occurs between the seed sequence ATCTATCTA and the genome sequence ATCTATCTT. The subsequent base sequence ATCTATCT is then output as the matching result.

[0044] In another embodiment of this application, a multi-stage precise matching system based on gene data features is also provided. This system mainly includes: a Kmer-Index processing module, configured to select K consecutive bases from the read sequence to be processed as a search string according to a pre-set initial length K, and determine the matching interval of the search string in the reference genome from a hash table pre-constructed according to length K using the Kmer-Index algorithm; an FM-Index processing module, configured to expand and match the search string base-by-base using the FM-Index algorithm based on a pre-constructed FM index within the matching interval, until the number of matching positions with the reference genome decreases to a preset matching count threshold; and a Direct-Index processing module, configured to expand each search string from the FM-Index processing module using a single-base alignment method until a mismatch occurs, and to use the search string with the most matching bases as the final determined seed sequence. The specific processes of the above modules are as follows... Figure 3 The corresponding steps are as follows, and will not be repeated here.

[0045] Based on the statistical characteristics of three-gene data—namely, the exponential decrease in the number of matching gene sequence positions as the seed length increases—this application divides the seed search phase into three stages according to the seed sequence length. Different indexing techniques are employed at each stage to maximize memory utilization within the corresponding seed sequence length range. Compared to using Kmer-Index exclusively, this application significantly reduces the hardware resource requirements caused by excessive memory consumption; or compared to using FM-Index exclusively, it narrows the matching range and reduces low cache hit rates caused by irregular memory access. This phased approach using different sequence indexing techniques solves the dilemma of balancing performance and resources inherent in traditional methods, achieving faster search speeds and higher memory utilization efficiency overall. Ultimately, it achieves an optimal balance between speed, accuracy, and resource consumption in large-scale genomic data processing, particularly in precision medicine scenarios requiring rapid response.

[0046] The above-described solutions of this application can be implemented using various computing devices, including but not limited to: a general-purpose computer server, which includes at least one processor (CPU), memory (RAM), and storage device (such as a hard disk or SSD). The Kmer-Index, FM-Index, and other index structures can be pre-loaded into memory for high-speed access. In some embodiments, the solutions described above can be implemented as a computer program stored in the storage device; when this program is executed by the processor, it performs the functions described in the above embodiments.

[0047] The terms “comprising,” “having,” “including,” and “containing” should be interpreted as open-ended terms (i.e., meaning “including but not limited to”) unless otherwise stated. The term “connected” should be interpreted as partially or wholly included, attached to, or joined together, even if other things are present in between. The enumeration of numerical ranges herein is intended only as a shorthand method for individually referring to each individual value falling within a range, unless otherwise stated herein, and each individual value is incorporated into the specification as if it were individually enumerated herein. All methods described herein may be performed in any suitable order unless otherwise stated herein or the context clearly contradicts it. Any and all examples or exemplary wording provided herein (e.g., “for example”) are intended only to better illustrate the implementation of this application and, unless otherwise stated, do not constitute a limitation on the scope of this application. No wording in the specification should be construed as indicating that any unstated element is essential to the practice of this application.

[0048] Although this application has been described through preferred embodiments, it is not limited to the embodiments described herein, and various changes and modifications are included without departing from the scope of this application.

Claims

1. A method for precise matching of multi-stage gene data, characterized in that, Includes the following steps: Based on a pre-set initial length K, K consecutive bases are selected from the read sequence to be processed as a search string, and the matching interval of the search string in the reference genome is determined by the Kmer-Index algorithm from a hash table pre-constructed according to length K. Within the matching interval, the FM-Index algorithm is used to expand and match the search string base by base based on a pre-built FM index until the number of matching positions with the reference genome decreases to a preset matching number threshold. For each search string obtained through base-by-base expansion and matching, it is expanded in the manner of single-base alignment until a mismatch occurs, and the search string with the most matching bases is used as the final seed sequence.

2. The method according to claim 1, wherein the length K ranges between [10, 20].

3. The method according to claim 2, wherein the length K is 14, 15, 16 or 17.

4. The method according to claim 1, wherein the matching interval is the position from the first occurrence of the search string to the last occurrence in the reference genome.

5. The method according to claim 1, wherein the matching quantity threshold N is set to a natural number less than 9.

6. The method of claim 5, wherein the matching quantity threshold is set to 3 or 2.

7. The method according to claim 1, wherein the hash table consists of key and value ranges, wherein: Each bond corresponds to one of all base sequences of length K in the reference genome; The value range corresponding to each key is the position of the first and last occurrence of that key in the reference genome.

8. The method according to any one of claims 1-7 further includes an FM index structure pre-constructed based on a reference genome for the FM-Index algorithm.

9. A multi-stage gene data precise matching system, characterized in that, include: The Kmer-Index processing module is configured to select K consecutive bases from the read sequence to be processed as a search string according to a pre-set initial length K, and determine the matching interval of the search string in the reference genome from a hash table pre-constructed according to length K using the Kmer-Index algorithm. The FM-Index processing module is configured to perform base-by-base expansion and matching of the search string based on a pre-built FM index within the matching interval using the FM-Index algorithm until the number of matching positions with the reference genome decreases to a preset matching count threshold. The Direct-Index processing module is configured to expand each search string from the FM-Index processing module by single-base alignment until a mismatch occurs, and to use the search string with the most matching bases as the final seed sequence.

10. A computer-readable storage medium having a computer program stored thereon that, when executed by a processor, implements the method as described in any one of claims 1 to 8.