Approximate character string comparison method, and computer program for realizing said comparison method
The hierarchical index method addresses the memory access limitations in existing algorithms by efficiently matching substrings and deriving approximate character strings, enhancing the speed and efficiency of human genome analysis.
Patent Information
- Application Number
- PCT/JP2023/008899
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-03-08
- Publication Date
- 2024-09-12
AI Technical Summary
Current approximate string matching algorithms, such as BWA-MEM, require significant memory resources and suffer from high memory access times, limiting the speed of human genome analysis due to large index sizes and frequent random memory access, which is exacerbated by the large data sets involved in genomic sequencing.
A method that creates a hierarchical index based on the reference string using hash functions to efficiently identify matching substrings and derive approximate character strings, reducing memory access by using a sampling interval and updating the index to accommodate only necessary data, thereby speeding up the analysis process.
This approach significantly reduces the time required for approximate string matching and analysis by minimizing memory access and calculation, enabling faster processing of large genomic data sets without the need for extensive computational resource upgrades.
Smart Images

Figure JP2023008899_12092024_PF_FP_ABST
Abstract
Description
Approximate string matching method and computer program for implementing said method
[0001] The present invention relates to approximate string matching technology, and more particularly to an approximate string matching device and method that can be used in analyzing the human genome, and a computer program for implementing the method.
[0002] The human genome is a set of genetic information that a person possesses, and the material that carries this information is DNA (deoxyribonucleic acid), which is a string of approximately 3 billion pairs of bases. The bases are adenine (A), guanine (G), cytosine (C), and thymine (T). In other words, a person's genetic information is determined by the arrangement (sequence) of these bases.
[0003] A device called a sequencer is used to read the human genome. The sequencer reads a sample human genome, cuts it into a predetermined upper limit (about several hundred base pairs), amplifies it, and outputs a huge data sequence made up of data fragments. Current sequencers can read one human genome in about an hour.
[0004] The individual data fragments read by the sequencer are compared with a human genome reference sequence, which is defined as the standard genome sequence for humans, to reconstruct and analyze the original length of the human genome sequence. For example, the position of each data fragment is determined (mapping) in comparison with the human genome reference sequence, and the presence of mutations is analyzed. Since the data read from the sequencer typically contains errors, statistical processing is performed using, for example, 30 times the amount of redundant data per sample (the equivalent of one person's human genome sequence) to reduce the errors. Therefore, analyzing the human genome sequence requires a huge amount of computation, and therefore, typically, high-performance computers such as supercomputers, cluster computers, and FPGA (Field-Programmable Gate Array)-based computers are used.
[0005] For example, a programming tool such as BWA (Burrow-Wheeler Aligner) is used to map data fragments. BWA consists of three algorithms: BWA-backtrack, BWA-SW, and BWA-MEM. Of these, BWA-MEM is widely used as a high-speed algorithm that supports indels (insertion deletions). BWA-MEM is an algorithm that creates an index using a suffix sequence for the portion of a query string based on the read data fragment that repeatedly appears in the human genome reference sequence, and performs mapping (Non-Patent Document 1).
[0006] The data fragments are then compared with a partial sequence of the human genome reference sequence obtained by mapping, and the presence of any mutations is analyzed. For example, an alignment algorithm is used to compare the partial sequence of the human genome reference sequence with the data fragments. The alignment algorithm identifies similar character strings by calculating the degree of variation (similarity) for each element of a sequence called an alignment table according to dynamic programming (Non-Patent Document 2).
[0007] Heng Li, "Aligning sequence reads, clone sequences and assembly contigs with BWA-MEM", May 26, 2013, arXiv:1303.3997 (q-bio.GN) Masao Uchiyama et al., "Fast Suffix Sequence Scanning for Full-Text Search Using Approximate String Matching", September 15, 2002, Information Processing Society of Japan, Vol. 43 No. SIG 9 (TOD 15)
[0008] The above-mentioned BWA-MEM is widely used as an algorithm that allows gaps and enables high-speed mapping, but has the problem that the size of the index created becomes very large, requiring a large amount of memory resources. Furthermore, BWA-MEM requires memory access a number of times corresponding to the number of characters (i.e., the number of bases) in the query string, which results in frequent random access to memory, causing the problem that the processing speed of the processor is limited by the time it takes to access the memory.
[0009] More specifically, in BWA-MEM, to identify the location where a substring (sometimes referred to as a "key") in a query string appears in the human genome reference sequence, random access to main memory is performed a number of times equal to the total number of characters in the query string. This is because the amount of data used in analyzing the human genome is so large that the necessary data sequences cannot be accommodated all at once in a cache memory that allows faster access. Here, the latency for a single random access to main memory (the time from when the access occurs until the data is actually obtained) on current computers is approximately 1 μs (0.000001 sec) per bank. Therefore, in the case of analyzing a 3 billion base pair human genome, assuming redundancy of 30, the total access time T for the total number of characters is: T = 3,000,000,000 × 0.000001 × 30 = 90,000 (seconds). In other words, in analyzing the human genome, random access to main memory alone would take approximately 90,000 seconds (approximately 25 hours). Therefore, even if a computer equipped with a high-performance processor is used, there is a limit to how much the mapping time can be reduced due to the constraints imposed by memory access time.
[0010] As mentioned above, it currently takes about an hour to read one person's genome using a sequencer. On the other hand, when BWA-MEM is executed using a high-performance computer, mapping is completed within the time it takes for the sequencer to read the genome, so the balance between the two is generally maintained.
[0011] On the other hand, next-generation sequencers are expected to reduce costs and further shorten read times, which will lead to a corresponding reduction in analysis time. One approach to shorten analysis time is to further improve the performance of computers, but the high cost of improving computer performance makes it difficult to put such a technology into practical use.
[0012] Furthermore, conventional alignment algorithms used to analyze mapped data fragments have the problem of requiring a large amount of calculation and time because they calculate the degree of variation for all elements in the alignment table.
[0013] Therefore, an object of the present invention is to provide a new technique that can quickly and / or efficiently analyze given query data using reference data.
[0014] More specifically, one object of the present invention is to provide an approximate string matching device and an approximate string matching method using the same that can perform approximate string matching between a given query string and a reference string quickly and / or efficiently.
[0015] Another object of the present invention is to provide an approximate string matching device and an approximate string matching method using the same that can quickly and / or efficiently perform analysis using a human genome reference sequence based on data fragments read by a sequencer.
[0016] Another object of the present invention is to provide a technique for creating a hierarchical index based on reference strings suitable for approximate string matching.
[0017] The present invention, which aims to solve the above problems, comprises the following invention-specifying matters and technical features.
[0018] According to one aspect, the present invention provides a computer program product for causing a computing device to implement a method for searching for an approximate string in a reference string based on a query string. The method includes: creating a hierarchical index based on the reference string; mapping the query string to the reference string by referring to the hierarchical index to identify a substring in the reference string that matches at least a portion of the query string; and deriving an approximate string that approximates the matched string based on a matched string based on the reference string and a match string based on the query string, the matched string being created based on the substring identified by the mapping. Here, creating the hierarchical index includes extracting first keys of a predetermined length from the reference string; creating a first key array by assigning hash values calculated based on the first keys using a predetermined hash function to each of the extracted first keys; updating the created first key array; and outputting the updated first key array as the hierarchical index. Further, updating the first key arrangement includes, for each first key in the first key arrangement, identifying the number of occurrences of the first key in the reference string, and updating the first key arrangement by adding a first additional key consisting of at least one character following the first key in the reference string to the first key according to the number of occurrences of the identified first key.
[0019] Creating the first key array may include sorting the first keys in the first key array according to the hash value.
[0020] In addition, updating the first key sequence may include determining whether the identified number of occurrences exceeds a predetermined tolerance; if it is determined that the identified number of occurrences exceeds the predetermined tolerance, creating a new first key by adding to the first key the first additional key consisting of at least one character following the first key in the reference string; and identifying, for the new first key, the number of occurrences of the new first key in the reference string.
[0021] Additionally, updating the first keyboard arrangement may further include sorting the new first keys in the first keyboard arrangement according to the first additional keys.
[0022] Additionally, updating the first key array may include creating a new first key by sequentially adding a new first additional key to the current first key until it is determined that the identified number of occurrences does not exceed a predetermined tolerance value.
[0023] Furthermore, outputting the first key arrangement as the hierarchical index may include outputting the current first key arrangement as the hierarchical index when it is determined that the identified number of occurrences does not exceed a predetermined allowable value.
[0024] Performing the mapping may include extracting each second key of a predetermined length from the query string; creating a second key array to which each second key extracted from the query string is assigned a hash value calculated based on the second key using the predetermined hash function; and, for each second key, referencing the hierarchical index at predetermined sampling intervals according to the hash value to identify the start position of appearance and the number of appearances of the second key.
[0025] Identifying the start position of appearance and the number of appearances of the second key may include determining whether the number of appearances of the second key exceeds the predetermined tolerance; if it is determined that the number of appearances of the second key exceeds the predetermined tolerance, creating a new second key by adding to the second key a second additional key consisting of at least one or more characters following the second key in the query string; and if it is determined that the number of appearances of the second key does not exceed the predetermined tolerance, outputting the identified current second key as a match string and the start position of appearance of the second key.
[0026] Furthermore, identifying the start position of appearance and the number of appearances of the second key may further include creating the new second key by sequentially adding new second additional keys to the current second key until it is determined that the identified number of appearances of the second key does not exceed the predetermined tolerance value.
[0027] Furthermore, when it is determined that the number of occurrences of the second key exceeds the predetermined allowable value, the predetermined sampling interval of the second key can be changed to be larger.
[0028] Deriving the approximate string may include receiving a string pair consisting of the matched string and the match string based on the substring identified by the mapping, performing a predetermined alignment process to derive at least one approximate string based on the string pair, and outputting the derived at least one approximate string.
[0029] Performing the predetermined alignment process may include creating a predetermined alignment table based on the matched string and the match string, setting a calculation area having a width m centered on a diagonal element of the alignment table, calculating a variation for each element in the set calculation area, determining a maximum variation based on the calculated variation, and deriving the at least one approximate string based on the determined maximum variation.
[0030] Furthermore, performing the predetermined alignment process may include comparing the maximum variability with a predetermined lower limit to determine whether the maximum variability exceeds the predetermined lower limit, widening the width m of the calculation region to set a new calculation region when it is determined that the maximum variability does not exceed the predetermined lower limit, and deriving the at least one approximate string based on an element having the maximum variability. The method may be configured to repeatedly widen the calculation region to set a new calculation region and calculate the variability until it is determined that the maximum variability exceeds the lower limit.
[0031] The predetermined lower limit value may be a value of the degree of variation when it is assumed that there are m consecutive gaps in a predetermined element string, and the remaining portions are a perfect or substantial match.
[0032] The method may further include creating the matched string by appending a corresponding predetermined character string in the reference string to the substring, and creating the match string by appending a corresponding predetermined character string in the query string to the substring.
[0033] According to one aspect, the present invention provides a computer program product for causing a computing device to execute a method for creating a hierarchical index for searching a reference string based on a query string. The method includes: extracting first keys of a predetermined length from the reference string; creating a first key array for each extracted first key by assigning a hash value calculated based on the first key using a predetermined hash function; updating the created first key array; and outputting the updated first key array as the hierarchical index. Here, updating the first key array includes identifying, for each first key in the first key array, a start position and a number of occurrences of the first key in the reference string; and updating the first key array by adding, to the first key, a first additional key consisting of at least one character following the first key in the reference string according to the start position and the number of occurrences of the identified first key.
[0034] According to one aspect, the present invention provides a computer program for causing a computing device to execute a method for mapping a query string to a reference string, the method including: reading a hierarchical index consisting of each first key extracted from the reference string and a first key array in which a hash value calculated by a predetermined hash function based on the first key is assigned to each of the first keys, the first key array having additional keys added to the first keys according to the appearance start position and the number of appearances of the first keys in the reference string; extracting each second key having a predetermined key length from the query string; creating a second key array in which a hash value calculated by a predetermined hash function based on the second key is assigned to each of the second keys extracted from the query string; and calculating the hash value for each of the second keys. and identifying an appearance start position and an appearance count of the second key by comparing it with the first key in the first key array, determining whether the identified appearance count exceeds a predetermined threshold, and creating a new second key by adding an additional key consisting of at least one character following the second key in the query string to the second key if it is determined that the identified appearance count exceeds a predetermined allowable value, and outputting the appearance start position of the identified current second key and the identified key if it is determined that the identified appearance count does not exceed the predetermined threshold. Identifying the appearance start position and the appearance count of the second key includes creating the new second key by sequentially adding the new additional key to the current second key until it is determined that the identified appearance count does not exceed the predetermined threshold.
[0035] Here, when it is determined that the identified number of occurrences exceeds a predetermined allowable value, the predetermined sampling interval of the second key may be changed to be larger.
[0036] According to one aspect, the present invention provides a computer program for causing a computing device to implement a method for identifying variations between a substring in a reference string and a query string by a predetermined alignment process. The method includes receiving string pairs, each of which is created based on the substring identified by mapping and includes a match string based on the reference string and a match string based on the query string, performing a predetermined alignment process to derive at least one approximate string that approximates the match string based on the string pairs, and outputting the derived at least one approximate string. Performing the predetermined alignment process includes creating a predetermined alignment table based on the match string and the match string, setting a calculation region having a width m centered on a diagonal element of the alignment table, calculating a degree of variation for each element in the set calculation region, determining a maximum degree of variation based on the calculated degree of variation, and deriving the at least one approximate string based on the determined maximum degree of variation.
[0037] Furthermore, performing the predetermined alignment process may include comparing the maximum variability with a predetermined lower limit to determine whether the maximum variability exceeds the predetermined lower limit, widening the width m of the calculation region to set a new calculation region when it is determined that the maximum variability does not exceed the predetermined lower limit, and deriving the at least one approximate string based on the element having the maximum variability. Then, widening the calculation region to set a new calculation region and calculating the variability may be repeated until it is determined that the maximum variability exceeds the lower limit.
[0038] Furthermore, performing the predetermined alignment process may further include setting, as the predetermined lower limit value, a value of the degree of variation when it is assumed that there are m consecutive gaps in a predetermined element string and that the remaining portions are completely or substantially identical.
[0039] The present invention also applies to a computer-readable recording medium that non-temporarily records the computer program. The present invention also applies to an apparatus that includes hardware and / or firmware configured to execute the method. An approximate string matching apparatus is one aspect of the present invention.
[0040] In this specification, a means or unit does not simply mean a physical means, but also includes cases where the functions of that means or unit are realized by software. Furthermore, the functions of one means or unit may be realized by two or more physical means, or the functions of two or more means or units may be realized by one physical means. Furthermore, a "system" refers to a logical collection of multiple devices (or functional modules that realize specific functions), regardless of whether each device or functional module is contained within a single housing.
[0041] The present invention provides fast and / or efficient analysis of given query data using reference data, and in particular fast and / or efficient approximate string matching between given query strings and reference strings.
[0042] Furthermore, according to the present invention, analysis using a human genome reference sequence based on data fragments read by a sequencer can be performed quickly and / or efficiently.
[0043] Furthermore, the present invention provides a hierarchical index based on reference strings that is suitable for approximate string matching.
[0044] Other technical features, objects, and operational effects or advantages of the present invention will become apparent from the following embodiments described with reference to the accompanying drawings. The effects described in this specification are merely examples and are not intended to be limiting, and other effects may also be present.
[0045] FIG. 1 is a block diagram showing an example of a schematic configuration of a computer system according to an embodiment of the present invention. FIG. 2 is a flowchart explaining an example of an approximate string matching process performed by a computer system according to an embodiment of the present invention. FIG. 3 is a flowchart explaining an example of an index creation process performed by a computer system according to an embodiment of the present invention. FIG. 4 is a diagram showing an example of a reference string used in a computer system according to an embodiment of the present invention. FIG. 4A is a diagram explaining an example of a data array structure in the process of creating a hierarchical index based on the reference string shown in FIG. 4. FIG. 4B is a diagram explaining an example of a data array structure in the process of creating a hierarchical index based on the reference string shown in FIG. 4. FIG. 4C is a diagram explaining an example of a data array structure in the process of creating a hierarchical index based on the reference string shown in FIG. 4. FIG. 5 is a diagram showing an example of a table structure indicating a key start position and the number of occurrences in the process of creating a hierarchical index based on the reference string shown in FIG. 4. FIG. 6 is a diagram showing an example of a reference string used in a computer system according to an embodiment of the present invention. FIG. 7 is a flowchart explaining an example of a reference string search process based on a query string performed by a computer system according to an embodiment of the present invention. FIG. 8A is a diagram showing an example of an alignment table for explaining the Needleman-Wunsch algorithm. FIG. 8B is a diagram showing an example of an alignment table for explaining the Needleman-Wunsch algorithm. FIG. 8C is a diagram showing an example of an alignment table for explaining the Needleman-Wunsch algorithm. FIG. 8D is a diagram showing an example of an alignment table for explaining the Needleman-Wunsch algorithm. FIG. 9 is a flowchart for explaining an example of alignment processing using dynamic programming by a computer system according to an embodiment of the present invention. FIG. 10A is a diagram showing an example of an alignment table for explaining alignment using dynamic programming according to an embodiment of the present invention. FIG. 10B is a diagram showing an example of an alignment table for explaining alignment using dynamic programming according to an embodiment of the present invention.Fig. 10C is a diagram showing an example of an alignment table for explaining alignment using dynamic programming according to an embodiment of the present invention. Fig. 11A is a diagram showing an example of approximate character strings obtained by alignment using dynamic programming according to an embodiment of the present invention. Fig. 11B is a diagram showing an example of approximate character strings obtained by alignment using dynamic programming according to an embodiment of the present invention. Fig. 12 is a diagram showing an example of the hardware configuration of a computing device in a system according to an embodiment of the present invention.
[0046] Hereinafter, embodiments of the present invention will be described with reference to the drawings. However, the embodiments described below are merely examples, and are not intended to exclude various modifications or applications of techniques not explicitly described below. The present invention can be implemented in various modifications (e.g., by combining the various embodiments) without departing from the spirit of the present invention. Furthermore, in the following description of the drawings, identical or similar parts are denoted by identical or similar reference numerals. The drawings are schematic and do not necessarily correspond to actual dimensions, ratios, etc. Parts in the drawings may have different dimensional relationships or ratios.
[0047] FIG. 1 is a block diagram illustrating an example of a schematic configuration of a computer system according to an embodiment of the present invention. As shown in the figure, the computer system 1 includes, for example, a host computer 10, multiple subordinate computers 20(1) to 20(n), and a database 30. The host computer 10 and the subordinate computers 20(1) to 20(n) are communicatively connected via a predetermined interface. In this disclosure, the computer system 1 is configured as a centralized computer system in which the host computer 10 comprehensively controls the multiple subordinate computers 20(1) to 20(n). However, this is not limited to this, and the computer system 1 may also be configured as a distributed computer system, for example. In a distributed computer system, each computer can operate cooperatively through parallel distributed processing, but for a specific process, only one representative computer may execute that process. The hardware configuration of the host computer 10 and the subordinate computers 20 is illustrated in FIG. 12, but detailed description thereof will be omitted as it is obvious to those skilled in the art. In this disclosure, the subordinate computers 20 process tasks in parallel under the control of the host computer 10. For example, each of the multiple lower-level computers 20 performs an analysis process based on a given individual query string in comparison with a reference string. Hereinafter, the lower-level computers 20(1) to 20(n) may be simply referred to as "lower-level computers 20" unless there is a particular need to distinguish between them.
[0048] The database 30 stores various data, such as reference character strings, under the control of the host computer 10. As an example, the database 30 stores a human genome reference sequence. The human genome reference sequence is data indicating a base pair sequence determined as a standard human genome sequence. The database 30 also stores an index created based on the reference character string. The index is a type of data array structure used to search for the reference character string. Note that, in the figure, the database 30 is configured to be connected so as to be accessible only to the host computer 10, but this is not limiting, and the database 30 may also be configured so as to be accessible to the lower computer 20.
[0049] 2 is a flowchart outlining an example of approximate string matching processing by a computer system according to an embodiment of the present invention. This processing is realized, for example, by a host computer 10 and a plurality of lower level computers 20 executing an approximate string matching program under the control of a processor, in cooperation with other hardware components.
[0050] That is, as shown in the figure, first, the host computer 10 reads the reference string stored in the database 30 and creates an index based on the read reference string (S201). Specifically, the host computer 10 creates an index having a predetermined data array structure by expanding and / or sorting substrings of the reference string according to predetermined conditions. The data array structure is a hierarchical tree structure. In the present disclosure, such an index is referred to as a hierarchical index. The host computer 10 stores the created index based on the reference string in the database 30. Details of the process of creating a hierarchical index based on the reference string will be described later. Note that if a hierarchical index based on the reference string has already been created and stored in the database 30, step S201 may be omitted.
[0051] Next, the host computer 10 receives a query string from an external device (not shown) and performs mapping by referencing the hierarchical index based on the received query string (S202). In one example, the external device is a sequencer that reads the human genome, and the query string is a data fragment of, for example, about 150 to 200 base pairs output from the sequencer. In the present disclosure, the lower-level computer 20 also performs mapping by referencing the hierarchical index based on the assigned query string under the control of the upper-level computer 10.
[0052] Mapping is a process for identifying substrings (matching strings) in a reference string that match at least a portion of a query string. That is, mapping identifies the start position and length (number of characters) of substrings in the reference string that match at least a portion of the query string. In the mapping disclosed herein, a hierarchical index is searched or searched for each key in the query string to identify each key of the query string and its start position in the reference string. Note that, to speed up processing, the created hierarchical index can be loaded into a high-speed memory such as main memory or cache memory.
[0053] Furthermore, in the mapping according to the present disclosure, when searching a hierarchical index, the sampling interval of the key appearance start position in the query string is adjusted to be somewhat larger than in conventional techniques. For example, in an algorithm called BLAST (Basic Local Alignment Search Tool) for performing sequence alignment of DNA base sequences and protein amino acid sequences, the interval of the key appearance start position is set to 3 to 5 characters, but in the search according to the present disclosure, it can be set to, for example, 10 characters or more. When searching, if the sampling interval of the key appearance start position is small, the number of searches increases and efficiency decreases. On the other hand, if the sampling interval of the key appearance start position is always large, the probability of overlooking a match increases in exchange for faster search. Therefore, in the present disclosure, while increasing the key length, if the key length exceeds a certain length, the sampling interval of the appearance start position is increased, thereby preventing key matches from being overlooked and improving search efficiency.
[0054] In the above example, the upper computer 10 and the lower computer 20 each perform mapping according to the assigned query string, but this is not limited to this. For example, only the upper computer 10 may perform a search by referring to a hierarchical index based on the assigned query string.
[0055] Next, the host computer 10 and the subordinate computer 20 each create a string pair for approximate string matching (S203), which will be described later. The string pair consists of a matched string in the reference string and a matching string in the query string, including a matching string identified by mapping.
[0056] Specifically, the host computer 10 and the lower computer 20 create a matched string by adding a corresponding character string of a predetermined length in the reference string to the beginning and end of the matching string identified by mapping. In other words, the matched string is a character string in the vicinity of the matching string identified in the reference string, including the matching string. For example, if the reference string is "CCGATCTGTATACCCTACGA" and the matching string is "TACC," the string to be matched is "TATACCCT," which is obtained by adding two characters to the beginning and two characters to the end. In the case of human genome analysis, the length of bases added to the beginning and end of the matching string for the reference string may be, for example, about 50 bases each.
[0057] Furthermore, the host computer 10 creates a matching string by adding a corresponding character string of a predetermined length in the query string to the end of the matching string. In the case of analyzing the human genome, the length of the character string added to the end of the matching string for the query string is, for example, about 50 bases.
[0058] In the present disclosure, for a reference string, a character string of a predetermined length is added to the beginning and end of the matching string, but this is not limited to this, and for example, a character string of a predetermined length may be added to only one of the beginning or end. Furthermore, for a query string, a character string of a predetermined length may be added to the beginning and end of the matching string, or the matching string itself may be treated as a matching string without adding any character string.
[0059] Next, the host computer 10 and the lower-level computer 20 derive at least one approximate string based on a string pair consisting of a matched string based on the reference string and a match string based on the query string (S204). A predetermined alignment using dynamic programming is applied to derive the approximate string. Alignment is a technique for comparing two sequences (strings) while allowing substitution, insertion, and deletion between their elements, and calculating the degree of variation (similarity) according to a defined score / penalty. Known algorithms for achieving alignment include the Smith-Waterman algorithm and the Needleman-Wunsch algorithm. Dynamic programming is a technique for calculating the optimal solution for the next stage based on the optimal solution obtained at a given stage. In other words, in calculating the degree of variation, a score is calculated for each element in an array-like alignment table according to dynamic programming, and the element with the highest score is determined, thereby deriving at least one approximate string.
[0060] As described above, in the approximate string matching of this embodiment, a hierarchical index based on a reference string is created, and then a matching string (and its length) is identified by searching the hierarchical index according to a given query string. An approximate string is then derived by performing approximate string matching on a string pair consisting of a matched string and a matching string based on the identified matching string.
[0061] Fig. 3 is a flowchart illustrating an example of index creation processing by a computer system according to an embodiment of the present invention. Specifically, Fig. 3 shows details of the hierarchical index creation processing (S201) shown in Fig. 2. Fig. 4 is a diagram illustrating an example of a reference string for creating a hierarchical index, and Figs. 4A to 4C are diagrams illustrating an example of a data array structure in the process of creating a hierarchical index based on the reference string. Fig. 5 is a diagram illustrating an example of a table structure indicating the start position and number of occurrences of a key in the process of creating a hierarchical index, and Fig. 6 is a diagram for explaining a hierarchical index.
[0062] First, as shown in Fig. 3, the host computer 10 receives a reference string for creating a hierarchical index (S301). For example, in the case of a human genome reference sequence, the host computer 10 accesses the database 30 and reads out the stored human genome reference sequence. For ease of understanding, the following description will be given using as an example the reference string "CCGATCTGTATACCCTACGA" consisting of four characters, "A," "C," "G," and "T" (see Fig. 4).
[0063] The host computer 10 extracts each substring (i.e., key) from the received reference string according to a predetermined key length to create a key arrangement (S302). For example, if the key length is "2", the key arrangement will be as shown in Figure 4A(a). In the figure, the number on the left is the array number. For simplicity's sake, the 19th key, beginning with "A", which is the end of the reference string, has been omitted here.
[0064] Next, the host computer 10 calculates a hash value for each key in the created keyboard layout using a predetermined hash function and assigns it to the key (S303). This results in a keyboard layout as shown in FIG. 4A(b). The hash function in this disclosure is defined as a function that outputs a value expressed in quaternary using the numeric values "0" to "3" assigned to the four characters "A," "C," "G," and "T," respectively, but is not limited to this. For example, for the first key "CG," the hash value is h(CG) = 1 x 4 + 2 = 6, and for the eleventh key "AC," the hash value is h(AC) = 0 x 4 + 1 = 1.
[0065] Next, the host computer 10 sorts each key in the key array, for example, in ascending order, according to the assigned hash value (S304). This results in a key array as shown in FIG. 4A(c). In this example, each key array after sorting may include the array number before sorting. For example, in FIG. 4A(c), the 0th key "AC" in the sorted key array holds the (original) array number "11" before sorting, and the 1st key "AC" after sorting holds the array number "16" before sorting.
[0066] In the above example, a calculated hash value is assigned to each extracted key and sorted, but this is not limiting. For example, regardless of the key extracted from the reference string, a key array may be prepared in which hash values are calculated and assigned based on the combination of all characters that appear in the reference string, and the appearance start position corresponding to the extracted key may be assigned. That is, in a reference string consisting of four characters, "A", "C", "G", and "T", for example, if the key length is two characters, then 4 2 First, a key array with elements is created, and each element is assigned a hash value. Then, the extracted keys are assigned to corresponding elements (elements with the same key) in the created key array along with the start position of their appearance in the reference string, resulting in the key array shown in Figure 4A(c).
[0067] Next, the host computer 10 identifies the appearance start position and the number of appearances of each key in the current keyboard layout (S305). FIG. 5(a) shows the appearance start position and the number of appearances of each key in the keyboard layout shown in FIG. 4A(c). For example, it is shown that the key "AC" appears twice in the keyboard layout, starting from the appearance start position "0" (sequence number "0"). It is also shown that the key "CC" appears three times, starting from the appearance start position "4". Note that here, the appearance start positions and the number of appearances for all key patterns (i.e., 16 patterns) consisting of combinations of each character are shown, and for example, the key "AA" not included in the illustrated keyboard layout is shown as having an appearance start position of "-" and an appearance number of "0".
[0068] Next, the host computer 10 determines whether the number of occurrences of each key exceeds a predetermined tolerance (S306). In this disclosure, the predetermined tolerance is a value that allows the same key to exist multiple times in the hierarchical index. In this example, the predetermined tolerance is set to "1." In other words, if the predetermined tolerance is "1," each key will exist uniquely in the hierarchical index. Furthermore, the larger the predetermined tolerance, the higher the possibility that duplicate keys will exist in the hierarchical index, while also speeding up the creation of the hierarchical index. If the host computer 10 determines that there is a key whose number of occurrences exceeds the predetermined tolerance (Yes in S306), it adds an additional key to that key (S308).
[0069] An additional key is one or more characters following the key in the original string. In this example, the additional key is one character. The substring obtained by adding the additional key is considered a new key. Hereinafter, the new key to which the additional key has been added will be referred to as an "extended key" to distinguish it from the original key, and the resulting array may be referred to as an "extended key array." The addition of the additional key allows each key to be identified as distinct from the others. Figure 4B (a) shows an example of an extended key array consisting of an extended key in which one additional key has been added to the original key. For the extended key "GA" with array number "12," since there is no character following "A" in the original string, a termination string such as "$" is assigned. Furthermore, since the keys with array numbers "13," "17," and "18" appear only once, no additional key is added.
[0070] Next, the host computer 10 further sorts each key (i.e., the extended keys) according to the added key, for example, in ascending order (S308), as shown in FIG. 4B(b). In this case, the sort order of the original keys takes priority. In the same figure, for example, it can be seen that the order of the key arrangement "AT" with array numbers "2" and "3" has been reversed by sorting according to the added key. Next, the host computer 10 returns to step S306 and repeats the above process until the number of occurrences of all keys does not exceed the predetermined allowable value.
[0071] That is, the host computer 10 identifies the start position and number of appearances of each key in the key arrangement (S305), and if it determines that there are no keys whose number of appearances exceeds a predetermined allowable value (No in S306), the desired hierarchical index has been created, and the processing ends.
[0072] FIG. 5 is a diagram illustrating the start position and number of occurrences of keys in the process of creating a hierarchical index based on the reference string shown in FIG. 4. For example, for keys with an occurrence count of two or more in FIG. 5(a), an additional key is added (FIG. 4B(a)), and each key (extended key) is sorted according to the additional key (FIG. 4B(b)). As a result, the start position and number of occurrences of each key in the current key arrangement are identified, as shown in FIG. 5(b). In the example shown in the figure, the number of occurrences of the extended keys "CGA" and "TAC" is two. Therefore, for each of these extended keys, an additional key is added and sorted in the same way (FIGS. 4C(a) and 4C(b)). Note that for the key "CG" of the original array number "17" (which becomes array number "8" after sorting by hash value), there is no character following the key "A," so a termination string, for example, "$," is assigned. As a result, the start position and number of occurrences of the key are identified, as shown in FIG. 5(c). As a result, the number of occurrences of all extended keys is now "1", and the index creation process is completed.
[0073] Consider the key "TA" as an example. Since the key "TA" is in the array numbers "14" to "16" (see FIG. 4A(c)), its start position is "14" and its number of occurrences is "3" as shown in FIG. 6(a). Next, an additional key is added to the key "TA" and sorted (see FIG. 4B(b)). As shown in FIG. 6(b), the start position of the extended key "TAC" containing the additional key "C" is "14" and its number of occurrences is "2," while the start position of the extended key "TAT" containing the additional key "T" is "16" and its number of occurrences is "1." Therefore, the additional keys "C" and "G" are further added to the key "TAC" with a number of occurrences of "2," resulting in the key "TACG" having a number of occurrences of "1" as shown in FIG. 6(c). In this way, the extended key arrangement can be understood as a hierarchical tree structure.
[0074] In this way, the host computer 10 creates a hierarchical index based on, for example, the human genome reference sequence. Because such a hierarchical index is sorted according to hash values, the partial data array structure of the hierarchical index associated with a specific key (substring) is expanded intensively in a specific address area in the main memory (data is sequentialized), thereby significantly reducing the number of random accesses to the main memory.
[0075] For simplicity, the above description has been given using an example of an extremely short character string. However, when dealing with the human genome, for example, it is preferable to set the key length of the partial character string to about 10 to 20, the key length of the additional key to 2 to 8, and the predetermined tolerance to 5 to 40, and it is even more preferable to set the key length of the partial character string to about 10 to 15, the key length of the additional key to 2 to 4, and the predetermined tolerance to 10 to 20.
[0076] 7 is a flowchart illustrating an example of a search process for a reference string based on a query string performed by a computer system according to an embodiment of the present invention. Specifically, FIG. 7 shows details of the search process (S202) for a reference string based on a query string shown in FIG. 2. This search process maps a predetermined key in the query string to the reference string, and identifies a matching string and its appearance start position in the reference string. While the search process performed by the host computer 10 will be described below, the search process performed by the subordinate computer 20, which operates in parallel, is similar.
[0077] As shown in the figure, the host computer 10 reads the hierarchical index from the database 30, expands it in memory, and stores it (S701). From the perspective of speed, the host computer 10 expands and stores the data that make up the hierarchical index contiguously in main memory. Here, "contiguously expanding" includes arranging the data at contiguous memory addresses in the same bank.
[0078] Next, the host computer 10 receives a query string for mapping to the reference string (S702). For example, if the reference string is a human genome reference sequence, the query string is a data fragment of base pairs read from a sequencer. For ease of understanding, the following description will be given assuming that the query string is "TACC."
[0079] Next, the host computer 10 successively extracts each key from the received query string according to a predetermined key length (S703). In this example, the initial value of the predetermined key length is "2." Therefore, the extracted keys are "TA," "AC," "CC," and "C$." In addition, in this example, the initial value of the sampling interval for each key is 1. The key sampling interval is the interval between the start positions for sequentially referencing the hierarchical index according to the key. Note that in the case of human genome analysis, the initial value of the sampling interval may be, for example, approximately 3 to 5. As will be described later, the sampling interval is extended according to the key length.
[0080] Next, the host computer 10 calculates a hash value for each extracted key using a predetermined hash function (S704). As described above, a hash function is defined as a function that outputs a value expressed in quaternary using the numerical values "0" to "3" assigned to the four characters "A," "C," "G," and "T," respectively. For example, for the key "TA," the hash value is h(TA) = 3 x 4 + 0 = 12.
[0081] Next, the host computer 10 refers to the hierarchical index according to the calculated hash value (S705) and identifies the appearance start position and the number of appearances of each key in the reference character string (S706). For example, for the key "TA", according to the hash value, the appearance start position in the hierarchical index is identified to be 14 and the number of appearances is identified to be 3 (see FIG. 6(a)).
[0082] Next, the host computer 10 determines whether the number of occurrences of each key exceeds a predetermined threshold value (S707). As described above, in this example, the predetermined tolerance is 1. If the host computer 10 determines that the number of occurrences of the key exceeds the predetermined tolerance value (Yes in S707), it then determines whether the current key length exceeds a predetermined upper limit value (S708). The predetermined upper limit value may be, for example, about 20 in the case of human genome analysis, but is not limited to this.
[0083] If the upper computer 10 determines that the current key length for each key does not exceed the specified upper limit (No in S708), it creates an extended key by adding an additional key to the key (S709) and returns to processing in S706.
[0084] For example, the host computer 10 adds an additional key "C" to the key "TA" and checks the number of times it appears (see FIG. 6(b)), and then adds an additional key "C" to the key (extended key) to which the additional key has been added and checks the number of times it appears (see FIG. 6(c)), repeating this process until the number of times it appears becomes 1.
[0085] On the other hand, if the host computer 10 determines that the current key length for each key exceeds the predetermined upper limit (Yes in S708), it extends (increases) the sampling interval for that key (S710) and returns to the processing of S705. Note that the extension of the sampling interval may be performed only a predetermined number of times (for example, once) for each key.
[0086] Furthermore, if the host computer 10 determines that the number of occurrences of the current key (i.e., the extended key) does not exceed a predetermined allowable value (No in S707), it outputs the key (matching string) in the identified reference string and its start position of occurrence (S711).
[0087] In this way, the host computer 10 can use the hierarchical index to search for at least a part of the query string from the reference string. In particular, according to this embodiment, since each key of the hierarchical index is sorted according to a hash value, a search according to the query string is performed on a partial and continuous data array structure in the hierarchical index, which makes it possible to significantly reduce the number of random accesses to the main memory.
[0088] Furthermore, when searching a hierarchical index, if the length of the current key (extended key) exceeds a certain length, the sampling interval for the appearance start position is extended, which effectively reduces the number of searches and speeds up the search. On the other hand, extending the sampling interval may increase the probability of missing a key that should have been identified, but since the sampling interval is lengthened when the key length exceeds a certain length, this effectively prevents such oversights.
[0089] Next, alignment using dynamic programming will be described. That is, the host computer 10 executes alignment processing using dynamic programming to estimate the degree of variation (variation degree) of the query string (matching string) relative to a string (matched string) near the identified appearance start position in the reference string.
[0090] Alignment is a technique for comparing two sequences (character strings) while allowing substitutions, insertions, and deletions between their elements, and calculating the degree of variation (similarity) according to a defined score / penalty. For example, in a comparison between character string X (i.e., a matched character string based on a reference character string) and character string Y (i.e., a matched character string based on a query character string), if some characters in character string Y are substituted, inserted, or deleted, character string Y is determined to not match character string X. In other words, the relationship between characters at each position in character strings X and Y can be said to be one of the following: a match (match), a mismatch (mismatch), or one character not being present (gap). Here, a score for a match is defined as, for example, "+2," a score for a mismatch is defined as, for example, "-1," and a score for a gap is defined as, for example, "-2." Then, each element (character) of character string X and character string Y is compared, and the variation of each element is calculated using these scores. In this disclosure, an improved alignment algorithm based on the Needleman-Wunsch algorithm, which is an example of global alignment, is used to calculate the degree of variation. Below, the basic concept of the Needleman-Wunsch algorithm will be explained, and further, the improved alignment algorithm applied to the present invention will be explained.
[0091] For example, the string X=x 1 x 2.. x i and the string Y = y 1 y 2.. y j In comparison with the letter x i and the letter y j The variance F(i, j) is defined as follows: Here, max is a function that outputs the maximum value among the values of a given expression, s is a score function (match: s=2, mismatch: s=-1, gap: s=-2), and d is a penalty due to a gap (d=2).
[0092] For ease of understanding, the following describes alignment between a matched string "GCCTCGCT" and a matching string "GCCATTCA" using dynamic programming.
[0093] 8A is an alignment table that arranges the strings to be compared in this example. In the table, "φ" is a null character, and F(0,0) = 0. Also, in Equation 1, if the argument of the mutation degree F(i,j) is a negative value, it is out of range and the calculation is omitted (the output is Null). The alignment table is expanded in memory as a type of data structure and is made available for use by the processor.
[0094] First, when j=0, for F(1,0), from Equation 1, each in the max function is F(0,-1)+s(x 1 , y 0 ) = Null F(0,0) - d = 0 - 2 = -2 F(1,-1) - d = Null, so F(1,0) = -2.
[0095] Next, F(2,0) becomes F(2,0)=F(1,0)-d=-4. Similarly, F(n,0)=-nd F(0,n)=-nd, and the alignment table becomes as shown in FIG. 8B.
[0096] Next, when j = 1, the calculation is similar. For F(1,1), each in the max function is F(0,0) + s(x 1 , y 1 )=0+2=2 F(0,1)-d=-2-2=-4 F(1,0)-d=-2-2=-4, which results in F(1,1)=2 and the alignment table is as shown in FIG. 8C.
[0097] By repeating the above calculations in a similar manner, an alignment table such as that shown in FIG. 8D is created. In the created alignment table, the mutation degree F(6,7) at element position (6,7) has the maximum value of "7." Therefore, as shown in the same figure, backtracking is performed from element position (6,7) to element position (1,1). In the table, arrows pointing diagonally downward to the right indicate a character match, arrows pointing to the right indicate a deletion, and arrows pointing downward indicate an insertion. This derives the approximate string "GCCT[T]G." Here, the symbols "< >" represent an insertion between characters, and the symbols "[ ]" represent a substitution. In other words, it can be seen that while the reference string is "GCCTCG," in the query string, an "A" is inserted between the "C" and "T" of the reference string, and the "C" of the "TCG" in the reference string has been replaced with a "T."
[0098] As described above, by identifying the element position in the alignment table where the degree of variation is the maximum according to the Needleman-Wunsch algorithm, an approximate character string can be derived from there. However, since the Needleman-Wunsch algorithm calculates the degree of variation of all elements in the alignment table, the amount of calculation required is enormous and it takes a long time. Therefore, in this disclosure, the following improved alignment algorithm is proposed, which reduces the amount of calculation and speeds up processing.
[0099] That is, the improved alignment algorithm applied to the present invention roughly involves defining a calculation region of a predetermined width centered on an element located on the diagonal of the alignment table, calculating the degree of variation only for elements within the calculation region to determine its maximum value, and deriving an approximate string from the element based on the maximum value if the maximum value satisfies a predetermined condition. If the maximum value does not satisfy the predetermined condition, the calculation region is expanded, and the degree of variation is similarly calculated to determine the maximum value, and this process is repeated until the maximum value satisfies the predetermined condition.
[0100] Fig. 9 is a flowchart illustrating an example of alignment processing using dynamic programming by a computer system according to an embodiment of the present invention. That is, Fig. 9 shows details of (S204) of the alignment processing shown in Fig. 2. Note that, although the alignment processing based on one query string by the host computer 10 will be described below, the same applies to alignment processing based on other query strings by the lower-level computers 20 operating in parallel.
[0101] As shown in the figure, the host computer 10 creates an alignment table based on string pairs consisting of a matched string and a matching string (S1001). As described above, the alignment table is developed in memory as a certain type of data structure.
[0102] Next, the host computer 10 sets the width m (where m is a positive number) of the calculation region to an initial value (S1002). The initial value of width m may be, for example, the length of the matched string obtained by mapping, but is not limited to this. Furthermore, since width m is centered on the diagonal element position of the alignment table, it is set to an odd number, but is not limited to this. This determines a calculation region of width m centered on the diagonal element position of the alignment table.
[0103] Next, the host computer 10 sets a predetermined dummy value to each element that defines the boundary of the calculation domain (S1003). The dummy value is selected to be a value that is sufficiently small as the value of the variability F. For example, the dummy value is a negative value, for example, about 2 to 3 times the width m of the initial value, and can be set arbitrarily.
[0104] Next, the host computer 10 calculates the mutation degree F for each element in the calculation domain according to Equation 1 (S1004). max The maximum variability F max There is not necessarily only one element with
[0105] The host computer 10 also determines the lower limit F of the degree of variation F in a row or column of the alignment table.Low is calculated (S1006). Low is the value of the variability F when comparing the reference string and the query string in the row or column, assuming that there are m consecutive gaps and the rest of the string matches perfectly or substantially. That is, the lower limit F Low is F Low = (length of character string - m) x s ... Equation 2 where s = 2.
[0106] Next, the host computer 10 calculates the maximum mutation degree F max and the lower limit F Low Compared with the maximum mutation F max is the lower limit F Low The host computer 10 determines whether the maximum mutation degree F max is the lower limit F Low If it is determined that the width m does not exceed δ (No in S1007), the width m is increased by a predetermined size δ (S1008). For example, δ is set to m+1 (however, m does not exceed the number of characters in the string).
[0107] The host computer 10 performs the same process on the expanded calculation area of width m, and obtains the maximum value F max is the lower limit F Low The above process is repeated until the
[0108] The host computer 10 determines the maximum value F max is the lower limit F Low If it is determined that the maximum value exceeds the maximum value (Yes in S1007), backtracking is performed from the position of the element with the maximum value to determine an approximate character string (S1009).Then, the host computer 10 outputs the determined approximate character string (S1010).
[0109] For example, an example of calculating the degree of variation using the alignment method according to the present invention between a matched string "GGGATCCGATAATCGGTCCCCTAGG" (24 characters) and a matching string "GGGCATTCAACATAAGTCGGCCTG" (24 characters) will be described. Note that, as in the above example, Equation 1 is used to calculate the degree of variation F. Note that the length of the matched string and the length of the matching string do not need to be the same, and typically the length of the matched string is longer than the length of the matching string.
[0110] First, the host computer 10 prepares an alignment table in which the strings to be compared are arranged, and sets an initial value for the width m. In this example, the initial value of the width m(0) is set to 7. The host computer 10 also sets dummy values to elements at the boundary of the calculation area defined according to the width m. In this example, the dummy value is set to -20. Figure 10A shows the alignment table in which dummy values have been set. In the table, the hatched elements are the calculation area R(0) with width m(0) = 7.
[0111] The host computer 10 calculates the mutation degree F of each element in the calculation region R(0) according to Equation 1. FIG. 10B shows the state in which the mutation degree F of each element in the calculation region has been calculated. The host computer 10 selects the maximum mutation degree F from the calculated mutation degrees F. max In this example, the maximum mutation degree F max is 17. In the figure, the maximum mutation degree F max The elements with a value of 17 are shown hatched.
[0112] Next, the host computer 10 determines the lower limit F in the row or column of the alignment table. Low In this example, the lower limit F Low is F Low = (24 - m) × s = 17 × 2 = 34.
[0113] Next, the host computer 10 calculates the maximum mutation degree F max and the lower limit F Low This results in the maximum mutation degree F max is the lower limit F LowIn order to determine that the width m does not exceed δ, the width m is widened by δ. In this example, the widened width m(1) is widened to 15. The calculation region of the widened width m(1) is defined as R(1).
[0114] Similarly, the host computer 10 calculates the degree of variation F of each element in the calculation region R(1) according to Equation 1. FIG. 10C shows the state in which the degree of variation F of each element in the calculation region has been calculated. In the figure, hatching is drawn on the region that has been added to the calculation region R(1) by widening. As a result, the maximum degree of variation F max is 19. In addition, the lower limit F Low becomes 18.
[0115] Therefore, the host computer 10 determines the maximum mutation degree F max is the lower limit F Low In order to determine that it exceeds the maximum mutation degree F max = 19, and identify the approximate string according to the resulting path.
[0116] That is, in the example shown in FIG. 10C, the host computer 10 max Starting from element (18, 22) with a mutation index F of 19 as the starting point (current element position), the element with the largest mutation index F value is identified among the adjacent elements in the direction of element (0, 0), and transition is made to that element. Therefore, element (17, 21) with a mutation index F of 17 becomes the current element position. By repeating this transition up to element (0, 0), an approximate string is finally derived. Note that the number of paths obtained by backtracking is not limited to one, and there may be multiple paths.
[0117] 10C, there are six paths obtained by backtracking, and the approximate strings according to each path are as follows: (a) First path: GGG<C>A<T>TC<AA>C-ATAA<G>TCG[G]CC (b) Second path: GGG<C>A<T>TC[A][C]ATAA<G>TCG[G]CC (c) Third path: GGG<C>AT[T]C[A][C]ATAA<G>TCG[G]CC (d) Fourth path: GGG<C>AT[T]C[A]<AC>ATAA<G>TCG[G]CC (e) Fifth path: GGG<C>A<T>TC<AA>C-ATAA<G>TCG[G]CC (f) Sixth path: GGG<C>AT<T>C[A][C]ATAA<G>TCG[G]CC where the symbol "< >" represents an insertion between characters, the symbol "[ ]" represents a character substitution, and the symbol "-" represents a missing character. For ease of understanding, approximate strings following each of the above paths are shown in comparison with the reference string in Figures 11A and 11B.
[0118] In this way, the improved alignment algorithm does not calculate the degree of variation for all elements in the alignment table, but defines a calculation region with a predetermined width and calculates the degree of variation while expanding the calculation region as needed, thereby reducing the amount of calculation and thereby enabling faster processing.
[0119] As described above, according to this embodiment, a hierarchical index based on a reference string is created, and then a matching string (and its length) is identified by searching the hierarchical index according to a given query string. An approximate string is then derived by performing approximate string matching on a string pair consisting of a matched string and a matching string based on the identified matching string.
[0120] The above-described embodiments are merely examples for explaining the present invention, and are not intended to limit the present invention to these embodiments. The present invention can be embodied in various forms without departing from the spirit of the present invention.
[0121] For example, in the methods disclosed herein, steps, operations, or functions may be performed in parallel or in a different order unless the results are inconsistent. The steps, operations, and functions described are provided merely as examples, and some of the steps, operations, and functions may be omitted or combined into one, or other steps, operations, or functions may be added, without departing from the spirit of the invention.
[0122] Furthermore, although various embodiments are disclosed in this specification, specific features (technical matters) in one embodiment can be added to or substituted for specific features in other embodiments, with appropriate modifications, and such forms are also included in the spirit of the present invention.
[0123] 1... Computer system 10... Upper computer 20... Lower computer 30... Database
Claims
1. A computer program product for causing a computing device to execute a method for searching for an approximate string in a reference string based on a query string, the method comprising: creating a hierarchical index based on the reference string; mapping the query string to the reference string by referring to the hierarchical index to identify a substring in the reference string that matches at least a portion of the query string; deriving an approximate string that approximates the matched string based on a matched string based on the reference string and a match string based on the query string, the approximate string being created based on the substring identified by the mapping; creating the hierarchical index comprises: extracting first keys of a predetermined length from the reference string; creating a first key array in which hash values calculated based on the first keys using a predetermined hash function are assigned to each of the extracted first keys; updating the created first key array; and outputting the updated first key array as the hierarchical index, and updating the first key array comprises:
1. A computer program product comprising: for each first key in the first key arrangement, identifying a number of occurrences of the first key in the reference string; and updating the first key arrangement by adding to the first key a first additional key consisting of at least one character following the first key in the reference string in accordance with the number of occurrences of the identified first key.
2. The computer program product of claim 1, wherein creating the first key array includes sorting each of the first keys in the first key array according to the hash value.
3. The computer program of claim 1 or 2, wherein updating the first key sequence includes: determining whether the identified number of occurrences exceeds a predetermined tolerance; if it is determined that the identified number of occurrences exceeds the predetermined tolerance, creating a new first key by adding to the first key the first additional key consisting of at least one character following the first key in the reference string; and identifying, for the new first key, the number of occurrences of the new first key in the reference string.
4. The computer program product of claim 1, wherein updating the first keyboard array further comprises sorting the new first keys in the first keyboard array according to the first additional key.
5. The computer program product of claim 3 or 4, wherein updating the first key sequence includes creating a new first key by sequentially adding a new first additional key to a current first key until it is determined that the identified number of occurrences does not exceed a predetermined tolerance value.
6. A computer program product according to any one of claims 3 to 5, wherein outputting the first key arrangement as the hierarchical index includes outputting the current first key arrangement as the hierarchical index if it is determined that the identified number of occurrences does not exceed a predetermined tolerance.
7. A computer program product according to any one of claims 1 to 6, wherein performing the mapping comprises: extracting each second key of a predetermined length from the query string; creating a second key array to which each of the second keys extracted from the query string is assigned a hash value calculated based on the second key using the predetermined hash function; and, for each of the second keys, referring to the hierarchical index at predetermined sampling intervals according to the hash value, identifying the start position of appearance of the second key and the number of appearances of the second key.
8. The computer program product of claim 7, wherein identifying the start position and the number of occurrences of the second key includes: determining whether the number of occurrences of the second key exceeds the predetermined tolerance; creating a new second key by adding to the second key a second additional key consisting of at least one character following the second key in the query string if it is determined that the number of occurrences of the second key exceeds the predetermined tolerance; and outputting the identified current second key as the substring and the start position of the occurrence of the second key if it is determined that the number of occurrences of the second key does not exceed the predetermined tolerance.
9. The computer program product of claim 8, wherein identifying the starting position of occurrences and the number of occurrences of the second key further comprises: sequentially adding new additional second keys to a current second key to create the new second key until it is determined that the identified number of occurrences of the second key does not exceed the predetermined tolerance.
10. The computer program product according to claim 8 or 9, further comprising increasing the predetermined sampling interval for the second key if it is determined that the number of occurrences of the second key exceeds the predetermined tolerance.
11. The computer program product of any one of claims 8 to 10, wherein deriving the approximate string comprises: receiving a string pair consisting of the matched string and the match string based on the substring identified by the mapping; performing a predefined alignment process to derive at least one approximate string based on the string pair; and outputting the derived at least one approximate string.
12. The computer program of claim 11, wherein executing the predetermined alignment process includes: creating a predetermined alignment table based on the matched string and the match string; setting a calculation area having a width m centered on a diagonal element of the alignment table; calculating a degree of variation for each element in the set calculation area; determining a maximum degree of variation based on the calculated degree of variation; and deriving the at least one approximate string based on the determined maximum degree of variation.
13. The computer program of claim 12, wherein executing the predetermined alignment process includes: comparing the maximum mutation degree with a predetermined lower limit value to determine whether the maximum mutation degree exceeds the predetermined lower limit value; widening the width m of the calculation area to set a new calculation area when it is determined that the maximum mutation degree does not exceed the predetermined lower limit value; and deriving the at least one approximate string based on an element having the maximum mutation degree when it is determined that the maximum mutation degree exceeds the predetermined lower limit value; and repeating the process of setting a new calculation area by widening the calculation area and calculating the mutation degree until it is determined that the maximum mutation degree exceeds the lower limit value.
14. The computer program according to claim 13, wherein the predetermined lower limit is a value of the degree of variation when it is assumed that a predetermined element string has m consecutive gaps and the remaining parts are identical.
15. The computer program product of claim 11, further comprising: creating the matched string by appending a corresponding predetermined string in the reference string to the substring; and creating the match string by appending a corresponding predetermined string in the query string to the substring.
16. A computer program product for causing a computing device to execute a method for creating a hierarchical index for searching a reference string based on a query string, the method comprising: extracting each first key of a predetermined length from the reference string; creating a first key array for each extracted first key by assigning a hash value calculated based on the first key using a predetermined hash function; updating the created first key array; and outputting the updated first key array as the hierarchical index, wherein updating the first key array comprises: for each first key in the first key array, identifying a start position and a number of occurrences of the first key in the reference string; and updating the first key array by adding, to the first key, a first additional key consisting of at least one character following the first key in the reference string in accordance with the start position and the number of occurrences of the identified first key.
17. A computer program product for causing a computing device to execute a method for mapping a query string to a reference string, the method comprising: reading a hierarchical index consisting of each first key extracted from the reference string and a first key array in which a hash value calculated based on the first key by a predetermined hash function is assigned to each of the first keys, the first key array being an additional key added to the first key according to an appearance start position and a number of appearances of the first key in the reference string; extracting each second key having a predetermined key length from the query string; creating a second key array in which each of the second keys extracted from the query string is assigned a hash value calculated based on the second key by a predetermined hash function; referring to the hierarchical index at a predetermined sampling interval according to the hash value, and identifying an appearance start position and a number of appearances of the second key by comparing the second key with the first key in the first key array; and determining whether the identified number of appearances exceeds a predetermined threshold. a step of generating a new second key by adding to the second key an additional key consisting of at least one or more characters following the second key in the query string when it is determined that the identified number of occurrences exceeds a predetermined tolerance; and a step of outputting an occurrence start position of the identified current second key and the key when it is determined that the identified number of occurrences does not exceed a predetermined threshold, wherein identifying the occurrence start position and the number of occurrences of the second key includes sequentially adding the new additional key to the current second key until it is determined that the identified number of occurrences does not exceed a predetermined threshold, thereby generating the new second key.
18. The computer program product of claim 17, wherein the method is configured to increase the predetermined sampling interval for the second key if it is determined that the identified number of occurrences exceeds a predetermined tolerance.
19. A computer program for causing a computing device to execute a method for identifying mutations between a substring in a reference string and a query string by a predetermined alignment process, the method comprising: receiving a string pair, the string pair being created based on the substring identified by mapping, the string pair being a matched string based on the reference string and a match string based on the query string; executing a predetermined alignment process to derive at least one approximate string that approximates the matched string based on the string pair; and outputting the derived at least one approximate string, the computer program comprising: creating a predetermined alignment table based on the matched string and the match string; setting a calculation area having a width m centered on a diagonal element of the alignment table; calculating a degree of mutation for each element in the set calculation area; determining a maximum degree of mutation based on the calculated degree of mutation; and deriving the at least one approximate string based on the determined maximum degree of mutation.
20. The computer program product of claim 19, wherein executing the predetermined alignment process includes: comparing the maximum mutation degree with a predetermined lower limit value to determine whether the maximum mutation degree exceeds the predetermined lower limit value; widening the width m of the calculation area to set a new calculation area when it is determined that the maximum mutation degree does not exceed the predetermined lower limit value; and deriving the at least one approximate string based on an element having the maximum mutation degree when it is determined that the maximum mutation degree exceeds the predetermined lower limit value; and repeating the process of setting a new calculation area by widening the calculation area and calculating the mutation degree until it is determined that the maximum mutation degree exceeds the lower limit value.
21. The computer program according to claim 20, wherein executing the predetermined alignment process further comprises setting the value of the degree of variation when it is assumed that there are m consecutive gaps in a predetermined element string and that the remaining parts match as the predetermined lower limit value.
Citation Information
Patent Citations
Computer-facilitated parallel information alignment and analysis
US20120239706A1
Genome Sequence Alignment System and Method
US20210201163A1
Cited By
Multi-source data management method and system applied to base layer platform
CN119322917A
