Gene matching technology
By combining the database search and optical computing chip optical independent comparison method, the problem of low efficiency of genetic comparison in existing technology has been solved, and the fast and efficient genetic comparison effect is achieved.
Patent Information
- Application Number
- CN201911046513.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2019-08-02
- Filing Date
- 2019-10-30
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2039-10-30
AI Technical Summary
The prior art is difficult to quickly process gene alignment tasks in massive DNA sequencing data, resulting in inefficiency.
The genetic comparison method that combines database search and optical computing chip optical comparison. By constructing a genetic database for initial matching, the reference gene fragments that may match possible matching are screened, and the optical computing chip is used to compare the rapid optical comparison.
It significantly improves the efficiency of genetic comparison, and can quickly achieve comparison when facing massive gene sequencing data, reducing the detailed comparison needs of reference gene fragments.
Smart Images

Figure CN112309501B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of optical technology, and in particular to a gene comparison technology. Background Art
[0002] Deoxyribonucleic acid (DNA) is the main chemical component of chromosomes and also the material that makes up genes. Gene refers to a DNA sequence that carries genetic information, also known as a genetic factor, which is the basic structural unit and functional unit of genetic material that controls biological traits. Genes express the genetic information they carry by directing the synthesis of proteins, thereby controlling the expression of biological traits. With the emergence of DNA sequencing technology, until the completion of the Human Genome Project (HGP), the generation of DNA sequence data has shown an exponential growth. DNA sequence comparison is a prerequisite for gene identification, information analysis, structure prediction and other issues. By comparing multiple DNA sequences, we can find their identical and different sites and regions, thereby helping to determine the homology, variation points and sources of the genes to be tested.
[0003] With the rapid development of the next generation of DNA sequencing technology, the explosive accumulation of DNA sequencing data is much faster than the speed at which it is processed. In the face of these big data analysis tasks in the field of bioinformatics and the integration of data in various dimensions, a fast and convenient DNA comparison method is urgently needed. Summary of the invention
[0004] The present application provides a gene comparison technology that can improve the efficiency of DNA comparison.
[0005] In a first aspect, an embodiment of the present invention provides a gene comparison method, which is applied to a computer system including an optical computing chip. According to the method, in the process of implementing gene comparison, the processor of the computer system can obtain a first group of gene fragments from a gene database according to a gene sequence to be tested, and input the gene sequence to be tested and a plurality of reference gene fragments in the first group of gene fragments into the optical computing chip for optical comparison. The gene database contains a plurality of reference gene fragments of a reference gene sequence, and the first group of gene fragments includes a plurality of reference gene fragments that match partial bases of the gene sequence to be tested.
[0006] The gene comparison method provided in the embodiment of the present invention combines the two methods of database search and optical autocorrelation comparison, and performs a primary match between the constructed gene database and the gene sequence to be tested, thereby screening out the first group of reference gene fragments that may match the gene sequence to be tested. After the gene fragments to be compared are screened by the gene database provided in the embodiment of the present invention, the number of reference gene fragments that need to be compared in detail can be greatly reduced. In addition, in the embodiment of the present invention, after obtaining the first group of reference gene fragments, the gene sequence to be tested and the multiple reference gene fragments in the first group of reference gene fragments are further optically compared by an optical computing chip. Since the optical computing chip performs optical comparison, the comparison speed is faster than the method of performing gene comparison by electrical means. Therefore, the gene comparison method provided in the embodiment of the present invention also greatly improves the comparison efficiency.
[0007] In practical applications, the processor can obtain the first group of gene fragments from the database according to some bases of the gene sequence to be tested. For example, the first group of gene fragments is obtained from the database according to the first m bases and the last n bases of the gene sequence to be tested, wherein the value of m and the value of n are both greater than 0, and the sum of m and n is less than the number of bases in the gene sequence to be tested. Generally, the values of m and n can be determined according to factors such as the length of the gene sequence to be tested and the length of the reference gene sequence.
[0008] In one possible implementation, the database may be a key-value database, wherein the key value is a partial base of multiple reference gene fragments of the reference gene sequence, and the value value is the position of the multiple reference gene fragments in the reference gene sequence.
[0009] In one possible implementation, the method further includes obtaining multiple sub-reference gene sequences from the reference gene sequence when it is determined, based on the output result of the optical computing chip, that the similarity between the gene sequence to be tested and the first gene fragment in the first group of gene fragments is less than a first threshold value and greater than a second threshold value, and inputting the gene sequence to be tested and a first sub-reference gene sequence among the multiple sub-reference gene sequences into the optical computing chip for optical comparison to obtain a first similarity between the gene sequence to be tested and the first sub-reference gene sequence, wherein each sub-reference gene sequence is a part of the reference gene sequence.
[0010] In the embodiment of the present invention, when the similarity between the gene sequence to be tested and at least one gene segment in the first group of gene segments is less than the first threshold value and greater than the second threshold value, it indicates that the gene sequence to be tested is likely to find a matching reference gene segment in the reference gene sequence, and further comparison is required. Therefore, the gene sequence to be tested and multiple sub-reference gene sequences of the reference gene sequence can be further optically compared, so as to quickly find a reference gene segment that matches at least a portion of the gene sequence to be tested.
[0011] In another possible implementation, the method may further include determining that the first similarity is greater than a third threshold and less than a fourth threshold, and in response to the above determination, obtaining a first sub-gene sequence to be tested and a second sub-gene sequence to be tested according to the gene sequence to be tested, wherein the fourth threshold is not greater than the first threshold, and the first sub-gene sequence to be tested and the second sub-gene sequence to be tested have some of the same bases. Further, the first sub-gene sequence to be tested and the first sub-reference gene sequence are input into the optical computing chip for optical comparison to obtain a second similarity, and the second sub-gene sequence to be tested and the first sub-reference gene sequence are input into the optical computing chip for optical comparison to obtain a third similarity. According to this mode, when the similarity between the gene sequence to be tested and the first sub-reference gene sequence meets the preset condition, the gene sequence to be tested can be further split, and the split first sub-gene sequence to be tested and the second sub-gene sequence to be tested are respectively compared with the first sub-reference gene sequence, so that the partial fragments matching the first sub-reference gene sequence in the gene sequence to be tested can be located as soon as possible. Moreover, since this maximum similarity matching method can tolerate the missing of bases, it can achieve accurate positioning of the missing part or the variant part in the gene sequence to be tested. In practical applications, the first sub-gene sequence to be tested may include bases of a first preset length obtained from the head to the tail of the gene sequence to be tested, and the second sub-gene sequence to be tested may include bases of the first preset length obtained from the tail to the head of the gene sequence to be tested, and some bases of the first sub-gene sequence to be tested and the second sub-gene sequence to be tested overlap.
[0012] In another possible implementation, the method further includes recording the position of the first sub-reference gene sequence in the reference gene sequence when the second similarity is greater than the fourth threshold. According to this method, when the second similarity between the first sub-gene sequence to be tested and the first sub-reference gene sequence is greater than the fourth threshold, it can be confirmed that the first sub-gene sequence to be tested has the maximum similarity match with the first sub-reference gene sequence, so that the position of the first sub-reference gene sequence in the reference gene sequence can be recorded to obtain the maximum similarity match fragment of the first sub-gene sequence to be tested.
[0013] In another possible implementation, the method further includes: when the third similarity is greater than the third threshold value and less than the fourth threshold value, obtaining a first sub-gene sequence unit to be tested and a second sub-gene sequence unit to be tested according to the second sub-gene sequence to be tested, and inputting the first sub-gene sequence unit to be tested and the first sub-reference gene sequence into the optical computing chip for optical comparison, and inputting the second sub-gene sequence unit to be tested and the first sub-reference gene sequence into the optical computing chip for optical comparison. Wherein, some bases of the first sub-gene sequence unit to be tested and the second sub-gene sequence unit to be tested are the same. According to this method, if the matching result of the second sub-gene sequence to be tested and the first sub-reference gene sequence still does not reach the maximum similarity matching standard, the second sub-gene sequence to be tested can continue to be split and compared, so that, according to this recursive search method, the maximum similarity matching fragment of at least part of the fragment of the second gene sequence to be tested can be quickly located. Since this maximum similarity matching method can tolerate the absence of bases, it can achieve accurate positioning of gene deletions and gene mutation points.
[0014] In another possible implementation, the method further includes: inputting the gene sequence to be tested and the second sub-reference gene sequence of the multiple sub-reference gene sequences into the optical computing chip for optical comparison, obtaining a fourth similarity between the gene sequence to be tested and the second sub-reference gene sequence, and inputting the gene sequence to be tested and the third sub-reference gene sequence of the multiple sub-reference gene sequences into the optical computing chip for optical comparison, obtaining a fifth similarity between the gene sequence to be tested and the third sub-reference gene sequence, wherein the third sub-reference gene sequence is a sub-reference gene sequence continuous with the second sub-reference gene sequence. When it is determined that the sum of the fourth similarity and the fifth similarity is greater than the first threshold, a fourth sub-reference gene sequence is obtained according to the second sub-reference gene sequence and the third sub-reference gene sequence, and the gene sequence to be tested and the fourth sub-reference gene sequence are input into the optical computing chip for optical comparison. Wherein, the fourth sub-reference gene sequence includes some bases of the second sub-reference gene sequence and some bases of the third sub-reference gene sequence.
[0015] According to this method, when it is determined that the value of the similarity between the gene sequence to be tested and the second sub-reference gene sequence does not meet the condition for further matching with the second sub-reference gene sequence, and the sum of the similarities between the gene sequence to be tested and the second sub-reference gene sequence and the third sub-reference gene sequence is greater than the first threshold, the position of the sub-reference gene sequence can be adjusted in time, and the fourth sub-reference gene sequence can be obtained by taking a continuous part from the second sub-reference gene sequence and the third sub-reference gene sequence, so that the maximum similar matching fragment of the gene sequence to be tested can be found from the fourth sub-reference gene sequence as soon as possible, without continuing to compare the gene fragment to be tested with the sub-reference gene sequence after the third sub-reference gene sequence. This method of timely adjusting the sub-reference gene sequence according to the partial comparison results can improve the probability and speed of obtaining the maximum similar gene fragment and reduce the number of comparisons.
[0016] It is understandable that, in practical applications, a portion of reference gene fragments can be obtained from the second sub-reference gene sequence and the third sub-reference gene sequence according to the ratio of the fourth similarity to the fifth similarity to form the fourth sub-reference gene sequence.
[0017] In another possible implementation, the method further includes determining, based on an output result of the optical computing chip, that a second gene segment in the first group of gene segments matches the gene sequence to be tested, and recording a position of the second gene segment in the reference gene sequence.
[0018] In another possible implementation, the step of inputting the gene sequence to be tested and the plurality of reference gene fragments in the first group of gene fragments into the optical computing chip for optical comparison includes: optically encoding the gene sequence to be tested and the plurality of reference gene fragments in the first group of gene fragments, respectively, and inputting the optical encoding of the gene sequence to be tested and the optical encoding of the plurality of gene fragments in the first group of gene sequences into the optical computing chip for optical comparison. In practical applications, the gene sequence to be tested and the plurality of reference gene fragments can be optically encoded according to light intensity information and / or light spatial information.
[0019] In a second aspect, an embodiment of the present invention provides a gene comparison device, comprising a processor and an optical computing chip. The processor is used to obtain a first group of gene fragments from a database according to a gene sequence to be tested, wherein the database system contains multiple reference gene fragments of a reference gene sequence, and the first group of gene fragments includes multiple reference gene fragments that match partial bases of the gene sequence to be tested. The optical computing chip is connected to the processor and is used to perform an optical comparison between the gene sequence to be tested and the multiple reference gene fragments in the first group of gene fragments.
[0020] In a possible implementation, the processor can obtain a first group of gene fragments from the database based on partial bases of the gene sequence to be tested. For example, the first group of gene fragments is obtained from the database based on the first m bases and the last n bases of the gene sequence to be tested, wherein the value of m and the value of n are both greater than 0, and the sum of m and n is less than the number of bases in the gene sequence to be tested. Specifically, the database can be a key-value database, wherein the key value is a partial base of multiple reference gene fragments of the reference gene sequence, and the value value is the position of the multiple reference gene fragments in the reference gene sequence.
[0021] In a possible implementation, the processor is further used to determine, based on the output result of the optical computing chip, that the similarity between the gene sequence to be tested and the first gene fragment in the first group of gene fragments is less than a first threshold value and greater than a second threshold value, and obtain multiple sub-reference gene sequences from the reference gene sequence, wherein each sub-reference gene sequence is a part of the reference gene sequence. The optical computing chip is also used to perform an optical comparison between the gene sequence to be tested and a first sub-reference gene sequence in the multiple sub-reference gene sequences to obtain a first similarity between the gene sequence to be tested and the first sub-reference gene sequence.
[0022] In another possible implementation, the processor is further used to determine that the first similarity is greater than a third threshold and less than a fourth threshold, wherein the fourth threshold is not greater than the first threshold, and in response to the above determination, a first sub-gene sequence to be tested and a second sub-gene sequence to be tested are obtained according to the gene sequence to be tested, wherein some bases of the first sub-gene sequence to be tested and the second sub-gene sequence to be tested are the same. The optical computing chip is also used to perform an optical comparison between the first sub-gene sequence to be tested and the first sub-reference gene sequence to obtain a second similarity; and perform an optical comparison between the second sub-gene sequence to be tested and the first sub-reference gene sequence to obtain a third similarity.
[0023] In yet another possible implementation, the processor is further configured to, when the second similarity is greater than the fourth threshold, record a position of the first sub-reference gene sequence in the reference gene sequence.
[0024] In another possible implementation, the processor is further configured to obtain a first sub-gene sequence unit to be detected and a second sub-gene sequence unit to be detected according to the second sub-gene sequence to be detected when the third similarity is greater than the third threshold value and less than the fourth threshold value, wherein some bases of the first sub-gene sequence unit to be detected and the second sub-gene sequence unit to be detected are the same. The optical computing chip is further configured to perform an optical comparison between the first sub-gene sequence unit to be detected and the first sub-reference gene sequence, and to perform an optical comparison between the second sub-gene sequence unit to be detected and the first sub-reference gene sequence.
[0025] In another possible implementation, the optical computing chip is also used to perform optical comparison between the gene sequence to be tested and the second sub-reference gene sequence among the multiple sub-reference gene sequences; and perform optical comparison between the gene sequence to be tested and the third sub-reference gene sequence among the multiple sub-reference gene sequences, wherein the third sub-reference gene sequence is a sub-reference gene sequence that is continuous with the second sub-reference gene sequence. The processor is also used to: determine that the sum of the fourth similarity between the gene sequence to be tested and the second sub-reference gene sequence and the fifth similarity between the gene sequence to be tested and the third sub-reference gene sequence is greater than the first threshold; obtain a fourth sub-reference gene sequence based on the second sub-reference gene sequence and the third sub-reference gene sequence; and input the gene sequence to be tested and the fourth sub-reference gene sequence into the optical computing chip for optical comparison. The fourth sub-reference gene sequence includes some bases of the second sub-reference gene sequence and some bases of the third sub-reference gene sequence.
[0026] In another possible implementation, the processor is further used to determine, based on the output result of the optical computing chip, whether a second gene segment in the first group of gene segments matches the gene sequence to be tested, and record the position of the second gene segment in the reference gene sequence.
[0027] In another possible implementation, the processor is also used to optically encode the gene sequence to be tested and the multiple reference gene fragments in the first group of gene fragments, respectively, and input the optical encoding of the gene sequence to be tested and the optical encoding of the multiple gene fragments in the first group of gene sequences into the optical computing chip for optical comparison.
[0028] In a third aspect, an embodiment of the present invention provides a comparison device, comprising a processor and an optical computing chip. The processor is used to obtain a first group of reference objects from a database according to a first object to be matched, wherein the first group of reference objects includes multiple reference objects with the same partial features as the first object. The optical computing chip is connected to the processor and is used to perform optical comparison on the first object and the multiple reference objects.
[0029] The comparison device provided by the embodiment of the present invention combines the two methods of database search and optical comparison. After the reference objects to be compared are screened by the database, the number of reference objects that need detailed comparison can be greatly reduced. In addition, the use of optical computing chips for comparison can greatly improve the comparison speed. The comparison device provided by the implementation of the present invention can not only be used in gene detection scenarios, but also can be applied to various scenarios that require massive data comparison.
[0030] In a possible implementation, the processor is further configured to determine, based on an output result of the optical computing chip, that a similarity between the first object and a first reference object in the first group of reference objects is less than a first threshold value but greater than a second threshold value, and to obtain a plurality of sub-reference objects based on a standard object, wherein each sub-reference object is a part of the reference object. The optical computing chip is further configured to perform an optical comparison between the first object and a first sub-reference object in the plurality of sub-reference objects to obtain a first similarity between the first object and the first sub-reference object.
[0031] In another possible implementation, the processor is further configured to determine that the first similarity is greater than a third threshold and less than a fourth threshold, and in response to the determination, obtain a first sub-object and a second sub-object based on the first object. The fourth threshold is not greater than the first threshold, and some data of the first sub-object and the second sub-object are the same. The optical computing chip is further configured to perform an optical comparison between the first sub-object and the first sub-reference object to obtain a second similarity, and perform an optical comparison between the second sub-object and the first sub-reference object to obtain a third similarity.
[0032] In yet another possible implementation manner, the processor is further configured to record a position of the first sub-reference object in the standard object when the second similarity is greater than the fourth threshold.
[0033] In a fourth aspect, the present application also provides a comparison device, including an acquisition module, a comparison module, a result processing module, a judgment module and other functional modules for implementing the first aspect or any possible implementation method of the first aspect.
[0034] In a fifth aspect, the present application further provides a computer program product, including a program code, wherein the instructions included in the program code are executed by a computer to implement the gene comparison method described in the first aspect and any possible implementation manner of the first aspect.
[0035] In a sixth aspect, the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store program code, and the instructions included in the program code are executed by a computer to implement the gene comparison method described in the first aspect and any possible implementation method of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for describing the embodiments are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention.
[0037] Figure 1 A schematic diagram of the structure of a gene comparison device provided by an embodiment of the present invention;
[0038] Figure 2A A schematic diagram of a gene database provided by an embodiment of the present invention;
[0039] Figure 2B A schematic diagram of optical encoding provided by an embodiment of the present invention;
[0040] Figure 3A A schematic diagram of the structure of an optical computing chip provided by an embodiment of the present invention;
[0041] Figure 3B A schematic diagram of the structure of another optical computing chip provided by an embodiment of the present invention;
[0042] Figure 3C A schematic diagram of the principle of optical comparison provided by an embodiment of the present invention;
[0043] Figure 4 A flow chart of a gene comparison method provided by an embodiment of the present invention;
[0044] Figure 5A , Figure 5B , Figure 5C and Figure 5D Examples of optical encoding provided for embodiments of the present invention;
[0045] Figure 6 A flow chart of another gene comparison method provided by an embodiment of the present invention;
[0046] Figure 7 Schematic diagram of sub-reference gene sequences and sub-gene sequences to be tested provided in an embodiment of the present invention;
[0047] Figure 8 A flow chart of another gene comparison method provided by an embodiment of the present invention;
[0048] Fig. 9A schematic diagram of the structure of a comparison device provided by an embodiment of the present invention;
[0049] Fig.10 A schematic diagram of the structure of another comparison device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0050] In order to make the technical personnel in the field of the present invention better understand the scheme of the present invention, the technical scheme in the embodiment of the present invention will be clearly described below in conjunction with the drawings in the embodiment of the present invention. Obviously, the described embodiment is only a part of the embodiment of the present invention, not all of the embodiments.
[0051] As mentioned above, due to the rapid development of deoxyribonucleic acid (DNA) sequencing technology, DNA sequencing data has exploded. Therefore, how to improve the speed of DNA comparison is a technical problem that needs to be solved urgently. In the prior art, the search rate is usually accelerated by building an index for the reference gene sequence in a computer system. The essence of the index is to improve the search efficiency by optimizing the data structure. Then there is a bottleneck in the index optimization itself, and creating a lot of responsible indexes at the same time will consume a lot of actual. Therefore, the efficiency of this gene comparison method is difficult to withstand the large-scale growth of DNA sequencing data. The gene comparison scheme provided by the embodiment of the present invention can greatly provide gene comparison speed, even when facing massive gene sequencing data, gene comparison can be quickly realized.
[0052] In order to understand the present solution more clearly, several technical terms involved in the embodiments of the present invention are first described.
[0053] Gene: refers to the genetic information that controls biological traits, usually carried by DNA sequences. Genes can also be regarded as basic genetic units, that is, a functional DNA or ribonucleic acid (RNA) sequence. The process of figuring out the sequence itself is called gene sequencing.
[0054] Gene sequence to be tested: also known as reads, is a small sequence fragment, a type of sequencing data generated by a high-throughput sequencing platform. In the process of sequencing the entire genome, hundreds of millions of reads will be generated, and then these reads can be spliced together to obtain the full sequence of the genome.
[0055] Reference gene sequence (also called reference sequence): is a verified and edited standard sequence. Reference gene sequence can provide a basis for the functional annotation of human genome and provide a stable reference point for mutation analysis, gene expression research and polymorphism discovery.
[0056] Base pair: a chemical structure that forms DNA and RNA monomers and encodes genetic information. The bases that make up the base pair include adenine A, guanine G, thymine T, cytosine C, and uracil U. Strictly speaking, a base pair is a pair of mutually matching bases (i.e. AT, GC, AU interact) connected by hydrogen bonds. It is often used to measure the length of DNA and RNA (although RNA is single-stranded).
[0057] The embodiments of the present invention are described in detail below. Figure 1 A schematic diagram of a method for realizing gene comparison using an optical system provided in an embodiment of the present invention. As shown in the figure, a gene comparison device 100 may include a processor 102, a memory 104, and an optical computing chip 106. Among them, the processor 102 and the memory 104 may be regarded as a part of the host 101. The optical computing chip 106 may be connected to the host 101 through a host interface. The host interface may include a standard host interface and a network interface. For example, the host interface may include a Peripheral Component Interconnect Express (PCIE) interface. Data may be sent to the optical computing chip 106 through the host interface, and data processed by the optical computing chip 106 may also be sent to the processor 102 through the host interface. The processor 102 may also monitor the working status of the optical computing chip 106 through the host interface. In practical applications, the processor 102 and the memory 104 may not be a part of the host, and the processor 102, the memory 104, and the optical computing chip 106 may be a part of a system on a chip (SOC).
[0058] The processor 102 is the computing core and control unit of the gene comparison device 100. The processor 102 may include multiple processor cores. The processor 102 may be a very large scale integrated circuit. An operating system and other software programs are installed in the processor 102, so that the processor 102 can realize the memory 1042, cache, disk and peripheral devices (such as Figure 1It is understandable that, in the embodiment of the present invention, the Core in the processor 102 may be, for example, a central processing unit (CPU), a graphics processing unit (GPU), a field programmable gate array (FPGA), or other application specific integrated circuits (ASIC).
[0059] The memory 104 is used to store data. The memory 104 may include other memories for storing data, such as memory 1042 and disks. The memory 1042 is the main memory of the host 101. The memory 1042 can be connected to the processor 102 via a double data rate (DDR) bus. The memory 1042 is usually used to store various running software in the operating system, input and output data, and information exchanged with external memory. In order to increase the access speed of the processor 102, the memory 1042 needs to have the advantage of fast access speed. In practical applications, dynamic random access memory (DRAM) is usually used as the memory 1042. The processor 102 can access the memory through a memory controller ( Figure 1 (not shown) high-speed access to memory 1042, and read and write operations on any storage unit in memory 1042.
[0060] In an embodiment of the present invention, the memory 104 can be used to store a gene database 1044. The gene database 1044 can be a key-value database established based on a reference sequence. The key value can be obtained based on a portion of the bases of the gene fragment. The value value can include the position of the reference gene fragment corresponding to the key value in the memory, and can also include the position of the reference gene fragment corresponding to the key value in the reference gene sequence.
[0061] In an embodiment of the present invention, part of the bases of the reference gene sequence can be used as the key value, for example, the first m bases and the last n bases of the reference gene fragment of a preset length can be used as the key value. m and n can be the same or different, and are not limited here. By traversing the reference gene sequence, all reference gene fragments that meet the key value are located, and the location information of all reference gene fragments is recorded as the value corresponding to the key value. Figure 2A A schematic diagram of a gene database provided by an embodiment of the present invention. Figure 2AAs shown, the gene database 1044 may include a key 1044_1 and a value 1044_2. The key 1044_1 part takes 10 bases as an example. Specifically, the 5 bases at the head and the 5 bases at the tail of the reference fragment can be taken as the key value. In the embodiment of the present invention, the length of the reference gene fragment of 150 bases is taken as an example to describe how to establish the gene database 1044. Specifically, first construct an empty set index table (only with key values), the number of rows of which is 4 5+5 , the key sorting combination is the alphabetical order from AAAAAAAAAA to TTTTTTTTTT. The mapping method is as follows Figure 2B As shown. Specifically, the bases are arranged in the order of the head base as the high position and the tail base as the low position. The bases on each unit are arranged in the order of A, C, G, T, and one unit base is added when the bases are full of T. When the tail bases are all TTTTT, one base is added to the head base part. In this way, the bases can be arranged in the following order: AAAAAAAAAA, AAAAAAAAAAC, AAAAAAAAAAG, AAAAAAAAAAT, AAAAAAAAACA, AAAAAAAAACC, AAAAAACG, AAAAAAAACT, etc. Thus, the following can be obtained: Figure 2A Key 1044_1 shown in .
[0062] After establishing the key value index table, slide on the reference gene sequence in turn with the preset base length as the unit window and the step length as the unit base (i.e. 1 base), so that multiple reference gene fragments can be obtained. In the process of obtaining each reference gene fragment, the key value of the reference gene fragment can be obtained according to the 5 bases at the head and the 5 bases at the tail of the reference gene fragment, and the position of the reference gene fragment in the reference gene sequence can be recorded in the value 1044_2 corresponding to the key value. For example, the position of the first base of the reference gene fragment can be recorded. In this way, slide all the way to the end of the reference gene sequence to obtain the value of all reference gene fragments of the reference gene sequence (i.e., the position information of the reference gene fragment). In this way, the following can be established: Figure 2A Gene database 1044 is shown.
[0063] In practical applications, the way key values are mapped depends on the form of permutations and combinations. Assuming that the sequence fragments of the first n and the last m bases are Seq1 and Seq2 respectively, the mapping of key values is defined as:
[0064]
[0065] For example, if there is a DNA sequence of GTGGA...CGAGC, and the values of A, C, G, and T are 0, 1, 2, and 3, then the Key value corresponding to this sequence is:
[0066] Key GTG……AGC
[0067] =(Seq1[4]×4 4 +Seq1[3]×4 3 +Seq1[2]×4 2 +Seq1[1]
[0068] ×4 1 +Seq1[0]×4 0 )×4 5 +Seq2[4]×4 4 +Seq2[3]
[0069] ×4 3 +Seq2[2]×4 2 +Seq2[1]×4 1 +Seq2[0]×4 0
[0070] =728×4 5 +393=745865
[0071] It is understandable that the choice of the number of bases n and m directly affects the efficiency of the algorithm itself. The increase of n and m will lead to a decrease in the value (i.e., location information) stored in the key value. If hardware factors are not considered, the addressing rate for each gene sequence to be tested will increase by 4 times for each additional unit base. However, due to sequencing errors and gene mutations, n and m cannot be increased indefinitely, and increasing n and m may reduce the reliability of the key value. Therefore, the values of m and n can be determined as needed, and the length of the reference gene fragment can also be set according to actual needs. Usually, the values of m and n can be determined based on factors such as the length of the gene sequence to be tested and the length of the reference gene sequence. In practical applications, the length of the reference gene fragment is usually the same as the base length of the gene sequence to be tested.
[0072] The optical computing chip 106 may be an on-chip optical computing system. Figure 3A The structure diagram of an optical computing chip provided by an embodiment of the present invention is shown in FIG. Figure 3AAs shown, the optical computing chip 106 may include a light source array 202, a modulator array 204, a detector array 206, a first concave mirror 208, and a second concave mirror 210. The light source array 202 is located on the object focal plane of the first concave mirror 208. The modulator array 204 is located on the image focal plane of the first concave mirror 208, and the modulator array 204 is also located on the object focal plane of the second concave mirror 210. The detector array 206 is located on the image focal plane of the second concave mirror 210.
[0073] The light source array 202 is used for data modulation and transmission, and serves as a data input unit of the optical computing chip 106. The light source array 202 can generate a plurality of optical signals with different light intensities according to the input data. The first concave mirror 208 is used to implement a standard Fourier transform on the data optical signal sent by the light source array 202. The modulator array 204 has two working modes: a recording mode and a modulation mode. Among them, the recording mode is used to obtain the image of the spectrum surface of the data optical signal sent by the light source array 202 after passing through the first concave mirror 208. The modulation mode is used to modulate the spectrum surface image of the data optical signal sent by the light source array 202 on the modulator array 204. The second concave mirror 210 is used to implement a standard inverse Fourier transform on the optical signal after passing through the modulator array 204. The detector array 206 is used for light intensity signal detection, and serves as a result output unit of the optical computing chip 106.
[0074] Figure 3B A schematic diagram of the structure of another optical computing chip provided by an embodiment of the present invention. Figure 3A The on-chip integrated optical computing chip provided is different in that: Figure 3B In the optical computing chip shown, the light source array 202 and the detector array 206 are arranged on the same side of the chip, making the structure of the entire computing chip more compact and reducing the chip size. Figure 3B As shown, Figure 3A Compared with the optical computing chip shown in the figure, the positions of the first concave mirror 208, the second concave mirror 210, and the modulator array 204 have not changed, and the focal length positions of the light source array 202, the modulator array 204, and the detector array 206 relative to the first concave mirror 208 and the second concave mirror 210 have not changed. Figure 3B The implementation of each device shown can refer to Figure 3A The description of each device in the optical computing chip shown is not repeated here.
[0075] Figure 3A and Figure 3BThis is only a schematic diagram of the structure of the optical computing chip provided by the embodiment of the present invention. In practical applications, the specific structure of the optical computing chip 106 is not limited, and optical computing chips with other structures may also be used. For example, the optical computing chip 106 may also be an optical computing chip with other structures implemented using the 4F optical computing system principle. Figure 3C Figure 4 is a schematic diagram of the 4F optical computing system. Figure 3C As shown, the first modulator 302 is located at the object plane focal position of the first convex lens 304. The second modulator 306 is located at the image plane focal position of the first convex lens 304 and at the object plane focal position of the second convex lens 308. The interval between the first convex lens 304 and the second convex lens 308 is the sum of the focal lengths of the two convex lenses (304 and 308). The detector 310 is located at the image plane focal position of the second convex lens 308, and the length of the entire system is 4 times the focal length. Figure 3C When the 4F optical system shown in the figure performs data comparison, the first data to be compared can be loaded on the first modulator 302, and the spectrum data of the second data after flipping can be loaded on the second modulator 306, so that the optical signal generated according to the first data passes through the first convex lens 304, undergoes Fourier transformation, and becomes a spectrum optical signal at the position of the second modulator 306, and completes the multiplication operation with the spectrum data of the second data after flipping on the second modulator 306 in the optical space. The optical field energy distribution of the spectrum optical signal of the first data in the optical space is essentially changed. The multiplied spectrum optical signal passes through the second convex lens 308, undergoes inverse Fourier transformation, and becomes a time domain optical signal again. The detector 310 can obtain the autocorrelation result of the two data by detecting the intensity of the time domain optical signal passing through the second convex lens 308. It should be noted that the first data and the second data loaded on the optical computing chip can both be vectors.
[0076] It is understandable that the above Figures 3A-3C The process of realizing data comparison by the optical computing chip is obtained by detecting the autocorrelation results of the optical signals of the two data in the optical space. Those skilled in the art will know that autocorrelation, also known as serial correlation, is the mutual correlation of a signal with itself at different time points. In other words, autocorrelation is a function of the similarity between two observations to the time difference between them. Autocorrelation is a mathematical tool for finding repetitive patterns in a sequence of random variables. When actually performing sequence recognition, by using autocorrelation operations, it can be ensured that when the sequence to be tested and the target sequence are the same, an obvious maximum position will appear in the autocorrelation results. By monitoring the appearance of the maximum value, sequence comparison can be achieved more easily.
[0077] The following will describe in detail how to use Figure 1 The gene comparison device shown realizes gene comparison and improves the speed of gene comparison. Figure 4A flow chart of a gene comparison method provided by an embodiment of the present invention. Figure 1 right Figure 4 The method shown in the figure is specifically introduced. For the sake of clarity and simplicity, the embodiment of the present invention is described by taking the detection of a gene sequence to be tested as an example. It can be understood that even if multiple gene sequences to be tested are detected at one time in actual applications, each gene sequence to be tested can be compared with the embodiment of the present invention. As shown in Figure 4, the method includes the following steps.
[0078] In step 402, the processor 102 obtains the first group of gene fragments from the database according to the partial bases of the gene sequence to be tested. Specifically, the key value of the gene sequence to be tested can be obtained according to the acquisition method of key 1044_1 of the gene database 1044. For example, the 5 bases at the head and the 5 bases at the tail of the gene sequence to be tested can be used as the key value of the gene sequence to be tested. According to the key value of the gene sequence to be tested, the gene database 1044 is searched to obtain multiple value values matching the key value, and the multiple value values are used to indicate the possible position of the gene sequence to be tested on the reference gene sequence. Since the value corresponding to a certain key value in the gene database 1044 indicates the position information of the corresponding reference gene fragment in the reference gene sequence, multiple reference gene fragments can be obtained according to the matched multiple value values. In an embodiment of the present invention, multiple reference gene fragments matching the key value of the gene sequence to be tested are referred to as the first group of gene fragments.
[0079] In step 404, the gene sequence to be tested is optically compared with the multiple reference gene fragments in the first group of gene fragments through the optical computing chip 106. Specifically, the processor 102 can optically encode the gene sequence to be tested and the multiple reference gene fragments, respectively, and load the optical encoding of the gene sequence to be tested and the optical encoding of the multiple reference gene fragments into the optical computing chip for comparison. In the process of optically encoding the gene sequence to be tested and the reference gene fragments, the base strings in the gene sequence to be tested and the reference gene fragments can be encoded respectively. For example, four point light sources are used as unit clusters of single bases, and their different brightness levels (0 means the light source is off, 1 means the light source is on) represent four different bases. The encoding schemes of A, C, G, and T are 0001, 0010, 0100, and 1000, as shown in FIG. Figure 5A As shown. According to the encoding method of single bases A, C, G, and T, the optical encoding of the gene sequence to be tested and the multiple reference gene fragments in the first group of gene fragments can be obtained. Thus, the obtained optical encoding of the gene sequence to be tested and the multiple reference gene fragments in the first group of gene fragments can be sent to the optical computing chip 106 for optical comparison.
[0080] In practical applications, different encoding methods directly affect the decoding difficulty and the credibility of the autocorrelation result output. In another case, the light intensity information and / or light spatial information can also be included in the encoding process. In an embodiment of the present invention, the method of encoding using the intensity information of light can be called an intensity encoding method, and the method of encoding using the spatial information of light can be called a spatial encoding method. In practical applications, the two encoding methods can also be combined, and this combination can be called a hybrid encoding method. The intensity encoding method can use different voltage amplitudes to modulate the light intensity, and represent four different bases through light signals of different intensities. The intensity encoding method can be as shown in 5B. The spatial encoding method can use multiple point light sources as unit clusters of single bases, and represent four different bases with different brightness levels (for example, 0 means the light source is off, and 1 means the light source is on). The spatial encoding method can be as shown in 5B. Figure 5C As shown in FIG. 1 , multiple optical signals with the same voltage and different light intensities can be used to represent different bases. A hybrid encoding method can be a method that combines intensity encoding and spatial encoding, for example, Figure 5D As shown, a plurality of light signals with different voltages and different light intensities may be used to represent different bases. In the embodiment of the present invention, no specific encoding method is limited.
[0081] During the gene comparison process of the optical computing chip 106, the light source array 202 can first send a first light signal according to the code of the gene sequence to be tested after the flipping, and the first light signal undergoes Fourier transformation to become a spectrum light signal after being reflected by the first concave mirror 208, and the modulator array 204 receives the reflected spectrum light signal of the first light signal, and modulates the reflected spectrum light signal of the first light signal on the modulator array 204. Then, the light source array 202 sends multiple light signals respectively according to the optical codes of multiple reference gene fragments in the first group of reference gene fragments, so that the light signal sent according to the optical code of the reference gene fragment passes through the first concave mirror 208 and becomes a spectrum light signal at the position of the modulator array 204, and then completes the multiplication operation with the reflected signal of the first light signal in the optical space. The spectrum light signal output by the modulator array 204 undergoes inverse Fourier transformation to become a time domain light signal through the second concave mirror 210, and finally the detector array 206 can obtain the matching results of the first light signal and the light signals of the multiple reference gene fragments respectively by detecting the light intensity of the time domain light signal output by the second concave mirror 210. Those skilled in the art will know that after the spectrum data are multiplied and subjected to inverse Fourier transform, the autocorrelation result of the two data is obtained.
[0082] In step 406, the processor 102 determines the similarity between the gene sequence to be tested and the multiple reference gene fragments according to the output result of the optical computing chip. In practical applications, after the detector array 206 obtains the matching result, the optical computing chip 106 can send the matching result to the processor 102. For example, the light intensity signal obtained by the detector array 206 can be collected through some peripheral circuits, the collected light intensity signal can be converted into an electrical signal, and the electrical signal can be converted into a digital signal and sent to the processor 102, so that the processor 102 can obtain the comparison result of the gene sequence to be tested and the reference gene fragment by the optical computing chip 106. It can be understood that in practical applications, the detector array 206 can generate feedback every time a comparison result is obtained, or it can generate feedback when the similarity reaches a preset threshold. It should be noted that the similarity in the embodiment of the present invention is used to indicate the degree of matching between the gene sequence to be tested and the reference gene fragment.
[0083] In step 408, the processor 102 determines whether the similarity between the gene segment to be tested and the first reference gene segment in the multiple reference gene segments is greater than or equal to the first threshold value. If it is greater than or equal to the first threshold value, the method proceeds to step 410. When it is determined that the similarity between the gene segment to be tested and the first reference gene segment is less than the first threshold value, the method proceeds to step 412. In this step, after obtaining the comparison result, the processor 102 can compare it with the set threshold value. For the matching result of the gene sequence to be tested and any reference gene segment, it can be compared with the set threshold value. The embodiment of the present invention is described by taking the gene sequence to be tested and the first reference gene segment in the first group of reference gene segments as an example, wherein the first reference gene segment is any reference gene segment in the first group of reference gene segments. When the similarity between the gene segment to be tested and the first reference gene segment is greater than or equal to the first threshold value, the method proceeds to step 410, otherwise the method proceeds to step 412.
[0084] In step 410, the processor 102 records the position of the first reference gene fragment in the reference gene sequence, and ends the matching of the gene sequence to be tested. In an embodiment of the present invention, a matching result with a similarity greater than or equal to a first threshold value can be considered a successful match. When the processor 102 determines that the gene sequence to be tested successfully matches the first reference gene fragment, the position of the first gene fragment in the reference gene sequence can be recorded. The matching of the gene sequence to be tested is ended, and the matching process ends. It can be understood that in an embodiment of the present invention, the similarity is used to indicate the degree of matching between the gene sequence to be tested and the reference gene fragment. The first threshold is used to indicate whether the required matching standard is met. In practical applications, the first threshold can be used to indicate a complete match or to indicate a maximum similarity match. If the similarity is greater than or equal to the set first threshold value, it can be considered that the gene sequence to be tested matches the reference gene sequence or has a maximum similarity match. For example, the first threshold value can be 100% or 95%, which is not limited here.
[0085] If in step 408, the processor determines that the similarity between the gene fragment to be tested and the first gene fragment is less than the first threshold value, then in step 412, the processor 102 will further determine whether the similarity between the gene fragment to be tested and the first gene fragment is greater than the second threshold value. When the similarity between the gene fragment to be tested and the first gene fragment is greater than the second threshold value, the method enters step 414 and enters the maximum similarity matching process. Otherwise, the method enters step 416, confirms that the gene sequence to be tested does not match the first reference gene fragment, and ends the matching of the gene fragment to be tested and the first gene fragment. In an embodiment of the present invention, the second threshold value can be set to 50%. When the similarity between the gene fragment to be tested and the first reference gene fragment is less than the first threshold value and greater than the second threshold value, it indicates that the gene sequence to be tested is likely to match the reference gene sequence, or in other words, some fragments in the gene sequence to be tested may match the reference gene sequence. Therefore, it is necessary to further compare the gene sequence to be tested with the reference gene sequence, and the method enters the maximum similarity matching process.
[0086] Understandably, Figure 4Steps 408 to 416 in the description are described by taking the matching of the gene sequence to be tested and the first reference gene fragment as an example. In practical applications, after obtaining the similarity between the gene sequence to be tested and multiple reference gene fragments through steps 404 and 406, the similarity between the gene sequence to be tested and each reference gene fragment can be processed according to steps 408 and 416 respectively. Of course, after obtaining the first group of reference gene fragments, the operations of steps 404 to 416 can also be performed sequentially on the gene sequence to be tested and each reference gene fragment in the first group of reference gene fragments. Here, the specific implementation method is not limited.
[0087] The gene comparison method provided in the embodiment of the present invention is to perform an initial match with the gene sequence to be tested by constructing a gene database, thereby screening out the first group of reference gene fragments that may match the gene sequence to be tested. It is known to those skilled in the art that, taking the reference gene fragments of humans as an example, the reference gene fragments of humans have 3 billion bases. If the gene fragments to be tested are directly compared with the reference gene fragments one by one, it will take a lot of time. After screening the gene fragments to be compared by the gene database provided in the embodiment of the present invention, the reference gene fragments that need to be compared can be reduced from 3 billion to hundreds of times, thereby greatly reducing the number of reference gene fragments that need to be compared. In addition, in the embodiment of the present invention, after obtaining the first group of reference gene fragments, the optical comparison of the gene sequence to be tested and the multiple reference gene fragments in the first group of reference gene fragments is further performed by an optical computing chip. Since the optical computing chip performs optical comparison, the comparison speed is faster than the method of performing gene comparison by electrical means. Thus, the gene comparison method provided in the embodiment of the present invention also greatly improves the comparison efficiency.
[0088] It should be noted that, in the embodiment of the present invention, as long as the similarity between the gene sequence to be tested and any one of the reference gene fragments in the first group of reference gene fragments is less than the first threshold value and greater than the second threshold value, the Figure 6 The maximum similarity matching method shown further compares the gene sequence to be tested. Figure 6 A flow chart of another gene comparison method provided in an embodiment of the present invention. Figure 6 The method shown is still performed by the gene matching device 100. Figure 6 As shown, the method may include the following steps.
[0089] In step 602, the processor 102 obtains a plurality of sub-reference gene sequences from the reference gene sequence. Specifically, the processor 102 obtains a plurality of sub-reference gene sequences from the reference gene sequence according to the length of the gene sequence to be tested. For example, the length of the gene sequence to be tested can be used as a window and a sliding step to obtain a plurality of sub-reference gene sequences from the reference gene sequence. The reference gene sequence can also be split into a plurality of sub-reference gene sequences according to the base length of the gene sequence to be tested. For example, Figure 7 As shown, multiple sub-reference gene sequences can be obtained according to the length of the gene sequence to be tested 702 based on the reference gene sequence 700. Taking the reference gene sequence as an example with 3 billion bases, if the gene sequence to be tested is 150 bases, 20 million sub-reference gene sequences can be obtained.
[0090] In step 604, the gene sequence to be tested and the i-th sub-reference gene sequence obtained in step 602 are input into the optical computing chip 106 for optical comparison. The initial value of i is 1, and the value of i is not greater than the number of sub-reference gene sequences obtained in step 602. Specifically, the processor 102 can optically encode the gene sequence to be tested and the i-th sub-reference gene sequence respectively, and load the optical encoding of the gene sequence to be tested and the i-th sub-reference gene sequence into the optical computing chip 106 for optical comparison to obtain the similarity between the gene sequence to be tested and the i-th sub-reference gene sequence, and the optical computing chip 106 will send the comparison result to the processor 102. In an embodiment of the present invention, the similarity between the gene sequence to be tested and the first sub-reference gene sequence among the multiple sub-reference gene sequences can be referred to as the first similarity.
[0091] In step 606, the processor 102 determines whether the similarity between the gene sequence to be tested and the i-th sub-reference gene sequence is greater than the set third threshold. If it is not greater than the third threshold, the gene sequence to be tested does not match the i-th sub-reference gene sequence, and the method enters step 608, sets i=i+1, and returns to step 604, and continues to compare the gene sequence to be tested with the next sub-reference gene sequence until the gene sequence to be tested and all sub-reference gene sequences obtained in step 602 are optically compared through the optical computing chip 106. If in step 606, the processor 102 determines that the similarity between the gene sequence to be tested and the i-th sub-reference gene sequence is greater than the third threshold, the method enters step 610. In an embodiment of the present invention, in order to find a reference gene fragment that matches at least a portion of the gene sequence to be tested as much as possible, the third threshold can be set to a similarity lower than 50%, for example, the third threshold can be set to 20%. It can be understood that in actual applications, the third threshold can also be the same as the second threshold, which is not limited here.
[0092] If the similarity between the gene sequence to be tested and the i-th sub-reference gene sequence is greater than the third threshold, then in step 610, the processor 102 further determines whether the similarity between the gene sequence to be tested and the i-th sub-reference gene sequence is greater than the fourth threshold. If the similarity between the gene sequence to be tested and the i-th sub-reference gene sequence is greater than the fourth threshold, the method enters step 612. In an embodiment of the present invention, the fourth threshold is not greater than the first threshold, the first threshold can be used to indicate the threshold set for a complete match, and the fourth threshold is a threshold for indicating a maximum similarity match. Usually the first threshold can be set to 100%, and the fourth threshold can be set to 95%. It can be understood that in actual applications, the fourth threshold can also be the same as the first threshold, for example, the first threshold and the fourth threshold can both be set to 95%, which is used to indicate the threshold for reaching the maximum similarity match. This is not limited here. In step 612, the processor 102 determines that the i-th sub-reference gene sequence is a gene fragment with the maximum similarity to the gene sequence to be tested, records the position of the i-th sub-reference gene sequence in the reference gene sequence, and ends the comparison process of the gene sequence to be tested. If the similarity between the gene sequence to be tested and the i-th sub-reference gene sequence is not greater than the fourth threshold, the method proceeds to step 614 .
[0093] In step 614, the processor 102 obtains a first sub-gene sequence to be tested and a second sub-gene sequence to be tested according to the gene sequence to be tested. Figure 7 In this step, the processor 102 may obtain a first sub-gene sequence to be tested 7022 and a second sub-gene sequence to be tested 7024 according to the gene sequence to be tested 702. Part of the bases of the first sub-gene sequence to be tested 7022 and the second sub-gene sequence to be tested 7024 are the same. For example, the first sub-gene sequence to be tested 7022 may include bases of a first preset length obtained from the head of the gene sequence to be tested 702 to the tail, and the second sub-gene sequence to be tested 7024 may include bases of a first preset length obtained from the tail of the gene sequence to be tested 702 to the head, and the first sub-gene sequence to be tested 7022 and the second sub-gene sequence to be tested 7024 are partly the same. The method proceeds to step 616.
[0094] In step 616, the j-th sub-gene sequence to be tested is optically compared with the i-th sub-reference gene sequence through the optical computing chip 106. Among them, the initial value of j is 1, and the value of j may not be greater than the number of sub-gene sequences to be tested. Since two sub-gene sequences to be tested are obtained from the gene sequence to be tested in the embodiment of the present invention, therefore, in the embodiment of the present invention, the value of j is not greater than 2. It can be understood that if it is necessary to obtain p (p is greater than 2) sub-gene sequences to be tested in actual applications, the value of j is not greater than p. In this step, the processor 102 also needs to first optically encode the j-th sub-gene sequence unit to be tested, and then load the optical encoding of the j-th sub-gene sequence unit to be tested and the optical encoding of the i-th sub-reference gene sequence into the optical computing chip 106 for optical comparison to obtain the similarity between the j-th sub-gene sequence to be tested and the i-th sub-reference gene sequence. The method enters step 618. In step 618, the processor 102 determines whether the similarity between the j-th sub-gene sequence to be tested and the i-th sub-reference gene sequence is greater than the third threshold value. If not, the method proceeds to step 620, setting j=j+1, and proceeds to step 616, optically comparing the j+1-th sub-gene sequence to be tested with the i-th sub-reference gene sequence to obtain the similarity between the j+1-th sub-gene sequence to be tested and the i-th sub-reference gene sequence. If in step 618, the processor 102 determines that the similarity between the j-th sub-gene sequence to be tested and the i-th sub-reference gene sequence is greater than the third threshold value, the method proceeds to step 622, further determining whether the similarity between the j-th sub-gene sequence to be tested and the i-th sub-reference gene sequence is greater than the fourth threshold value. In the embodiment of the present invention, for the sake of clarity and convenience of description, the matching result of the optical computing chip for the first sub-gene sequence to be tested and the first sub-reference gene sequence can be referred to as the second similarity, and the matching result of the optical computing chip for the second sub-gene sequence to be tested and the first sub-reference gene sequence can be referred to as the third similarity.
[0095] If in step 622, the processor 102 determines that the similarity between the j-th sub-gene sequence to be tested and the i-th sub-reference gene sequence is greater than the fourth threshold, the method enters step 624, records the position of the reference gene fragment in the i-th sub-reference gene sequence that matches the j-th sub-gene sequence to be tested in the reference gene sequence, and ends the matching of the gene sequence to be tested. It should be noted that in actual applications, if it has been determined that the similarity between the j-th sub-gene sequence to be tested and the partial fragments of the i-th sub-reference gene sequence is greater than the fourth threshold, in order to increase the matching speed, it is also possible not to continue matching the j+1-th sub-gene sequence to be tested with the i-th sub-reference gene sequence, but directly end the comparison process of the gene sequence to be tested. Of course, it is understandable that in actual applications, the j+1-th sub-gene sequence to be tested and the i-th sub-reference gene sequence can also be optically compared as needed.
[0096] If in step 622, the processor 102 determines that the similarity between the j-th sub-gene sequence to be tested and the i-th sub-reference gene sequence is not greater than the fourth threshold value, the method enters step 626. In step 626, the processor 102 obtains the first gene sequence unit to be tested and the second gene sequence unit to be tested of the j-th sub-gene sequence to be tested, wherein some bases of the first gene sequence unit to be tested and the second gene sequence unit to be tested are the same. Specifically, reference may be made to the method for obtaining the first sub-gene sequence to be tested and the second sub-gene sequence to be tested from the gene sequence to be tested in step 614. For example, the first gene sequence unit to be tested may include bases of a second preset length obtained from the head to the tail of the j-th sub-gene sequence to be tested, and the second gene sequence unit to be tested may include bases of a second preset length obtained from the tail to the head of the j-th sub-gene sequence to be tested.
[0097] In step 628, the kth gene sequence unit to be tested is optically compared with the i-th sub-reference gene sequence through the optical computing chip 106. The initial value of k is 1, and the value of k is not greater than the number of gene sequence units to be tested. In the embodiment of the present invention, since two gene sequence units to be tested are obtained according to the j-th sub-gene sequence to be tested as an example, the value of k is not greater than 2. Specifically, in step 628, the processor 102 can optically encode the kth gene sequence unit to be tested, and load the optical encoding of the kth gene sequence unit to be tested and the optical encoding of the i-th sub-reference gene sequence onto the optical computing chip 106 for optical comparison. The method enters step 630. In step 630, the processor 102 determines whether the similarity between the kth gene sequence unit to be tested and the i-th sub-reference gene sequence is greater than the third threshold. If it is not greater than the third threshold, the process proceeds to step 632 , where k=k+1 is set, and the process proceeds to step 628 , where the optical computing chip 106 optically compares the second gene sequence unit to be tested with the i-th sub-reference gene sequence.
[0098] If in step 630, the processor 102 determines that the similarity between the kth gene sequence unit to be tested and the i-th sub-reference gene sequence is greater than the third threshold, the method enters step 634 to determine whether the similarity between the kth gene sequence unit to be tested and the i-th sub-reference gene sequence is greater than the fourth threshold. If it is greater than the fourth threshold, the method enters step 636 to record the position of the gene fragment in the i-th sub-reference gene sequence that matches the kth gene sequence unit to be tested in the reference gene sequence, and ends the matching. Specifically, in one case, in order to improve the matching speed, after obtaining the gene fragment with the maximum similarity, the matching of the gene sequence to be tested can be ended. In another case, the matching of the jth sub-gene sequence to be tested can also be ended, or the matching of the kth gene sequence unit to be tested can be ended, and the matching of the k+1 gene sequence unit to be tested or the j+1 sub-gene sequence to be tested can continue.
[0099] If in step 634, the processor 102 determines that the similarity between the kth gene sequence unit to be tested and the i-th sub-reference gene sequence is not greater than the fourth threshold, the method enters step 638, and the kth gene sequence unit to be tested is continued to be split in a recursive manner, and the sub-units of the kth gene sequence unit to be tested are optically compared with the i-th sub-reference gene sequence until a gene segment to be tested having a similarity with the i-th sub-reference gene sequence greater than the fourth threshold is found. In an embodiment of the present invention, the reference gene segment in the sub-reference gene segment whose similarity with some of the gene segments to be tested in the gene sequence to be tested is greater than the fourth threshold can be called the maximum similar gene segment.
[0100] The gene comparison method provided in the embodiment of the present invention is for Figure 4 The gene fragments that fail to match accurately can continue to pass Figure 6 The gene alignment method shown further performs maximum similarity matching on the gene fragments to be tested. Figure 6 The method shown allows the gene to be tested to be not completely consistent with the obtained maximum similar gene fragment, and some bases may be missing in the gene sequence to be tested or different from the reference gene fragment, thereby enabling accurate positioning of missing genes or variant genes in the gene sequence to be tested.
[0101] In another embodiment, the gene comparison method provided by the embodiment of the present invention may also include: Figure 8 The method flow is shown. Figure 8 The method shown can be Figure 6 After step 604 shown. Figure 8 As shown, the method may include the following steps. In step 802, the processor 102 determines that the first similarity between the gene sequence to be tested and the i-th sub-reference gene sequence is less than a third threshold. And, in step 804, when the processor 102 further determines that the second similarity between the gene sequence to be tested and the i+1-th sub-reference gene sequence is greater than the third threshold, the method proceeds to step 806. It should be noted that the description of steps 802 and 804 can refer to Figure 6 Regarding the description of step 606, the third threshold may be the same as the third threshold set in step 606, for example, may be 50%.
[0102] In step 806, the processor further determines whether the sum of the first similarity and the second similarity is greater than 100%. If the sum of the first similarity and the second similarity is not greater than 100%, the method proceeds to step 808, and the gene sequence to be tested is optically compared with the i+2 sub-reference gene sequence through the optical computing chip 106. If the sum of the first similarity and the second similarity is greater than 100%, the method proceeds to step 810. In step 810, the processor 102 obtains a new sub-reference gene sequence based on the i-th sub-reference gene sequence and the i+1-th sub-reference gene sequence. In step 810, a portion of reference gene fragments can be obtained from the i-th sub-reference gene sequence and the i+1-th sub-reference gene sequence according to the ratio of the first similarity and the second similarity to form a new sub-reference gene sequence. For example, if the first similarity is 40%, the second similarity is 80%, and the length of a reference gene sequence is 150 base pairs, then the 50 base pairs at the tail of the i-th sub-reference sequence and the 100 base pairs at the head of the i+1-th sub-reference sequence can be combined into a continuous new sub-reference sequence with a length of 150 base pairs. After obtaining the new sub-reference sequence, the method proceeds to step 812, and the optical computing chip 106 performs an optical comparison between the gene sequence to be tested and the obtained new sub-reference sequence. For a specific optical comparison method, see Figure 6 In addition, in the process of comparing the gene sequence to be tested with the obtained new sub-reference sequence, it can be seen that Figure 6 According to this method, if the similarity between the gene sequence to be tested and the new sub-reference gene sequence is greater than the third threshold, then the process of comparing the gene sequence to be tested with the i-th sub-reference gene sequence can be continued. Figure 6 In the method of step 610 to step 638 in the above, a reference gene fragment having a similarity with the gene sequence to be tested greater than the fourth threshold is searched from the new sub-reference sequence. Figure 6 and Figure 8 The reference gene segments found in the reference gene sequence by the comparison method shown and having a similarity with the gene sequence to be tested greater than the fourth threshold value are all called maximum similar gene segments.
[0103] Figure 8 The method shown can be used with Figure 6 For example, when it is determined that the gene sequence to be tested has a lower similarity with the i-th sub-reference gene sequence, but a higher similarity with the i+1-th sub-reference gene sequence, then the method shown in the figure can be used in combination. Figure 8The method shown in the figure can obtain a new reference gene sequence from the i-th sub-reference gene sequence and the i+1-th sub-reference gene sequence and compare it with the gene sequence to be tested. This method of timely adjusting the sub-reference gene sequence according to the partial comparison results can increase the probability and speed of obtaining the maximum similar gene fragment and reduce the number of comparisons. It is understandable that in actual applications, it is also possible to first follow Figure 6 After the method shown in FIG. 6 compares the gene sequence to be tested with the multiple sub-reference gene sequences obtained in step 602, the following steps are performed: Figure 8 The method shown in the figure adjusts the sub-reference gene sequence and then performs the comparison. In the embodiment of the present invention, the specific execution method is not limited.
[0104] It should be noted that Figure 8 The description is made by taking the gene sequence to be tested and the i-th sub-reference gene sequence as an example. In actual applications, the i-th sub-reference gene sequence can be any sub-reference gene sequence among the multiple sub-reference gene sequences. For example, in step 802, the processor can take the comparison of the gene sequence to be tested and the second sub-reference gene sequence among the multiple sub-reference gene sequences as an example. If the similarity between the gene sequence to be tested and the second sub-reference gene sequence is the fourth similarity, and the fourth similarity is less than the third threshold. In step 804, the processor 102 determines that the similarity between the gene sequence to be tested and the third sub-reference gene sequence among the multiple sub-reference gene sequences is the fifth similarity, and the fifth similarity is greater than the third threshold. If in step 806, the processor further determines that the sum of the fourth similarity and the fifth similarity is greater than 100%, the processor 102 can Figure 8 The method shown obtains a new sub-reference gene sequence based on the second sub-reference gene sequence and the third sub-reference gene sequence.
[0105] In the embodiment of the present invention, by Figure 6 and Figure 8 After finding the maximum similar gene fragment of the gene sequence to be tested by the method, the maximum similar gene fragment can be extended on the gene sequence to be tested and the reference sequence by the Smith-Waterman local alignment algorithm to obtain a longer maximum similar gene fragment, thereby facilitating further gene analysis of the gene fragment to be tested.
[0106] It is understandable that the method shown in the above embodiment is described by comparing the gene sequence to be tested with a sub-reference gene sequence in the multiple sub-reference gene sequences as an example. In practical applications, comparisons can be made with multiple sub-reference gene sequences respectively, which is not limited here. The ordinal numbers such as "first" and "second" mentioned in the embodiments of the present application are used to distinguish multiple objects, and are not used to limit the order, timing, priority or importance of multiple objects.
[0107] It is understandable that the comparison method of the embodiment of the present invention is only based on gene comparison as an example. In practical applications, the comparison method provided by the embodiment of the present invention, which combines the electrical comparison method based on database implementation and the optical comparison based on optical computing chip, can also be applied to various other application scenarios. Fig. 9 A schematic diagram of a comparison device provided by an embodiment of the present invention. The comparison device can be used to implement various data comparison scenarios including gene comparison.
[0108] like Fig. 9 As shown, the comparison device 900 may include a processor 902, a memory 904, and an optical computing chip 906. The processor 902 is used to obtain a first group of reference objects from a database stored in the memory 904 according to a first object to be matched, wherein the first group of reference objects includes a plurality of reference objects having the same partial features as the first object. The optical computing chip 906 is used to connect to the processor and to perform optical comparison on the first object and the plurality of reference objects. The processor 902 may also be used to determine the similarity between the first object and the plurality of reference objects according to an output result of the optical computing chip.
[0109] In another case, the processor 902 may also be used to determine, based on the output result of the optical computing chip, that the similarity between the first object and the first reference object in the first group of reference objects is less than a first threshold value but greater than a second threshold value, and obtain multiple sub-reference objects based on the standard object, wherein each sub-reference object is a part of the reference object. The optical computing chip 906 may also be used to perform an optical comparison between the first object and the first sub-reference object in the multiple sub-reference objects to obtain a first similarity between the first object and the first sub-reference object.
[0110] In another case, the processor 902 can also be used to determine that the first similarity is greater than a third threshold and less than a fourth threshold, and in response to the above determination, obtain a first sub-object and a second sub-object based on the first object, wherein the fourth threshold is not greater than the first threshold, and some data of the first sub-object and the second sub-object are the same. The optical computing chip 906 can also be used to perform an optical comparison between the first sub-object and the first sub-reference object to obtain a second similarity, and perform an optical comparison between the second sub-object and the first sub-reference object to obtain a third similarity. In practical applications, the processor 902 can also be used to record the position of the first sub-reference object in the standard object when the second similarity is greater than the fourth threshold.
[0111] Understandably, Fig. 9 The comparison device shown can be used to implement Figure 1 The function of the comparison device shown is to Fig. 9 The description of the comparison device can be described in the above embodiment of the present invention. Figure 1-Figure 8 Description. Fig. 9 The comparison devices shown can be applied to various scenarios that require data comparison or feature comparison, including gene comparison. Figure 1 The gene alignment device shown is Fig. 9 A specific application of the comparison device shown. It should be noted that, Fig. 9 The comparison device shown and the comparison method provided in the embodiment of this aspect can also be used for image comparison, image search, sequence comparison, fuzzy matching and other scenarios, which are not limited here.
[0112] Fig.10 A schematic diagram of another comparison device provided by an embodiment of the present invention. Fig.10 As shown, the comparison device 1000 may include an acquisition module 1002, a comparison module 1004 and a result processing module 1006. The acquisition module 1002 is used to obtain a first group of gene fragments from a database according to the gene sequence to be tested, wherein the database system contains multiple reference gene fragments of a reference gene sequence, and the first group of gene fragments includes multiple reference gene fragments that match some bases of the gene sequence to be tested. The comparison module 1004 is used to perform an optical comparison between the gene sequence to be tested and the multiple reference gene fragments in the first group of gene fragments. The result processing module 1006 is used to determine the similarity between the gene sequence to be tested and the multiple reference gene fragments in the first group of gene fragments according to the output result of the comparison module 1004.
[0113] In another case, the comparison device 1000 may also include a judgment module 1008. The judgment module 1008 is used to determine that the similarity between the gene sequence to be tested and the first gene fragment in the first group of gene fragments is less than a first threshold value and greater than a second threshold value based on the output result of the comparison module 1004. The acquisition module 1002 is also used to obtain multiple sub-reference gene sequences from the reference gene sequence when the judgment module 1008 determines that the similarity between the gene sequence to be tested and the first gene fragment in the first group of gene fragments is less than the first threshold value and greater than the second threshold value, wherein each sub-reference gene sequence is a part of the reference gene sequence. The comparison module 1004 is also used to perform optical comparison between the gene sequence to be tested and the first sub-reference gene sequence in the multiple sub-reference gene sequences. The result processing module 1006 is also used to obtain the first similarity between the gene sequence to be tested and the first sub-reference gene sequence based on the output result of the optical computing chip.
[0114] In another case, the judgment module 1008 is further used to determine that the first similarity is greater than a third threshold and less than a fourth threshold, wherein the fourth threshold is not greater than the first threshold. The acquisition module 1002 is also used to obtain a first sub-gene sequence to be tested and a second sub-gene sequence to be tested according to the gene sequence to be tested in response to the judgment of the judgment module 1008, wherein some bases of the first sub-gene sequence to be tested and the second sub-gene sequence to be tested are the same. The comparison module 1004 is also used to optically compare the first sub-gene sequence to be tested with the first sub-reference gene sequence to obtain a second similarity, and to optically compare the second sub-gene sequence to be tested with the first sub-reference gene sequence to obtain a third similarity.
[0115] In yet another case, the result processing module 1006 is further configured to record the position of the first sub-reference gene sequence in the reference gene sequence when the second similarity is greater than the fourth threshold.
[0116] In another case, the acquisition module 1002 is further used to obtain a first sub-gene sequence unit to be detected and a second sub-gene sequence unit to be detected according to the second sub-gene sequence to be detected when the judgment module 1008 judges that the third similarity is greater than the third threshold value and less than the fourth threshold value, wherein some bases of the first sub-gene sequence unit to be detected and the second sub-gene sequence unit to be detected are the same. The comparison module 1004 is also used to optically compare the first sub-gene sequence unit to be detected with the first sub-reference gene sequence, and to optically compare the second sub-gene sequence unit to be detected with the first sub-reference gene sequence.
[0117] In another case, the comparison module 1004 is further used to perform an optical comparison between the gene sequence to be tested and the second sub-reference gene sequence of the plurality of sub-reference gene sequences to obtain a fourth similarity between the gene sequence to be tested and the second sub-reference gene sequence; and, perform an optical comparison between the gene sequence to be tested and the third sub-reference gene sequence of the plurality of sub-reference gene sequences to obtain a fifth similarity between the gene sequence to be tested and the third sub-reference gene sequence, wherein the third sub-reference gene sequence is a sub-reference gene sequence continuous with the second sub-reference gene sequence. When the judgment module 1008 determines that the sum of the fourth similarity and the fifth similarity is greater than the first threshold, the acquisition module 1002 is further used to obtain a fourth sub-reference gene sequence according to the second sub-reference gene sequence and the third sub-reference gene sequence, wherein the fourth sub-reference gene sequence includes some bases of the second sub-reference gene sequence and some bases of the third sub-reference gene sequence. The comparison module 1004 is further used to input the gene sequence to be tested and the fourth sub-reference gene sequence into the optical computing chip for optical comparison.
[0118] In another case, the result processing module 1006 is further used to determine whether the second gene fragment in the first group of gene fragments matches the gene sequence to be tested according to the output result of the optical computing chip, and record the position of the second gene fragment in the reference gene sequence.
[0119] Understandably, Fig.10 The comparison device shown can be used to implement Figure 1 The function of the gene comparison device shown in FIG. Figure 1 Description of the functions of the relevant modules. It will not be repeated here. It can be understood that the device embodiments described above are only schematic. For example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation. For example, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the connection between the modules discussed in the above embodiments can be electrical, mechanical or other forms. The modules described as separate components may be physically separated or not physically separated. The components displayed as modules may be physical modules or not physical modules. In addition, the functional modules in each embodiment of the application embodiment may exist independently or be integrated in a processing module.
[0120] The embodiment of the present invention also provides a computer program product for implementing gene comparison, including a computer-readable storage medium storing program code, wherein the program code includes instructions for executing the method flow described in any of the aforementioned method embodiments. It can be understood by those skilled in the art that the aforementioned storage medium includes: a U disk, a mobile hard disk, a magnetic disk, an optical disk, a random access memory (RAM), a solid state disk (SSD) or a non-volatile memory (non-volatile memory) and other non-transitory machine-readable media that can store program code.
[0121] It should be noted that the embodiments provided in this application are merely illustrative. Those skilled in the art can clearly understand that, for the convenience and brevity of description, in the above embodiments, the descriptions of each embodiment have their own emphasis, and for parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments. The features disclosed in the embodiments, claims, and drawings of the present invention may exist independently or in combination. The features described in the embodiment of the present invention in the form of hardware may be executed by software, and vice versa. This is not limited here.
Claims
1. A gene comparison method, characterized in that: The method is performed by a computer system including an optical computing chip, and the method includes: Acquire a first group of gene fragments from a gene database according to the gene sequence to be tested, wherein the gene database contains a plurality of reference gene fragments of the reference gene sequence, and the first group of gene fragments includes a plurality of reference gene fragments that match partial bases of the gene sequence to be tested; Inputting the gene sequence to be tested and a plurality of reference gene fragments in the first group of gene fragments into the optical computing chip for optical comparison; Determining, according to the output result of the optical computing chip, that the similarity between the gene sequence to be tested and the first gene segment in the first group of gene segments is less than a first threshold value and greater than a second threshold value; Obtaining a plurality of sub-reference gene sequences from the reference gene sequence according to the length of the gene sequence to be tested, wherein each sub-reference gene sequence is a part of the reference gene sequence; Inputting the gene sequence to be tested and a second sub-reference gene sequence among the multiple sub-reference gene sequences into the optical computing chip for optical comparison, and obtaining a fourth similarity between the gene sequence to be tested and the second sub-reference gene sequence; Inputting the gene sequence to be tested and a third sub-reference gene sequence among the multiple sub-reference gene sequences into the optical computing chip for optical comparison, and obtaining a fifth similarity between the gene sequence to be tested and the third sub-reference gene sequence, wherein the third sub-reference gene sequence is a sub-reference gene sequence continuous with the second sub-reference gene sequence; Determining that a sum of the fourth similarity and the fifth similarity is greater than the first threshold; Obtaining a fourth sub-reference gene sequence according to the second sub-reference gene sequence and the third sub-reference gene sequence, wherein the fourth sub-reference gene sequence includes some bases of the second sub-reference gene sequence and some bases of the third sub-reference gene sequence; Inputting the gene sequence to be tested and the fourth sub-reference gene sequence into the optical computing chip for optical comparison to obtain the similarity between the gene sequence to be tested and the fourth sub-reference gene sequence; Wherein, obtaining a first group of gene fragments from a gene database according to the gene sequence to be tested comprises: Obtaining from the gene database a first group of gene fragments that are identical to the first m bases and the last n bases of the gene sequence to be tested, wherein the value of m and the value of n are both greater than 0, and the sum of m and n is less than the number of bases in the gene sequence to be tested; The step of obtaining a plurality of sub-reference gene sequences from the reference gene sequence according to the length of the gene sequence to be tested comprises: Using the length of the gene sequence to be tested as a window and a sliding step length, a plurality of sub-reference gene sequences are obtained from the reference gene sequence; or, The reference gene sequence is split into a plurality of sub-reference gene sequences according to the base length of the gene sequence to be tested.
2. The gene comparison method according to claim 1, characterized in that: The method further comprises: Determine that the similarity between the gene sequence to be tested and the fourth sub-reference gene sequence is greater than a third threshold and less than a fourth threshold, wherein the fourth threshold is not greater than the first threshold; In response to the above determination, a first sub-gene sequence to be tested and a second sub-gene sequence to be tested are obtained according to the gene sequence to be tested, wherein some bases of the first sub-gene sequence to be tested and the second sub-gene sequence to be tested are the same; Inputting the first sub-gene sequence to be tested and the fourth sub-reference gene sequence into the optical computing chip for optical comparison to obtain a second similarity; The second sub-gene sequence to be tested and the fourth sub-reference gene sequence are input into the optical computing chip for optical comparison to obtain a third similarity.
3. The gene comparison method according to claim 2, characterized in that: The method further comprises: When the second similarity is greater than the fourth threshold, the position of the fourth sub-reference gene sequence in the reference gene sequence is recorded.
4. The gene comparison method according to claim 3, characterized in that: The method further comprises: When the third similarity is greater than the third threshold value and less than the fourth threshold value, obtaining a first sub-gene sequence unit to be tested and a second sub-gene sequence unit to be tested according to the second sub-gene sequence to be tested, wherein some bases of the first sub-gene sequence unit to be tested and the second sub-gene sequence unit to be tested are the same; Inputting the first sub-gene sequence unit to be tested and the fourth sub-reference gene sequence into the optical computing chip for optical comparison; The second sub-gene sequence unit to be tested and the fourth sub-reference gene sequence are input into the optical computing chip for optical comparison.
5. The gene comparison method according to claim 1, characterized in that: The method further comprises: Determining the similarity between the second gene segment in the first group of gene segments and the gene sequence to be tested according to the output result of the optical computing chip; When the similarity between a second gene segment in the first group of gene segments and the gene sequence to be tested is greater than or equal to a first threshold, the position of the second gene segment in the reference gene sequence is recorded.
6. The gene comparison method according to claim 1, characterized in that: The step of inputting the gene sequence to be tested and a plurality of reference gene fragments in the first group of gene fragments into the optical computing chip for optical comparison comprises: Optically encoding the gene sequence to be tested and the plurality of reference gene fragments in the first group of gene fragments respectively; The optical code of the gene sequence to be tested and the optical codes of the multiple reference gene fragments in the first group of gene fragments are respectively input into the optical computing chip for optical comparison.
7. A gene comparison device, comprising: A processor, configured to obtain a first group of gene fragments from a gene database according to a gene sequence to be tested, wherein the database contains a plurality of reference gene fragments of a reference gene sequence, and the first group of gene fragments includes a plurality of reference gene fragments that match a portion of bases of the gene sequence to be tested; an optical computing chip, connected to the processor and used to perform optical comparison between the gene sequence to be tested and a plurality of reference gene fragments in the first group of gene fragments; The processor is further configured to: Determining, according to the output result of the optical computing chip, that the similarity between the gene sequence to be tested and the first gene segment in the first group of gene segments is less than a first threshold value and greater than a second threshold value; Obtaining a plurality of sub-reference gene sequences from the reference gene sequence according to the length of the gene sequence to be tested, wherein each sub-reference gene sequence is a part of the reference gene sequence; The optical computing chip is also used for: Performing an optical comparison between the gene sequence to be tested and a second sub-reference gene sequence among the multiple sub-reference gene sequences; Performing an optical comparison between the gene sequence to be tested and a third sub-reference gene sequence among the multiple sub-reference gene sequences, wherein the third sub-reference gene sequence is a sub-reference gene sequence continuous with the second sub-reference gene sequence; The processor is further configured to: Determine that a sum of a fourth similarity between the gene sequence to be tested and the second sub-reference gene sequence, and a fifth similarity between the gene sequence to be tested and the third sub-reference gene sequence is greater than the first threshold; Obtaining a fourth sub-reference gene sequence according to the second sub-reference gene sequence and the third sub-reference gene sequence, wherein the fourth sub-reference gene sequence includes some bases of the second sub-reference gene sequence and some bases of the third sub-reference gene sequence; Inputting the gene sequence to be tested and the fourth sub-reference gene sequence into the optical computing chip for optical comparison to obtain the similarity between the gene sequence to be tested and the fourth sub-reference gene sequence; The processor is used to obtain from the gene database a first group of gene fragments that are identical to the first m bases and the last n bases of the gene sequence to be tested, wherein the value of m and the value of n are both greater than 0, and the sum of m and n is less than the number of bases in the gene sequence to be tested; The processor is used to obtain multiple sub-reference gene sequences from the reference gene sequence with the length of the gene sequence to be tested as a window and a sliding step; or, to split the reference gene sequence into multiple sub-reference gene sequences according to the base length of the gene sequence to be tested.
8. The gene comparison device according to claim 7, characterized in that: The processor is further configured to: Determining that the similarity between the gene sequence to be tested and the fourth sub-reference gene sequence is greater than a third threshold and less than a fourth threshold, wherein the fourth threshold is not greater than the first threshold; In response to the above determination, a first sub-gene sequence to be tested and a second sub-gene sequence to be tested are obtained according to the gene sequence to be tested, wherein some bases of the first sub-gene sequence to be tested and the second sub-gene sequence to be tested are the same; The optical computing chip is also used for: performing an optical comparison between the first test sub-gene sequence and the fourth reference sub-gene sequence to obtain a second similarity; and Optically comparing the second test sub-gene sequence with the fourth reference sub-gene sequence to obtain a third similarity.
9. The gene comparison device according to claim 8, characterized in that: The processor is further configured to: When the second similarity is greater than the fourth threshold, the position of the fourth sub-reference gene sequence in the reference gene sequence is recorded.
10. The gene comparison device according to claim 8, characterized in that: The processor is further configured to: When the third similarity is greater than the third threshold value and less than the fourth threshold value, obtaining a first sub-gene sequence unit to be tested and a second sub-gene sequence unit to be tested according to the second sub-gene sequence to be tested, wherein some bases of the first sub-gene sequence unit to be tested and the second sub-gene sequence unit to be tested are the same; The optical computing chip is also used for: Optically comparing the first sub-gene sequence unit to be tested with the fourth sub-reference gene sequence; Optically comparing the second to-be-tested sub-gene sequence unit with the fourth sub-reference gene sequence.
11. The gene comparison device according to claim 7, characterized in that: The processor is further configured to: Determining the similarity between the second gene segment in the first group of gene segments and the gene sequence to be tested according to the output result of the optical computing chip; When the similarity between a second gene segment in the first group of gene segments and the gene sequence to be tested is greater than or equal to a first threshold, the position of the second gene segment in the reference gene sequence is recorded.
12. The gene comparison device according to claim 7, characterized in that: The processor is further configured to: Optically encoding the gene sequence to be tested and the plurality of reference gene fragments in the first group of gene fragments respectively; The optical code of the gene sequence to be tested and the optical codes of the multiple reference gene fragments in the first group of gene fragments are respectively input into the optical computing chip for optical comparison.
13. A computer program product, comprising a program code, wherein the instructions included in the program code are executed by a computer to perform the gene comparison method according to any one of claims 1 to 6.
14. A computer-readable storage medium, comprising computer program instructions, which, when executed on a computer, enable the computer to execute the gene comparison method according to any one of claims 1 to 6.