Gene alignment technology
A gene alignment technology may be applied to a computer system including an optical computing chip. In a process of performing gene alignment, a first group of gene fragments may be first obtained from a gene database based on a to-be-tested gene sequence, where the first group of gene fragments includes a plurality of reference gene fragments that match some bases of the to-be-tested gene sequence. After the first group of gene fragments is obtained, the to-be-tested gene sequence and the plurality of reference gene fragments in the first group of gene fragments may be input into the optical computing chip to perform optical alignment.
1 . A gene alignment method implemented by a computer system comprising an optical computing chip, the gene alignment method comprising:
obtaining reference gene fragments from a gene database based on a to-be-tested gene sequence, wherein the gene database comprises a reference gene sequence, wherein the reference gene sequence comprises the reference gene fragments, and wherein the reference gene fragments match some bases of the to-be-tested gene sequence;
inputting the to-be-tested gene sequence and the reference gene fragments into the optical computing chip;
performing a first optical alignment of the to-be-tested gene sequence and the reference gene fragments using the optical computing chip;
determining, based on an output result of the first optical alignment, that a similarity degree between the to-be-tested gene sequence and a first gene fragment in the reference gene fragments is less than a first threshold and greater than a second threshold;
obtaining a plurality of reference gene subsequences from the reference gene sequence, wherein the reference gene subsequences comprise a first reference gene subsequence;
inputting the to-be-tested gene sequence and the first reference gene subsequence into the optical computing chip;
performing a second optical alignment of the to-be-tested gene sequence and the first reference gene subsequence to obtain a first similarity degree between the to-be-tested gene sequence and the first reference gene subsequence;
making a determination that the first similarity degree is greater than a third threshold and less than a fourth threshold, wherein the fourth threshold is not greater than the first threshold;
obtaining, in response to the determination, a first to-be-tested gene subsequence and a second to-be-tested gene subsequence based on the to-be-tested gene sequence, wherein some bases of the first to-be-tested gene subsequence are the same as some bases of the second to-be-tested gene subsequence;
inputting the first to-be-tested gene subsequence and the first reference gene subsequence into the optical computing chip;
performing a third optical alignment of the first to-be-tested gene subsequence and the first reference gene subsequence to obtain a second similarity degree;
inputting the second to-be-tested gene subsequence and the first reference gene subsequence into the optical computing chip; and
performing a fourth optical alignment of the second to-be-tested gene subsequence and the first reference gene subsequence to obtain a third similarity degree.
2 . The gene alignment method of claim 1 , further comprising recording, when the second similarity degree is greater than the fourth threshold, a location of the first reference gene subsequence in the reference gene sequence.
3 . The gene alignment method of claim 1 , further comprising:
obtaining, when the third similarity degree is greater than the third threshold and less than the fourth threshold, a first to-be-tested gene subsequence unit and a second to-be-tested gene subsequence unit based on the second to-be-tested gene subsequence, wherein some bases of the first to-be-tested gene subsequence unit are the same as some bases of the second to-be-tested gene subsequence unit;
inputting the first to-be-tested gene subsequence unit and the first reference gene subsequence into the optical computing chip;
performing a fifth optical alignment of the first to-be-tested gene subsequence unit and the first reference gene subsequence;
inputting the second to-be-tested gene subsequence unit and the first reference gene subsequence into the optical computing chip; and
performing a sixth optical alignment of the second to-be-tested gene subsequence unit and the first reference gene subsequence.
4 . The gene alignment method of claim 1 , further comprising:
determining, based on the output result, that a first reference gene fragment of the reference gene fragments matches the to-be-tested gene sequence; and
recording a location of the first reference gene fragment in the reference gene sequence.
5 . The gene alignment method of claim 1 , wherein inputting the to-be-tested gene sequence and the reference gene fragments comprises:
separately performing optical encoding on the to-be-tested gene sequence and the reference gene fragments; and
separately inputting optical code of the to-be-tested gene sequence and optical code of the reference gene fragments into the optical computing chip.
6 . The gene alignment method of claim 1 , further comprising further obtaining the reference gene fragments from the gene database based on first m bases and last n bases of the to-be-tested gene sequence, wherein m and n are greater than 0, and wherein a sum of m and n is less than a quantity of bases in the to-be-tested gene sequence.
7 . A gene alignment apparatus comprising:
a processor configured to:
obtain reference gene fragments from a gene database based on a to-be-tested gene sequence, wherein the gene database comprises a reference gene sequence, wherein the reference gene sequence comprises the reference gene fragments, and wherein the reference gene fragments match some bases of the to-be-tested gene sequence;
determine, based on an output result of a first optical alignment, that a similarity degree between the to-be-tested gene sequence and a first gene fragment in the reference gene fragments is less than a first threshold and greater than a second threshold;
obtain a plurality of reference gene subsequences from the reference gene sequence, wherein the reference gene subsequences comprise a first reference gene subsequence;
make a determination that a first similarity degree is greater than a third threshold and less than a fourth threshold, wherein the fourth threshold is not greater than the first threshold; and
obtain, in response to the determination, a first to-be-tested gene subsequence and a second to-be-tested gene subsequence based on the to-be-tested gene sequence, wherein some bases of the first to-be-tested gene subsequence are the same as some bases of the second to-be-tested gene subsequence, and
an optical computing chip coupled to the processor and configured to:
input the to-be-tested gene sequence and the reference gene fragments;
perform the first optical alignment of the to-be-tested gene sequence and the reference gene fragments;
input the to-be-tested gene sequence and the first reference gene subsequence;
perform a second optical alignment of the to-be-tested gene sequence and the first reference gene subsequence to obtain the first similarity degree between the to-be-tested gene sequence and the first reference gene subsequence;
input the first to-be-tested gene subsequence and the first reference gene subsequence;
perform a third optical alignment of the first to-be-tested gene subsequence and the first reference gene subsequence to obtain a second similarity degree;
input the second to-be-tested gene subsequence and the first reference gene subsequence; and
perform a fourth optical alignment between the second to-be-tested gene subsequence and the first reference gene subsequence to obtain a third similarity degree.
8 . The gene alignment apparatus of claim 7 , wherein the processor is further configured to record, when the second similarity degree is greater than the fourth threshold, a location of the first reference gene subsequence in the reference gene sequence.
9 . The gene alignment apparatus of claim 7 , wherein the processor is further configured to obtain, when the third similarity degree is greater than the third threshold and less than the fourth threshold, a first to-be-tested gene subsequence unit and a second to-be-tested gene subsequence unit based on the second to-be-tested gene subsequence, wherein some bases of the first to-be-tested gene subsequence unit are the same as some bases of the second to-be-tested gene subsequence unit, and wherein the optical computing chip is further configured to:
input the first to-be-tested gene subsequence unit and the first reference gene subsequence;
perform a fifth optical alignment of the first to-be-tested gene subsequence unit and the first reference gene subsequence;
input the second to-be-tested gene subsequence unit and the first reference gene subsequence; and
perform a sixth optical alignment of the second to-be-tested gene subsequence unit and the first reference gene subsequence.
10 . The gene alignment apparatus of claim 7 , wherein the processor is further configured to:
determine, based on the output result, that a first reference gene fragment of the reference gene fragments matches the to-be-tested gene sequence; and
record a location of the first reference gene fragment in the reference gene sequence.
11 . The gene alignment apparatus of claim 7 , wherein the processor is further configured to separately perform optical encoding on the to-be-tested gene sequence and the reference gene fragments, and wherein the optical computing chip is further configured to separately input optical code of the to-be-tested gene sequence and optical code of the reference gene fragments.
12 . The gene alignment apparatus of claim 7 , wherein the processor is configured to further obtain the reference gene fragments from the gene database based on first m bases and last n bases of the to-be-tested gene sequence, wherein m and n are greater than 0, and wherein a sum of m and n is less than a quantity of bases in the to-be-tested gene sequence.
13 . An alignment apparatus comprising:
a processor configured to:
obtain a first group of reference objects from a database based on a first object, wherein at least some of the reference objects have some features that are the same as some features of the first object;
determine, based on an output result of a first optical alignment, that a similarity degree between the first object and a first reference object in the reference objects is less than a first threshold and greater than a second threshold;
obtain reference sub-objects based on a standard object, wherein each of the reference sub-objects is a part of one of the reference objects, and wherein the reference sub-objects comprise a first reference sub-object;
make a determination that a first similarity degree is greater than a third threshold and less than a fourth threshold, wherein the fourth threshold is not greater than the first threshold; and
obtain, in response to the determination, a first sub-object and a second sub-object based on the first object, wherein some data of the first sub-object is the same as some data of the second sub-object; and
an optical computing chip coupled to the processor and configured to:
perform the first optical alignment between the first object and the reference objects;
input the first object and the first reference sub-object;
perform a second optical alignment of the first object and the first reference sub-object to obtain the first similarity degree between the first object and the first reference sub-object;
input the first sub-object and the first reference sub-object;
perform a third optical alignment between the first sub-object and the first reference sub-object to obtain a second similarity degree;
input the second sub-object and the first reference sub-object; and
perform a fourth optical alignment between the second sub-object and the first reference sub-object to obtain a third similarity degree.
14 . The alignment apparatus of claim 13 , wherein the processor is further configured to record, when the second similarity degree is greater than the fourth threshold, a location of the first reference sub-object in the standard object.
15 . A non-transitory computer-readable storage medium comprising computer program instructions that, when executed by a processor, cause a gene alignment apparatus to:
obtain reference gene fragments from a gene database based on a to-be-tested gene sequence, wherein the gene database comprises a reference gene sequence, wherein the reference gene sequence comprises the reference gene fragments, and wherein the reference gene fragments match some bases of the to-be-tested gene sequence;
input the to-be-tested gene sequence and the reference gene fragments into an optical computing chip;
perform a first optical alignment of the to-be-tested gene sequence and the reference gene fragments using the optical computing chip;
determine, based on an output result of the first optical alignment, that a similarity degree between the to-be-tested gene sequence and a first gene fragment in the reference gene fragments is less than a first threshold and greater than a second threshold;
obtain a plurality of reference gene subsequences from the reference gene sequence, wherein the reference gene subsequences comprise a first reference gene subsequence;
input the to-be-tested gene sequence and the first reference gene subsequence into the optical computing chip;
perform a second optical alignment of the to-be-tested gene sequence and the first reference gene subsequence to obtain a first similarity degree between the to-be-tested gene sequence and the first reference gene subsequence;
make a determination that the first similarity degree is greater than a third threshold and less than a fourth threshold, wherein the fourth threshold is not greater than the first threshold;
obtain, in response to the determination, a first to-be-tested gene subsequence and a second to-be-tested gene subsequence based on the to-be-tested gene sequence, wherein some bases of the first to-be-tested gene subsequence are the same as some bases of the second to-be-tested gene subsequence;
input the first to-be-tested gene subsequence and the first reference gene subsequence into the optical computing chip;
perform a third optical alignment of the first to-be-tested gene subsequence and the first reference gene subsequence to obtain a second similarity degree;
input the second to-be-tested gene subsequence and the first reference gene subsequence into the optical computing chip; and
perform a fourth optical alignment of the second to-be-tested gene subsequence and the first reference gene subsequence to obtain a third similarity degree.
16 . The non-transitory computer-readable storage medium of claim 15 , wherein the computer program instructions, when executed by the processor further cause the gene alignment apparatus to record, when the second similarity degree is greater than the fourth threshold, a location of the first reference gene subsequence in the reference gene sequence.
17 . The non-transitory computer-readable storage medium of claim 15 , wherein the computer program instructions, when executed by the processor further cause the gene alignment apparatus to:
obtain, when the third similarity degree is greater than the third threshold and less than the fourth threshold, a first to-be-tested gene subsequence unit and a second to-be-tested gene subsequence unit based on the second to-be-tested gene subsequence, wherein some bases of the first to-be-tested gene subsequence unit are the same as some bases of the second to-be-tested gene subsequence unit;
input the first to-be-tested gene subsequence unit and the first reference gene subsequence;
perform a fifth optical alignment of the first to-be-tested gene subsequence unit and the first reference gene subsequence;
input the second to-be-tested gene subsequence unit and the first reference gene subsequence; and
perform a sixth optical alignment of the second to-be-tested gene subsequence unit and the first reference gene subsequence.
18 . The non-transitory computer-readable storage medium of claim 15 , wherein the computer program instructions, when executed by the processor further cause the gene alignment apparatus to:
determine, based on the output result, that a first reference gene fragment of the reference gene fragments matches the to-be-tested gene sequence; and
record a location of the first reference gene fragment in the reference gene sequence.
19 . The non-transitory computer-readable storage medium of claim 15 , wherein the computer program instructions, when executed by the processor further cause the gene alignment apparatus to separately perform optical encoding on the to-be-tested gene sequence and the reference gene fragments, and wherein the optical computing chip is further configured to separately input optical code of the to-be-tested gene sequence and optical code of the reference gene fragments.
20 . The non-transitory computer-readable storage medium of claim 15 , wherein the computer program instructions, when executed by the processor further cause the gene alignment apparatus to further obtain the reference gene fragments from the gene database based on first m bases and last n bases of the to-be-tested gene sequence, wherein m and n are greater than 0, and wherein a sum of m and n is less than a quantity of bases in the to-be-tested gene sequence.
21 . An alignment method implemented by a computer system comprising an optical computing chip, the alignment method comprising:
obtaining a first group of reference objects from a database based on a first object, wherein at least some of the reference objects have some features that are the same as some features of the first object;
determining, based on an output result of a first optical alignment, that a similarity degree between the first object and a first reference object in the reference objects is less than a first threshold and greater than a second threshold;
obtaining reference sub-objects based on a standard object, wherein each of the reference sub-objects is a part of one of the reference objects, and wherein the reference sub-objects comprise a first reference sub-object;
making a determination that a first similarity degree between the first object and the first reference sub-object is greater than a third threshold and less than a fourth threshold, wherein the fourth threshold is not greater than the first threshold;
obtaining, in response to the determination, a first sub-object and a second sub-object based on the first object, wherein some data of the first sub-object is the same as some data of the second sub-object;
performing the first optical alignment between the first object and the reference objects;
inputting the first object and the first reference sub-object into the optical computing chip;
performing a second optical alignment of the first object and the first reference sub-object to obtain the first similarity degree;
inputting the first sub-object and the first reference sub-object into the optical computing chip;
performing a third optical alignment between the first sub-object and the first reference sub-object to obtain a second similarity degree;
inputting the second sub-object and the first reference sub-object into the optical computing chip; and
performing a fourth optical alignment between the second sub-object and the first reference sub-object to obtain a third similarity degree.
22 . The alignment method of claim 21 , further comprising recording, when the second similarity degree is greater than the fourth threshold, a location of the first reference sub-object in the standard object.